fix:工单下推拆分配盘需求单+1
This commit is contained in:
@@ -95,11 +95,11 @@ public class MesToWmsController {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResponseEntity subWorkOrder(@RequestBody List<WorkOrderDto.WorkOrderDataDto> dtos){
|
||||
String[] filter = {};//过滤产线
|
||||
String[] filterOnDemand = {"E3"};//下发需求产线过滤
|
||||
String[] filterOnDemand = {"E317"};//下发需求产线过滤
|
||||
List<String> orderCodes = new ArrayList<>();
|
||||
for (WorkOrderDto.WorkOrderDataDto dto : dtos) {
|
||||
if (!ArrayUtils.contains(filter, dto.getWorkArea())){
|
||||
if (ArrayUtils.contains(filterOnDemand, dto.getWorkArea())){
|
||||
if (!StringUtils.isEmpty(dto.getWorkArea()) && dto.getWorkArea().startsWith("E3")){
|
||||
orderCodes.add(dto.getOrderCode());
|
||||
dto.getWorkOrderBomList().forEach(bom -> {
|
||||
bom.setWarehouseCode("6.011.03");
|
||||
|
||||
@@ -261,7 +261,7 @@ public class PlatingDemandServiceImpl implements IPlatingDemandService {
|
||||
.qty_unit_name(materialbase.getQty_unit_name())
|
||||
.qty(item.getQty())
|
||||
.status(GROUP_PLATE_STATUS.code("出库"))
|
||||
.load_port(demand.getLoad_port())
|
||||
.load_port(parseLoadPort(demand.getLoad_port()))
|
||||
.ext_code("")
|
||||
.ext_type("")
|
||||
.ext_dtl_code("")
|
||||
@@ -364,6 +364,7 @@ public class PlatingDemandServiceImpl implements IPlatingDemandService {
|
||||
entry.put("srcbillid", order.getOrder_id());
|
||||
entry.put("srcbillentryid", bom == null ? null : bom.getItem_id());
|
||||
entry.put("qty", qty);
|
||||
entry.put("warehouseno", struct.getStor_code());
|
||||
entries.add(entry);
|
||||
}
|
||||
ioStorInvMapper.insert(bill);
|
||||
@@ -437,4 +438,11 @@ public class PlatingDemandServiceImpl implements IPlatingDemandService {
|
||||
dto.setIgnored(item.getIs_ignored() == null ? 0 : item.getIs_ignored());
|
||||
return dto;
|
||||
}
|
||||
public static String parseLoadPort(String input) {
|
||||
if (input == null || input.isEmpty()) {
|
||||
return input;
|
||||
}
|
||||
int index = input.indexOf(':');
|
||||
return index == -1 ? input : input.substring(0, index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ public class StInventoryServiceImpl implements IStInventoryService {
|
||||
}
|
||||
GroupPlate groupPlate = iMdPbGroupplateService.getOne(queryWrapper);
|
||||
if (groupPlate == null){
|
||||
throw new BadRequestException("当前仓库无库存");
|
||||
throw new BadRequestException("物料"+ outFinishParam.getMaterialCode() +"当前仓库无库存");
|
||||
}
|
||||
final BigDecimal force_qty = groupPlate.getFrozen_qty().subtract(outFinishParam.getChangeQty());
|
||||
if (groupPlate.getQty().subtract(outFinishParam.getChangeQty()).intValue() <= 0){
|
||||
|
||||
Reference in New Issue
Block a user