fix:生产投料问题修复

This commit is contained in:
zhaoyf
2026-10-16 19:44:37 +08:00
parent 394bbce93f
commit c52318f976
2 changed files with 8 additions and 9 deletions

View File

@@ -338,15 +338,13 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
if (CollectionUtils.isEmpty(pmDemandDtos)) {
throw new BadRequestException("下推失败,请求数据不能为空");
}
pmDemandDtos.forEach(item -> {
List<PmDemand> disList = this.list(new LambdaQueryWrapper<PmDemand>()
.in(PmDemand::getId, pmDemandDtos.stream().map(PmDemandDto::getId).collect(Collectors.toList())));
disList.forEach(item -> {
if (!Objects.equals(item.getStatus(), DemandStatus.DIS.getValue())){
throw new BadRequestException("下推失败,单据状态不是已分配:" + item.getWorkOrder());
throw new BadRequestException("下推失败,单据状态已更新请刷新重新推送");
}
});
// List<PmDemand> disList = this.list(new LambdaQueryWrapper<PmDemand>()
// .in(PmDemand::getId, pmDemandDtos.stream().map(PmDemandDto::getId).collect(Collectors.toList()))
// .eq(PmDemand::getStatus, DemandStatus.DIS.getValue())
// .ne(PmDemand::getIs_deleted, 1));
// if (disList.size() < pmDemandDtos.size()) {
// String collect = pmDemandDtos.stream()
// .map(PmDemandDto::getWorkOrder)

View File

@@ -31,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Arrays;
@@ -120,7 +121,7 @@ public class DealLLCKBillPmDeamndCallBack implements CallbackStrategy {
entry.put("srcbillno", orderCode);
entry.put("srcbillid", workOrder.getOrder_id());
entry.put("srcbillentryid", item.getItemId());
entry.put("qty", item.getBomQty());
entry.put("qty", item.getBomQty().multiply(BigDecimal.valueOf(workOrder.getOrder_qty())));
entry.put("warehouseno", one.getInventory_dis());
entry.put("materialno", item.getMaterialCode());
entrys.add(entry);
@@ -134,14 +135,14 @@ public class DealLLCKBillPmDeamndCallBack implements CallbackStrategy {
entry.put("srcbillid", workOrder.getOrder_id());
entry.put("srcbillentryid", item.getItem_id());
entry.put("warehouseno", one.getInventory_dis());
entry.put("qty", item.getBom_qty());
entry.put("qty", item.getBom_qty().multiply(BigDecimal.valueOf(workOrder.getOrder_qty())));
entry.put("materialno", item.getMaterial_code());
entrys.add(entry);
}
dataOut.put("entrys", entrys);
callbackData.put("data", dataOut);
// ErpUtil.create().login().audit(callbackData.toString());
stockReturn.setRequest_Id(param.getIostorinv_id());
stockReturn.setRequest_Id(workOrderCode);
stockReturn.setRequest_type(IOSEnum.BILL_TYPE.code("生产出库"));
stockReturn.setBill_code(ioStorInv.getBill_code());
stockReturn.setStatus(StockReturnStatusEnum.TODO.getCode());