Browse Source

更新

master
gengby 2 years ago
parent
commit
5cff15cad0
  1. 2
      hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java
  2. 47
      hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsZDServiceImpl.java

2
hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java

@ -1594,7 +1594,7 @@ public class AgvServiceImpl implements AgvService {
JSONObject jo1 = new JSONObject();
jo1.put("blockId", IdUtil.simpleUUID());
jo1.put("location",inst.getStart_point_code());
jo1.put("operation","Jackload");
jo1.put("operation","JackLoad");
ja.add(jo1);
JSONObject jo2 = new JSONObject();

47
hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsZDServiceImpl.java

@ -223,11 +223,13 @@ public class AcsToWmsZDServiceImpl implements AcsToWmsZDService {
}
@Override
public Map<String, Object> checkDeviceStatus(Map whereJson) throws Exception {
public Map<String, Object> checkDeviceStatus(Map whereJson) {
Map<String, Object> map = new HashMap<>();
String systemCode = MapUtil.getStr(whereJson, "systemCode");
String houseCode = MapUtil.getStr(whereJson, "houseCode");
String parameters = MapUtil.getStr(whereJson, "parameters");
HttpResponse result = null;
AddressDto addressDto = addressService.findByCode("checkDeviceStatus");
String wcsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WCSURL);
String methods_url = addressDto.getMethods_url();
String url = wcsurl + methods_url;
String deviceCode = MapUtil.getStr(whereJson, "deviceCode");
if (StrUtil.isEmpty(deviceCode)) {
map.put("responseCode", 1);
@ -235,31 +237,20 @@ public class AcsToWmsZDServiceImpl implements AcsToWmsZDService {
map.put("parameters", new HashMap<>());
return map;
}
Device device = deviceAppService.findDeviceByCode(deviceCode);
StandardConveyorLineDeviceDriver standardConveyorLineDeviceDriver;
int status = 0;
Boolean hasGoods = false;
String statusDescription = "正常";
if (device.getDeviceDriver() instanceof StandardConveyorLineDeviceDriver) {
standardConveyorLineDeviceDriver = (StandardConveyorLineDeviceDriver) device.getDeviceDriver();
status = standardConveyorLineDeviceDriver.getError();
int move = standardConveyorLineDeviceDriver.getMove();
if (status != 0) {
statusDescription = "异常";
}
if (move == 1) {
hasGoods = true;
}
} else if (1 == 1) {
try {
result = HttpRequest.post(url)
.header("Authorization", token).body(String.valueOf(whereJson))
.execute();
} catch (Exception e) {
e.printStackTrace();
logServer.log(deviceCode, "checkDeviceStatus", "error", whereJson.toString(), e.getMessage(), String.valueOf(result.getStatus()), url, "");
map.put("responseCode", 1);
map.put("responseMessage", e.getMessage());
return map;
}
map.put("responseCode", 0);
map.put("responseMessage", "响应成功!");
map.put("parameters", new HashMap<>());
map.put("status", status);
map.put("statusDescription", statusDescription);
map.put("hasGoods", hasGoods);
return map;
JSONObject jo = JSONObject.fromObject(result.body());
log.info("checkDeviceStatus-----输出参数{}", jo.toString());
return jo;
}
}

Loading…
Cancel
Save