Browse Source

更新

master
gengby 2 years ago
parent
commit
7fc28d6f12
  1. 69
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java
  2. 17
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CancelTaskRequest.java
  3. 44
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java
  4. 63
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java
  5. 20
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java
  6. 147
      acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java
  7. 2
      acs/nladmin-ui/src/views/login.vue

69
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java

@ -169,25 +169,20 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
return; return;
} }
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver){ if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
Object reqWms = device.getExtraValue().get("reqWms"); Object reqWms = device.getExtraValue().get("reqWms");
if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")){ if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")) {
JSONArray req = new JSONArray(); JSONArray req = new JSONArray();
JSONObject map = new JSONObject(); JSONObject map = new JSONObject();
map.put("vehicle_code", inst.getVehicle_code()); map.put("Vehiclecode", inst.getVehicle_code());
map.put("status", "1"); map.put("Status", "1");
map.put("device_code", inst.getStart_point_code()); map.put("Devicecode", inst.getStart_device_code());
map.put("task_code", inst.getTask_code()); map.put("Taskcode", inst.getTask_code());
req.add(map); req.add(map);
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req); HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) { if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
JSONObject resp = JSONObject.parseObject(httpResponse.body());
if (resp.getInteger("status") == 200) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
log.info("指令号:{},acs请求wms取货申请成功,wms允许agv申请取货,已反馈agv允许取货", inst.getInstruction_code()); log.info("指令号:{},acs请求wms取货申请成功,wms允许agv申请取货,已反馈agv允许取货", inst.getInstruction_code());
} else {
log.warn("指令号:{},acs请求wms取货申请成功,wms不允许agv申请取货,未反馈agv允许取货", inst.getInstruction_code());
}
} else { } else {
log.warn("指令号:{},acs请求wms取货申请失败,连接被拒绝,未反馈agv允许取货", inst.getInstruction_code()); log.warn("指令号:{},acs请求wms取货申请失败,连接被拒绝,未反馈agv允许取货", inst.getInstruction_code());
} }
@ -230,25 +225,20 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
return; return;
} }
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver){ if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
Object reqWms = device.getExtraValue().get("reqWms"); Object reqWms = device.getExtraValue().get("reqWms");
if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")){ if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")) {
JSONArray req = new JSONArray(); JSONArray req = new JSONArray();
JSONObject map = new JSONObject(); JSONObject map = new JSONObject();
map.put("vehicle_code", inst.getVehicle_code()); map.put("Vehiclecode", inst.getVehicle_code());
map.put("status", "2"); map.put("Status", "2");
map.put("device_code", inst.getStart_point_code()); map.put("Devicecode", inst.getStart_device_code());
map.put("task_code", inst.getTask_code()); map.put("Taskcode", inst.getTask_code());
req.add(map); req.add(map);
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req); HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) { if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
JSONObject resp = JSONObject.parseObject(httpResponse.body());
if (resp.getInteger("status") == 200) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
log.info("指令号:{},acs反馈wms取货完成成功,wms允许agv取货完成,已反馈agv取货完成", inst.getInstruction_code()); log.info("指令号:{},acs反馈wms取货完成成功,wms允许agv取货完成,已反馈agv取货完成", inst.getInstruction_code());
} else {
log.warn("指令号:{},acs反馈wms取货完成成功,wms不允许agv取货完成,未反馈agv取货完成", inst.getInstruction_code());
}
} else { } else {
log.warn("指令号:{},acs反馈wms取货完成失败,连接被拒绝,未反馈agv取货完成", inst.getInstruction_code()); log.warn("指令号:{},acs反馈wms取货完成失败,连接被拒绝,未反馈agv取货完成", inst.getInstruction_code());
} }
@ -287,25 +277,20 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("未找到关联编号{}对应的指令", ikey); log.info("未找到关联编号{}对应的指令", ikey);
return; return;
} }
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver){ if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
Object reqWms = device.getExtraValue().get("reqWms"); Object reqWms = device.getExtraValue().get("reqWms");
if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")){ if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")) {
JSONArray req = new JSONArray(); JSONArray req = new JSONArray();
JSONObject map = new JSONObject(); JSONObject map = new JSONObject();
map.put("vehicle_code", inst.getVehicle_code()); map.put("Vehiclecode", inst.getVehicle_code());
map.put("status", "3"); map.put("Status", "3");
map.put("device_code", inst.getStart_point_code()); map.put("Devicecode", inst.getNext_device_code());
map.put("task_code", inst.getTask_code()); map.put("Taskcode", inst.getTask_code());
req.add(map); req.add(map);
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req); HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) { if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
JSONObject resp = JSONObject.parseObject(httpResponse.body());
if (resp.getInteger("status") == 200) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
log.info("指令号:{},acs请求wms放货申请成功,wms允许agv申请放货,已反馈agv允许放货", inst.getInstruction_code()); log.info("指令号:{},acs请求wms放货申请成功,wms允许agv申请放货,已反馈agv允许放货", inst.getInstruction_code());
} else {
log.warn("指令号:{},acs请求wms放货申请成功,wms不允许agv申请放货,未反馈agv允许放货", inst.getInstruction_code());
}
} else { } else {
log.warn("指令号:{},acs请求wms放货申请失败,连接被拒绝,未反馈agv允许放货", inst.getInstruction_code()); log.warn("指令号:{},acs请求wms放货申请失败,连接被拒绝,未反馈agv允许放货", inst.getInstruction_code());
} }
@ -345,8 +330,24 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("未找到编号{}对应的指令", ikey); log.info("未找到编号{}对应的指令", ikey);
return; return;
} }
if (StrUtil.equals(inst.getNext_device_code(), device_code)) { if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
Object reqWms = device.getExtraValue().get("reqWms");
if (ObjectUtil.isNotEmpty(reqWms) && reqWms.toString().equals("true")) {
JSONArray req = new JSONArray();
JSONObject map = new JSONObject();
map.put("Vehiclecode", inst.getVehicle_code());
map.put("Status", "4");
map.put("Devicecode", inst.getNext_device_code());
map.put("Taskcode", inst.getTask_code());
req.add(map);
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
log.info("指令号:{},acs请求wms放货完成成功", inst.getInstruction_code());
} else {
log.warn("指令号:{},acs请求wms放货完成失败", inst.getInstruction_code());
}
}
} }
} }
//到达位置点 //到达位置点

