代码更新
This commit is contained in:
@@ -30,8 +30,8 @@ public abstract class AbstractAcsTask {
|
||||
*/
|
||||
public List<AcsTaskDto> schedule() {
|
||||
this.autoCreate();
|
||||
this.findStartPoint();
|
||||
this.findNextPoint();
|
||||
this.findStartPoint(null);
|
||||
this.findNextPoint(null);
|
||||
return addTask();
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public abstract class AbstractAcsTask {
|
||||
* @created 2020年6月12日 下午6:01:30
|
||||
*/
|
||||
|
||||
public abstract void findStartPoint();
|
||||
public abstract JSONObject findStartPoint(JSONObject param);
|
||||
|
||||
/**
|
||||
* @return
|
||||
@@ -85,7 +85,7 @@ public abstract class AbstractAcsTask {
|
||||
* @author ldjun
|
||||
* @created 2020年6月12日 下午6:01:06
|
||||
*/
|
||||
public abstract void findNextPoint();
|
||||
public abstract JSONObject findNextPoint(JSONObject param);
|
||||
|
||||
/**
|
||||
* @param form 创建任务需要的参数
|
||||
|
||||
@@ -9,12 +9,9 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
|
||||
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
@@ -24,8 +21,6 @@ import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.service.PointService;
|
||||
import org.nl.wms.sch.service.dto.PointDto;
|
||||
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -90,13 +85,13 @@ public class CallEmpVehicleTask extends AbstractAcsTask {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findStartPoint() {
|
||||
|
||||
public JSONObject findStartPoint(JSONObject param) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findNextPoint() {
|
||||
|
||||
public JSONObject findNextPoint(JSONObject param) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -116,7 +111,8 @@ public class CallEmpVehicleTask extends AbstractAcsTask {
|
||||
} else {
|
||||
// 判断终点是否有正在执行的任务
|
||||
JSONObject beforTaskObj = taskTab.query("is_delete='0' and point_code2='" + point_code2 + "' and task_status <>'" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(beforTaskObj)) throw new BadRequestException("存在任务号为'" + beforTaskObj.getString("task_code") + "' 未完成!");
|
||||
if (ObjectUtil.isNotEmpty(beforTaskObj))
|
||||
throw new BadRequestException("存在任务号为'" + beforTaskObj.getString("task_code") + "' 未完成!");
|
||||
}
|
||||
// 载具数量不能为空
|
||||
if (ObjectUtil.isEmpty(qty)) throw new BadRequestException("载具数量不能为空");
|
||||
@@ -130,7 +126,7 @@ public class CallEmpVehicleTask extends AbstractAcsTask {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code2", point_code2);
|
||||
param.put("vehicle_qty", qty);
|
||||
JSONObject json = this.findBeginPoint(param);
|
||||
JSONObject json = this.findNextPoint(param);
|
||||
point_code1 = json.getString("point_code1");
|
||||
vehicle_type = json.getString("vehicle_type");
|
||||
} else {
|
||||
@@ -217,6 +213,8 @@ public class CallEmpVehicleTask extends AbstractAcsTask {
|
||||
String point_code1 = "";
|
||||
JSONObject map = new JSONObject();
|
||||
if (StrUtil.equals(jsonRegionEnd.getString("region_code"), RegionTypeEnum.GJQY.getCode())) {
|
||||
//1、判断是否有到该叠盘位的堆叠任务。
|
||||
|
||||
|
||||
//1、判断叠盘架B是否有对应类型的空载具
|
||||
JSONObject jsonDpjB = pointTab.query("point_status ='2' and lock_type='00' and can_vehicle_type = '" + vehicle_type + "'").uniqueResult(0);
|
||||
|
||||
@@ -6,12 +6,9 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
|
||||
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
@@ -21,8 +18,6 @@ import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.service.PointService;
|
||||
import org.nl.wms.sch.service.dto.PointDto;
|
||||
import org.nl.wms.sch.service.impl.PointServiceImpl;
|
||||
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -87,7 +82,7 @@ public class CallMaterialTask extends AbstractAcsTask {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findStartPoint() {
|
||||
public JSONObject findStartPoint(JSONObject data) {
|
||||
String task_status = TaskStatusEnum.SURE_START.getCode();
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
JSONArray taskArry = taskTab.query("task_status='" + task_status + "' AND handle_class='" + THIS_CLASS + "' AND is_delete='0' ").getResultJSONArray(0);
|
||||
@@ -123,12 +118,13 @@ public class CallMaterialTask extends AbstractAcsTask {
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskTab.update(taskObj);
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findNextPoint() {
|
||||
|
||||
public JSONObject findNextPoint(JSONObject param) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
package org.nl.wms.sch.tasks;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
|
||||
public class GjxFullMaterialTask extends AbstractAcsTask {
|
||||
@Override
|
||||
public void updateTaskStatus(JSONObject taskObj, String status) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findStartPoint() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findNextPoint() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createTask(JSONObject form) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceFinish(String task_id) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pullBack(String task_id) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(String task_id) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,21 +4,15 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* 普通点对点任务
|
||||
*/
|
||||
@@ -57,15 +51,16 @@ public class PointToPointTask extends AbstractAcsTask {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findStartPoint() {
|
||||
|
||||
public JSONObject findStartPoint(JSONObject param) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findNextPoint() {
|
||||
|
||||
public JSONObject findNextPoint(JSONObject param) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public String createTask(JSONObject form) {
|
||||
|
||||
@@ -103,15 +103,16 @@ public class SendEmpVehicleTask extends AbstractAcsTask {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findStartPoint() {
|
||||
|
||||
public JSONObject findStartPoint(JSONObject param) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findNextPoint() {
|
||||
|
||||
public JSONObject findNextPoint(JSONObject param) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String createTask(JSONObject form) {
|
||||
|
||||
@@ -115,12 +115,13 @@ public class SendMaterialTask extends AbstractAcsTask {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findStartPoint() {
|
||||
|
||||
public JSONObject findStartPoint(JSONObject param) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void findNextPoint() {
|
||||
public JSONObject findNextPoint(JSONObject data) {
|
||||
String task_status = TaskStatusEnum.SURE_START.getCode();
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
JSONArray taskArry = taskTab.query("task_status='" + task_status + "' AND handle_class='" + THIS_CLASS + "' AND is_delete='0' ").getResultJSONArray(0);
|
||||
@@ -157,7 +158,7 @@ public class SendMaterialTask extends AbstractAcsTask {
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskTab.update(taskObj);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user