|
@ -348,24 +348,10 @@ public class ItemServiceImpl implements ItemService { |
|
|
public PageResult<ItemDO> getWarningPage(ItemPageReqVO pageReqVO) { |
|
|
public PageResult<ItemDO> getWarningPage(ItemPageReqVO pageReqVO) { |
|
|
pageReqVO.setFlag("2"); |
|
|
pageReqVO.setFlag("2"); |
|
|
PageResult<ItemDO> pageResult = itemMapper.selectPage(pageReqVO); |
|
|
PageResult<ItemDO> pageResult = itemMapper.selectPage(pageReqVO); |
|
|
List<ItemDO> itemNewList=new ArrayList(); |
|
|
for(ItemDO en: pageResult.getList()){ |
|
|
for (ItemDO itemDO : pageResult.getList()) { |
|
|
BigDecimal bigDecimal = itemAccountsMapper.selectInventorySum(en.getNumber()); |
|
|
QueryWrapper<ItemAccountsDO> queryWrapper = new QueryWrapper<>(); |
|
|
en.setAllCount(bigDecimal); |
|
|
queryWrapper.eq("item_number",itemDO.getNumber()); |
|
|
|
|
|
queryWrapper.eq("available","TRUE"); |
|
|
|
|
|
List<ItemAccountsDO> itemAccountsDOList = itemAccountsMapper.selectList(queryWrapper); |
|
|
|
|
|
BigDecimal allCount = BigDecimal.ZERO; |
|
|
|
|
|
for (ItemAccountsDO itemAccountsDO : itemAccountsDOList) { |
|
|
|
|
|
allCount=allCount.add(itemAccountsDO.getQty()); |
|
|
|
|
|
} |
|
|
|
|
|
//如果各种类型的备件库存数量总数低于最低库存数量
|
|
|
|
|
|
if(allCount.compareTo(itemDO.getMinInventory())==-1){ |
|
|
|
|
|
itemDO.setAllCount(allCount); |
|
|
|
|
|
itemNewList.add(itemDO); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
pageResult.setList(itemNewList); |
|
|
|
|
|
pageResult.setTotal(Long.valueOf(itemNewList.size()).longValue()); |
|
|
|
|
|
return pageResult; |
|
|
return pageResult; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|