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

This commit is contained in:
zds
2024-08-19 17:38:55 +08:00
parent c0aaa825fc
commit 71ed7177f1
4 changed files with 19 additions and 31 deletions

View File

@@ -6,10 +6,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.wms.ext.service.AcsToWmsService;
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.dao.SchBasePoint;
import org.nl.wms.sch.task.service.ISchBaseTaskService;
@@ -49,13 +46,7 @@ public class KJRKTask extends AbstractTask {
@Autowired
private ISchBaseTaskconfigService taskConfigService;
@Autowired
private IPdmBdWorkorderService workorderService;
@Autowired
private ISchBaseVehiclematerialgroupService vehiclematerialgroupService;
@Autowired
private PointMapper pointMapper;
@Autowired
private AcsToWmsService acsToWmsService;
@Override
// @Transactional(rollbackFor = Exception.class)
@@ -105,9 +96,12 @@ public class KJRKTask extends AbstractTask {
String regionCode = "KJHC";
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "0");
for (SchBasePoint schBasePoint : schBasePointList) {
if (StringUtils.isEmpty(schBasePoint.getIng_task_code())
&& schBasePoint.getVehicle_qty() ==0) {
log.info("原材料入库找到当前符合条件的点位{}", schBasePoint.getPoint_code());
//查找点上无载具号无任务号、载具数量为0的
if (schBasePoint.getIs_used()
&& StringUtils.isEmpty(schBasePoint.getIng_task_code())
&& schBasePoint.getVehicle_qty() ==0
&& ObjectUtil.isEmpty(schBasePoint.getVehicle_code2())) {
log.info("空架入库找到当前符合条件的点位{}", schBasePoint.getPoint_code());
return schBasePoint;
}
}

View File

@@ -6,10 +6,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.wms.ext.service.AcsToWmsService;
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.dao.SchBasePoint;
import org.nl.wms.sch.task.service.ISchBaseTaskService;
@@ -49,13 +46,7 @@ public class SSXBKJTask extends AbstractTask {
@Autowired
private ISchBaseTaskconfigService taskConfigService;
@Autowired
private IPdmBdWorkorderService workorderService;
@Autowired
private ISchBaseVehiclematerialgroupService vehiclematerialgroupService;
@Autowired
private PointMapper pointMapper;
@Autowired
private AcsToWmsService acsToWmsService;
@Override
// @Transactional(rollbackFor = Exception.class)
@@ -71,7 +62,6 @@ public class SSXBKJTask extends AbstractTask {
.eq(SchBasePoint::getPoint_code, task.getPoint_code1()));
String extGroupData = task.getExt_group_data();
JSONObject jsonObject = JSONObject.parseObject(extGroupData);
// String materialType = jsonObject.getString("material_type");
SchBasePoint point = findNextPoint();
if (ObjectUtil.isEmpty(point)) {
task.setRemark("未找到所需点位!");
@@ -80,7 +70,7 @@ public class SSXBKJTask extends AbstractTask {
log.info("原材料入库未找到当前符合条件的点位!");
continue;
}
// 设置点并修改创建成功状态
// 设置点并修改创建成功状态
task.setPoint_code1(point.getPoint_code());
task.setTask_status(TaskStatus.CREATED.getCode());
task.setRemark("");
@@ -88,7 +78,6 @@ public class SSXBKJTask extends AbstractTask {
//发起任务时先把点位占用,防止发起重复任务
point.setIng_task_code(task.getTask_code());
// point.setVehicle_type(materialType);
pointService.update(point);
//下发
@@ -105,9 +94,12 @@ public class SSXBKJTask extends AbstractTask {
String regionCode = "KJHC";
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "0");
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) {
log.info("原材料入库找到当前符合条件的点位{}", schBasePoint.getPoint_code());
log.info("输送线补空架找到当前符合条件的点位{}", schBasePoint.getPoint_code());
return schBasePoint;
}
}

View File

@@ -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.ISchBaseTaskconfigService;
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.GeneralDefinition;
import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum;
@@ -132,7 +131,9 @@ public class YCLCKTask extends AbstractTask {
return schBasePoint;
}
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());
return schBasePoint;
}

View File

@@ -87,7 +87,7 @@ public class YCLRKTask extends AbstractTask {
SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>()
.eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE));
for (SchBaseTask task : tasks) {
// 找终点
// 当前输送线
SchBasePoint startPoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getPoint_code, task.getPoint_code1()));
String extGroupData = task.getExt_group_data();
@@ -150,9 +150,10 @@ public class YCLRKTask extends AbstractTask {
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "0");
for (SchBasePoint schBasePoint : schBasePointList) {
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());
return schBasePoint;
}
}