|
|
@ -301,6 +301,14 @@ public class CountPlanMainServiceImpl implements CountPlanMainService { |
|
|
|
List<CountRequestDetailCreateReqVO> subList = new ArrayList<>(); |
|
|
|
int countDetailNumber = 1; |
|
|
|
for (BalanceDO balanceDO : balanceDOList) { |
|
|
|
//忽略物品或者忽略库位直接continue
|
|
|
|
if(mainDO.getIgnoreListOfItem().contains(balanceDO.getItemCode()) || mainDO.getIgnoreListOfLocation().contains(balanceDO.getLocationCode())) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
//维度,按照库存扩大范围,比如维度是库位时,盘点库位上某一个物品,那要扩大到这个物品所在库位的所有物品,BY_INVENTORY,按库存 BY_ITEM,按物品 BY_BATCH,按批次 BY_LOCATION,按库位
|
|
|
|
//if(mainDO.getDimension().equals("BY_INVENTORY")) {
|
|
|
|
|
|
|
|
//}
|
|
|
|
CountRequestDetailCreateReqVO countRequestDetailCreateReqVO = new CountRequestDetailCreateReqVO(); |
|
|
|
BeanUtils.copyProperties(balanceDO, countRequestDetailCreateReqVO); |
|
|
|
ItembasicDO itembasicDO = itembasicService.selectItembasic(balanceDO.getItemCode()); |
|
|
@ -308,17 +316,24 @@ public class CountPlanMainServiceImpl implements CountPlanMainService { |
|
|
|
countRequestDetailCreateReqVO.setItemDesc1(itembasicDO.getDesc1()); |
|
|
|
countRequestDetailCreateReqVO.setItemDesc2(itembasicDO.getDesc2()); |
|
|
|
countRequestDetailCreateReqVO.setCountDetailNumber(String.valueOf(countDetailNumber)); |
|
|
|
int listSize1 = subList.size(); |
|
|
|
if(countRequestDetailCreateReqVO.getQty().compareTo(BigDecimal.ZERO) == 0) { |
|
|
|
if ("TRUE".equals(mainDO.getIsCountZeroInventory())) { |
|
|
|
if ("TRUE".equals(mainDO.getIsCountZeroInventory())) {//盘点零库存
|
|
|
|
subList.add(countRequestDetailCreateReqVO); |
|
|
|
} |
|
|
|
} else if (countRequestDetailCreateReqVO.getQty().compareTo(BigDecimal.ZERO) < 0) { |
|
|
|
if ("TRUE".equals(mainDO.getIsCountNegativeInventory())) { |
|
|
|
if ("TRUE".equals(mainDO.getIsCountNegativeInventory())) {//盘点负库存
|
|
|
|
subList.add(countRequestDetailCreateReqVO); |
|
|
|
} |
|
|
|
} else { |
|
|
|
subList.add(countRequestDetailCreateReqVO); |
|
|
|
} |
|
|
|
//增加了数据并且冻结盘点时,冻结库存余额
|
|
|
|
if(subList.size() > listSize1 && "TRUE".equals(mainDO.getIsFreeze())) { |
|
|
|
balanceDO.setFrozen("TRUE"); |
|
|
|
balanceDO.setFrozenReason("冻结盘点"); |
|
|
|
balanceMapper.updateById(balanceDO); |
|
|
|
} |
|
|
|
countDetailNumber++; |
|
|
|
} |
|
|
|
//盘点空库位,补齐空库位,在生成任务时拆分为只有主的盘点任务
|
|
|
@ -327,6 +342,10 @@ public class CountPlanMainServiceImpl implements CountPlanMainService { |
|
|
|
locationExportReqVO.setAvailable("TRUE"); |
|
|
|
List<LocationDO> locationDOList = locationService.getLocationList(new LocationExportReqVO()); |
|
|
|
for(LocationDO locationDO : locationDOList) { |
|
|
|
//忽略库位直接continue
|
|
|
|
if(mainDO.getIgnoreListOfLocation().contains(locationDO.getCode())) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
boolean flag = false; |
|
|
|
for(CountRequestDetailCreateReqVO countRequestDetailCreateReqVO : subList) { |
|
|
|
if(countRequestDetailCreateReqVO.getLocationCode().equals(locationDO.getCode())) { |
|
|
|