fix:生产入库,拣选出库

This commit is contained in:
zhaoyf
2026-12-02 14:57:19 +08:00
parent 0a414dc2fa
commit 03e5be4a0b
4 changed files with 41 additions and 7 deletions

View File

@@ -0,0 +1,18 @@
package org.nl.common.utils;
import cn.hutool.core.util.StrUtil;
import org.nl.common.exception.BadRequestException;
public class WorkOrderUtil {
/**
* SAP 生产订单号:工单号去掉 -优先级 后缀
*/
public static String aufnrOf(String code) {
if (StrUtil.isBlank(code)) {
throw new BadRequestException("工单号为空,无法投料");
}
int index = code.indexOf('-');
return index > 0 ? code.substring(0, index) : code;
}
}

View File

@@ -159,6 +159,8 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
@Autowired
private ISchBaseTaskService taskService;
@Autowired
private ISchBasePointService schBasePointService;
/**
* 仓位服务
*/
@@ -907,6 +909,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
.set(GroupPlate::getUpdate_time,DateUtil.now())
.eq(GroupPlate::getStoragevehicle_code,ioStorInvDis.get(0).getStoragevehicle_code())
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库")));
unLockPoints(ioStorInvDis);
}
/**
@@ -946,7 +949,18 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
finishOutDtl(dtlId, finishedStatus);
}
}
private void unLockPoints(List<IOStorInvDis> ioStorInvDis){
if (ioStorInvDis.isEmpty()){
return;
}
Map<String, List<IOStorInvDis>> collect = ioStorInvDis.stream().collect(Collectors.groupingBy(IOStorInvDis::getPoint_code));
for (String point : collect.keySet()) {
schBasePointService.update(new LambdaUpdateWrapper<SchBasePoint>()
.set(SchBasePoint::getIng_task_code, null)
.set(SchBasePoint::getVehicle_code, null)
.eq(SchBasePoint::getPoint_code, point));
}
}
/**
* 明细下分配明细全部确认后完成明细并回传,明细全部完成则完成主表
*/

View File

@@ -2,9 +2,9 @@ package org.nl.wms.sch_manage.service.core.tasks;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.IdUtil;
@@ -16,6 +16,7 @@ import org.nl.wms.sch_manage.service.ISchBaseTaskService;
import org.nl.wms.sch_manage.service.core.AbstractTask;
import org.nl.wms.sch_manage.service.core.AcsTaskDto;
import org.nl.wms.sch_manage.service.core.TaskType;
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
import org.nl.wms.warehouse_manage.enums.IOSEnum;
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDis;
@@ -163,10 +164,10 @@ public class DeptPickingOutTask extends AbstractTask {
taskObj.setRemark("已到拣选位,待拣选确认");
taskObj.setUpdate_time(DateUtil.now());
taskService.updateById(taskObj);
// schBasePointService.update(new LambdaUpdateWrapper<SchBasePoint>()
// .set(SchBasePoint::getIng_task_code, null)
// .set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
// .eq(SchBasePoint::getPoint_code, taskObj.getPoint_code2()));
schBasePointService.update(new LambdaUpdateWrapper<SchBasePoint>()
.set(SchBasePoint::getIng_task_code, null)
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
.eq(SchBasePoint::getPoint_code, taskObj.getPoint_code2()));
}
@Transactional(rollbackFor = Exception.class)

View File

@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.WorkOrderUtil;
import org.nl.wms.ext_manage.sap.api.SapApi;
import org.nl.wms.ext_manage.sap.api.dto.ProductionInboundBody;
import org.nl.wms.ext_manage.sap.api.dto.ProductionInboundHeader;
@@ -112,7 +113,7 @@ public class SapProductionInboundDelivery implements CallbackStrategy {
request.setHeader(header);
ProductionInboundBody body = new ProductionInboundBody();
body.setAufnr(StrUtil.trim(StrUtil.blankToDefault(workOrder.getOrder_code(), param.getSource_bill_code())));
body.setAufnr(WorkOrderUtil.aufnrOf(workOrder.getOrder_code()));
body.setBldat(today);
body.setBudat(today);
body.setBwart(SapConstant.BWART_RECEIPT);