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