Commit f039e70d5928f08111cc78441dfe2062e0e18eb0

Authored by 谢茂盛
1 parent 7e45e7e4

feat: 问题修复项

1、利润分析表提交的审核内容,管理员通过审核OK,系统放开后可以编辑,但是不能保存更改
src/main/java/com/order/erp/service/order/impl/OrderBaseInfoServiceImpl.java
... ... @@ -547,12 +547,12 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O
547 547 * @param orderId
548 548 * @param userId
549 549 */
550   - private void checkApply(Long orderId, Long userId) {
  550 + private void checkApply(Long orderId, Long userId, ApplyTypeEnum applyTypeEnum) {
551 551 List<OrderFieldLockApplyDO> applyDOS = orderFieldLockApplyService.list(new LambdaQueryWrapper<OrderFieldLockApplyDO>()
552 552 .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN)
553 553 .eq(OrderFieldLockApplyDO::getOrderId, orderId)
554 554 .eq(OrderFieldLockApplyDO::getApplyUserId, userId)
555   - .eq(OrderFieldLockApplyDO::getType, ApplyTypeEnum.FIELD_EDIT_APPLY.getType())
  555 + .eq(OrderFieldLockApplyDO::getType, applyTypeEnum.getType())
556 556 .eq(OrderFieldLockApplyDO::getStatus, ApplyStatusEnum.WAIT_AUDIT.getStatus()));
557 557 if (CollectionUtils.isNotEmpty(applyDOS)) {
558 558 throw new BusinessException(ServerResultCode.APPLY_UNLOCK_FIELD_EXIST);
... ... @@ -688,7 +688,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
688 688 .in(OrderProfitAnalysisDO::getOrderId, orderIds));
689 689  
690 690 if (CollectionUtils.isNotEmpty(orderProfitAnalysisDOS)) {
691   - Map<Long, OrderProfitAnalysisDO> profitAnalysisDOMap = orderProfitAnalysisDOS.stream().collect(Collectors.toMap(OrderProfitAnalysisDO::getOrderId, Function.identity()));
  691 + Map<Long, OrderProfitAnalysisDO> profitAnalysisDOMap = orderProfitAnalysisDOS.stream().collect(Collectors.toMap(OrderProfitAnalysisDO::getOrderId, Function.identity(), (v1, v2) -> v1));
692 692 orderInfoResultVOList.forEach(result -> {
693 693 if (profitAnalysisDOMap.containsKey(result.getId())) {
694 694 OrderProfitAnalysisDO profitAnalysisDO = profitAnalysisDOMap.get(result.getId());
... ... @@ -717,7 +717,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
717 717 if (CollectionUtils.isEmpty(orderCompletionReportDOS)) {
718 718 return;
719 719 }
720   - Map<Long, OrderCompletionReportDO> completionReportDOMap = orderCompletionReportDOS.stream().collect(Collectors.toMap(OrderCompletionReportDO::getOrderId, Function.identity()));
  720 + Map<Long, OrderCompletionReportDO> completionReportDOMap = orderCompletionReportDOS.stream().collect(Collectors.toMap(OrderCompletionReportDO::getOrderId, Function.identity(), (v1, v2) -> v1));
721 721 orderInfoResultVOList.forEach(result -> {
722 722 if (completionReportDOMap.containsKey(result.getId())) {
723 723 OrderCompletionReportDO completionReportDO = completionReportDOMap.get(result.getId());
... ... @@ -1017,10 +1017,10 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
1017 1017 .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN)
1018 1018 .eq(OrderFieldLockApplyDO::getApplyUserId, dataScope.getLoginUserId())
1019 1019 .eq(OrderFieldLockApplyDO::getStatus, ApplyStatusEnum.WAIT_AUDIT.getStatus())
1020   - .in(OrderFieldLockApplyDO::getOrderId, orderIds));
  1020 + .in(OrderFieldLockApplyDO::getOrderId, orderIds).orderByAsc(OrderFieldLockApplyDO::getId));
1021 1021  
1022 1022 if (CollectionUtils.isNotEmpty(fieldLockApplyDOList)) {
1023   - Map<Long, OrderFieldLockApplyDO> applyDOMap = fieldLockApplyDOList.stream().collect(Collectors.toMap(OrderFieldLockApplyDO::getOrderId, Function.identity()));
  1023 + Map<Long, OrderFieldLockApplyDO> applyDOMap = fieldLockApplyDOList.stream().collect(Collectors.toMap(OrderFieldLockApplyDO::getOrderId, Function.identity(), (v1, v2) -> v1));
1024 1024 orderInfoResultVOList.forEach(x -> {
1025 1025 OrderFieldLockApplyDO applyDO = applyDOMap.get(x.getId());
1026 1026 if (Objects.nonNull(applyDO) && ApplyTypeEnum.ORDER_REPORT_APPLY.getType().equals(applyDO.getType())) {
... ... @@ -1242,7 +1242,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
1242 1242 .eq(StringUtils.isNotBlank(queryVO.getOrderStatus()), OrderBaseInfoDO::getOrderStatus, queryVO.getOrderStatus())
1243 1243 .eq(StringUtils.isNotBlank(queryVO.getCustomerCode()), OrderBaseInfoDO::getCustomerCode, queryVO.getCustomerCode())
1244 1244 .in(CollectionUtils.isNotEmpty(queryVO.getProjectNo()), OrderBaseInfoDO::getProjectNo, queryVO.getProjectNo())
1245   - .in(CollectionUtils.isNotEmpty(queryVO.getInnerNo()),OrderBaseInfoDO::getInnerNo,queryVO.getInnerNo())
  1245 + .in(CollectionUtils.isNotEmpty(queryVO.getInnerNo()), OrderBaseInfoDO::getInnerNo, queryVO.getInnerNo())
1246 1246 .eq(StringUtils.isNotBlank(queryVO.getProductionDepartment()), OrderBaseInfoDO::getProductionDepartment, queryVO.getProductionDepartment())
1247 1247 .eq(StringUtils.isNotBlank(queryVO.getCreateBy()), OrderBaseInfoDO::getCreateBy, queryVO.getCreateBy())
1248 1248 .eq(StringUtils.isNotBlank(queryVO.getBusinessPerson()), OrderBaseInfoDO::getBusinessPerson, queryVO.getBusinessPerson())
... ... @@ -1373,7 +1373,6 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
1373 1373 .eq(SystemSettingDO::getRelationCode, "profitRate").last("limit 1"));
1374 1374  
1375 1375 double profitRate = Objects.nonNull(systemSettingDO) ? Double.parseDouble(systemSettingDO.getRelationValue()) : 0.3;
1376   - checkApply(profitAnalysisVO.getOrderId(), userId);
1377 1376 OrderFieldLockApplyDO orderFieldLockApplyDO = buildProfitFieldLockApplyDO(profitAnalysisFieldVO, userId);
1378 1377 orderFieldLockApplyService.save(orderFieldLockApplyDO);
1379 1378  
... ... @@ -1415,6 +1414,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
1415 1414 optLogDO = buildOrderOptLogDo(updateVO.getOrderId(), userId, OrderOptTypeEnum.ORDER_EDIT.getDesc(), JSONObject.toJSONString(updateVO));
1416 1415 }
1417 1416 if (Objects.nonNull(updateVO.getProfitAnalysisInfo())) {
  1417 + checkApply(updateVO.getOrderId(), userId, ApplyTypeEnum.ORDER_PROFIT_APPLY);
1418 1418 OrderFieldLockApplyDO orderFieldLockApplyDO = handlerProfitRate(updateVO.getProfitAnalysisInfo(), orderBaseInfoDo, userId);
1419 1419  
1420 1420 orderBaseInfoDo.setOrderStatus(ApplyStatusEnum.AUDIT_PASS.getStatus().equals(orderFieldLockApplyDO.getStatus()) ? OrderStatusEnum.PROFIT_AUDIT_PASS.getStatus()
... ... @@ -1423,7 +1423,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
1423 1423 }
1424 1424  
1425 1425 if (Objects.nonNull(updateVO.getReportInfo())) {
1426   - checkApply(updateVO.getOrderId(), userId);
  1426 + checkApply(updateVO.getOrderId(), userId, ApplyTypeEnum.ORDER_REPORT_APPLY);
1427 1427 OrderFieldLockApplyDO orderFieldLockApplyDO = buildReportFieldLockApplyDO(updateVO.getReportInfo(), userId);
1428 1428 orderFieldLockApplyService.save(orderFieldLockApplyDO);
1429 1429  
... ...