lms新需求
This commit is contained in:
@@ -231,6 +231,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
if (last_move == 1 && move == 0) {
|
||||
// 有货变无货请求lms
|
||||
this.shipDeviceUpdate();
|
||||
}
|
||||
|
||||
|
||||
// if (mode == 2 && move != 0 && task > 0) {
|
||||
@@ -302,6 +306,14 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
last_task = task;
|
||||
}
|
||||
|
||||
private void shipDeviceUpdate() {
|
||||
JSONObject param = new JSONObject() {{
|
||||
put("device_code", device_code);
|
||||
}};
|
||||
|
||||
acsToWmsService.shipDeviceUpdate(param);
|
||||
}
|
||||
|
||||
|
||||
public boolean exe_error() {
|
||||
if (this.error == 0) {
|
||||
|
||||
@@ -103,4 +103,7 @@ public interface AcsToWmsService {
|
||||
LiKuApplyTakResponse liKuApplyTaskRequest(LiKuApplyTaskRequest liKuApplyTaskRequest);
|
||||
|
||||
UpdateLKTaskResponse updateLKTaskRequest(UpdateLKTaskRequest updateLKTaskRequest);
|
||||
|
||||
// 输送线有货变成无货时向lms请求
|
||||
void shipDeviceUpdate(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -501,4 +501,25 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shipDeviceUpdate(JSONObject param) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("shipDeviceUpdate-----输入参数{}", param);
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
AddressDto addressDto = addressService.findByCode("shipDeviceUpdate");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
String url = wmsUrl + methods_url;
|
||||
HttpRequest
|
||||
.post(url)
|
||||
.body(param.toString())
|
||||
.execute();
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user