diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/BaseResponse.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/BaseResponse.java index a02b32b..16bd161 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/BaseResponse.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/BaseResponse.java @@ -36,6 +36,10 @@ public class BaseResponse implements Serializable { * 信息 */ private String message; + /** + * 异常状态 + */ + private String errMsg; /** * 状态 diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/wms/AcsResponse.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/wms/AcsResponse.java index 25fa3c0..0650e9e 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/wms/AcsResponse.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/wms/AcsResponse.java @@ -18,7 +18,9 @@ public class AcsResponse extends BaseResponse { public static AcsResponse requestRefuse(String message) { AcsResponse result = new AcsResponse(); result.setCode(HttpStatus.HTTP_BAD_REQUEST); + result.setStatus(HttpStatus.HTTP_BAD_REQUEST); result.setMessage(message); + result.setErrMsg(message); result.setResponseDate(DateUtil.now()); return result; } @@ -26,6 +28,7 @@ public class AcsResponse extends BaseResponse { public static AcsResponse requestOk() { AcsResponse result = new AcsResponse(); result.setCode(HttpStatus.HTTP_OK); + result.setStatus(HttpStatus.HTTP_OK); result.setMessage("请求成功"); result.setResponseDate(DateUtil.now()); return result; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index 4b50aa6..3a5410c 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -306,6 +306,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { //取货完成 pickupComplete(schBaseTask, status, is_connector, task_type); break; + case "3": + //申请放货 + requestRelease(schBaseTask, status, is_connector); + break; case "4": //放货完成 releaseComplete(schBaseTask, status, is_connector, task_type, is_empty); @@ -494,6 +498,41 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } } } + if ("2".equals(is_connector)) { + //反馈connector申请取货 + JSONObject json = new JSONObject(); + json.put("vehicle_code", schBaseTask.getVehicle_code()); + json.put("status", status); + json.put("device_code", schBaseTask.getPoint_code1()); + json.put("task_code", schBaseTask.getTask_code()); + boolean flag = true; + AcsResponse acsResponse = sortingService.feedAgvTaskStatus(json); + if (acsResponse.getStatus() != 200 || StringUtils.isNotEmpty(acsResponse.getErrMsg())) { + throw new BadRequestException("申请失败,"+ acsResponse.getErrMsg()); + } + } + } + + /** + * 申请放货 + * @param schBaseTask + * @param status + * @param is_connector + */ + private void requestRelease(SchBaseTask schBaseTask, String status, String is_connector) { + if ("2".equals(is_connector)) { + //反馈connector申请取货 + JSONObject json = new JSONObject(); + json.put("vehicle_code", schBaseTask.getVehicle_code()); + json.put("status", status); + json.put("device_code", schBaseTask.getPoint_code1()); + json.put("task_code", schBaseTask.getTask_code()); + boolean flag = true; + AcsResponse acsResponse = sortingService.feedAgvTaskStatus(json); + if (acsResponse.getStatus() != 200 || StringUtils.isNotEmpty(acsResponse.getErrMsg())) { + throw new BadRequestException("申请失败,"+ acsResponse.getErrMsg()); + } + } } /**