This commit is contained in:
psh
2023-12-25 17:25:32 +08:00
parent aa8302f8c6
commit c0454f6ae2
7 changed files with 20 additions and 23 deletions

View File

@@ -336,8 +336,8 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
put("device_code", device_code); put("device_code", device_code);
}}; }};
HttpResponse response = acsToWmsService.shipDeviceUpdate(param); JSONObject response = acsToWmsService.shipDeviceUpdate(param);
if (response == null || response.getStatus() == 200) { if (response == null || 20000 == response.getIntValue("code")) {
this.requiresShipDeviceUpdate = true; this.requiresShipDeviceUpdate = true;
} }
} }

View File

@@ -268,8 +268,8 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
put("device_code", device_code); put("device_code", device_code);
}}; }};
HttpResponse response = acsToWmsService.shipDeviceUpdate(param); JSONObject response = acsToWmsService.shipDeviceUpdate(param);
if (response == null || response.getStatus() == 200) { if (response == null || 20000 == response.getIntValue("code")) {
this.requiresShipDeviceUpdate = true; this.requiresShipDeviceUpdate = true;
} }
} }

View File

@@ -339,12 +339,9 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
} else { } else {
this.instruction_require_time = date; this.instruction_require_time = date;
HttpResponse response = acsToWmsService.shipDeviceUpdate(param); JSONObject response = acsToWmsService.shipDeviceUpdate(param);
if (response.getStatus() == HttpStatus.OK.value()) { if (20000 == response.getIntValue("code")) {
JSONObject result = JSONObject.parseObject(response.body());
if (ObjectUtil.isNotEmpty(result) && result.getIntValue("status") == HttpStatus.OK.value()) {
this.requireSucess = true; this.requireSucess = true;
}
} }
} }
} }

View File

@@ -211,12 +211,9 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
} else { } else {
this.instruction_require_time = date; this.instruction_require_time = date;
HttpResponse response = acsToWmsService.shipDeviceUpdate(param); JSONObject response = acsToWmsService.shipDeviceUpdate(param);
if (response.getStatus() == HttpStatus.OK.value()) { if (20000 == response.getIntValue("code")) {
JSONObject result = JSONObject.parseObject(response.body()); this.requireSucess = true;
if (ObjectUtil.isNotEmpty(result) && result.getIntValue("status") == HttpStatus.OK.value()) {
this.requireSucess = true;
}
} }
} }
} }

View File

@@ -105,7 +105,7 @@ public interface AcsToWmsService {
UpdateLKTaskResponse updateLKTaskRequest(UpdateLKTaskRequest updateLKTaskRequest); UpdateLKTaskResponse updateLKTaskRequest(UpdateLKTaskRequest updateLKTaskRequest);
// 输送线有货变成无货时向lms请求 // 输送线有货变成无货时向lms请求
HttpResponse shipDeviceUpdate(JSONObject param); JSONObject shipDeviceUpdate(JSONObject param);
/** /**
* 反馈AGV取放货状态 * 反馈AGV取放货状态

View File

@@ -530,7 +530,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
} }
@Override @Override
public HttpResponse shipDeviceUpdate(JSONObject param) { public JSONObject shipDeviceUpdate(JSONObject param) {
try { try {
MDC.put(log_file_type, log_type); MDC.put(log_file_type, log_type);
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
@@ -538,12 +538,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
AddressDto addressDto = addressService.findByCode("shipDeviceUpdate"); AddressDto addressDto = addressService.findByCode("shipDeviceUpdate");
String methods_url = addressDto.getMethods_url(); String methods_url = addressDto.getMethods_url();
String url = wmsUrl + methods_url; String url = wmsUrl + methods_url;
// log.info("feedAgvTaskStatus - 请求参数 {}", param); log.info("shipDeviceUpdate - 请求参数 {}", param);
return HttpRequest JSONArray ja = new JSONArray();
.post(url) ja.add(param);
.body(param.toString()) HttpResponse result=HttpRequest.post(url)
.body(ja.toString())
.basicAuth("INFOR","Aa123456@@!!")
.execute(); .execute();
// log.info("feedAgvTaskStatus - 返回参数 {}", response.body()); log.info("shipDeviceUpdate - 返回参数 {}", result.body());
return JSONObject.parseObject(result.body());
} }
} catch (Throwable ignored) { } catch (Throwable ignored) {

View File

@@ -11,7 +11,7 @@ spring:
druid: druid:
db-type: com.alibaba.druid.pool.DruidDataSource db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:bjsz_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:bjszacs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
username: ${DB_USER:root} username: ${DB_USER:root}
password: ${DB_PWD:123456} password: ${DB_PWD:123456}
# 初始连接数 # 初始连接数