|
|
@ -94,14 +94,15 @@ public class WithStationDeviceDriver extends AbstractOpcDeviceDriver implements |
|
|
|
requestParam.put("type", RequestTypeEnum.APPLY_IN_TASK.getType()); |
|
|
|
String getLinkDeviceCode = Optional.ofNullable(device.getExtraValue().get("getLinkDeviceCode")).map(Object::toString).orElse(null); |
|
|
|
if (StrUtil.isEmpty(getLinkDeviceCode)) { |
|
|
|
requestParam.put("device_code1", deviceCode); |
|
|
|
requestParam.put("barcode1", appearanceInspectionScannerConveyorDeviceDriver.getBarcode()); |
|
|
|
JSONObject param = new JSONObject(); |
|
|
|
param.put(appearanceInspectionScannerConveyorDeviceDriver.getBarcode(), deviceCode); |
|
|
|
requestParam.put("param", param); |
|
|
|
logServer.deviceExecuteLog(new LuceneLogDto(this.device_code, "申请任务...." + requestParam.toString())); |
|
|
|
// UnifiedResponse<JSONObject> response = acsToWmsService.applyTaskToWms(requestParam);
|
|
|
|
// if (response.isSuccess()) {
|
|
|
|
UnifiedResponse<JSONObject> response = acsToWmsService.applyTaskToWms(requestParam); |
|
|
|
if (response.isSuccess()) { |
|
|
|
appearanceInspectionScannerConveyorDeviceDriver.setRequireSuccess(true); |
|
|
|
this.requireSuccess = true; |
|
|
|
// }
|
|
|
|
} |
|
|
|
} else { |
|
|
|
Device linkDevice = deviceAppservice.findDeviceByCode(getLinkDeviceCode); |
|
|
|
if (ObjectUtil.isNotEmpty(linkDevice) && linkDevice.getDeviceDriver() instanceof AppearanceInspectionScannerConveyorDeviceDriver) { |
|
|
@ -109,29 +110,29 @@ public class WithStationDeviceDriver extends AbstractOpcDeviceDriver implements |
|
|
|
if (appearanceInspectionScannerConveyorDeviceDriver2.getMove() == 1 && !appearanceInspectionScannerConveyorDeviceDriver2.isRequireSuccess()) { |
|
|
|
TaskDto taskDto2 = taskServer.findByContainer(appearanceInspectionScannerConveyorDeviceDriver2.getBarcode()); |
|
|
|
if (ObjectUtil.isEmpty(taskDto2)) { |
|
|
|
requestParam.put("device_code1", deviceCode); |
|
|
|
requestParam.put("barcode1", appearanceInspectionScannerConveyorDeviceDriver.getBarcode()); |
|
|
|
requestParam.put("device_code2", getLinkDeviceCode); |
|
|
|
requestParam.put("barcode2", appearanceInspectionScannerConveyorDeviceDriver2.getBarcode()); |
|
|
|
JSONObject param = new JSONObject(); |
|
|
|
param.put(appearanceInspectionScannerConveyorDeviceDriver.getBarcode(), deviceCode); |
|
|
|
param.put(appearanceInspectionScannerConveyorDeviceDriver2.getBarcode(), getLinkDeviceCode); |
|
|
|
requestParam.put("param", param); |
|
|
|
logServer.deviceExecuteLog(new LuceneLogDto(this.device_code, "申请任务...." + requestParam.toString())); |
|
|
|
//UnifiedResponse<JSONObject> response = acsToWmsService.applyTaskToWms(requestParam);
|
|
|
|
// if (response.isSuccess()) {
|
|
|
|
UnifiedResponse<JSONObject> response = acsToWmsService.applyTaskToWms(requestParam); |
|
|
|
if (response.isSuccess()) { |
|
|
|
this.requireSuccess = true; |
|
|
|
appearanceInspectionScannerConveyorDeviceDriver.setRequireSuccess(true); |
|
|
|
appearanceInspectionScannerConveyorDeviceDriver2.setRequireSuccess(true); |
|
|
|
|
|
|
|
// }
|
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (System.currentTimeMillis() - appearanceInspectionScannerConveyorDeviceDriver.getRequireInTaskTime() > waitTime * 1000) { |
|
|
|
requestParam.put("device_code1", deviceCode); |
|
|
|
requestParam.put("barcode1", appearanceInspectionScannerConveyorDeviceDriver.getBarcode()); |
|
|
|
JSONObject param = new JSONObject(); |
|
|
|
param.put(appearanceInspectionScannerConveyorDeviceDriver.getBarcode(), deviceCode); |
|
|
|
requestParam.put("param", param); |
|
|
|
logServer.deviceExecuteLog(new LuceneLogDto(this.device_code, "申请任务...." + requestParam.toString())); |
|
|
|
// UnifiedResponse<JSONObject> response = acsToWmsService.applyTaskToWms(requestParam);
|
|
|
|
//if (response.isSuccess()) {
|
|
|
|
UnifiedResponse<JSONObject> response = acsToWmsService.applyTaskToWms(requestParam); |
|
|
|
if (response.isSuccess()) { |
|
|
|
appearanceInspectionScannerConveyorDeviceDriver.setRequireSuccess(true); |
|
|
|
this.requireSuccess = true; |
|
|
|
// }
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|