Browse Source

rev:反馈状态

master
zhangzq 5 months ago
parent
commit
54d463dc28
  1. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/BaseResponse.java
  2. 3
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/wms/AcsResponse.java
  3. 39
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java

4
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;
/**
* 状态

3
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;

39
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());
}
}
}
/**

Loading…
Cancel
Save