opt: 优化任务代码
This commit is contained in:
@@ -76,6 +76,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
wrapSendEmptyTask.createTask(param);
|
||||
break;
|
||||
default:
|
||||
throw new BadRequestException("任务请求类型错误!");
|
||||
}
|
||||
|
||||
}catch (Exception ex){
|
||||
|
||||
@@ -15,7 +15,6 @@ import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -62,7 +61,6 @@ public class PlotterCallEmptyTask extends AbstractAcsTask {
|
||||
pointObj.put("material_id", "");
|
||||
pointObj.put("update_time", DateUtil.now());
|
||||
pointTab.update(pointObj);
|
||||
// todo: 是否需要记录库存
|
||||
}
|
||||
// 2任务完成
|
||||
taskObj.put("task_status", StatusEnum.TASK_FINISH.getCode());
|
||||
@@ -105,8 +103,8 @@ public class PlotterCallEmptyTask extends AbstractAcsTask {
|
||||
}
|
||||
// 判断当前点是否有未完成的任务
|
||||
JSONObject taskObj = taskTab.query("is_delete='0' and point_code2 = '" + end_point_code + "' " +
|
||||
"and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "' " +
|
||||
"and task_status <> '" + TaskStatusEnum.CANCEL.getCode() + "'").uniqueResult(0);
|
||||
"and task_status <> '" + StatusEnum.TASK_FINISH.getCode() + "' " +
|
||||
"and task_status <> '" + StatusEnum.TASK_CANNEL.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj)) {
|
||||
throw new BadRequestException("当前点位" + end_point_code + "存在未完成的任务");
|
||||
}
|
||||
|
||||
@@ -37,8 +37,8 @@ public class WrapCallMaterialTask extends AbstractAcsTask {
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||
JSONObject taskObj = taskTab.query("task_id = '" + task.getString("task_id") + "' " +
|
||||
"AND task_status <> '" + StatusEnum.TASK_FINISH.getCode() + "' " +
|
||||
"AND task_status <> '" + StatusEnum.TASK_CANNEL.getCode() + "'").uniqueResult(0);
|
||||
"and task_status <> '" + StatusEnum.TASK_FINISH.getCode() + "' " +
|
||||
"and task_status <> '" + StatusEnum.TASK_CANNEL.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(taskObj)) {
|
||||
throw new BadRequestException("任务已完成,不可取消!");
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -99,8 +98,8 @@ public class WrapSendEmptyTask extends AbstractAcsTask {
|
||||
}
|
||||
// 判断当前点是否有未完成的任务
|
||||
JSONObject taskObj = taskTab.query("is_delete='0' and point_code1 = '" + start_point_code + "' " +
|
||||
"and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "' " +
|
||||
"and task_status <> '" + TaskStatusEnum.CANCEL.getCode() + "'").uniqueResult(0);
|
||||
"and task_status <> '" + StatusEnum.TASK_FINISH.getCode() + "' " +
|
||||
"and task_status <> '" + StatusEnum.TASK_CANNEL.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj)) {
|
||||
throw new BadRequestException("当前点位" + start_point_code + "存在未完成的任务");
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -102,8 +101,8 @@ public class PlotterSendMaterialTask extends AbstractAcsTask {
|
||||
}
|
||||
// 判断当前点是否有未完成的任务
|
||||
JSONObject taskObj = taskTab.query("is_delete='0' and point_code1 = '" + start_point_code + "' " +
|
||||
"and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "' " +
|
||||
"and task_status <> '" + TaskStatusEnum.CANCEL.getCode() + "'").uniqueResult(0);
|
||||
"and task_status <> '" + StatusEnum.TASK_FINISH.getCode() + "' " +
|
||||
"and task_status <> '" + StatusEnum.TASK_CANNEL.getCode() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj)) {
|
||||
throw new BadRequestException("当前点位" + start_point_code + "存在未完成的任务");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user