fix:来料入库优化

This commit is contained in:
zhengxuming
2025-08-06 18:14:55 +08:00
parent 97c83d6470
commit c5c4ab28b5
3 changed files with 55 additions and 2 deletions

View File

@@ -574,6 +574,10 @@ public class PdaIosInServiceImpl implements PdaIosInService {
.eq(SchBaseTask::getPoint_code2, paramDto.getSite_code())
.or()
.eq(SchBaseTask::getPoint_code3, paramDto.getSite_code())
.or()
.eq(SchBaseTask::getPoint_code1, paramDto.getSite_code())
.or()
.eq(SchBaseTask::getPoint_code4, paramDto.getSite_code())
)
.le(SchBaseTask::getTask_status, TaskStatus.EXECUTING.getCode()));
@@ -631,11 +635,52 @@ public class PdaIosInServiceImpl implements PdaIosInService {
.orderByDesc(SchBasePoint::getOut_empty_seq);
List<SchBasePoint> schBasePointList = schBasePointMapper.selectList(queryWrapper);
if (CollectionUtils.isEmpty(schBasePointList)) {
throw new BadRequestException("原料卸车区不存在空的点位");
}
schBasePointString = schBasePointList.get(0).getPoint_code();
//剔除任务执行中的点位
final List<String> emptyPointStringList = schBasePointList.stream().map(SchBasePoint::getPoint_code)
.collect(Collectors.toList());
//找到空点位正在执行的任务(正常来说不应该存在)
List<SchBaseTask> taskingSchBaseTaskList = iSchBaseTaskService.list(new LambdaQueryWrapper<SchBaseTask>()
.eq(SchBaseTask::getIs_delete, IOSConstant.IS_DELETE_NO)
.and(wp -> wp
.in(SchBaseTask::getPoint_code1, emptyPointStringList)
.or()
.in(SchBaseTask::getPoint_code2, emptyPointStringList)
.or()
.in(SchBaseTask::getPoint_code3, emptyPointStringList)
.or()
.in(SchBaseTask::getPoint_code4, emptyPointStringList)
)
.le(SchBaseTask::getTask_status, TaskStatus.EXECUTING.getCode()));
//如果不存在,则正常执行
if(CollectionUtils.isEmpty(taskingSchBaseTaskList)){
schBasePointString = schBasePointList.get(0).getPoint_code();
} else {
List<String> pointList1 = taskingSchBaseTaskList.stream().map(SchBaseTask::getPoint_code1)
.collect(Collectors.toList());
List<String> pointList2 = taskingSchBaseTaskList.stream().map(SchBaseTask::getPoint_code2)
.collect(Collectors.toList());
List<String> pointList3 = taskingSchBaseTaskList.stream().map(SchBaseTask::getPoint_code3)
.collect(Collectors.toList());
List<String> pointList4 = taskingSchBaseTaskList.stream().map(SchBaseTask::getPoint_code4)
.collect(Collectors.toList());
List <String> pointStringList = emptyPointStringList.stream().filter(a->StringUtils.isNotBlank(a)
&& !pointList1.contains(a)
&& !pointList2.contains(a)
&& !pointList3.contains(a)
&& !pointList4.contains(a))
.collect(Collectors.toList());
schBasePointString = pointStringList.get(0);
}
}
//point1为库存空托盘点
@@ -932,6 +977,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
// 组织主数据
Map<String, Object> jsonMst = new HashMap<>();
jsonMst.put("checked", true);
jsonMst.put("point_code", whereJson.getString("point_code"));
jsonMst.put("sect_id", sectDao.getSect_id());
jsonMst.put("stor_id", sectDao.getStor_id());
jsonMst.put("sect_code", sectDao.getSect_code());

View File

@@ -11,6 +11,7 @@ import org.nl.common.utils.SecurityUtils;
import org.nl.common.utils.IdUtil;;
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
import org.nl.wms.basedata_manage.service.IStructattrService;
import org.nl.wms.basedata_manage.service.dao.Structattr;
import org.nl.wms.pm_manage.service.IPmFormDataService;
import org.nl.wms.pm_manage.service.dao.PmFormData;
import org.nl.wms.sch_manage.enums.TaskStatus;
@@ -178,7 +179,7 @@ public class InBillTask extends AbstractTask {
//更改点位的托盘信息,空托盘的点位 2为空托盘放置点位
pointService.update(new LambdaUpdateWrapper<SchBasePoint>()
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
.set(SchBasePoint::getPoint_status, "1")
.set(SchBasePoint::getPoint_status, "2")
.set(SchBasePoint::getUpdate_id, SecurityUtils.getCurrentUserId())
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName())
.set(SchBasePoint::getUpdate_time, DateUtil.now())
@@ -195,6 +196,11 @@ public class InBillTask extends AbstractTask {
rawAssistIStorService.taskFinish(taskObj);
iStructattrService.update(new LambdaUpdateWrapper<Structattr>()
.set(Structattr::getStoragevehicle_code, taskObj.getVehicle_code2())
.set(Structattr::getUpdate_time, DateUtil.now())
.eq(Structattr::getStruct_code, taskObj.getPoint_code1()));
List<SchBaseTask> noFinishTask = taskService.list(new LambdaQueryWrapper<>(SchBaseTask.class)
.eq(SchBaseTask::getForm_data_code,taskObj.getForm_data_code())
.eq(SchBaseTask::getIs_delete, BaseDataEnum.IS_YES_NOT.code(""))

View File

@@ -514,6 +514,7 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
dis_map.put("struct_id", struct_id);
dis_map.put("struct_code", struct_code);
dis_map.put("struct_name", struct_name);
dis_map.put("point_code", param.getString("point_code"));
dis_map.put("storagevehicle_code", storagevehicle_code);
//锁定货位
IOStorInv ioStorInv = ioStorInvMapper.selectById(map.get("iostorinv_id"));