代码更新
This commit is contained in:
@@ -117,7 +117,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
public String againApply(String task_id) {
|
public String againApply(String task_id) {
|
||||||
log.info("输入参数:" + task_id);
|
log.info("输入参数:" + task_id);
|
||||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "' and task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(jsonTask)) throw new BadRequestException("任务已删除或已完成!");
|
||||||
|
|
||||||
String point_code = "";
|
String point_code = "";
|
||||||
String message = "";
|
String message = "";
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ import java.util.List;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class GjxSendMaterialTask extends AbstractAcsTask {
|
public class GjxSendMaterialTask extends AbstractAcsTask {
|
||||||
|
//任务步骤描述:task_step 1-创建,2-确定起点,3-确定终点,4-起点终点确认,
|
||||||
|
// 5-下发,6-执行,7-二次申请,8-执行,9-完成,10-取消
|
||||||
|
|
||||||
private final String THIS_CLASS = GjxSendMaterialTask.class.getName();
|
private final String THIS_CLASS = GjxSendMaterialTask.class.getName();
|
||||||
|
|
||||||
@@ -51,17 +53,17 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
|||||||
if (StrUtil.equals(taskObj.getString("task_status"), TaskStatusEnum.FINISHED.getCode())) {
|
if (StrUtil.equals(taskObj.getString("task_status"), TaskStatusEnum.FINISHED.getCode())) {
|
||||||
throw new BadRequestException("已完成不能取消!");
|
throw new BadRequestException("已完成不能取消!");
|
||||||
}
|
}
|
||||||
String point_code2 = taskObj.getString("point_code2");
|
|
||||||
String point_code3 = taskObj.getString("point_code3");
|
|
||||||
//说明未二次申请过
|
|
||||||
if (ObjectUtil.isEmpty(point_code3)) {
|
|
||||||
JSONObject json = pointTab.query("point_code = '" + point_code2 + "'").uniqueResult(0);
|
|
||||||
json.put("lock_type", "1");
|
|
||||||
pointTab.update(json);
|
|
||||||
}
|
|
||||||
taskObj.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
taskObj.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||||
taskObj.put("remark", "已取消");
|
taskObj.put("remark", "已取消");
|
||||||
taskTab.update(taskObj);
|
taskTab.update(taskObj);
|
||||||
|
|
||||||
|
//释放相关电位信息
|
||||||
|
JSONObject param1 = new JSONObject();
|
||||||
|
param1.put("lock_type", "1");
|
||||||
|
param1.put("task_id", "");
|
||||||
|
param1.put("material_id", "");
|
||||||
|
pointTab.update(param1, "task_id = '" + taskObj.getString("task_id") + "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("1".equals(status)) {
|
if ("1".equals(status)) {
|
||||||
@@ -73,13 +75,23 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (StrUtil.equals(status, "2")) {
|
if (StrUtil.equals(status, "2")) {
|
||||||
|
|
||||||
|
//判断状态,
|
||||||
|
if (StrUtil.equals("2", taskObj.getString("task_status"))) {
|
||||||
|
// 更改任务状态为完成
|
||||||
|
taskObj.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||||
|
taskObj.put("update_time", DateUtil.now());
|
||||||
|
taskTab.update(taskObj);
|
||||||
|
return;
|
||||||
|
}
|
||||||
// 更改任务状态为完成
|
// 更改任务状态为完成
|
||||||
taskObj.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
taskObj.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||||
taskObj.put("update_time", DateUtil.now());
|
taskObj.put("update_time", DateUtil.now());
|
||||||
taskTab.update(taskObj);
|
taskTab.update(taskObj);
|
||||||
|
|
||||||
String point_code3 = taskObj.getString("point_code3");
|
|
||||||
JSONObject point3Obj = pointTab.query("point_code = '" + point_code3 + "'").uniqueResult(0);
|
String point_code2 = taskObj.getString("point_code2");
|
||||||
|
JSONObject endPoint = pointTab.query("point_code = '" + point_code2 + "'").uniqueResult(0);
|
||||||
JSONObject requestObj = task.getJSONObject("request_param");
|
JSONObject requestObj = task.getJSONObject("request_param");
|
||||||
//工单标识
|
//工单标识
|
||||||
String workorder_id = requestObj.getString("material_info_id");
|
String workorder_id = requestObj.getString("material_info_id");
|
||||||
@@ -87,8 +99,6 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
|||||||
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_BD_WorkOrder");
|
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_BD_WorkOrder");
|
||||||
JSONObject workorderObj = workOrderTab.query("workorder_id", workorder_id).uniqueResult(0);
|
JSONObject workorderObj = workOrderTab.query("workorder_id", workorder_id).uniqueResult(0);
|
||||||
|
|
||||||
JSONObject point3 = pointTab.query("point_code = '" + point_code3 + "'").uniqueResult(0);
|
|
||||||
|
|
||||||
|
|
||||||
//区域出入表【st_ivt_regionIO】
|
//区域出入表【st_ivt_regionIO】
|
||||||
WQLObject regionIoTab = WQLObject.getWQLObject("st_ivt_regionIO");
|
WQLObject regionIoTab = WQLObject.getWQLObject("st_ivt_regionIO");
|
||||||
@@ -97,9 +107,9 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
|||||||
regionIoObj.put("bill_code", CodeUtil.getNewCode("IN_STORE_CODE"));
|
regionIoObj.put("bill_code", CodeUtil.getNewCode("IN_STORE_CODE"));
|
||||||
regionIoObj.put("buss_date", DateUtil.today());
|
regionIoObj.put("buss_date", DateUtil.today());
|
||||||
regionIoObj.put("io_type", "1");
|
regionIoObj.put("io_type", "1");
|
||||||
regionIoObj.put("region_id", point3.getString("region_id"));
|
regionIoObj.put("region_id", endPoint.getString("region_id"));
|
||||||
regionIoObj.put("region_code", point3.getString("region_code"));
|
regionIoObj.put("region_code", endPoint.getString("region_code"));
|
||||||
regionIoObj.put("region_name", point3.getString("region_name"));
|
regionIoObj.put("region_name", endPoint.getString("region_name"));
|
||||||
regionIoObj.put("material_id", taskObj.getString("material_id"));
|
regionIoObj.put("material_id", taskObj.getString("material_id"));
|
||||||
regionIoObj.put("vehicle_code", taskObj.getString("vehicle_code"));
|
regionIoObj.put("vehicle_code", taskObj.getString("vehicle_code"));
|
||||||
regionIoObj.put("qty", requestObj.getString("qty"));
|
regionIoObj.put("qty", requestObj.getString("qty"));
|
||||||
@@ -119,12 +129,12 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
|||||||
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_StructIvt");
|
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_StructIvt");
|
||||||
JSONObject ivtObj = new JSONObject();
|
JSONObject ivtObj = new JSONObject();
|
||||||
ivtObj.put("stockrecord_id", IdUtil.getLongId());
|
ivtObj.put("stockrecord_id", IdUtil.getLongId());
|
||||||
ivtObj.put("point_id", point3Obj.getString("point_id"));
|
ivtObj.put("point_id", endPoint.getString("point_id"));
|
||||||
ivtObj.put("point_code", point3Obj.getString("point_code"));
|
ivtObj.put("point_code", endPoint.getString("point_code"));
|
||||||
ivtObj.put("point_name", point3Obj.getString("point_name"));
|
ivtObj.put("point_name", endPoint.getString("point_name"));
|
||||||
ivtObj.put("region_id", point3Obj.getString("region_id"));
|
ivtObj.put("region_id", endPoint.getString("region_id"));
|
||||||
ivtObj.put("region_code", point3Obj.getString("region_code"));
|
ivtObj.put("region_code", endPoint.getString("region_code"));
|
||||||
ivtObj.put("region_name", point3Obj.getString("region_name"));
|
ivtObj.put("region_name", endPoint.getString("region_name"));
|
||||||
ivtObj.put("instorage_time", DateUtil.now());
|
ivtObj.put("instorage_time", DateUtil.now());
|
||||||
ivtObj.put("pcsn", DateUtil.format(DateUtil.parse(DateUtil.today()), "yyyyMMdd"));
|
ivtObj.put("pcsn", DateUtil.format(DateUtil.parse(DateUtil.today()), "yyyyMMdd"));
|
||||||
ivtObj.put("ivt_qty", requestObj.getString("qty"));
|
ivtObj.put("ivt_qty", requestObj.getString("qty"));
|
||||||
@@ -133,19 +143,26 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
|||||||
ivtTab.insert(ivtObj);
|
ivtTab.insert(ivtObj);
|
||||||
|
|
||||||
// 点位解锁
|
// 点位解锁
|
||||||
point3Obj.put("lock_type", "1");
|
endPoint.put("lock_type", "1");
|
||||||
point3Obj.put("point_status", "3");
|
endPoint.put("point_status", "3");
|
||||||
pointTab.update(point3Obj);
|
endPoint.put("material_id", taskObj.getString("material_id"));
|
||||||
|
pointTab.update(endPoint);
|
||||||
|
//释放整列货位
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("lock_type", "1");
|
||||||
|
pointTab.update(param, "task_id = '" + task_id + "'");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void findNextPoint() {
|
public void findNextPoint() {
|
||||||
|
//判断共挤线是否有执行中的任务,如果任务数>=3,则不生成任务
|
||||||
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||||
/*
|
/*
|
||||||
* 根据业务找对应的终点
|
* 根据业务找对应的终点
|
||||||
*/
|
*/
|
||||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
|
||||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||||
JSONArray taskArr = taskTab.query("handle_class = '" + THIS_CLASS + "'and is_delete = '0' and task_status = '2'").getResultJSONArray(0);
|
JSONArray taskArr = taskTab.query("handle_class = '" + THIS_CLASS + "'and is_delete = '0' and task_status = '2'").getResultJSONArray(0);
|
||||||
for (int i = 0; i < taskArr.size(); i++) {
|
for (int i = 0; i < taskArr.size(); i++) {
|
||||||
@@ -159,31 +176,51 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
|||||||
param1.put("vehicle_type", "%" + vehicle_type + "%");
|
param1.put("vehicle_type", "%" + vehicle_type + "%");
|
||||||
//1、查找库区类是否有响应的载具类型和对应的物料
|
//1、查找库区类是否有响应的载具类型和对应的物料
|
||||||
JSONObject json1 = WQL.getWO("QSCH_gjxSendMaterial_01").addParamMap(param1).process().uniqueResult(0);
|
JSONObject json1 = WQL.getWO("QSCH_gjxSendMaterial_01").addParamMap(param1).process().uniqueResult(0);
|
||||||
|
|
||||||
|
|
||||||
|
//判断是否有到同一列的相同物料SKU的AGV任务,如果有,则等待
|
||||||
|
JSONArray taskIngs = taskTab.query("is_delete='0' and material_id = '" + material_id + "' and (task_status = '4' or task_status = '5' or task_status = '6' )").getResultJSONArray(0);
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(taskIngs)) {
|
||||||
|
JSONObject taskIng = taskIngs.getJSONObject(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(taskIng) && ObjectUtil.isNotEmpty(json1)) {
|
||||||
|
JSONObject point2 = pointTab.query("point_code = '" + taskIng.getString("point_code2") + "'").uniqueResult(0);
|
||||||
|
if (StrUtil.equals(point2.getString("block_num"), json1.getString("block_num"))
|
||||||
|
&& StrUtil.equals(point2.getString("col_num"), json1.getString("col_num"))) {
|
||||||
|
taskObj.put("remark", "相应列有AGV在工作,等待执行!");
|
||||||
|
taskObj.put("update_time", DateUtil.now());
|
||||||
|
taskTab.update(taskObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (ObjectUtil.isNotEmpty(json1)) {
|
if (ObjectUtil.isNotEmpty(json1)) {
|
||||||
Integer block_num = json1.getInteger("block_num");
|
Integer block_num = json1.getInteger("block_num");
|
||||||
Integer row_num = json1.getInteger("row_num");
|
Integer row_num = json1.getInteger("row_num");
|
||||||
Integer col_num = json1.getInteger("col_num");
|
Integer col_num = json1.getInteger("col_num");
|
||||||
|
|
||||||
//拿到第一排
|
JSONObject firstRow = pointTab.query("block_num = '" + block_num + "' and col_num = '" + col_num + "' and row_num ='" + (row_num - 1) + "'").uniqueResult(0);
|
||||||
JSONObject firstRow = pointTab.query("block_num = '" + block_num + "' and col_num = '" + col_num + "' and row_num ='1'").uniqueResult(0);
|
|
||||||
if (ObjectUtil.isEmpty(firstRow)) throw new BadRequestException("数据错误,请校验!");
|
if (ObjectUtil.isEmpty(firstRow)) throw new BadRequestException("数据错误,请校验!");
|
||||||
taskObj.put("point_code2", firstRow.getString("point_code"));
|
taskObj.put("point_code2", firstRow.getString("point_code"));
|
||||||
taskObj.put("update_time", DateUtil.now());
|
taskObj.put("update_time", DateUtil.now());
|
||||||
//需要设置等待点
|
taskObj.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||||
if (row_num > 2) {
|
//二楼普通任务
|
||||||
//二楼终点追加任务
|
|
||||||
taskObj.put("acs_task_type", "4");
|
|
||||||
} else if (row_num == 2) {
|
|
||||||
//二楼普通任务
|
|
||||||
taskObj.put("acs_task_type", "2");
|
|
||||||
}
|
|
||||||
//把物料信(SKU)息更新到点位上
|
|
||||||
JSONObject param = new JSONObject();
|
|
||||||
param.put("material_id", taskObj.getString("material_id"));
|
|
||||||
pointTab.update(param, "block_num = '" + block_num + "' and row_num = '" + (row_num-1) + "' and col_num = '" + col_num + "'");
|
|
||||||
|
|
||||||
taskTab.update(taskObj);
|
taskTab.update(taskObj);
|
||||||
|
//锁住相关货位
|
||||||
|
JSONObject point = new JSONObject();
|
||||||
|
point.put("lock_type", "2");
|
||||||
|
point.put("task_id", taskObj.getString("task_id"));
|
||||||
|
pointTab.update(point, "block_num = '" + block_num + "' and col_num = '" + col_num + "' and row_num <= '" + (row_num - 1) + "'");
|
||||||
|
|
||||||
} else {//找空位入
|
} else {//找空位入
|
||||||
|
if (ObjectUtil.isNotEmpty(taskIngs) && taskIngs.size() > 1) {
|
||||||
|
taskObj.put("remark", "相应列有AGV在工作,等待执行!");
|
||||||
|
taskObj.put("update_time", DateUtil.now());
|
||||||
|
taskTab.update(taskObj);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
JSONObject param2 = new JSONObject();
|
JSONObject param2 = new JSONObject();
|
||||||
param2.put("flag", "2");
|
param2.put("flag", "2");
|
||||||
param2.put("region_code", "YSQA01");
|
param2.put("region_code", "YSQA01");
|
||||||
@@ -197,12 +234,18 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
|||||||
} else {
|
} else {
|
||||||
Integer block_num = json2.getInteger("block_num");
|
Integer block_num = json2.getInteger("block_num");
|
||||||
Integer col_num = json2.getInteger("col_num");
|
Integer col_num = json2.getInteger("col_num");
|
||||||
JSONObject firstRow = pointTab.query("block_num = '" + block_num + "' and col_num = '" + col_num + "' and row_num ='1'").uniqueResult(0);
|
JSONObject firstRow = pointTab.query("block_num = '" + block_num + "' and col_num = '" + col_num + "' and row_num ='9'").uniqueResult(0);
|
||||||
taskObj.put("point_code2", firstRow.getString("point_code"));
|
taskObj.put("point_code2", firstRow.getString("point_code"));
|
||||||
//二楼终点追加任务
|
//二楼普通任务
|
||||||
taskObj.put("acs_task_type", "4");
|
taskObj.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||||
taskObj.put("update_time", DateUtil.now());
|
taskObj.put("update_time", DateUtil.now());
|
||||||
taskTab.update(taskObj);
|
taskTab.update(taskObj);
|
||||||
|
//锁住相关货位
|
||||||
|
JSONObject point = new JSONObject();
|
||||||
|
point.put("lock_type", "2");
|
||||||
|
point.put("task_id", taskObj.getString("task_id"));
|
||||||
|
pointTab.update(point, "block_num = '" + block_num + "' and col_num = '" + col_num + "' and row_num <= '" + 9 + "'");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,16 +254,18 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AcsTaskDto> addTask() {
|
public List<AcsTaskDto> addTask() {
|
||||||
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||||
/*
|
/*
|
||||||
* 下发给ACS时需要特殊处理
|
* 下发给ACS时需要特殊处理
|
||||||
*/
|
*/
|
||||||
JSONArray arr = WQLObject.getWQLObject("SCH_BASE_Task").query("handle_class = '" + THIS_CLASS + "' and task_status = '" + TaskStatusEnum.START_AND_POINT.getCode() + "' and is_delete ='0'").getResultJSONArray(0);
|
JSONArray arr = taskTab.query("handle_class = '" + THIS_CLASS + "' and task_status = '" + TaskStatusEnum.START_AND_POINT.getCode() + "' and is_delete ='0'").getResultJSONArray(0);
|
||||||
|
|
||||||
ArrayList<AcsTaskDto> acsTaskArr = new ArrayList<>();
|
ArrayList<AcsTaskDto> acsTaskArr = new ArrayList<>();
|
||||||
for (int i = 0; i < arr.size(); i++) {
|
for (int i = 0; i < arr.size(); i++) {
|
||||||
JSONObject json = arr.getJSONObject(i);
|
JSONObject json = arr.getJSONObject(i);
|
||||||
|
|
||||||
//养生A区发给ACS需要新的点位(2101-03-1----->21011-03-1)
|
//养生A区发给ACS需要新的点位(2101-03-1----->21011-03-1)
|
||||||
String point_code = json.getString("point_code3");
|
String point_code = json.getString("point_code2");
|
||||||
String newPoint = point_code.substring(0, 4) + "1" + point_code.substring(4, 9);
|
String newPoint = point_code.substring(0, 4) + "1" + point_code.substring(4, 9);
|
||||||
|
|
||||||
AcsTaskDto dto = AcsTaskDto.builder()
|
AcsTaskDto dto = AcsTaskDto.builder()
|
||||||
@@ -271,6 +316,7 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
|||||||
.task_name("共挤线满料")
|
.task_name("共挤线满料")
|
||||||
.task_status(TaskStatusEnum.SURE_START.getCode())
|
.task_status(TaskStatusEnum.SURE_START.getCode())
|
||||||
.point_code1(point_code1)
|
.point_code1(point_code1)
|
||||||
|
.acs_task_type("2")//2楼AGV普通任务
|
||||||
.vehicle_code(vehicle_code)
|
.vehicle_code(vehicle_code)
|
||||||
.material_qty(qty)
|
.material_qty(qty)
|
||||||
.material_info_id(workOrderObj.getLong("workorder_id"))
|
.material_info_id(workOrderObj.getLong("workorder_id"))
|
||||||
@@ -292,9 +338,13 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
|||||||
@Override
|
@Override
|
||||||
public void forceFinish(String task_id) {
|
public void forceFinish(String task_id) {
|
||||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status <> " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status < " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(taskObj))
|
if (ObjectUtil.isNotEmpty(taskObj)) {
|
||||||
this.updateTaskStatus(taskObj, "2");
|
this.updateTaskStatus(taskObj, "2");
|
||||||
|
} else {
|
||||||
|
throw new BadRequestException("任务已删除或者已完成!");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -303,6 +353,7 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO 暂时不用二次申请
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public String againApply(String task_id) {
|
public String againApply(String task_id) {
|
||||||
@@ -315,28 +366,22 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
|
|||||||
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point"); // 点位表
|
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point"); // 点位表
|
||||||
|
|
||||||
JSONObject taskObj = taskTab.query("task_id ='" + task_id + "'").uniqueResult(0);
|
JSONObject taskObj = taskTab.query("task_id ='" + task_id + "'").uniqueResult(0);
|
||||||
JSONObject jsonPoint2 = pointTab.query("point_code = '" + taskObj.getString("point_code2") + "'").uniqueResult(0);
|
|
||||||
|
|
||||||
// 根据 区域、块、列找到第一个有物料的货位
|
JSONObject jsonPoint3 = pointTab.query("point_code = '" + taskObj.getString("point_code3") + "'").uniqueResult(0);
|
||||||
JSONObject jsonOnePoint = pointTab.query("region_id = '" + jsonPoint2.getString("region_id") +
|
//提前更新这列货位状态,方便生成往这列的任务
|
||||||
"' and block_num = '" + jsonPoint2.getString("block_num") +
|
jsonPoint3.put("point_status", "3");
|
||||||
"' and col_num = '" + jsonPoint2.getString("col_num") +
|
jsonPoint3.put("material_id", taskObj.getString("material_id"));
|
||||||
"' and point_status = '1' order by row_num desc").uniqueResult(0);
|
pointTab.update(jsonPoint3);
|
||||||
|
//释放相关货位
|
||||||
|
JSONObject point = new JSONObject();
|
||||||
|
point.put("lock_type", "1");
|
||||||
|
point.put("task_id", "");
|
||||||
|
pointTab.update(point, "task_id = '" + taskObj.getString("task_id") + "'");
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(jsonOnePoint)) throw new BadRequestException("该列库存状态有误,请检查!");
|
|
||||||
|
|
||||||
taskObj.put("point_code3", jsonOnePoint.getString("point_code"));
|
|
||||||
taskObj.put("remark", "二次申请货位");
|
|
||||||
taskObj.put("update_time", DateUtil.now());
|
|
||||||
taskTab.update(taskObj);
|
|
||||||
|
|
||||||
//养生A区发给ACS需要新的点位(2101-03-1----->21011-03-1)
|
//养生A区发给ACS需要新的点位(2101-03-1----->21011-03-1)
|
||||||
String point_code = jsonOnePoint.getString("point_code");
|
String point_code = taskObj.getString("point_code3");
|
||||||
String newPoint = point_code.substring(0, 4) + "1" + point_code.substring(4, 9);
|
String newPoint = point_code.substring(0, 4) + "1" + point_code.substring(4, 9);
|
||||||
|
|
||||||
// 点位上锁
|
|
||||||
jsonOnePoint.put("lock_type", "2");
|
|
||||||
pointTab.update(jsonOnePoint);
|
|
||||||
return newPoint;
|
return newPoint;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,13 +51,13 @@
|
|||||||
p.row_num,
|
p.row_num,
|
||||||
p.col_num
|
p.col_num
|
||||||
FROM
|
FROM
|
||||||
|
|
||||||
SCH_BASE_Point p
|
SCH_BASE_Point p
|
||||||
where p.is_used = '1'
|
where
|
||||||
AND is_delete = '0'
|
p.is_used = '1'
|
||||||
AND lock_type = '1'
|
AND is_delete = '0'
|
||||||
AND p.row_num >1
|
AND lock_type = '1'
|
||||||
and p.point_status='1'
|
AND point_status = '3'
|
||||||
|
and row_num>1
|
||||||
OPTION 输入.material_id <> ""
|
OPTION 输入.material_id <> ""
|
||||||
p.material_id = 输入.material_id
|
p.material_id = 输入.material_id
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
OPTION 输入.vehicle_type <> ""
|
OPTION 输入.vehicle_type <> ""
|
||||||
p.can_vehicle_type like 输入.vehicle_type
|
p.can_vehicle_type like 输入.vehicle_type
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
ORDER BY block_num,row_num
|
ORDER BY block_num,col_num,row_num
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDQUERY
|
ENDQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|||||||
Binary file not shown.
@@ -114,9 +114,10 @@
|
|||||||
>
|
>
|
||||||
<el-table-column type="selection" width="50" />
|
<el-table-column type="selection" width="50" />
|
||||||
<el-table-column v-if="true" prop="task_id" label="任务标识" min-width="150" show-overflow-tooltip />
|
<el-table-column v-if="true" prop="task_id" label="任务标识" min-width="150" show-overflow-tooltip />
|
||||||
|
<el-table-column v-if="true" prop="material_id" label="物料标识" min-width="150" show-overflow-tooltip />
|
||||||
<el-table-column prop="task_code" label="任务编码" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="task_code" label="任务编码" min-width="100" show-overflow-tooltip />
|
||||||
<el-table-column v-if="false" prop="task_type" label="任务类型" />
|
<el-table-column v-if="false" prop="task_type" label="任务类型" />
|
||||||
<el-table-column prop="acs_task_type" label="acs任务类型" min-width="120" show-overflow-tooltip/>
|
<el-table-column prop="acs_task_type" label="acs任务类型" min-width="120" show-overflow-tooltip />
|
||||||
<el-table-column prop="task_name" label="任务描述" min-width="120" show-overflow-tooltip />
|
<el-table-column prop="task_name" label="任务描述" min-width="120" show-overflow-tooltip />
|
||||||
<el-table-column v-if="false" prop="task_type_name" label="任务类型" min-width="120" show-overflow-tooltip />
|
<el-table-column v-if="false" prop="task_type_name" label="任务类型" min-width="120" show-overflow-tooltip />
|
||||||
<el-table-column v-if="false" prop="task_status" label="任务状态" />
|
<el-table-column v-if="false" prop="task_status" label="任务状态" />
|
||||||
|
|||||||
Reference in New Issue
Block a user