Browse Source

opt:优化自动移库和自动出库逻辑

master
zds 3 months ago
parent
commit
d78a806031
  1. 11
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java
  2. 8
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java
  3. 54
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/impl/WorkorderServiceImpl.java

11
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/impl/SchBaseTaskServiceImpl.java

@ -313,20 +313,25 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
SchBasePoint nexSchBasePoint = nextList.get(0);
param.put("start_point", schBasePoint.getPoint_code());
param.put("next_point", nexSchBasePoint.getPoint_code());
param.put("create_mode","1");
param.put("request_medthod_code", "POINTTask");
param.put("request_medthod_name", "点对点任务");
param.put("vehicle_code",schBasePoint.getVehicle_code());
param.put("vehicle_code2",schBasePoint.getVehicle_code2());
param.put("device_code", schBasePoint.getPoint_code());
acsToWmsService.pdaApply(param);
BaseResponse baseResponse= acsToWmsService.pdaApply(param);
Integer resultCode = baseResponse.getCode();
if(resultCode.equals(200)){
//发起任务时先把点位占用,防止发起重复任务
schBasePoint.setIng_task_code("1");
pointService.update(schBasePoint);
nexSchBasePoint.setIng_task_code("1");
pointService.update(nexSchBasePoint);
nextList.remove(0);
}else{
log.info(baseResponse.toString());
}
}
}
}

8
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java

@ -190,6 +190,14 @@ public abstract class AbstractTask {
Assert.isFalse(apply_sub_tray_lists.size()>0,
"该任务申请子托盘["+sub_tray+"]已存在未完成的任务,无法申请任务!");
}
//子托盘非空
String vehicle_code2 = param.getString("vehicle_code2");
if(ObjectUtil.isNotEmpty(vehicle_code2)) {
//判断该子托盘是否存在未完成任务
List<SchBaseTask> apply_vehicle_code2_lists = taskService.findUnFinishTasksBySub_tray("",vehicle_code2);
Assert.isFalse(apply_vehicle_code2_lists.size()>0,
"该任务申请子托盘["+vehicle_code2+"]已存在未完成的任务,无法申请任务!");
}
// 最大可创建任务数
Integer tcmn = taskConfig.getTask_create_max_num();
// 获取申请的任务

54
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/impl/WorkorderServiceImpl.java

@ -13,7 +13,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.ext.service.AcsToWmsService;
import org.nl.wms.ext.service.dto.to.BaseResponse;
import org.nl.wms.pda.service.PdaService;
import org.nl.wms.pda.service.dao.vo.PdaResponseVo;
import org.nl.wms.pdm.service.dao.PointDetailAdd;
import org.nl.wms.sch.point.service.ISchBasePointService;
import org.nl.wms.sch.point.service.dao.SchBasePoint;
@ -130,8 +132,23 @@ public class WorkorderServiceImpl extends ServiceImpl<WorkorderMapper, Workorder
List<String> pointCodes = pointDetailAdd.getPointCodes();
//下发状态
String status = pointDetailAdd.getStatus();
//查询是否有目的空点位
List<SchBasePoint> nextList = schBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getRegion_code, "YL")
.eq(SchBasePoint::getIs_used, true)
.eq(SchBasePoint::getVehicle_qty, 0)
.and(slam -> slam.isNull(SchBasePoint::getVehicle_code2)
.or()
.eq(SchBasePoint::getVehicle_code2, ""))
.and(slam -> slam.isNull(SchBasePoint::getIng_task_code)
.or()
.eq(SchBasePoint::getIng_task_code, "")));
if("1".equals(status)){
for(String pointCode : pointCodes){
if(nextList.size()==0){
log.info("原料库存区无可用点位,取消后续循环");
return;
}
//查询当前点位最新信息
SchBasePoint schBasePoint =schBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getIs_used, true)
@ -143,23 +160,10 @@ public class WorkorderServiceImpl extends ServiceImpl<WorkorderMapper, Workorder
.eq(SchBasePoint::getIng_task_code, "")
));
if(ObjectUtil.isNull(schBasePoint)){
log.info("移库点位异常:"+pointCode);
continue;
}
//查询是否有目的空点位
SchBasePoint nexSchBasePoint = schBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getRegion_code, "YL")
.eq(SchBasePoint::getIs_used, true)
.eq(SchBasePoint::getVehicle_qty, 0)
.and(slam -> slam.isNull(SchBasePoint::getVehicle_code2)
.or()
.eq(SchBasePoint::getVehicle_code2, ""))
.and(slam -> slam.isNull(SchBasePoint::getIng_task_code)
.or()
.eq(SchBasePoint::getIng_task_code, "")));
if(ObjectUtil.isNull(nexSchBasePoint)){
log.info("原料库存区无可用点位,取消后续循环");
break;
}
SchBasePoint nexSchBasePoint = nextList.get(0);
JSONObject param = new JSONObject();
param.put("start_point", schBasePoint.getPoint_code());
param.put("next_point", nexSchBasePoint.getPoint_code());
@ -169,12 +173,19 @@ public class WorkorderServiceImpl extends ServiceImpl<WorkorderMapper, Workorder
param.put("vehicle_code",schBasePoint.getVehicle_code());
param.put("vehicle_code2",schBasePoint.getVehicle_code2());
param.put("device_code", schBasePoint.getPoint_code());
acsToWmsService.pdaApply(param);
BaseResponse baseResponse= acsToWmsService.pdaApply(param);
Integer resultCode = baseResponse.getCode();
if(resultCode.equals(200)){
//发起任务时先把点位占用,防止发起重复任务
schBasePoint.setIng_task_code("1");
pointService.update(schBasePoint);
nexSchBasePoint.setIng_task_code("1");
pointService.update(nexSchBasePoint);
nextList.remove(0);
}else{
log.info(baseResponse.toString());
}
}
}
}
@ -216,11 +227,20 @@ public class WorkorderServiceImpl extends ServiceImpl<WorkorderMapper, Workorder
param.put("batch", DateUtil.format(DateUtil.date(), "yyyyMMddHHmmss"));
param.put("user_id","1");
param.put("person_name", "管理员");
pdaService.yclck(param);
param.put("request_medthod_code", "YCLCKTask");
param.put("request_medthod_name", "原材料出库");
param.put("device_code",param.getString("start_point"));
BaseResponse baseResponse=acsToWmsService.pdaApply(param);
Integer resultCode = baseResponse.getCode();
if(resultCode.equals(200)){
//更新对应载具工单状态为已生成任务,不可在工单页面取消
//pdm_bd_workorder_two任务生成时,status改为2
this.update(vehicle_code2,"2");
tcmn--;
}else{
log.info(baseResponse.toString());
continue;
}
}else{
break;
}

Loading…
Cancel
Save