出库优化

This commit is contained in:
mashuai 2025-09-18 19:51:47 +08:00
parent 040b69d594
commit 0a6f204afc
1 changed files with 19 additions and 23 deletions

View File

@ -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<LeaseApplyDetails> 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<LeaseApplyDetails> detailsList = leaseApplyDetailsMapper.getLeaseMaCode(bean);
if (!CollectionUtils.isEmpty(detailsList)) {
continue;
}
}
}
// 默认设置领料单位为非班组
bean.setLeaseUnitIsTeam(false);
// 根据现在的领料发布出库单位ID来判断类型是否是班组