Browse Source

更新各类任务分配点位的逻辑

master
zds 3 months ago
parent
commit
71ed7177f1
  1. 18
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java
  2. 20
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java
  3. 5
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java
  4. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java

18
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java

@ -6,10 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.common.exception.BadRequestException; import org.nl.common.exception.BadRequestException;
import org.nl.wms.ext.service.AcsToWmsService;
import org.nl.wms.ext.service.dto.to.BaseResponse; import org.nl.wms.ext.service.dto.to.BaseResponse;
import org.nl.wms.pdm.service.IPdmBdWorkorderService;
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
import org.nl.wms.sch.point.service.ISchBasePointService; import org.nl.wms.sch.point.service.ISchBasePointService;
import org.nl.wms.sch.point.service.dao.SchBasePoint; import org.nl.wms.sch.point.service.dao.SchBasePoint;
import org.nl.wms.sch.task.service.ISchBaseTaskService; import org.nl.wms.sch.task.service.ISchBaseTaskService;
@ -49,13 +46,7 @@ public class KJRKTask extends AbstractTask {
@Autowired @Autowired
private ISchBaseTaskconfigService taskConfigService; private ISchBaseTaskconfigService taskConfigService;
@Autowired @Autowired
private IPdmBdWorkorderService workorderService;
@Autowired
private ISchBaseVehiclematerialgroupService vehiclematerialgroupService;
@Autowired
private PointMapper pointMapper; private PointMapper pointMapper;
@Autowired
private AcsToWmsService acsToWmsService;
@Override @Override
// @Transactional(rollbackFor = Exception.class) // @Transactional(rollbackFor = Exception.class)
@ -105,9 +96,12 @@ public class KJRKTask extends AbstractTask {
String regionCode = "KJHC"; String regionCode = "KJHC";
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "0"); List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "0");
for (SchBasePoint schBasePoint : schBasePointList) { for (SchBasePoint schBasePoint : schBasePointList) {
if (StringUtils.isEmpty(schBasePoint.getIng_task_code()) //查找点上无载具号无任务号、载具数量为0的
&& schBasePoint.getVehicle_qty() ==0) { if (schBasePoint.getIs_used()
log.info("原材料入库找到当前符合条件的点位{}", schBasePoint.getPoint_code()); && StringUtils.isEmpty(schBasePoint.getIng_task_code())
&& schBasePoint.getVehicle_qty() ==0
&& ObjectUtil.isEmpty(schBasePoint.getVehicle_code2())) {
log.info("空架入库找到当前符合条件的点位{}", schBasePoint.getPoint_code());
return schBasePoint; return schBasePoint;
} }
} }

20
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java

