|
|
@ -3,6 +3,7 @@ package org.nl.wms.sch.task_manage.task.tasks; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.alibaba.druid.util.StringUtils; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
@ -108,10 +109,11 @@ public class SSXBKJTask extends AbstractTask { |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private SchBasePoint findNextPoint() { |
|
|
|
String regionCode = "YL"; |
|
|
|
String regionCode = "KJHC"; |
|
|
|
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "0"); |
|
|
|
for (SchBasePoint schBasePoint : schBasePointList) { |
|
|
|
if (schBasePoint.getVehicle_qty() ==1) { |
|
|
|
if (StringUtils.isEmpty(schBasePoint.getIng_task_code()) |
|
|
|
&& schBasePoint.getVehicle_qty() ==1) { |
|
|
|
log.info("原材料入库找到当前符合条件的点位{}", schBasePoint.getPoint_code()); |
|
|
|
return schBasePoint; |
|
|
|
} |
|
|
@ -134,19 +136,8 @@ public class SSXBKJTask extends AbstractTask { |
|
|
|
JSONObject extGroupData = ObjectUtil.isNotEmpty(taskObj.getExt_group_data()) |
|
|
|
? JSONObject.parseObject(taskObj.getExt_group_data()) |
|
|
|
: null; |
|
|
|
// 载具编码:没有就创建一个
|
|
|
|
String vehicle_code = ObjectUtil.isNotEmpty(taskObj.getVehicle_code()) |
|
|
|
? taskObj.getVehicle_code() |
|
|
|
: IdUtil.getSnowflake(1, 1).nextIdStr(); |
|
|
|
PdmBdWorkorder workorderCode = null; |
|
|
|
if (extGroupData != null) { |
|
|
|
workorderCode = ObjectUtil.isNotEmpty(extGroupData.getString("workorder_code")) |
|
|
|
? workorderService.getOne(new LambdaQueryWrapper<PdmBdWorkorder>() |
|
|
|
.eq(PdmBdWorkorder::getWorkorder_code, extGroupData.getString("workorder_code"))) |
|
|
|
: null; |
|
|
|
} |
|
|
|
String startPoint = taskObj.getPoint_code1(); // 获取起点
|
|
|
|
String endPoint = ObjectUtil.isNotEmpty(taskObj.getPoint_code2())?taskObj.getPoint_code2().substring(0,taskObj.getPoint_code2().length()-2):"0"; // 获取终点
|
|
|
|
String endPoint = taskObj.getPoint_code2(); // 获取终点
|
|
|
|
SchBasePoint startPointObj = pointService.getById(startPoint); |
|
|
|
SchBasePoint endPointObj = pointService.getById(endPoint); |
|
|
|
// 根据传来的类型去对任务进行操作
|
|
|
@ -161,8 +152,6 @@ public class SSXBKJTask extends AbstractTask { |
|
|
|
} |
|
|
|
// 终点解锁
|
|
|
|
endPointObj.setIng_task_code(""); |
|
|
|
endPointObj.setVehicle_code(ObjectUtil.isEmpty(endPointObj.getVehicle_code()) ? vehicle_code + "," : endPointObj.getVehicle_code() + vehicle_code + ","); |
|
|
|
endPointObj.setVehicle_qty(1); |
|
|
|
pointService.update(endPointObj); |
|
|
|
// 任务完成
|
|
|
|
taskObj.setTask_status(TaskStatus.FINISHED.getCode()); |
|
|
|