NDC接口调整

This commit is contained in:
psh
2023-10-20 17:46:26 +08:00
parent 66af1d20d2
commit 1427a3689d
9 changed files with 103 additions and 23 deletions

View File

@@ -56,6 +56,15 @@ public class AcsToWmsController {
return new ResponseEntity<>(acsToWmsService.status(param), HttpStatus.OK);
}
@PostMapping("/feedbackState")
@Log("ACS系统反馈AGV取放货状态")
@ApiOperation("ACS系统反馈AGV取放货状态")
//@SaCheckPermission("@el.check('schBaseTask:add')")
@SaIgnore
public ResponseEntity<Object> feedbackState(@RequestBody JSONObject param) {
return new ResponseEntity<>(acsToWmsService.feedbackState(param), HttpStatus.OK);
}
@PostMapping("/notify")
@Log("acs通知wms")
@ApiOperation("acs通知wms")
@@ -64,4 +73,13 @@ public class AcsToWmsController {
public ResponseEntity<Object> notify(@RequestBody JSONObject param) {
return new ResponseEntity<>(acsToWmsService.notify(param), HttpStatus.OK);
}
// @PostMapping("/notify")
// @Log("acs通知wms")
// @ApiOperation("acs通知wms")
// //@SaCheckPermission("@el.check('schBaseTask:add')")
// @SaIgnore
// public ResponseEntity<Object> notify(@RequestBody JSONObject param) {
// return new ResponseEntity<>(acsToWmsService.notify(param), HttpStatus.OK);
// }
}

View File

@@ -15,7 +15,10 @@ public interface AcsToWmsService {
/** 任务反馈 */
BaseResponse status(JSONObject param);
/** 任务反馈 */
/** 任务阶段反馈最新点位 */
BaseResponse feedbackState(JSONObject param);
/** acs通知wms */
BaseResponse notify(JSONObject param);
}

View File

@@ -179,4 +179,39 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
return BaseResponse.responseOk(requestNo, "反馈成功!");
}
/**
* 任务阶段反馈最新点位
* todo
* */
@Override
public BaseResponse feedbackState(JSONObject param) {
String requestNo = param.getString("requestNo");
String requestMethodCode = param.getString("request_medthod_code"); // 获取请求方法名
String requestMethodName = param.getString("request_medthod_name");
BaseResponse result = BaseResponse.build(requestNo);
String device_code = param.getString("device_code");
param.put("config_code",requestMethodCode);
try {
if(ObjectUtil.isEmpty(requestMethodCode)){
throw new BadRequestException("任务类型不正确!requestMethodCode"+requestMethodName+",device_code"+device_code);
}
AbstractTask task = taskFactory.getTask(requestMethodCode);
// 执行创建任务
task.apply(param);
} catch (Exception e) {
String message = ObjectUtil.isEmpty(e.getMessage())
? ((InvocationTargetException) e).getTargetException().getMessage()
: e.getMessage();
log.error("ACS请求LMS出现错误: {}", message);
result.setCode(HttpStatus.HTTP_BAD_REQUEST);
result.setMessage(message);
result.setRequestNo(requestNo);
// 消息通知
noticeService.createNotice("异常信息:" + message, "acsApply: " + param.getString("request_medthod_code"),
NoticeTypeEnum.EXCEPTION.getCode());
}
return result;
}
}