@ -6,10 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.common.exception.BadRequestException; import org.nl.common.exception.BadRequestException;
import org.nl.wms.ext.service.AcsToWmsService;
import org.nl.wms.ext.service.dto.to.BaseResponse; import org.nl.wms.ext.service.dto.to.BaseResponse;
import org.nl.wms.pdm.service.IPdmBdWorkorderService;
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
import org.nl.wms.sch.point.service.ISchBasePointService; import org.nl.wms.sch.point.service.ISchBasePointService;
import org.nl.wms.sch.point.service.dao.SchBasePoint; import org.nl.wms.sch.point.service.dao.SchBasePoint;
import org.nl.wms.sch.task.service.ISchBaseTaskService; import org.nl.wms.sch.task.service.ISchBaseTaskService;
@ -49,13 +46,7 @@ public class SSXBKJTask extends AbstractTask {
@Autowired @Autowired
private ISchBaseTaskconfigService taskConfigService; private ISchBaseTaskconfigService taskConfigService;
@Autowired @Autowired
private IPdmBdWorkorderService workorderService;
@Autowired
private ISchBaseVehiclematerialgroupService vehiclematerialgroupService;
@Autowired
private PointMapper pointMapper; private PointMapper pointMapper;
@Autowired
private AcsToWmsService acsToWmsService;
@Override @Override
// @Transactional(rollbackFor = Exception.class) // @Transactional(rollbackFor = Exception.class)
@ -71,7 +62,6 @@ public class SSXBKJTask extends AbstractTask {
.eq(SchBasePoint::getPoint_code, task.getPoint_code1())); .eq(SchBasePoint::getPoint_code, task.getPoint_code1()));
String extGroupData = task.getExt_group_data(); String extGroupData = task.getExt_group_data();
JSONObject jsonObject = JSONObject.parseObject(extGroupData); JSONObject jsonObject = JSONObject.parseObject(extGroupData);
// String materialType = jsonObject.getString("material_type");
SchBasePoint point = findNextPoint(); SchBasePoint point = findNextPoint();
if (ObjectUtil.isEmpty(point)) { if (ObjectUtil.isEmpty(point)) {
task.setRemark("未找到所需点位!"); task.setRemark("未找到所需点位!");
@ -80,7 +70,7 @@ public class SSXBKJTask extends AbstractTask {
log.info("原材料入库未找到当前符合条件的点位!"); log.info("原材料入库未找到当前符合条件的点位!");
continue; continue;
} }
// 设置点并修改创建成功状态 // 设置点并修改创建成功状态
task.setPoint_code1(point.getPoint_code()); task.setPoint_code1(point.getPoint_code());
task.setTask_status(TaskStatus.CREATED.getCode()); task.setTask_status(TaskStatus.CREATED.getCode());
task.setRemark(""); task.setRemark("");
@ -88,7 +78,6 @@ public class SSXBKJTask extends AbstractTask {
//发起任务时先把点位占用,防止发起重复任务 //发起任务时先把点位占用,防止发起重复任务
point.setIng_task_code(task.getTask_code()); point.setIng_task_code(task.getTask_code());
// point.setVehicle_type(materialType);
pointService.update(point); pointService.update(point);
//下发 //下发
@ -105,9 +94,12 @@ public class SSXBKJTask extends AbstractTask {
String regionCode = "KJHC"; String regionCode = "KJHC";
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "0"); List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "0");
for (SchBasePoint schBasePoint : schBasePointList) { for (SchBasePoint schBasePoint : schBasePointList) {
if (StringUtils.isEmpty(schBasePoint.getIng_task_code()) //查找点上无载具号无任务号、载具数量为1的
if (schBasePoint.getIs_used()
&& StringUtils.isEmpty(schBasePoint.getIng_task_code())
&& StringUtils.isEmpty(schBasePoint.getVehicle_code2())
&& schBasePoint.getVehicle_qty() ==1) { && schBasePoint.getVehicle_qty() ==1) {
log.info("原材料入库找到当前符合条件的点位{}", schBasePoint.getPoint_code()); log.info("输送线补空架找到当前符合条件的点位{}", schBasePoint.getPoint_code());
return schBasePoint; return schBasePoint;
} }
} }

5
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java

@ -25,7 +25,6 @@ import org.nl.wms.sch.point.service.dao.SchBasePoint;
import org.nl.wms.sch.task.service.ISchBaseTaskService; import org.nl.wms.sch.task.service.ISchBaseTaskService;
import org.nl.wms.sch.task.service.ISchBaseTaskconfigService; import org.nl.wms.sch.task.service.ISchBaseTaskconfigService;
import org.nl.wms.sch.task.service.dao.SchBaseTask; import org.nl.wms.sch.task.service.dao.SchBaseTask;
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
import org.nl.wms.sch.task_manage.AbstractTask; import org.nl.wms.sch.task_manage.AbstractTask;
import org.nl.wms.sch.task_manage.GeneralDefinition; import org.nl.wms.sch.task_manage.GeneralDefinition;
import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum;
@ -132,7 +131,9 @@ public class YCLCKTask extends AbstractTask {
return schBasePoint; return schBasePoint;
} }
if (schBasePoint.getIs_used() if (schBasePoint.getIs_used()
&& schBasePoint.getVehicle_qty() == 0 &&ObjectUtil.isEmpty(schBasePoint.getIng_task_code())) { && schBasePoint.getVehicle_qty() == 0
&&ObjectUtil.isEmpty(schBasePoint.getIng_task_code())
&& ObjectUtil.isEmpty(schBasePoint.getVehicle_code2())) {
log.info("原材料出库任务找到当前符合条件的缓存区位置{}", schBasePoint.getPoint_code()); log.info("原材料出库任务找到当前符合条件的缓存区位置{}", schBasePoint.getPoint_code());
return schBasePoint; return schBasePoint;
} }

7
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java

@ -87,7 +87,7 @@ public class YCLRKTask extends AbstractTask {
SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>() SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>()
.eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE)); .eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE));
for (SchBaseTask task : tasks) { for (SchBaseTask task : tasks) {
// 找终点 // 当前输送线
SchBasePoint startPoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>() SchBasePoint startPoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getPoint_code, task.getPoint_code1())); .eq(SchBasePoint::getPoint_code, task.getPoint_code1()));
String extGroupData = task.getExt_group_data(); String extGroupData = task.getExt_group_data();
@ -150,9 +150,10 @@ public class YCLRKTask extends AbstractTask {
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "0"); List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "0");
for (SchBasePoint schBasePoint : schBasePointList) { for (SchBasePoint schBasePoint : schBasePointList) {
if (schBasePoint.getIs_used() if (schBasePoint.getIs_used()
&& schBasePoint.getVehicle_qty() ==0 &&ObjectUtil.isEmpty(schBasePoint.getIng_task_code())) { && schBasePoint.getVehicle_qty() ==0
&& ObjectUtil.isEmpty(schBasePoint.getIng_task_code())
&& ObjectUtil.isEmpty(schBasePoint.getVehicle_code2())) {
log.info("原材料入库找到当前符合条件的点位{}", schBasePoint.getPoint_code()); log.info("原材料入库找到当前符合条件的点位{}", schBasePoint.getPoint_code());
return schBasePoint; return schBasePoint;
} }
} }

Loading…
Cancel
Save