|
|
@@ -2536,19 +2536,21 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
|
|
|
ptlAgreementProductCostsNewService.saveBatch(ptlAgreementProductCostsNews);
|
|
|
// 映射新增之后的id 和 原先的数据
|
|
|
- Map<String, PtlAgreementProductCostsNew> costsMapping = ptlAgreementProductCostsNews.stream()
|
|
|
- .collect(Collectors.toMap(PtlAgreementProductCostsNew::getSaveBeforeId, x -> x));
|
|
|
+ Map<String, String> costsMapping = ptlAgreementProductCostsNews.stream()
|
|
|
+ .collect(Collectors.toMap(PtlAgreementProductCostsNew::getSaveBeforeId, PtlAgreementProductCostsNew::getId));
|
|
|
// 协议费用出口比例
|
|
|
ptlAgreementProductCostsExportList.forEach(x -> {
|
|
|
x.setId(null);
|
|
|
- x.setCostsId(costsMapping.get(x.getCostsId()).getId());
|
|
|
+ x.setCostsId(costsMapping.get(x.getCostsId()));
|
|
|
});
|
|
|
ptlAgreementProductCostsExportService.saveBatch(ptlAgreementProductCostsExportList);
|
|
|
|
|
|
// 将出口和入口合并
|
|
|
+ Map<String, PtlAgreementProductCostsNew> costsMappingNew = ptlAgreementProductCostsNews.stream()
|
|
|
+ .collect(Collectors.toMap(PtlAgreementProductCostsNew::getId, x-> x));
|
|
|
List<PtlAgreementProductCostsNewHistory> ptlAgreementProductCostsNewHistories = ptlAgreementProductCostsExportList.stream()
|
|
|
.map(x -> {
|
|
|
- PtlAgreementProductCostsNew ptlAgreementProductCostsNew = costsMapping.get(x.getCostsId());
|
|
|
+ PtlAgreementProductCostsNew ptlAgreementProductCostsNew = costsMappingNew.get(x.getCostsId());
|
|
|
return new PtlAgreementProductCostsNewHistory(ptlAgreementProductCostsNew, x, OperatorType.ADD, batchId, userId);
|
|
|
})
|
|
|
.collect(Collectors.toList());
|
|
|
@@ -2557,7 +2559,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
|
|
|
// 费用因子规则
|
|
|
ptlAgreementProductCostsAttrLinkList.forEach(x -> {
|
|
|
x.setId(null);
|
|
|
- x.setCostsId(costsMapping.get(x.getCostsId()).getId());
|
|
|
+ x.setCostsId(costsMapping.get(x.getCostsId()));
|
|
|
});
|
|
|
ptlAgreementProductCostsAttrLinkService.saveBatch(ptlAgreementProductCostsAttrLinkList);
|
|
|
|