This commit is contained in:
2022-12-01 13:34:00 +08:00
parent f8e0813e2b
commit 5cff15cad0
2 changed files with 20 additions and 29 deletions

View File

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

View File

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