fix(生产工单报工):报工查询产出总数量

This commit is contained in:
liaohechuan 2025-03-20 21:16:42 +08:00
parent 14d85f3dac
commit 3a3f4c4b6d

View File

@ -85,6 +85,11 @@ public class ShopOrderStatisticTransController {
List<ZShoporderStatisticsTransaction> newList = new ArrayList<>(); List<ZShoporderStatisticsTransaction> newList = new ArrayList<>();
String bat = SapUtil.noPrefixGenerateReqId(); String bat = SapUtil.noPrefixGenerateReqId();
for (ZShoporderStatisticsTransaction soStatisticsTrans : shoporderStatisticsTransactionList) { for (ZShoporderStatisticsTransaction soStatisticsTrans : shoporderStatisticsTransactionList) {
// 获取工单已完工数量
BigDecimal qtyOut = zShoporderStatisticsTransactionMapper.getQtyOut(soStatisticsTrans);
if (qtyOut != null) {
soStatisticsTrans.setQtyOut(qtyOut);
}
// 校验已报数量和产出数量 // 校验已报数量和产出数量
if (soStatisticsTrans.getSumQtyDone().compareTo(soStatisticsTrans.getQtyOut()) >= 0) { if (soStatisticsTrans.getSumQtyDone().compareTo(soStatisticsTrans.getQtyOut()) >= 0) {
throw BusinessException.build("工单【"+soStatisticsTrans.getShopOrder()+"】没有需要报工的产出数量!"); throw BusinessException.build("工单【"+soStatisticsTrans.getShopOrder()+"】没有需要报工的产出数量!");