|
|
@@ -224,7 +224,7 @@ public class ProjectChangeStopHelper { |
|
|
|
|
|
|
|
private void projectEditRewrite(ProjectEditDTO projectEdit) { |
|
|
|
List<FieldDiff> projectDiffs = projectEdit.getProjectDiffs(); |
|
|
|
if (projectDiffs != null && !projectDiffs.isEmpty()) { |
|
|
|
if (CollUtil.isNotEmpty(projectDiffs)) { |
|
|
|
ProjectDTO projectDetail = projectEdit.getProject(); |
|
|
|
FieldDiff systemReplaceInfos = CollUtil.findOne(projectDiffs, |
|
|
|
w -> w.getFieldName().equals(ProjectDTO.SYSTEM_REPLACE_INFOS)); |
|
|
@@ -241,33 +241,45 @@ public class ProjectChangeStopHelper { |
|
|
|
List<PurchaseEditDTO> purchases = projectEdit.getPurchases(); |
|
|
|
if (CollUtil.isNotEmpty(purchases)) { |
|
|
|
for (PurchaseEditDTO purchaseEdit : purchases) { |
|
|
|
List<FieldDiff> purchaseDiffs = purchaseEdit.getPurchaseDiffs(); |
|
|
|
if (CollUtil.isNotEmpty(purchaseDiffs)) { |
|
|
|
PurchaseDTO purchaseDetail = purchaseEdit.getPurchase(); |
|
|
|
UpdateWrapper<Purchase> wrapper = buildWrapper(purchaseDiffs, Purchase.class); |
|
|
|
if (wrapper != null) { |
|
|
|
wrapper.eq("id", purchaseDetail.getId()); |
|
|
|
purchaseService.update(wrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
List<FieldDiff> contractDiffs = purchaseEdit.getContractDiffs(); |
|
|
|
if (CollUtil.isNotEmpty(contractDiffs)) { |
|
|
|
ContractDTO contractDetail = purchaseEdit.getContract(); |
|
|
|
UpdateWrapper<Contract> wrapper = buildWrapper(contractDiffs, Contract.class); |
|
|
|
if (wrapper != null) { |
|
|
|
wrapper.eq("id", contractDetail.getId()); |
|
|
|
contractService.update(wrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
List<FieldDiff> operationDiffs = purchaseEdit.getOperationDiffs(); |
|
|
|
if (CollUtil.isNotEmpty(operationDiffs)) { |
|
|
|
OperationDTO operationDetail = purchaseEdit.getOperation(); |
|
|
|
UpdateWrapper<Operation> wrapper = buildWrapper(operationDiffs, Operation.class); |
|
|
|
if (wrapper != null) { |
|
|
|
wrapper.eq("id", operationDetail.getId()); |
|
|
|
operationService.update(wrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
modifyPurchase(purchaseEdit); |
|
|
|
modifyContract(purchaseEdit); |
|
|
|
modifyOperation(purchaseEdit); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void modifyPurchase(PurchaseEditDTO purchaseEdit) { |
|
|
|
List<FieldDiff> purchaseDiffs = purchaseEdit.getPurchaseDiffs(); |
|
|
|
if (CollUtil.isNotEmpty(purchaseDiffs)) { |
|
|
|
PurchaseDTO purchaseDetail = purchaseEdit.getPurchase(); |
|
|
|
UpdateWrapper<Purchase> wrapper = buildWrapper(purchaseDiffs, Purchase.class); |
|
|
|
if (wrapper != null) { |
|
|
|
wrapper.eq("id", purchaseDetail.getId()); |
|
|
|
purchaseService.update(wrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void modifyContract(PurchaseEditDTO purchaseEdit) { |
|
|
|
List<FieldDiff> contractDiffs = purchaseEdit.getContractDiffs(); |
|
|
|
if (CollUtil.isNotEmpty(contractDiffs)) { |
|
|
|
ContractDTO contractDetail = purchaseEdit.getContract(); |
|
|
|
UpdateWrapper<Contract> wrapper = buildWrapper(contractDiffs, Contract.class); |
|
|
|
if (wrapper != null) { |
|
|
|
wrapper.eq("id", contractDetail.getId()); |
|
|
|
contractService.update(wrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void modifyOperation(PurchaseEditDTO purchaseEdit) { |
|
|
|
List<FieldDiff> operationDiffs = purchaseEdit.getOperationDiffs(); |
|
|
|
if (CollUtil.isNotEmpty(operationDiffs)) { |
|
|
|
OperationDTO operationDetail = purchaseEdit.getOperation(); |
|
|
|
UpdateWrapper<Operation> wrapper = buildWrapper(operationDiffs, Operation.class); |
|
|
|
if (wrapper != null) { |
|
|
|
wrapper.eq("id", operationDetail.getId()); |
|
|
|
operationService.update(wrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|