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

@@ -0,0 +1,18 @@
package cn.code.nl.module.lms.api;
import cn.code.nl.framework.execute.biz.api.AbstractTaskCommonApiImpl;
import cn.code.nl.framework.execute.biz.api.lms.LmsTaskCommonApi;
import org.springframework.context.annotation.Primary;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;
/**
* LMS 任务通用 API 实现
*
* @author liyongde
*/
@RestController
@Validated
@Primary
public class LmsTaskExecuteApiImpl extends AbstractTaskCommonApiImpl implements LmsTaskCommonApi {
}

View File

@@ -1,80 +1,80 @@
package cn.code.nl.module.lms.demo;
import cn.code.nl.framework.common.pojo.CommonResult;
import cn.code.nl.framework.execute.biz.api.lms.LmsTaskCommonApi;
import cn.code.nl.framework.execute.biz.dto.TaskStatusCallApiReqDTO;
import cn.code.nl.framework.execute.biz.vo.AcsApplyActionRespVO;
import com.alibaba.fastjson.JSON;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;
import static cn.code.nl.framework.common.pojo.CommonResult.success;
/**
*
* @Author: liyongde
* @Date: 2026/7/15 15:25
*/
@RestController // 提供 RESTful API 接口,给 Feign 调用
@Validated
public class DemoApi implements LmsTaskCommonApi {
@Override
public CommonResult<AcsApplyActionRespVO> doHandlePicked(TaskStatusCallApiReqDTO taskStatusCallApiReqDTO) {
// 构建外层VO
AcsApplyActionRespVO respVO = new AcsApplyActionRespVO();
respVO.setTaskId(10001L);
respVO.setTaskCode("ACS20260716001");
// 内层data赋值 "success"
return success(respVO);
}
@Override
public CommonResult<AcsApplyActionRespVO> doHandleApplyAgain(TaskStatusCallApiReqDTO taskStatusCallApiReqDTO) {
DemoRespVO demoRespVO = new DemoRespVO();
demoRespVO.setTargetPoint("A_10001");
// 构建外层VO
AcsApplyActionRespVO respVO = new AcsApplyActionRespVO();
respVO.setTaskId(10001L);
respVO.setTaskCode("ACS20260716001");
// 内层data赋值 "success"
respVO.setData(JSON.parseObject(JSON.toJSONString(demoRespVO)));
return success(respVO);
}
@Override
public CommonResult<AcsApplyActionRespVO> doHandleRequestRelease(TaskStatusCallApiReqDTO taskStatusCallApiReqDTO) {
// 构建外层VO
AcsApplyActionRespVO respVO = new AcsApplyActionRespVO();
respVO.setTaskId(10001L);
respVO.setTaskCode("ACS20260716001");
return success(respVO);
}
@Override
public CommonResult<AcsApplyActionRespVO> doHandleRequestPick(TaskStatusCallApiReqDTO taskStatusCallApiReqDTO) {
// 构建外层VO
AcsApplyActionRespVO respVO = new AcsApplyActionRespVO();
respVO.setTaskId(10001L);
respVO.setTaskCode("ACS20260716001");
return success(respVO);
}
@Override
public CommonResult<AcsApplyActionRespVO> doHandleRequestLeave(TaskStatusCallApiReqDTO taskStatusCallApiReqDTO) {
// 构建外层VO
AcsApplyActionRespVO respVO = new AcsApplyActionRespVO();
respVO.setTaskId(10001L);
respVO.setTaskCode("ACS20260716001");
return success(respVO);
}
@Override
public CommonResult<AcsApplyActionRespVO> doHandleRequestEnter(TaskStatusCallApiReqDTO taskStatusCallApiReqDTO) {
// 构建外层VO
AcsApplyActionRespVO respVO = new AcsApplyActionRespVO();
respVO.setTaskId(10001L);
respVO.setTaskCode("ACS20260716001");
return success(respVO);
}
}
//package cn.code.nl.module.lms.demo;
//
//import cn.code.nl.framework.common.pojo.CommonResult;
//import cn.code.nl.framework.execute.biz.api.lms.LmsTaskCommonApi;
//import cn.code.nl.framework.execute.biz.dto.TaskStatusCallApiReqDTO;
//import cn.code.nl.framework.execute.biz.vo.AcsApplyActionRespVO;
//import com.alibaba.fastjson.JSON;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.RestController;
//
//import static cn.code.nl.framework.common.pojo.CommonResult.success;
//
///**
// *
// * @Author: liyongde
// * @Date: 2026/7/15 15:25
// */
//@RestController // 提供 RESTful API 接口,给 Feign 调用
//@Validated
//public class DemoApi implements LmsTaskCommonApi {
// @Override
// public CommonResult<AcsApplyActionRespVO> doHandlePicked(TaskStatusCallApiReqDTO taskStatusCallApiReqDTO) {
// // 构建外层VO
// AcsApplyActionRespVO respVO = new AcsApplyActionRespVO();
// respVO.setTaskId(10001L);
// respVO.setTaskCode("ACS20260716001");
// // 内层data赋值 "success"
// return success(respVO);
// }
//
// @Override
// public CommonResult<AcsApplyActionRespVO> doHandleApplyAgain(TaskStatusCallApiReqDTO taskStatusCallApiReqDTO) {
// DemoRespVO demoRespVO = new DemoRespVO();
// demoRespVO.setTargetPoint("A_10001");
//
// // 构建外层VO
// AcsApplyActionRespVO respVO = new AcsApplyActionRespVO();
// respVO.setTaskId(10001L);
// respVO.setTaskCode("ACS20260716001");
// // 内层data赋值 "success"
// respVO.setData(JSON.parseObject(JSON.toJSONString(demoRespVO)));
// return success(respVO);
// }
//
// @Override
// public CommonResult<AcsApplyActionRespVO> doHandleRequestRelease(TaskStatusCallApiReqDTO taskStatusCallApiReqDTO) {
// // 构建外层VO
// AcsApplyActionRespVO respVO = new AcsApplyActionRespVO();
// respVO.setTaskId(10001L);
// respVO.setTaskCode("ACS20260716001");
// return success(respVO);
// }
//
// @Override
// public CommonResult<AcsApplyActionRespVO> doHandleRequestPick(TaskStatusCallApiReqDTO taskStatusCallApiReqDTO) {
// // 构建外层VO
// AcsApplyActionRespVO respVO = new AcsApplyActionRespVO();
// respVO.setTaskId(10001L);
// respVO.setTaskCode("ACS20260716001");
// return success(respVO);
// }
//
// @Override
// public CommonResult<AcsApplyActionRespVO> doHandleRequestLeave(TaskStatusCallApiReqDTO taskStatusCallApiReqDTO) {
// // 构建外层VO
// AcsApplyActionRespVO respVO = new AcsApplyActionRespVO();
// respVO.setTaskId(10001L);
// respVO.setTaskCode("ACS20260716001");
// return success(respVO);
// }
//
// @Override
// public CommonResult<AcsApplyActionRespVO> doHandleRequestEnter(TaskStatusCallApiReqDTO taskStatusCallApiReqDTO) {
// // 构建外层VO
// AcsApplyActionRespVO respVO = new AcsApplyActionRespVO();
// respVO.setTaskId(10001L);
// respVO.setTaskCode("ACS20260716001");
// return success(respVO);
// }
//}

View File

@@ -0,0 +1,6 @@
/**
*
* @Author: liyongde
* @Date: 2026/7/23 14:41
*/
package cn.code.nl.module.lms.manage;