opt: 把 LMS/WMS 重复的执行逻辑下沉到 starter

This commit is contained in:
2026-07-23 16:05:51 +08:00
parent 7972122ea1
commit 65fb53fc00
11 changed files with 266 additions and 110 deletions

View File

@@ -11,7 +11,6 @@ import cn.code.nl.module.task.dal.mysql.transporttask.TransportTaskMapper;
import cn.code.nl.module.task.dto.AcsFeedbackReqDTO;
import cn.code.nl.module.task.enums.AcsBusinessOperationTypeEnum;
import cn.code.nl.module.task.enums.TransportTaskStatusEnum;
import com.alibaba.fastjson.JSON;
import jakarta.annotation.PostConstruct;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
@@ -104,68 +103,63 @@ public class TransportTaskBusinessOperationManager {
TaskCommonApi serverApi = taskCommonApiFactory.getByServerName(task.getOwnerService());
CommonResult<AcsApplyActionRespVO> result =
serverApi.doHandlePicked(buildReq(task, reqDTO));
return result.getData();
return result.getCheckedData();
}
/**
* 处理二次请求
*/
private AcsApplyActionRespVO handleApplyAgain(TransportTaskDO task, AcsFeedbackReqDTO reqDTO) {
// TODO 二次请求业务待开发
log.info("二次请求业务待开发, taskId={}", task.getTaskId());
log.info("二次请求, taskId={}", task.getTaskId());
// 调用具体的服务去执行取货完成操作。
TaskCommonApi serverApi = taskCommonApiFactory.getByServerName(task.getOwnerService());
CommonResult<AcsApplyActionRespVO> result =
serverApi.doHandleApplyAgain(buildReq(task, reqDTO));
return result.getData();
return result.getCheckedData();
}
/**
* 处理请求放货
*/
private Object handleRequestRelease(TransportTaskDO task, AcsFeedbackReqDTO reqDTO) {
// TODO 请求放货业务待开发
log.info("请求放货业务待开发, taskId={}", task.getTaskId());
log.info("请求放货, taskId={}", task.getTaskId());
TaskCommonApi serverApi = taskCommonApiFactory.getByServerName(task.getOwnerService());
CommonResult<AcsApplyActionRespVO> result =
serverApi.doHandleRequestRelease(buildReq(task, reqDTO));
return result.getData();
return result.getCheckedData();
}
/**
* 处理请求取货
*/
private Object handleRequestPick(TransportTaskDO task, AcsFeedbackReqDTO reqDTO) {
// TODO 请求取货业务待开发
log.info("请求取货业务待开发, taskId={}", task.getTaskId());
log.info("请求取货, taskId={}", task.getTaskId());
TaskCommonApi serverApi = taskCommonApiFactory.getByServerName(task.getOwnerService());
CommonResult<AcsApplyActionRespVO> result =
serverApi.doHandleRequestPick(buildReq(task, reqDTO));
return result.getData();
return result.getCheckedData();
}
/**
* 处理请求离开
*/
private Object handleRequestLeave(TransportTaskDO task, AcsFeedbackReqDTO reqDTO) {
// TODO 请求离开业务待开发
log.info("请求离开业务待开发, taskId={}", task.getTaskId());
log.info("请求离开, taskId={}", task.getTaskId());
TaskCommonApi serverApi = taskCommonApiFactory.getByServerName(task.getOwnerService());
CommonResult<AcsApplyActionRespVO> result =
serverApi.doHandleRequestLeave(buildReq(task, reqDTO));
return result.getData();
return result.getCheckedData();
}
/**
* 处理请求进入
*/
private Object handleRequestEnter(TransportTaskDO task, AcsFeedbackReqDTO reqDTO) {
// TODO 请求进入业务待开发
log.info("请求进入业务待开发, taskId={}", task.getTaskId());
log.info("请求进入, taskId={}", task.getTaskId());
TaskCommonApi serverApi = taskCommonApiFactory.getByServerName(task.getOwnerService());
CommonResult<AcsApplyActionRespVO> result =
serverApi.doHandleRequestEnter(buildReq(task, reqDTO));
return result.getData();
return result.getCheckedData();
}
/**
@@ -175,7 +169,7 @@ public class TransportTaskBusinessOperationManager {
AcsApplyActionRespVO respVO = new AcsApplyActionRespVO();
respVO.setTaskId(task.getTaskId());
respVO.setTaskCode(task.getTaskCode());
respVO.setData(JSON.parseObject(JSON.toJSONString(data)));
respVO.setData(data);
return respVO;
}
/**
@@ -185,7 +179,7 @@ public class TransportTaskBusinessOperationManager {
TaskStatusCallApiReqDTO req = new TaskStatusCallApiReqDTO();
req.setTaskId(task.getTaskId());
req.setTaskCode(task.getTaskCode());
req.setStatus(TransportTaskStatusEnum.PICKED.getCode());
req.setStatus(reqDTO.getStatus());
req.setOwnerService(task.getOwnerService());
req.setBizType(task.getBizType());
req.setBizId(task.getBizId());