Browse Source

联调

master
psh 1 year ago
parent
commit
b1e133cb31
  1. 45
      acs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java
  2. 36
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java
  3. 2
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java
  4. 2
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java
  5. 2
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java
  6. 2
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/JDToAcsServiceImpl.java

45
acs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java

@ -159,28 +159,31 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
inst.setAgv_jobno(String.valueOf(index));
inst.setSend_status("1");
instructionService.update(inst);
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "0")) {
// if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "0")
// ||StrUtil.startWith(inst.getTask_code(), "-")) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
} else {
JSONArray req = new JSONArray();
JSONObject map = new JSONObject();
map.put("uuid", IdUtil.simpleUUID());
map.put("taskNo", inst.getTask_id());
map.put("businessType", "PENDING");
req.add(map);
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
JSONObject resp = JSONObject.parseObject(httpResponse.body());
if (resp.getInteger("code") == 200) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
log.info("指令号:{},acs请求wms任务执行申请成功,wms允许agv任务执行,已反馈agv任务执行", inst.getInstruction_code());
} else {
log.warn("指令号:{},acs请求wms任务执行任务执行失败,wms不允许agv任务执行离开,未反馈agv任务执行", inst.getInstruction_code());
}
} else {
log.warn("指令号:{},acs请求wms任务执行任务执行失败,连接被拒绝,未反馈agv任务执行", inst.getInstruction_code());
}
}
// } else {
// JSONArray req = new JSONArray();
// JSONObject map = new JSONObject();
// map.put("uuid", IdUtil.simpleUUID());
// map.put("taskNo", inst.getTask_code());
// map.put("businessType", "PENDING");
// map.put("containerNo",inst.getVehicle_code());
// map.put("deviceNo",inst.getCarno());
// req.add(map);
// HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
// if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
// JSONObject resp = JSONObject.parseObject(httpResponse.body());
// if (resp.getInteger("code") == 200) {
// data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
// log.info("指令号:{},acs请求wms任务执行申请成功,wms允许agv任务执行,已反馈agv任务执行", inst.getInstruction_code());
// } else {
// log.warn("指令号:{},acs请求wms任务执行任务执行失败,wms不允许agv任务执行离开,未反馈agv任务执行", inst.getInstruction_code());
// }
// } else {
// log.warn("指令号:{},acs请求wms任务执行任务执行失败,连接被拒绝,未反馈agv任务执行", inst.getInstruction_code());
// }
// }
}
}
//任务完毕

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

@ -132,7 +132,15 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
inst.setCarno(String.valueOf(carno));
instructionService.update(inst);
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + "反馈:" + data);
// JSONArray req = new JSONArray();
JSONObject map = new JSONObject();
map.put("uuid", IdUtil.simpleUUID());
map.put("taskNo", inst.getTask_code());
map.put("businessType", "PENDING");
map.put("containerNo",inst.getVehicle_code());
map.put("deviceNo",inst.getCarno());
// req.add(map);
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(map);
//到达取货点
//(需要WCS反馈)
} else if (phase == 0x03) {
@ -208,16 +216,19 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
return;
}
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "0")) {
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "0")
||StrUtil.startWith(inst.getTask_code(), "-")) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
} else {
JSONArray req = new JSONArray();
// JSONArray req = new JSONArray();
JSONObject map = new JSONObject();
map.put("uuid", IdUtil.simpleUUID());
map.put("taskNo", inst.getTask_id());
map.put("taskNo", inst.getTask_code());
map.put("businessType", "LEAVE_FROM_POINT");
req.add(map);
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
map.put("containerNo",inst.getVehicle_code());
map.put("deviceNo",inst.getCarno());
// req.add(map);
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(map);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
JSONObject resp = JSONObject.parseObject(httpResponse.body());
if (resp.getInteger("code") == 200) {
@ -301,16 +312,19 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("未找到编号{}对应的指令", ikey);
return;
}
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "0")) {
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "0")
||StrUtil.startWith(inst.getTask_code(), "-")) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
} else {
JSONArray req = new JSONArray();
// JSONArray req = new JSONArray();
JSONObject map = new JSONObject();
map.put("uuid", IdUtil.simpleUUID());
map.put("taskNo", inst.getTask_id());
map.put("taskNo", inst.getTask_code());
map.put("businessType", "ARRIVE_TO_POINT");
req.add(map);
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
map.put("containerNo",inst.getVehicle_code());
map.put("deviceNo",inst.getCarno());
// req.add(map);
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(map);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
JSONObject resp = JSONObject.parseObject(httpResponse.body());
if (resp.getInteger("code") == 200) {

2
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java

@ -107,7 +107,7 @@ public class AcsToWmsController {
@PostMapping("/feedAgvTaskStatus")
@Log(value = "反馈AGV取放货状态", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
@ApiOperation("反馈AGV取放货状态")
public ResponseEntity<Object> feedAgvTaskStatus(@RequestBody JSONArray from) {
public ResponseEntity<Object> feedAgvTaskStatus(@RequestBody JSONObject from) {
return new ResponseEntity<>(acstowmsService.feedAgvTaskStatus(from), HttpStatus.OK);
}

2
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java

@ -113,7 +113,7 @@ public interface AcsToWmsService {
* @param from
* @return
*/
HttpResponse feedAgvTaskStatus(JSONArray from);
HttpResponse feedAgvTaskStatus(JSONObject from);
JSONObject test(JSONObject form);
}

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

@ -556,7 +556,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
@Override
public HttpResponse feedAgvTaskStatus(JSONArray from) {
public HttpResponse feedAgvTaskStatus(JSONObject from) {
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
log.info("开始反馈WMS AGV取放货状态,请求参数:{}", from);
this.getTokenFromWms();

2
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/JDToAcsServiceImpl.java

@ -467,7 +467,7 @@ public class JDToAcsServiceImpl implements JDToAcsService {
String start_device_code = reqs.getCarryTask().getFromPoint();
String next_device_code = reqs.getCarryTask().getToPoint();
String priority = reqs.getPriority();
String vehicle_code = reqs.getDeviceNo();
String vehicle_code = reqs.getCarryTask().getContainerNo();
// String vehicle_type = req.getVehicle_type();
String task_type = "1";
// String remark = req.getRemark();

Loading…
Cancel
Save