Commit 5f019a15602c62f5575ff3a0e6f92722b65e4668
1 parent
c3c2734f
fix:修改删除生产科对账单时校验一下是否存在待审核的发票。
Showing
1 changed file
with
7 additions
and
5 deletions
src/main/java/com/order/erp/service/order/impl/ProducePaymentCheckBillOrderServiceImpl.java
... | ... | @@ -987,7 +987,7 @@ public class ProducePaymentCheckBillOrderServiceImpl extends ServiceImpl<Produce |
987 | 987 | } |
988 | 988 | OrderBaseInfoDO orderBaseInfoDO = orderBaseInfoService.getById(checkBillOrderDO.getOrderId()); |
989 | 989 | //校验是否有处于待审核的发票。 |
990 | - checkCommitApply(id); | |
990 | + checkCommitApply(Arrays.asList(id)); | |
991 | 991 | //校验是否有处于待审核的订单。 todo |
992 | 992 | checkApply(new ArrayList<>(Arrays.asList(id))); |
993 | 993 | OrderLockFieldVO locakFieldVO = new OrderLockFieldVO(); |
... | ... | @@ -1181,16 +1181,16 @@ public class ProducePaymentCheckBillOrderServiceImpl extends ServiceImpl<Produce |
1181 | 1181 | } |
1182 | 1182 | |
1183 | 1183 | /** |
1184 | - * @param id | |
1184 | + * @param ids | |
1185 | 1185 | */ |
1186 | - private void checkCommitApply(Long id) { | |
1186 | + private void checkCommitApply(List<Long> ids) { | |
1187 | 1187 | OrderFieldLockApplyDO applyDO = orderFieldLockApplyService.getOne(new LambdaQueryWrapper<OrderFieldLockApplyDO>() |
1188 | 1188 | .eq(OrderFieldLockApplyDO::getEnableFlag, Constant.ENABLE_TEN) |
1189 | 1189 | .eq(OrderFieldLockApplyDO::getType, ApplyTypeEnum.DEPARTMENT_INVOICE_APPLY.getType()) |
1190 | 1190 | .eq(OrderFieldLockApplyDO::getStatus, ApplyStatusEnum.WAIT_AUDIT.getStatus()) |
1191 | - .eq(OrderFieldLockApplyDO::getOrderId, id)); | |
1191 | + .in(OrderFieldLockApplyDO::getOrderId, ids)); | |
1192 | 1192 | if (Objects.nonNull(applyDO)) { |
1193 | - throw new BusinessException("该账单发票还在审批中,请联系总经理审批后操作!"); | |
1193 | + throw new BusinessException("该账单发票还在审批中,请联系总经理审批后再执行操作!"); | |
1194 | 1194 | } |
1195 | 1195 | } |
1196 | 1196 | |
... | ... | @@ -1236,6 +1236,8 @@ public class ProducePaymentCheckBillOrderServiceImpl extends ServiceImpl<Produce |
1236 | 1236 | } |
1237 | 1237 | //todo 审核有点问题。审核时是是哪个orderid共用一个orderid作为id,查询的时候是只能查询到第一个。 已完成。 |
1238 | 1238 | checkApply(ids); |
1239 | + //查询一下是否存在待审核的发票。如果存在待审核的发票就目前无法删除。 | |
1240 | + checkCommitApply(ids); | |
1239 | 1241 | List<Long> orderIds = checkBillOrderDOS.stream() |
1240 | 1242 | .map(ProducePaymentCheckBillOrderDO::getOrderId) |
1241 | 1243 | .collect(Collectors.toList()); | ... | ... |