|
|
@@ -1019,6 +1019,7 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
|
|
|
.eq(PtlAgreement::getInsuranceCompanyId, ptlAgreement.getInsuranceCompanyId()));
|
|
|
}
|
|
|
|
|
|
+ @Transactional
|
|
|
@Override
|
|
|
public HttpResult getAgreementCopy(PtlAgreementVo ptlAgreementVo) {
|
|
|
PtlAgreement ptlAgreement = baseMapper.selectById(ptlAgreementVo.getId());
|
|
|
@@ -1028,25 +1029,27 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
|
|
|
newPtlAgreement.generateTheProtocolCode();
|
|
|
save(newPtlAgreement);
|
|
|
PtlAgreementAttribution ptlAgreementAttributionOld = ptlAgreementAttributionService.getById(ptlAgreementVo.getId());
|
|
|
- // 复制账号配置
|
|
|
- PtlAgreementAttribution ptlAgreementAttributionNew = new PtlAgreementAttribution();
|
|
|
- BeanUtils.copyProperties(ptlAgreementAttributionOld, ptlAgreementAttributionNew, "id");
|
|
|
- ptlAgreementAttributionNew.setId(newPtlAgreement.getId());
|
|
|
- ptlAgreementAttributionService.save(ptlAgreementAttributionNew);
|
|
|
- EsmInsCompany esmInsCompany = esmInsCompanyService.getById(newPtlAgreement.getInsuranceCompanyId());
|
|
|
- // 添加账号配置记录
|
|
|
+ // 复制账号归属信息
|
|
|
String batchNo = IdGenerate.nextId();
|
|
|
- PtlAgreementAttributionHistory ptlAgreementAttributionHistory = new PtlAgreementAttributionHistory();
|
|
|
- ptlAgreementAttributionHistory.setId(IdGenerate.nextId());
|
|
|
- ptlAgreementAttributionHistory.setBatch(batchNo);
|
|
|
- ptlAgreementAttributionHistory.setInsCompanyId(newPtlAgreement.getInsuranceCompanyId());
|
|
|
- ptlAgreementAttributionHistory.setInsCompanyName(esmInsCompany.getName());
|
|
|
- ptlAgreementAttributionHistory.setFields(ptlAgreementAttributionNew.getFields());
|
|
|
- ptlAgreementAttributionHistory.setTemplateId(ptlAgreementAttributionNew.getTemplateId());
|
|
|
- ptlAgreementAttributionHistory.setApiType(ptlAgreementAttributionNew.getApiType());
|
|
|
- ptlAgreementAttributionHistory.setUsername(ptlAgreementAttributionNew.getUsername());
|
|
|
- ptlAgreementAttributionHistory.setPassword(ptlAgreementAttributionNew.getPassword());
|
|
|
- ptlAgreementAttributionHistoryService.save(ptlAgreementAttributionHistory);
|
|
|
+ if (ptlAgreement.getIsExternal() == 0) {
|
|
|
+ PtlAgreementAttribution ptlAgreementAttributionNew = new PtlAgreementAttribution();
|
|
|
+ BeanUtils.copyProperties(ptlAgreementAttributionOld, ptlAgreementAttributionNew, "id");
|
|
|
+ ptlAgreementAttributionNew.setId(newPtlAgreement.getId());
|
|
|
+ ptlAgreementAttributionService.save(ptlAgreementAttributionNew);
|
|
|
+ EsmInsCompany esmInsCompany = esmInsCompanyService.getById(newPtlAgreement.getInsuranceCompanyId());
|
|
|
+ // 添加账号配置记录
|
|
|
+ PtlAgreementAttributionHistory ptlAgreementAttributionHistory = new PtlAgreementAttributionHistory();
|
|
|
+ ptlAgreementAttributionHistory.setId(IdGenerate.nextId());
|
|
|
+ ptlAgreementAttributionHistory.setBatch(batchNo);
|
|
|
+ ptlAgreementAttributionHistory.setInsCompanyId(newPtlAgreement.getInsuranceCompanyId());
|
|
|
+ ptlAgreementAttributionHistory.setInsCompanyName(esmInsCompany.getName());
|
|
|
+ ptlAgreementAttributionHistory.setFields(ptlAgreementAttributionNew.getFields());
|
|
|
+ ptlAgreementAttributionHistory.setTemplateId(ptlAgreementAttributionNew.getTemplateId());
|
|
|
+ ptlAgreementAttributionHistory.setApiType(ptlAgreementAttributionNew.getApiType());
|
|
|
+ ptlAgreementAttributionHistory.setUsername(ptlAgreementAttributionNew.getUsername());
|
|
|
+ ptlAgreementAttributionHistory.setPassword(ptlAgreementAttributionNew.getPassword());
|
|
|
+ ptlAgreementAttributionHistoryService.save(ptlAgreementAttributionHistory);
|
|
|
+ }
|
|
|
// 复制授权部门
|
|
|
List<PtlAgreementDept> ptlAgreementDept = ptlAgreementDeptService.list(new LambdaQueryWrapper<PtlAgreementDept>().eq(PtlAgreementDept::getAgreementId, ptlAgreement.getId()));
|
|
|
List<String> deptIds = ptlAgreementDept.stream().map(PtlAgreementDept::getDeptId).collect(Collectors.toList());
|