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