This commit is contained in:
USER-20220102CG\noblelift
2022-12-22 13:57:02 +08:00
11 changed files with 26 additions and 23 deletions

View File

@@ -2,7 +2,7 @@
package org.nl.wms.ext.acs.rest;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -32,6 +32,7 @@ public class AcsToWmsController {
@PostMapping("/status")
@Log("ACS给WMS反馈任务状态")
@ApiOperation("ACS给WMS反馈任务状态")
@SaIgnore
public ResponseEntity<Object> receiveTaskStatusAcs(@RequestBody String string) {
return new ResponseEntity<>(acsToWmsService.receiveTaskStatusAcs(string), HttpStatus.OK);
}
@@ -39,6 +40,7 @@ public class AcsToWmsController {
@PostMapping("/orderFinish")
@Log("ACS给WMS下发工单完成状态")
@ApiOperation("ACS给WMS下发工单完成状态")
@SaIgnore
public ResponseEntity<Object> orderFinish(@RequestBody String string) {
return new ResponseEntity<>(acsToWmsService.orderFinish(string), HttpStatus.OK);
}
@@ -46,7 +48,7 @@ public class AcsToWmsController {
@PostMapping("/apply")
@Log("申请任务")
@ApiOperation("申请任务")
@SaCheckPermission("menu:list")
@SaIgnore
public ResponseEntity<Object> apply(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(acsToWmsService.apply(whereJson), HttpStatus.OK);
}
@@ -54,7 +56,7 @@ public class AcsToWmsController {
@PostMapping("/againApply")
@Log("二次申请任务")
@ApiOperation("二次申请任务")
@SaCheckPermission("menu:list")
@SaIgnore
public ResponseEntity<Object> againApply(@RequestBody String task_id) {
return new ResponseEntity<>(acsToWmsService.againApply(task_id), HttpStatus.OK);
}

View File

@@ -53,7 +53,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
JSONArray errArr = new JSONArray();
for (int i = 0; i < array.size(); i++) {
JSONObject row = array.getJSONObject(i);
String task_id = row.getString("task_id");
String task_id = row.getString("ext_task_id");
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
// 任务处理类
String processing_class = taskObj.getString("handle_class");
@@ -62,10 +62,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String message = "";
String status = "";
if ("1".equals(acs_task_status)) {
status = TaskStatusEnum.EXECUTING.getCode();
status = "1";
}
if ("2".equals(acs_task_status)) {
status = TaskStatusEnum.FINISHED.getCode();
status = "2";
}
if ("3".equals(acs_task_status)) {
status = "0";
@@ -76,7 +76,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
Object obj = clz.newInstance();
// 调用每个任务类的forceFinishInst()强制结束方法
Method m = obj.getClass().getDeclaredMethod("updateTaskStatus", JSONObject.class, String.class);
m.invoke(obj, row, status);
m.invoke(obj, taskObj, status);
} catch (InvocationTargetException e) {
e.printStackTrace();
//空指针

View File

@@ -69,7 +69,6 @@ public abstract class AbstractAcsTask {
}
;
/**
* @param form 创建任务需要的参数

View File

@@ -108,9 +108,12 @@ public class AutoCreateTask {
//处理下发失败的任务
for (int i = 0; i < errArr.size(); i++) {
JSONObject taskObj = errArr.getJSONObject(i);
taskObj.put("remark", "下发失败:"+taskObj.getString("message"));
taskObj.put("update_time", DateUtil.now());
taskTab.update(taskObj);
JSONObject param=new JSONObject();
param.put("remark", "下发失败:"+taskObj.getString("message"));
param.put("update_time", DateUtil.now());
param.put("task_id", taskObj.getString("ext_task_id"));
taskTab.update(param);
}
}

View File

@@ -398,7 +398,7 @@ public class GjxCallEmpVehicleTask extends AbstractAcsTask {
//判断起点是否属于养生A区
if (point_code1.startsWith("2")) {
//养生A区发给ACS需要新的点位(2101-03-1----->21011-03-1)
point_code1 = point_code1.substring(0, 4) + "1" + point_code1.substring(4, 9);
point_code1 = point_code1.substring(0, 4) + "2" + point_code1.substring(4, 10);
}
AcsTaskDto dto = AcsTaskDto.builder()

View File

@@ -405,8 +405,8 @@ public class YqxCallEmpVehicleTask extends AbstractAcsTask {
String point_code1 = json.getString("point_code1");
//判断起点是否属于养生A区
if (point_code1.startsWith("2")) {
//养生A区发给ACS需要新的点位(2101-03-1----->21011-03-1)
point_code1 = point_code1.substring(0, 4) + "1" + point_code1.substring(4, 9);
//养生A区发给ACS需要新的点位(21012-03-1----->21011-03-1)
point_code1 = point_code1.substring(0, 4) + "2" + point_code1.substring(4, 10);
}
AcsTaskDto dto = AcsTaskDto.builder()

View File

@@ -165,7 +165,7 @@ public class YqxCallMaterialTask extends AbstractAcsTask {
JSONObject json = arr.getJSONObject(i);
//养生A区发给ACS需要新的点位(2101-03-1----->21011-03-1)
String point_code =json.getString("point_code1");
String newPoint = point_code.substring(0, 4) + "1" + point_code.substring(4, 9);
String newPoint = point_code.substring(0, 4) + "2" + point_code.substring(4, 10);
AcsTaskDto dto = AcsTaskDto.builder()
.task_id(json.getString("task_id"))

View File

@@ -407,7 +407,7 @@ public class HtSendEmpVehicleTask extends AbstractAcsTask {
//判断点位是否属于养生A区
if (point_code.startsWith("2")) {
//养生A区发给ACS需要新的点位(2101-03-1----->21011-03-1)
point_code = point_code.substring(0, 4) + "1" + point_code.substring(4, 9);
point_code = point_code.substring(0, 4) + "1" + point_code.substring(4, 10);
}
return point_code;
}
@@ -427,7 +427,7 @@ public class HtSendEmpVehicleTask extends AbstractAcsTask {
//判断终点是否属于养生A区
if (point_code3.startsWith("2")) {
//养生A区发给ACS需要新的点位(2101-03-1----->21011-03-1)
point_code3 = point_code3.substring(0, 4) + "1" + point_code3.substring(4, 9);
point_code3 = point_code3.substring(0, 4) + "1" + point_code3.substring(4, 10);
}

View File

@@ -360,7 +360,7 @@ public class YqxSendEmpVehicleTask extends AbstractAcsTask {
//判断点位是否属于养生A区
if (point_code.startsWith("2")) {
//养生A区发给ACS需要新的点位(2101-03-1----->21011-03-1)
point_code = point_code.substring(0, 4) + "1" + point_code.substring(4, 9);
point_code = point_code.substring(0, 4) + "1" + point_code.substring(4, 10);
}
return point_code;
}
@@ -379,7 +379,7 @@ public class YqxSendEmpVehicleTask extends AbstractAcsTask {
//判断终点是否属于养生A区
if (point_code3.startsWith("2")) {
//养生A区发给ACS需要新的点位(2101-03-1----->21011-03-1)
point_code3 = point_code3.substring(0, 4) + "1" + point_code3.substring(4, 9);
point_code3 = point_code3.substring(0, 4) + "1" + point_code3.substring(4, 10);
}

View File

@@ -252,7 +252,7 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
//养生A区发给ACS需要新的点位(2101-03-1----->21011-03-1)
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, 10);
AcsTaskDto dto = AcsTaskDto.builder()
.task_id(json.getString("task_id"))
@@ -373,7 +373,7 @@ public class GjxSendMaterialTask extends AbstractAcsTask {
//养生A区发给ACS需要新的点位(2101-03-1----->21011-03-1)
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, 10);
return newPoint;
}
}

View File

@@ -441,9 +441,8 @@ export default {
rounding(row, column) {
return parseFloat(row[column.property]).toFixed(2)
},
// 下发按钮禁用条件
is_disabled(len, row) {
if (len === 1 && row.order_status === '00') {
if (len === 1 && row.order_status === '1') {
return false
} else {
return true