cuijian
2023-08-29 a81b9fc7dc055874d501becd1862b4ff581c0d4a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package org.jeecg.modules.eam.controller;
 
import io.swagger.annotations.Api;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.eam.service.IdentityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
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;
 
@RestController
@RequestMapping("/eam/sysIdentity")
@Api(value = "单号生成器 前端控制器")
public class IdentityController {
  @Autowired
  @Lazy
  private IdentityService sysIdentityService;
  // 新增
  @GetMapping("/getNumNew")
  public Result<?> getNum(@RequestParam(name="type",required = true)String type,
                          @RequestParam(name="length",defaultValue = "4")Integer length) {
    String serialNum = sysIdentityService.getNumByTypeAndLength(type, length);
    return Result.ok(serialNum);
  }
}