Merge remote-tracking branch 'origin/master'

This commit is contained in:
2023-04-06 11:19:46 +08:00
128 changed files with 12550 additions and 13364 deletions

View File

@@ -76,6 +76,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
wrapSendEmptyTask.createTask(param);
break;
default:
throw new BadRequestException("任务请求类型错误!");
}
}catch (Exception ex){

View File

@@ -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;
@@ -55,15 +54,13 @@ public class PlotterCallEmptyTask extends AbstractAcsTask {
taskTab.update(taskObj);
} else if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())) {
// 完成
if (ObjectUtil.isNotEmpty(pointCode1)) {
if (ObjectUtil.isNotEmpty(pointObj)) {
// 释放点位并赋值
pointTab.query("point_code = '" + pointCode1 + "'").uniqueResult(0);
pointObj.put("lock_type", StatusEnum.LOCK_OFF.getCode());
pointObj.put("point_status", StatusEnum.POINT_STATUS_EMPTY.getCode());
pointObj.put("material_id", "");
pointObj.put("update_time", DateUtil.now());
pointTab.update(pointObj);
// todo: 是否需要记录库存
}
// 2任务完成
taskObj.put("task_status", StatusEnum.TASK_FINISH.getCode());
@@ -78,9 +75,8 @@ public class PlotterCallEmptyTask extends AbstractAcsTask {
* 2、任务状态修改
*/
// 2点位恢复
if (ObjectUtil.isNotEmpty(pointCode1)) {
if (ObjectUtil.isNotEmpty(pointObj)) {
// 释放点位
pointTab.query("point_code = '" + pointCode1 + "'").uniqueResult(0);
pointObj.put("lock_type", StatusEnum.LOCK_OFF.getCode());
pointObj.put("update_time", DateUtil.now());
pointTab.update(pointObj);
@@ -102,10 +98,13 @@ public class PlotterCallEmptyTask extends AbstractAcsTask {
if(StrUtil.isEmpty(end_point_code)) {
throw new BadRequestException("终点不能为空!");
}
if(StrUtil.isEmpty(workorder)) {
throw new BadRequestException("工单不能为空!");
}
// 判断当前点是否有未完成的任务
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 + "存在未完成的任务");
}

View File

@@ -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("任务已完成,不可取消!");
}
@@ -55,9 +55,8 @@ public class WrapCallMaterialTask extends AbstractAcsTask {
taskTab.update(taskObj);
} else if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())) {
// 完成
if (ObjectUtil.isNotEmpty(pointCode1)) {
if (ObjectUtil.isNotEmpty(pointObj)) {
// 释放点位并赋值
pointTab.query("point_code = '" + pointCode1 + "'").uniqueResult(0);
pointObj.put("lock_type", StatusEnum.LOCK_OFF.getCode());
pointObj.put("point_status", StatusEnum.POINT_STATUS_EMPTY.getCode());
pointObj.put("material_id", "");
@@ -77,9 +76,8 @@ public class WrapCallMaterialTask extends AbstractAcsTask {
* 2、任务状态修改
*/
// 2点位恢复
if (ObjectUtil.isNotEmpty(pointCode1)) {
if (ObjectUtil.isNotEmpty(pointObj)) {
// 释放点位
pointTab.query("point_code = '" + pointCode1 + "'").uniqueResult(0);
pointObj.put("lock_type", StatusEnum.LOCK_OFF.getCode());
pointObj.put("update_time", DateUtil.now());
pointTab.update(pointObj);
@@ -101,6 +99,9 @@ public class WrapCallMaterialTask extends AbstractAcsTask {
if(StrUtil.isEmpty(end_point_code)) {
throw new BadRequestException("终点不能为空!");
}
if(StrUtil.isEmpty(workorder)) {
throw new BadRequestException("工单不能为空!");
}
// 判断当前点是否有未完成的任务
JSONObject taskObj = taskTab.query("is_delete='0' and point_code2 = '" + end_point_code + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(taskObj)) {

View File

@@ -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;
@@ -55,9 +54,8 @@ public class WrapSendEmptyTask extends AbstractAcsTask {
taskTab.update(taskObj);
} else if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())) {
// 完成
if (ObjectUtil.isNotEmpty(pointCode2)) {
if (ObjectUtil.isNotEmpty(pointObj)) {
// 释放点位并赋值
pointTab.query("point_code = '" + pointCode2 + "'").uniqueResult(0);
pointObj.put("lock_type", StatusEnum.LOCK_OFF.getCode());
pointObj.put("point_status", StatusEnum.POINT_STATUS_EMPTY_VEHICLE.getCode());
pointObj.put("update_time", DateUtil.now());
@@ -76,9 +74,8 @@ public class WrapSendEmptyTask extends AbstractAcsTask {
* 2、任务状态修改
*/
// 2点位恢复
if (ObjectUtil.isNotEmpty(pointCode2)) {
if (ObjectUtil.isNotEmpty(pointObj)) {
// 释放点位
pointTab.query("point_code = '" + pointCode2 + "'").uniqueResult(0);
pointObj.put("lock_type", StatusEnum.LOCK_OFF.getCode());
pointObj.put("update_time", DateUtil.now());
pointTab.update(pointObj);
@@ -101,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 + "存在未完成的任务");
}

View File

@@ -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;
@@ -55,9 +54,8 @@ public class PlotterSendMaterialTask extends AbstractAcsTask {
taskTab.update(taskObj);
} else if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())) {
// 完成
if (ObjectUtil.isNotEmpty(pointCode2)) {
if (ObjectUtil.isNotEmpty(pointObj)) {
// 释放点位并赋值
pointTab.query("point_code = '" + pointCode2 + "'").uniqueResult(0);
pointObj.put("lock_type", StatusEnum.LOCK_OFF.getCode());
pointObj.put("point_status", StatusEnum.POINT_STATUS_FULL.getCode());
pointObj.put("material_id", taskObj.getString("material_id"));
@@ -78,9 +76,8 @@ public class PlotterSendMaterialTask extends AbstractAcsTask {
* 2、任务状态修改
*/
// 2点位恢复
if (ObjectUtil.isNotEmpty(pointCode2)) {
if (ObjectUtil.isNotEmpty(pointObj)) {
// 释放点位
pointTab.query("point_code = '" + pointCode2 + "'").uniqueResult(0);
pointObj.put("lock_type", StatusEnum.LOCK_OFF.getCode());
pointObj.put("update_time", DateUtil.now());
pointTab.update(pointObj);
@@ -104,11 +101,14 @@ 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 + "存在未完成的任务");
}
if(StrUtil.isEmpty(workorder)) {
throw new BadRequestException("工单不能为空!");
}
// 判断工单
JSONObject workOrderObj = workOrderTab.query("workorder_code = '" + workorder + "' and workorder_status <> '" + StatusEnum.TASK_FINISH.getCode() + "' and is_delete ='0'").uniqueResult(0);
if (ObjectUtil.isEmpty(workOrderObj)){