Merge remote-tracking branch 'origin/feature/20260713/task-module'
# Conflicts: # nl-module-lms/nl-module-lms-server/pom.xml
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package cn.code.nl.module.base.api;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||
import cn.code.nl.module.base.api.classstandard.ClassStandardApi;
|
||||
import cn.code.nl.module.base.dal.dataobject.classstandard.ClassStandardDO;
|
||||
import cn.code.nl.module.base.service.classstandard.ClassStandardService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.code.nl.framework.common.pojo.CommonResult.success;
|
||||
import static cn.code.nl.framework.common.util.collection.CollectionUtils.convertList;
|
||||
|
||||
/**
|
||||
* RPC API - 基础数据分类标准(供其它模块 Feign 调用)
|
||||
*
|
||||
* @author zhouz
|
||||
*/
|
||||
@Tag(name = "RPC API - 基础数据分类标准")
|
||||
@RestController
|
||||
@RequestMapping("/rpc-api/base/class-standard")
|
||||
@Validated
|
||||
public class ClassStandardApiController implements ClassStandardApi {
|
||||
|
||||
@Resource
|
||||
private ClassStandardService classStandardService;
|
||||
|
||||
/**
|
||||
* 根据分类编码获取该分类及所有子分类编码
|
||||
*/
|
||||
@GetMapping("/code-list-by-code")
|
||||
@Operation(summary = "根据分类编码获取该分类及所有子分类编码")
|
||||
@Override
|
||||
public CommonResult<List<String>> getClassStandardCodeListByCode(@RequestParam("classCode") String classCode) {
|
||||
List<ClassStandardDO> list = classStandardService.getClassStandardListByCode(classCode);
|
||||
return success(convertList(list, ClassStandardDO::getClassCode));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.code.nl.module.base.controller.api;
|
||||
package cn.code.nl.module.base.api;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||
import cn.code.nl.module.base.api.codegen.CodeGenApi;
|
||||
import cn.code.nl.module.base.api.codegen.dto.CodeGenerateReqDTO;
|
||||
import cn.code.nl.module.base.service.codegen.CodeGenService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@@ -26,7 +27,7 @@ import static cn.code.nl.framework.common.pojo.CommonResult.success;
|
||||
@RestController
|
||||
@RequestMapping("/rpc-api/base/code-gen")
|
||||
@Validated
|
||||
public class CodeGenController {
|
||||
public class CodeGenController implements CodeGenApi {
|
||||
|
||||
@Resource
|
||||
private CodeGenService codeGenService;
|
||||
@@ -36,6 +37,7 @@ public class CodeGenController {
|
||||
*/
|
||||
@PostMapping("/generate")
|
||||
@Operation(summary = "生成编码")
|
||||
@Override
|
||||
public CommonResult<String> generate(@Valid @RequestBody CodeGenerateReqDTO reqDTO) {
|
||||
String code = codeGenService.generate(reqDTO.getRuleCode());
|
||||
return success(code);
|
||||
@@ -43,9 +45,9 @@ public class CodeGenController {
|
||||
|
||||
@GetMapping("/preview")
|
||||
@Operation(summary = "预览下一个编码(不消耗序号)")
|
||||
@Override
|
||||
public CommonResult<String> preview(@RequestParam("ruleCode") String ruleCode) {
|
||||
String code = codeGenService.preview(ruleCode);
|
||||
return success(code);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,6 +15,9 @@ public class ClassStandardSimpleRespVO {
|
||||
@Schema(description = "分类标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long classId;
|
||||
|
||||
@Schema(description = "分类编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "原材料")
|
||||
private String classCode;
|
||||
|
||||
@Schema(description = "分类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "原材料")
|
||||
private String className;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package cn.code.nl.module.base.dal.mysql.codegen;
|
||||
|
||||
import cn.code.nl.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.code.nl.module.base.dal.dataobject.codegen.CodeSequenceDO;
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -35,6 +36,7 @@ public interface CodeSequenceMapper extends BaseMapperX<CodeSequenceDO> {
|
||||
* @param maxValue 最大值上限
|
||||
* @return 更新行数
|
||||
*/
|
||||
@InterceptorIgnore(dataPermission = "true")
|
||||
int updateCurrentValueBySegment(@Param("ruleId") Long ruleId,
|
||||
@Param("resetKey") String resetKey,
|
||||
@Param("step") int step,
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: http://192.168.81.193:8848 # Nacos 服务器地址
|
||||
server-addr: 192.168.81.193:8848 # Nacos 服务器地址
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery: # 【配置中心】配置项
|
||||
namespace: dev # 命名空间。这里使用 dev 开发环境
|
||||
namespace: 91c8ac41-7fb0-423b-947e-2caad4c87d41 # 命名空间。这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
metadata:
|
||||
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||
config: # 【注册中心】配置项
|
||||
namespace: dev # 命名空间。这里使用 dev 开发环境
|
||||
namespace: 91c8ac41-7fb0-423b-947e-2caad4c87d41 # 命名空间。这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
|
||||
--- #################### 数据库相关配置 ####################
|
||||
@@ -57,14 +57,14 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://192.168.81.193:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||
url: jdbc:mysql://127.0.0.1:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||
username: root
|
||||
password: root123
|
||||
password: root
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:mysql://192.168.81.193:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||
url: jdbc:mysql://127.0.0.1:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||
username: root
|
||||
password: root123
|
||||
password: root
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
data:
|
||||
@@ -95,11 +95,11 @@ spring:
|
||||
xxl:
|
||||
job:
|
||||
admin:
|
||||
addresses: http://localhost:8080/xxl-job-admin # 调度中心部署跟地址
|
||||
accessToken: 123456 # 执行器通讯TOKEN
|
||||
addresses: http://192.168.81.193:8080/xxl-job-admin # 调度中心部署跟地址
|
||||
accessToken: default_token # 执行器通讯TOKEN
|
||||
executor:
|
||||
ip: localhost
|
||||
port: 9993
|
||||
ip: 192.168.81.193
|
||||
port: 8993
|
||||
|
||||
--- #################### 服务保障相关配置 ####################
|
||||
|
||||
|
||||
@@ -59,12 +59,12 @@ spring:
|
||||
master:
|
||||
url: jdbc:mysql://192.168.81.193:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||
username: root
|
||||
password: root123
|
||||
password: root
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:mysql://192.168.81.193:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||
username: root
|
||||
password: root123
|
||||
password: root
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
data:
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
VALUES (#{ruleId}, #{resetKey}, #{startAt} + #{step} - 1, #{maxValue})
|
||||
ON DUPLICATE KEY UPDATE
|
||||
current_value = current_value + #{step},
|
||||
max_value = #{maxValue}
|
||||
max_value = #{maxValue},
|
||||
deleted = 0
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user