Browse Source

更新

master
gengby 2 years ago
parent
commit
082b647105
  1. 19
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java
  2. 14
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java
  3. 2
      acs/nladmin-system/src/main/resources/config/application.yml
  4. 17
      acs/nladmin-ui/src/views/acs/device/driver/standard_storage.vue

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

@ -169,14 +169,13 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
return; return;
} }
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("Vehiclecode", inst.getVehicle_code()); map.put("Vehiclecode", inst.getVehicle_code());
map.put("Status", "1"); map.put("Status", "1");
map.put("Devicecode", inst.getStart_device_code()); map.put("Devicecode", inst.getStart_point_code());
map.put("Taskcode", 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);
@ -187,7 +186,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
log.warn("指令号:{},acs请求wms取货申请失败,连接被拒绝,未反馈agv允许取货", inst.getInstruction_code()); log.warn("指令号:{},acs请求wms取货申请失败,连接被拒绝,未反馈agv允许取货", inst.getInstruction_code());
} }
} }
}
//取货完毕 //取货完毕
//(需要WCS反馈) //(需要WCS反馈)
} else if (phase == 0x05) { } else if (phase == 0x05) {
@ -225,14 +224,13 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
return; return;
} }
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("Vehiclecode", inst.getVehicle_code()); map.put("Vehiclecode", inst.getVehicle_code());
map.put("Status", "2"); map.put("Status", "2");
map.put("Devicecode", inst.getStart_device_code()); map.put("Devicecode", inst.getStart_point_code());
map.put("Taskcode", 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);
@ -243,7 +241,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
log.warn("指令号:{},acs反馈wms取货完成失败,连接被拒绝,未反馈agv取货完成", inst.getInstruction_code()); log.warn("指令号:{},acs反馈wms取货完成失败,连接被拒绝,未反馈agv取货完成", inst.getInstruction_code());
} }
} }
}
//到达放货点 //到达放货点
//(需要WCS反馈) //(需要WCS反馈)
} else if (phase == 0x07) { } else if (phase == 0x07) {
@ -277,14 +275,13 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("未找到关联编号{}对应的指令", ikey); log.info("未找到关联编号{}对应的指令", ikey);
return; return;
} }
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("Vehiclecode", inst.getVehicle_code()); map.put("Vehiclecode", inst.getVehicle_code());
map.put("Status", "3"); map.put("Status", "3");
map.put("Devicecode", inst.getNext_device_code()); map.put("Devicecode", inst.getNext_point_code());
map.put("Taskcode", 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);
@ -295,7 +292,6 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
log.warn("指令号:{},acs请求wms放货申请失败,连接被拒绝,未反馈agv允许放货", inst.getInstruction_code()); log.warn("指令号:{},acs请求wms放货申请失败,连接被拒绝,未反馈agv允许放货", inst.getInstruction_code());
} }
} }
}
//放货完毕 //放货完毕
//(需要WCS反馈) //(需要WCS反馈)
} else if (phase == 0x09) { } else if (phase == 0x09) {
@ -330,14 +326,13 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("未找到编号{}对应的指令", ikey); log.info("未找到编号{}对应的指令", ikey);
return; return;
} }
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("Vehiclecode", inst.getVehicle_code()); map.put("Vehiclecode", inst.getVehicle_code());
map.put("Status", "4"); map.put("Status", "4");
map.put("Devicecode", inst.getNext_device_code()); map.put("Devicecode", inst.getNext_point_code());
map.put("Taskcode", 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);
@ -348,7 +343,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
log.warn("指令号:{},acs请求wms放货完成失败", inst.getInstruction_code()); log.warn("指令号:{},acs请求wms放货完成失败", inst.getInstruction_code());
} }
} }
}
} }
//到达位置点 //到达位置点
//(需要WCS反馈) //(需要WCS反馈)

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

@ -119,11 +119,18 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
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; String url = wmsurl + methods_url;
for (int i = 0; i < data.size(); i++) {
JSONObject jsonObject = data.getJSONObject(i);
String taskcode = jsonObject.getString("Taskcode");
String taskstatus = jsonObject.getString("Taskstatus");
JSONObject reqData = new JSONObject();
reqData.put("Staus",taskstatus);
try { try {
result = HttpRequest result = HttpRequest
.post(url + "?token=" + token) .put(url + taskcode + "?token=" + token)
.header("Content-Type", "application/json") .header("Content-Type", "application/json")
.body(String.valueOf(data)) .body(String.valueOf(reqData))
.execute(); .execute();
// //System.out.println(result2); // //System.out.println(result2);
} catch (Exception e) { } catch (Exception e) {
@ -133,6 +140,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
log.info("feedbackTaskStatusToWms-----输出参数{}", msg); log.info("feedbackTaskStatusToWms-----输出参数{}", msg);
} }
}
String type = ""; String type = "";
if (result.getStatus() == 200) { if (result.getStatus() == 200) {
type = "info"; type = "info";
@ -140,7 +148,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
type = "error"; type = "error";
} }
JSONObject jo = JSONObject.parseObject(result.body()); JSONObject jo = JSONObject.parseObject(result.body());
log.info("feedbackTaskStatusToWms-----输出参数{}", jo.toString()); log.info("feedbackTaskStatusToWms-----输出参数{}", String.valueOf(jo));
return result; return result;
} finally { } finally {
MDC.remove(log_file_type); MDC.remove(log_file_type);

2
acs/nladmin-system/src/main/resources/config/application.yml

@ -2,7 +2,7 @@ spring:
freemarker: freemarker:
check-template-location: false check-template-location: false
profiles: profiles:
active: prod active: dev
jackson: jackson:
time-zone: GMT+8 time-zone: GMT+8
data: data:

17
acs/nladmin-ui/src/views/acs/device/driver/standard_storage.vue

@ -1,6 +1,20 @@
<template> <template>
<!-- 标准版-货架--> <!-- 标准版-货架-->
<div> <div>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span class="role-span">指令相关</span>
</div>
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
<el-row>
<el-col :span="8">
<el-form-item label="是否请求wms" label-width="150px">
<el-switch v-model="form.reqWms" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="box-card" shadow="never"> <el-card class="box-card" shadow="never">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span class="role-span">设备协议</span> <span class="role-span">设备协议</span>
@ -133,7 +147,8 @@ export default {
maxY: 0, maxY: 0,
maxZ: 0, maxZ: 0,
minY: 0, minY: 0,
minZ: 0 minZ: 0,
reqWms: true
}, },
rules: { rules: {
x: [ x: [

Loading…
Cancel
Save