| | |
| | | @RequestMapping("/mes/wm/product-sales-line") |
| | | @Validated |
| | | public class MesWmProductSalesLineController { |
| | | @Resource private cn.iocoder.yudao.module.mes.dal.mysql.wm.transaction.MesWmTransactionMapper transactionMapper; |
| | | |
| | | @Resource |
| | | private MesWmProductSalesLineService productSalesLineService; |
| | |
| | | .stream().collect(Collectors.toMap(MdmUnitMeasureRespDTO::getId, e -> e)); |
| | | // 2. 构建结果 |
| | | return BeanUtils.toBean(list, MesWmProductSalesLineRespVO.class, vo -> { |
| | | var shipped = transactionMapper.sumSalesOutboundByLineId(vo.getId()); |
| | | vo.setShippedQuantity(shipped == null ? java.math.BigDecimal.ZERO : shipped); |
| | | vo.setRemainingQuantity((vo.getQuantity() == null ? java.math.BigDecimal.ZERO : vo.getQuantity()).subtract(vo.getShippedQuantity()).max(java.math.BigDecimal.ZERO)); |
| | | MapUtils.findAndThen(itemMap, vo.getItemId(), item -> { |
| | | vo.setItemCode(item.getCode()).setItemName(item.getName()).setSpecification(item.getSpecification()); |
| | | MapUtils.findAndThen(unitMeasureMap, item.getUnitMeasureId(), |