17
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CancelTaskRequest.java

@ -1,5 +1,6 @@
package org.nl.acs.ext.wms.data; package org.nl.acs.ext.wms.data;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
import java.util.HashMap; import java.util.HashMap;
@ -11,24 +12,28 @@ public class CancelTaskRequest extends BaseRequest {
/** /**
* 任务编号 * 任务编号
*/ */
private String task_code; @JsonProperty("Taskcode")
private String Taskcode;
/** /**
* 载具号 * 载具号
*/ */
String vehicle_code; @JsonProperty("Vehiclecode")
String Vehiclecode;
/** /**
* 扩展属性 * 扩展属性
*/ */
Map<String,String> params = new HashMap<>(); @JsonProperty("Params")
Map<String,String> Params = new HashMap<>();
@Override @Override
public String toString() { public String toString() {
return "CancelTaskRequest{" + return "CancelTaskRequest{" +
"task_code='" + task_code + '\'' + "Taskcode='" + Taskcode + '\'' +
", vehicle_code='" + vehicle_code + '\'' + ", Vehiclecode='" + Vehiclecode + '\'' +
", params=" + params + ", Params=" + Params +
'}'; '}';
} }
} }

44
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java

@ -1,5 +1,6 @@
package org.nl.acs.ext.wms.data; package org.nl.acs.ext.wms.data;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
import java.util.HashMap; import java.util.HashMap;
@ -13,63 +14,58 @@ public class CreateTaskRequest extends BaseRequest {
/** /**
* 任务编号 * 任务编号
*/ */
private String task_code; @JsonProperty("Taskcode")
private String Taskcode;
/** /**
* 取货点1 * 取货点1
*/ */
String start_device_code; @JsonProperty("Startdevicecode")
String Startdevicecode;
/** /**
* 放货点1 * 放货点1
*/ */
String next_device_code; @JsonProperty("Nextdevicecode")
String Nextdevicecode;
/** /**
* 优先级 * 优先级
*/ */
String priority = "1"; @JsonProperty("Priority")
String Priority = "1";
/** /**
* 载具号 * 载具号
*/ */
String vehicle_code; @JsonProperty("Vehiclecode")
String Vehiclecode;
/** /**
* 载具类型 * 载具类型
*/ */
String vehicle_type; @JsonProperty("Vehicletype")
String Vehicletype;
/** /**
* 任务类型 * 任务类型
*/ */
String task_type; @JsonProperty("Tasktype")
String Tasktype;
/** /**
* 备注 * 备注
*/ */
String remark; @JsonProperty("Remark")
String Remark;
/** /**
* 扩展属性 * 扩展属性
*/ */
Map<String,String> params = new HashMap<>(); @JsonProperty("Params")
Map<String,String> Params = new HashMap<>();
@Override
public String toString() {
return "CreateTaskRequest{" +
"task_code='" + task_code + '\'' +
", start_device_code='" + start_device_code + '\'' +
", next_device_code='" + next_device_code + '\'' +
", priority='" + priority + '\'' +
", vehicle_code='" + vehicle_code + '\'' +
", vehicle_type='" + vehicle_type + '\'' +
", task_type='" + task_type + '\'' +
", remark='" + remark + '\'' +
", params=" + params +
'}';
}
} }

63
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java

@ -19,6 +19,7 @@ import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto; import org.nl.acs.task.service.dto.TaskDto;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.system.service.ParamService; import org.nl.modules.system.service.ParamService;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -47,8 +48,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
public String token; public String token;
private String log_file_type="log_file_type"; private String log_file_type = "log_file_type";
private String log_type="ACS请求LMS"; private String log_type = "ACS请求LMS";
@Override @Override
public String applyTaskToWms(JSONObject jo) { public String applyTaskToWms(JSONObject jo) {
@ -71,7 +72,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
//网络不通 //网络不通
// //System.out.println(msg); // //System.out.println(msg);
} }
if(ObjectUtil.isEmpty(result2)){ if (ObjectUtil.isEmpty(result2)) {
log.info("applyTaskToWms-----输出参数{}", "返回结果为空"); log.info("applyTaskToWms-----输出参数{}", "返回结果为空");
return null; return null;
} }
@ -97,22 +98,32 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
MDC.put(log_file_type, log_type); MDC.put(log_file_type, log_type);
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
String task_code = ""; AddressDto getToken = addressService.findByCode("getToken");
for (int i = 0; i < data.size(); i++) { String getToken_url = getToken.getMethods_url();
JSONObject json = (JSONObject) data.get(i); HttpResponse getTokenResult = null;
task_code = json.getString("task_code"); try {
getTokenResult = HttpRequest
.get(wmsurl + getToken_url)
.execute();
} catch (Exception e) {
logServer.extLog("获取token", "反馈任务状态获取token失败" + e.getMessage());
return null;
} }
TaskDto taskDto = taskService.findByCode(task_code);
String vehicle_code = taskDto.getVehicle_code();
HttpResponse result2 = null; String token = getTokenResult.body();
logServer.extLog("获取token", "反馈任务状态获取token成功" + token);
HttpResponse result = null;
log.info("feedbackTaskStatusToWms-----请求参数{}", data.toString()); log.info("feedbackTaskStatusToWms-----请求参数{}", data.toString());
AddressDto addressDto = addressService.findByCode("feedbackTaskStatusToWms"); AddressDto addressDto = addressService.findByCode("feedbackTaskStatusToWms");
String methods_url = addressDto.getMethods_url(); String methods_url = addressDto.getMethods_url();
String url = wmsurl + methods_url;
try { try {
result2 = HttpRequest.post(wmsurl + methods_url) result = HttpRequest
.header("Authorization", token).body(String.valueOf(data)) .post(url + "?token=" + token)
.header("Content-Type", "application/json")
.body(String.valueOf(data))
.execute(); .execute();
// //System.out.println(result2); // //System.out.println(result2);
} catch (Exception e) { } catch (Exception e) {
@ -122,18 +133,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
log.info("feedbackTaskStatusToWms-----输出参数{}", msg); log.info("feedbackTaskStatusToWms-----输出参数{}", msg);
} }
String type = ""; String type = "";
if (result2.getStatus() == 200) { if (result.getStatus() == 200) {
type = "info"; type = "info";
} else { } else {
type = "error"; type = "error";
} }
JSONObject jo = JSONObject.parseObject(result.body());
JSONObject jo = JSONObject.parseObject(result2.body());
log.info("feedbackTaskStatusToWms-----输出参数{}", jo.toString()); log.info("feedbackTaskStatusToWms-----输出参数{}", jo.toString());
return result2; return result;
} finally { } finally {
MDC.remove(log_file_type); MDC.remove(log_file_type);
} }
@ -472,7 +480,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
} }
@Override @Override
public UpdateLKTaskResponse updateLKTaskRequest(UpdateLKTaskRequest param) { public UpdateLKTaskResponse updateLKTaskRequest(UpdateLKTaskRequest param) {
try { try {
@ -534,6 +541,22 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
public HttpResponse feedAgvTaskStatus(JSONArray from) { public HttpResponse feedAgvTaskStatus(JSONArray from) {
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto getToken = addressService.findByCode("getToken");
String getToken_url = getToken.getMethods_url();
HttpResponse getTokenResult = null;
try {
getTokenResult = HttpRequest
.get(wmsUrl + getToken_url)
.execute();
} catch (Exception e) {
logServer.extLog("获取token", e.getMessage());
return null;
}
String token = getTokenResult.body();
AddressDto addressDto = addressService.findByCode("feedAgvTaskStatus"); AddressDto addressDto = addressService.findByCode("feedAgvTaskStatus");
String methods_url = addressDto.getMethods_url(); String methods_url = addressDto.getMethods_url();
String url = wmsUrl + methods_url; String url = wmsUrl + methods_url;
@ -541,7 +564,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
log.info("feedAgvTaskStatus----请求参数{}", from); log.info("feedAgvTaskStatus----请求参数{}", from);
try { try {
result = HttpRequest.post(url) result = HttpRequest.post(url + "?token=" + token)
.body(String.valueOf(from)) .body(String.valueOf(from))
.execute(); .execute();
System.out.println(result); System.out.println(result);

20
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java

@ -71,8 +71,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
JSONArray errArr = new JSONArray(); JSONArray errArr = new JSONArray();
for (int i = 0; i < reqs.size(); i++) { for (int i = 0; i < reqs.size(); i++) {
CancelTaskRequest request = reqs.get(i); CancelTaskRequest request = reqs.get(i);
String task_code = request.getTask_code(); String task_code = request.getTaskcode();
String vehicle_code = request.getVehicle_code(); String vehicle_code = request.getVehiclecode();
Map<String, String> params = request.getParams(); Map<String, String> params = request.getParams();
if (StrUtil.isEmpty(task_code)) { if (StrUtil.isEmpty(task_code)) {
throw new WDKException("任务号不能为空"); throw new WDKException("任务号不能为空");
@ -460,13 +460,13 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
JSONArray errArr = new JSONArray(); JSONArray errArr = new JSONArray();
for (int i = 0; i < reqs.size(); i++) { for (int i = 0; i < reqs.size(); i++) {
CreateTaskRequest req = reqs.get(i); CreateTaskRequest req = reqs.get(i);
String task_code = req.getTask_code(); String task_code = req.getTaskcode();
String start_device_code = req.getStart_device_code(); String start_device_code = req.getStartdevicecode();
String next_device_code = req.getNext_device_code(); String next_device_code = req.getNextdevicecode();
String priority = req.getPriority(); String priority = req.getPriority();
String vehicle_code = req.getVehicle_code(); String vehicle_code = req.getVehiclecode();
String vehicle_type = req.getVehicle_type(); String vehicle_type = req.getVehicletype();
String task_type = req.getTask_type(); String task_type = req.getTasktype();
String remark = req.getRemark(); String remark = req.getRemark();
Map<String, String> params = req.getParams(); Map<String, String> params = req.getParams();
@ -542,14 +542,14 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
if (StrUtil.isEmpty(start_point_code)) { if (StrUtil.isEmpty(start_point_code)) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("task_code", task_code); json.put("task_code", task_code);
json.put("message", req.getStart_device_code() + " 该设备号未找到对应点位"); json.put("message", req.getStartdevicecode() + " 该设备号未找到对应点位");
errArr.add(json); errArr.add(json);
continue; continue;
} }
if (StrUtil.isEmpty(next_point_code)) { if (StrUtil.isEmpty(next_point_code)) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("task_code", task_code); json.put("task_code", task_code);
json.put("message", req.getNext_device_code() + " 该设备号未找到对应点位"); json.put("message", req.getNextdevicecode() + " 该设备号未找到对应点位");
errArr.add(json); errArr.add(json);
continue; continue;
} }

147
acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java

@ -702,16 +702,15 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
if (!StrUtil.startWith(dto.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) { if (!StrUtil.startWith(dto.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
TaskFeedbackDto feefbackdto = taskFeedbackService.findByCode(entity.getTask_code()); TaskFeedbackDto feefbackdto = taskFeedbackService.findByCode(entity.getTask_code());
JSONObject feed_jo = new JSONObject(); JSONObject feed_jo = new JSONObject();
feed_jo.put("task_id", entity.getExt_task_id()); feed_jo.put("Taskcode", dto.getTask_code());
feed_jo.put("task_code", dto.getTask_code()); feed_jo.put("Taskstatus", dto.getTask_status());
feed_jo.put("task_status", dto.getTask_status());
JSONArray ja = new JSONArray(); JSONArray ja = new JSONArray();
ja.add(feed_jo); ja.add(feed_jo);
String message = null; String message = null;
HttpResponse body = null; HttpResponse body = null;
boolean flag = false; boolean flag = false;
try { try {
body = acstowmsService.feedbackTaskStatusToWms(ja); // body = acstowmsService.feedbackTaskStatusToWms(ja);
} catch (Exception e) { } catch (Exception e) {
flag = true; flag = true;
message = e.getMessage(); message = e.getMessage();
@ -719,71 +718,71 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
} finally { } finally {
} }
if (flag) { // if (flag) {
if (ObjectUtil.isEmpty(feefbackdto)) { // if (ObjectUtil.isEmpty(feefbackdto)) {
feefbackdto = new TaskFeedbackDto(); // feefbackdto = new TaskFeedbackDto();
feefbackdto.setTask_id(entity.getTask_id()); // feefbackdto.setTask_id(entity.getTask_id());
feefbackdto.setTask_code(entity.getTask_code()); // feefbackdto.setTask_code(entity.getTask_code());
feefbackdto.setTask_status(entity.getTask_status()); // feefbackdto.setTask_status(entity.getTask_status());
feefbackdto.setVehicle_type(entity.getVehicle_type()); // feefbackdto.setVehicle_type(entity.getVehicle_type());
feefbackdto.setVehicle_code(entity.getVehicle_code()); // feefbackdto.setVehicle_code(entity.getVehicle_code());
feefbackdto.setStart_device_code(entity.getStart_device_code()); // feefbackdto.setStart_device_code(entity.getStart_device_code());
feefbackdto.setStart_point_code(entity.getStart_point_code()); // feefbackdto.setStart_point_code(entity.getStart_point_code());
feefbackdto.setNext_device_code(entity.getNext_device_code()); // feefbackdto.setNext_device_code(entity.getNext_device_code());
feefbackdto.setNext_point_code(entity.getNext_point_code()); // feefbackdto.setNext_point_code(entity.getNext_point_code());
feefbackdto.setError_code("400"); // feefbackdto.setError_code("400");
feefbackdto.setIs_finished("0"); // feefbackdto.setIs_finished("0");
feefbackdto.setRemark(message); // feefbackdto.setRemark(message);
taskFeedbackService.create(feefbackdto); // taskFeedbackService.create(feefbackdto);
} else { // } else {
feefbackdto.setTask_status(entity.getTask_status()); // feefbackdto.setTask_status(entity.getTask_status());
feefbackdto.setStart_device_code(entity.getStart_device_code()); // feefbackdto.setStart_device_code(entity.getStart_device_code());
feefbackdto.setStart_point_code(entity.getStart_point_code()); // feefbackdto.setStart_point_code(entity.getStart_point_code());
feefbackdto.setNext_device_code(entity.getNext_device_code()); // feefbackdto.setNext_device_code(entity.getNext_device_code());
feefbackdto.setNext_point_code(entity.getNext_point_code()); // feefbackdto.setNext_point_code(entity.getNext_point_code());
feefbackdto.setError_code("400"); // feefbackdto.setError_code("400");
feefbackdto.setRemark(message); // feefbackdto.setRemark(message);
taskFeedbackService.update(feefbackdto); // taskFeedbackService.update(feefbackdto);
} // }
} else { // } else {
int status = body.getStatus(); // int status = body.getStatus();
JSONObject jo = JSONObject.parseObject(body.body()); // JSONObject jo = JSONObject.parseObject(body.body());
if (ObjectUtil.isEmpty(feefbackdto)) { // if (ObjectUtil.isEmpty(feefbackdto)) {
feefbackdto = new TaskFeedbackDto(); // feefbackdto = new TaskFeedbackDto();
feefbackdto.setTask_id(entity.getTask_id()); // feefbackdto.setTask_id(entity.getTask_id());
feefbackdto.setTask_code(entity.getTask_code()); // feefbackdto.setTask_code(entity.getTask_code());
feefbackdto.setTask_status(entity.getTask_status()); // feefbackdto.setTask_status(entity.getTask_status());
feefbackdto.setVehicle_type(entity.getVehicle_type()); // feefbackdto.setVehicle_type(entity.getVehicle_type());
feefbackdto.setVehicle_code(entity.getVehicle_code()); // feefbackdto.setVehicle_code(entity.getVehicle_code());
feefbackdto.setError_code(String.valueOf(body.getStatus())); // feefbackdto.setError_code(String.valueOf(body.getStatus()));
feefbackdto.setStart_device_code(entity.getStart_device_code()); // feefbackdto.setStart_device_code(entity.getStart_device_code());
feefbackdto.setStart_point_code(entity.getNext_point_code()); // feefbackdto.setStart_point_code(entity.getNext_point_code());
feefbackdto.setNext_device_code(entity.getNext_device_code()); // feefbackdto.setNext_device_code(entity.getNext_device_code());
feefbackdto.setNext_point_code(entity.getNext_point_code()); // feefbackdto.setNext_point_code(entity.getNext_point_code());
if (status == 200) { // if (status == 200) {
if (StrUtil.equals(entity.getTask_status(), "2")) { // if (StrUtil.equals(entity.getTask_status(), "2")) {
feefbackdto.setIs_finished("1"); // feefbackdto.setIs_finished("1");
} else { // } else {
feefbackdto.setIs_finished("0"); // feefbackdto.setIs_finished("0");
} // }
} else { // } else {
feefbackdto.setIs_finished("0"); // feefbackdto.setIs_finished("0");
feefbackdto.setRemark(jo.getString("message")); // feefbackdto.setRemark(jo.getString("message"));
} // }
taskFeedbackService.create(feefbackdto); // taskFeedbackService.create(feefbackdto);
} else { // } else {
feefbackdto.setTask_status(entity.getTask_status()); // feefbackdto.setTask_status(entity.getTask_status());
if (status == 200) { // if (status == 200) {
} else { // } else {
if (StrUtil.equals(entity.getTask_status(), "2")) { // if (StrUtil.equals(entity.getTask_status(), "2")) {
feefbackdto.setIs_finished("1"); // feefbackdto.setIs_finished("1");
} else { // } else {
feefbackdto.setIs_finished("0"); // feefbackdto.setIs_finished("0");
} // }
} // }
taskFeedbackService.update(feefbackdto); // taskFeedbackService.update(feefbackdto);
} // }
} // }
} }
} }
@ -819,9 +818,8 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
TaskFeedbackDto feefbackdto = taskFeedbackService.findByCode(entity.getTask_code()); TaskFeedbackDto feefbackdto = taskFeedbackService.findByCode(entity.getTask_code());
System.out.println(feefbackdto == null); System.out.println(feefbackdto == null);
JSONObject feed_jo = new JSONObject(); JSONObject feed_jo = new JSONObject();
feed_jo.put("task_id", entity.getTask_id()); feed_jo.put("Taskcode", entity.getTask_code());
feed_jo.put("task_code", entity.getTask_code()); feed_jo.put("Taskstatus", entity.getTask_status());
feed_jo.put("task_status", entity.getTask_status());
JSONArray ja = new JSONArray(); JSONArray ja = new JSONArray();
ja.add(feed_jo); ja.add(feed_jo);
String message = null; String message = null;
@ -953,9 +951,8 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue(); String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) { if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
JSONObject feed_jo = new JSONObject(); JSONObject feed_jo = new JSONObject();
feed_jo.put("task_id", entity.getTask_id()); feed_jo.put("Taskcode", entity.getTask_code());
feed_jo.put("task_code", entity.getTask_code()); feed_jo.put("Taskstatus", entity.getTask_status());
feed_jo.put("task_status", entity.getTask_status());
JSONArray ja = new JSONArray(); JSONArray ja = new JSONArray();
ja.add(feed_jo); ja.add(feed_jo);
acstowmsService.feedbackTaskStatusToWms(ja); acstowmsService.feedbackTaskStatusToWms(ja);

2
acs/nladmin-ui/src/views/login.vue

@ -50,7 +50,7 @@ export default {
name: 'Login', name: 'Login',
data() { data() {
return { return {
title: '诺力开发平台', title: '中泰龙ACS平台',
title_param: 'platform', title_param: 'platform',
Background: Background, Background: Background,
codeUrl: '', codeUrl: '',

Loading…
Cancel
Save