Commit 07487184 authored by Cheng C Yang's avatar Cheng C Yang

Orange Heap

parent 40b75304
......@@ -24,7 +24,7 @@ import static pwc.taxtech.atms.common.CommonConstants.CommonFail;
import static pwc.taxtech.atms.common.CommonConstants.SystemError;
@Service
public class EquityServiceImpl extends BaseService{
public class EquityServiceImpl extends BaseService {
@Autowired
private OperationLogServiceImpl operationLogServiceImpl;
......@@ -48,6 +48,7 @@ public class EquityServiceImpl extends BaseService{
EquityInfoDto equityInfoDto = new EquityInfoDto();
// 可能需要补充一些处理
BeanUtils.copyProperties(equityInformation, equityInfoDto);
equityInfoDto.setPayableShareholderName(equityInfoDto.getPayableShareholderName() + " " + equityInfoDto.getPayableShareholderIdNum());
equityInfoDtos.add(equityInfoDto);
}
);
......@@ -59,35 +60,35 @@ public class EquityServiceImpl extends BaseService{
}
public OperationResultDto<Object> insertAll(List<EquityInfoDto> equityInfoDtos) {
try{
try {
// todo opt insertAll
if(equityInfoDtos.get(0).getId()==null){
if (equityInfoDtos.get(0).getId() == null) {
equityInfoDtos.get(0).setId(idService.nextId());
equityInfoDtos.get(0).seteNum(1);
}
for (EquityInfoDto equityInfoDto : equityInfoDtos) {
EquityInformation equityInformation = new EquityInformation();
BeanUtils.copyProperties(equityInfoDto,equityInformation);
BeanUtils.copyProperties(equityInfoDto, equityInformation);
equityInformationMapper.insert(equityInformation);
}
AddOrgEquityLog(OperationAction.New.value(),LogMessage.AddOrganizationEquity,equityInfoDtos.get(0).getOrganizationId(),OperationModule.Equity.value());
AddOrgEquityLog(OperationAction.New.value(), LogMessage.AddOrganizationEquity, equityInfoDtos.get(0).getOrganizationId(), OperationModule.Equity.value());
return new OperationResultDto(true);
}catch (Exception e){
} catch (Exception e) {
logger.error(String.format("写入全部股东信息异常:%s", e.getMessage()));
return new OperationResultDto(false, CommonFail + SystemError);
}
}
public OperationResultDto<Object> update(EquityInfoDto equityInfoDto) {
try{
try {
EquityInformation equityInformation = new EquityInformation();
BeanUtils.copyProperties(equityInfoDto,equityInformation);
BeanUtils.copyProperties(equityInfoDto, equityInformation);
EquityInformationExample example = new EquityInformationExample();
example.createCriteria().andIdEqualTo(equityInformation.getId()).andENumEqualTo(equityInformation.geteNum());
equityInformationMapper.updateByExampleSelective(equityInformation,example);
AddOrgEquityLog(OperationAction.Update.value(),LogMessage.UpdateOrganizationEquity,equityInfoDto.getOrganizationId(),OperationModule.Equity.value());
equityInformationMapper.updateByExampleSelective(equityInformation, example);
AddOrgEquityLog(OperationAction.Update.value(), LogMessage.UpdateOrganizationEquity, equityInfoDto.getOrganizationId(), OperationModule.Equity.value());
return new OperationResultDto(true);
}catch (Exception e){
} catch (Exception e) {
logger.error(String.format("更新股东信息异常:%s", e.getMessage()));
return new OperationResultDto(false, CommonFail + SystemError);
}
......@@ -104,7 +105,7 @@ public class EquityServiceImpl extends BaseService{
if (delRes > 0) {
refreshEquityList(id);
}
AddOrgEquityLog(OperationAction.Delete.value(),LogMessage.DeleteOrganizationEquity,String.valueOf(id),OperationModule.Equity.value());
AddOrgEquityLog(OperationAction.Delete.value(), LogMessage.DeleteOrganizationEquity, String.valueOf(id), OperationModule.Equity.value());
return new OperationResultDto(true);
} catch (Exception e) {
logger.error(String.format("删除股东信息异常:%s", e.getMessage()));
......@@ -116,8 +117,9 @@ public class EquityServiceImpl extends BaseService{
* 17/01/2019 15:51
* 变更当前股权信息时,刷新股权信息的序号
* [id]
* @author Gary J Li
*
* @return
* @author Gary J Li
*/
private void refreshEquityList(Long id) {
EquityInformationExample exampleForENumUp = new EquityInformationExample();
......@@ -128,9 +130,9 @@ public class EquityServiceImpl extends BaseService{
return;
}
List<EquityInformation> resList = new ArrayList<>();
int i =1;
int i = 1;
for (EquityInformation record : equityInformations) {
if(record.geteNum()!=i){
if (record.geteNum() != i) {
record.seteNum(i);
}
resList.add(record);
......@@ -154,13 +156,14 @@ public class EquityServiceImpl extends BaseService{
* 3、equityInfoDtos 生成新id、createTime、updateTime 插入equity_infomation
* 4、根据id(原始)删除旧数据 equity_infomation
* 5、记录日志 id(原始)
*
* <p>
* remark:
* 1、无股权记录时,为初始变更只进行3、5
* 2、// todo 事务过长并发时,可能出现问题
* [equityInfoDtos]
* @author Gary J Li
*
* @return OperationResultDto<Object>
* @author Gary J Li
*/
public OperationResultDto<Object> change(String orgName, String comment, List<EquityInfoDto> equityInfoDtos) {
......@@ -195,8 +198,8 @@ public class EquityServiceImpl extends BaseService{
newData.setId(newId);
newData.seteNum(i);
float investRadio = 0L;
if(CommonUtil.hasDigit(org.getRegistrationCapital())&&null!=newData.getInvestmentAmount()){
investRadio = (float)newData.getInvestmentAmount()/(float)CommonUtil.getNum(org.getRegistrationCapital());
if (CommonUtil.hasDigit(org.getRegistrationCapital()) && null != newData.getInvestmentAmount()) {
investRadio = (float) newData.getInvestmentAmount() / (float) CommonUtil.getNum(org.getRegistrationCapital());
}
newData.setInvestmentRadio(investRadio);
newData.setOrganizationId(orgId);
......@@ -237,7 +240,7 @@ public class EquityServiceImpl extends BaseService{
opLog.setLogType(OperateLogType.OperationLogEquity.value());
opLog.setEquityLog(true);
operationLogService.addOperationLog(opLog);
AddOrgEquityLog(OperationAction.Update.value(),LogMessage.ChangeOrganizationEquity,orgName,OperationModule.Equity.value());
AddOrgEquityLog(OperationAction.Update.value(), LogMessage.ChangeOrganizationEquity, orgName, OperationModule.Equity.value());
return new OperationResultDto(true, "变更成功!", oldId);
}
......@@ -245,8 +248,9 @@ public class EquityServiceImpl extends BaseService{
* 18/01/2019 14:03
* 根据id查询出所有日志,时间排序
* [ids]
* @author Gary J Li
*
* @return List<OperationLogBasicData>
* @author Gary J Li
*/
public List<OperationLogBasicData> getChangeLogByOrgName(String orgName) {
List<OperationLogBasicData> logListByIds = null;
......@@ -268,8 +272,9 @@ public class EquityServiceImpl extends BaseService{
* 5、根据oldId删除操作日志 operation_log_equity
* remark : 最初的记录撤销变更仅做3、5
* [id]
* @author Gary J Li
*
* @return OperationResultDto<Object>
* @author Gary J Li
*/
public OperationResultDto<Object> cancelChange(Long oldId, Long newId) {
if (null != oldId) {
......@@ -308,7 +313,7 @@ public class EquityServiceImpl extends BaseService{
logger.warn(String.format("撤销变更-3 表operation_log_equity 删除操作日志异常.id: [ %s ]", oldId));
throw new ApplicationException("撤销变更-5 删除操作日志异常");
}
AddOrgEquityLog(OperationAction.Update.value(),LogMessage.CancelChangeUpdateOrganizationEquity,String.valueOf(newId),OperationModule.Equity.value());
AddOrgEquityLog(OperationAction.Update.value(), LogMessage.CancelChangeUpdateOrganizationEquity, String.valueOf(newId), OperationModule.Equity.value());
return new OperationResultDto(true);
}
......@@ -356,10 +361,11 @@ public class EquityServiceImpl extends BaseService{
* 25/01/2019 14:39
* [增删改查,操作描述,操作对象,操作模块] 更新、删除需补充oldData、newData
* [actionValue, content, object, module]
* @author Gary J Li
*
* @return
* @author Gary J Li
*/
private void AddOrgEquityLog(int actionValue,String content,String object,Integer module) {
private void AddOrgEquityLog(int actionValue, String content, String object, Integer module) {
OperationLogDto opLog = new OperationLogDto();
opLog.setAction(actionValue);
opLog.setOperationContent(content);
......
......@@ -374,7 +374,7 @@
"CertificateType": "证件类型",
"IdNum": "证件号码",
"InvestmentAmount": "投资金额",
"InvestmentCurrency": "投资金额币种",
"InvestmentCurrency": "投资币种",
"InvestmentRadio": "投资比例",
"PayableShareholderName": "实缴投资方信息",
"PayableShareholderIdNum": "证件编号",
......
......@@ -296,13 +296,13 @@
allowHeaderFiltering: false
},
{
dataField: "investmentAmount",
caption: $translate.instant('InvestmentAmount'),
dataField: "investmentCurrency",
caption: $translate.instant('InvestmentCurrency'),
allowHeaderFiltering: false
},
{
dataField: "investmentCurrency",
caption: $translate.instant('InvestmentCurrency'),
dataField: "investmentAmount",
caption: $translate.instant('InvestmentAmount'),
allowHeaderFiltering: false
},
{
......@@ -315,9 +315,14 @@
caption: $translate.instant('PayableShareholderName'),
allowHeaderFiltering: false
},
// {
// dataField: "payableShareholderIdNum",
// caption: $translate.instant('PayableShareholderIdNum'),
// allowHeaderFiltering: false
// },
{
dataField: "payableShareholderIdNum",
caption: $translate.instant('PayableShareholderIdNum'),
dataField: "payableCapitalContributionCurrency",
caption: $translate.instant('PayableCapitalContributionCurrency'),
allowHeaderFiltering: false
},
{
......@@ -325,11 +330,6 @@
caption: $translate.instant('PayableCapitalContributionAmount'),
allowHeaderFiltering: false
},
{
dataField: "payableCapitalContributionCurrency",
caption: $translate.instant('PayableCapitalContributionCurrency'),
allowHeaderFiltering: false
},
{
dataField: "payableContributionProportion",
caption: $translate.instant('PayableContributionProportion'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment