diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java index aad878c3..ca3b5ebe 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java @@ -206,22 +206,18 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { if (StringUtils.isNotBlank(publishTask)) { // 根据领用批次查询领用详情 details = leaseApplyDetailsMapper.getDetailsPublish(leaseApplyInfo); - if (!CollectionUtils.isEmpty(details)) { - for (LeaseApplyDetails detail : details) { - // 根据parent_id和type_id查询出库数量 - BigDecimal outNum = leaseApplyDetailsMapper.getOutNum(detail); - detail.setAlNum(outNum); - detail.setOutNum(detail.getPreNum().subtract(outNum)); - if (detail.getPreNum().compareTo(detail.getAlNum()) == 0) { - detail.setStatus("2"); - } else { - detail.setStatus("1"); - } - } - } } - if (details.size()>0){ - for (LeaseApplyDetails detail : details){ + if (!CollectionUtils.isEmpty(details)) { + for (LeaseApplyDetails detail : details) { + // 根据parent_id和type_id查询出库数量 + BigDecimal outNum = leaseApplyDetailsMapper.getOutNum(detail); + detail.setAlNum(outNum); + detail.setOutNum(detail.getPreNum().subtract(outNum)); + if (detail.getPreNum().compareTo(detail.getAlNum()) == 0) { + detail.setStatus("2"); + } else { + detail.setStatus("1"); + } //查询类型的库存和总待出库数量 LeaseApplyDetails pendingOutNum = mapper.selectPendingOutNum(detail); detail.setPendingOutNum(pendingOutNum.getPendingOutNum()); @@ -1753,20 +1749,20 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { return AjaxResult.error("该设备已出库,请勿重复操作"); } } - if (leaseOutDetails.getManageType().equals(MaTypeManageTypeEnum.CODE_DEVICE.getTypeId())) { - if (leaseOutDetails.getParentId() != null) { - List detailsList = leaseApplyDetailsMapper.getLeaseMaCode(leaseOutDetails); - if (!CollectionUtils.isEmpty(detailsList)) { - return AjaxResult.error("该设备已出库,请勿重复操作"); - } - } - } } } for (LeaseOutDetails bean : leaseOutRequestVo.getLeaseOutDetailsList()) { if (Objects.isNull(bean)) { continue; } + if (bean.getManageType().equals(MaTypeManageTypeEnum.CODE_DEVICE.getTypeId())) { + if (bean.getParentId() != null) { + List detailsList = leaseApplyDetailsMapper.getLeaseMaCode(bean); + if (!CollectionUtils.isEmpty(detailsList)) { + continue; + } + } + } // 默认设置领料单位为非班组 bean.setLeaseUnitIsTeam(false); // 根据现在的领料发布出库单位ID来判断类型是否是班组