|
|
|
@ -1,5 +1,8 @@
|
|
|
|
package cn.iocoder.yudao.module.erp.controller.admin.autocode;
|
|
|
|
package cn.iocoder.yudao.module.erp.controller.admin.autocode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.erp.controller.admin.autocode.util.AutoCodeUtil;
|
|
|
|
|
|
|
|
import io.swagger.v3.oas.annotations.Parameters;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
@ -102,5 +105,27 @@ public class AutocodeRuleController {
|
|
|
|
public CommonResult<List<AutocodePartDO>> getAutocodePartListByRuleId(@RequestParam("ruleId") Long ruleId) {
|
|
|
|
public CommonResult<List<AutocodePartDO>> getAutocodePartListByRuleId(@RequestParam("ruleId") Long ruleId) {
|
|
|
|
return success(autocodeRuleService.getAutocodePartListByRuleId(ruleId));
|
|
|
|
return success(autocodeRuleService.getAutocodePartListByRuleId(ruleId));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private AutoCodeUtil autoCodeUtil;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "获取一个自动生成的编码")
|
|
|
|
|
|
|
|
@Parameters({
|
|
|
|
|
|
|
|
@Parameter(name = "ruleCode", description = "规则编码", required = true),
|
|
|
|
|
|
|
|
@Parameter(name = "inputCharacter", description = "输入字符", required = false)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
@GetMapping(value = "/getAutoCode")
|
|
|
|
|
|
|
|
public CommonResult<String> getAutoCode(@RequestParam("ruleCode") String ruleCode, String inputCharacter){
|
|
|
|
|
|
|
|
String code = autoCodeUtil.genSerialCode(ruleCode,inputCharacter);
|
|
|
|
|
|
|
|
return CommonResult.success(code);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Operation(summary = "测试自动生成的编码")
|
|
|
|
|
|
|
|
@Parameters({
|
|
|
|
|
|
|
|
@Parameter(name = "ruleCode", description = "规则编码", required = true),
|
|
|
|
|
|
|
|
@Parameter(name = "inputCharacter", description = "输入字符", required = false)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
@GetMapping(value = "/getTestCode")
|
|
|
|
|
|
|
|
public CommonResult<String> getAutoCodeTest(@RequestParam("ruleCode") String ruleCode,String inputCharacter){
|
|
|
|
|
|
|
|
String code = autoCodeUtil.genSerialCodeTest(ruleCode,inputCharacter);
|
|
|
|
|
|
|
|
return CommonResult.success(code);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|