Browse Source

feat: [模板管理] 编号修改

master
memorylkf 1 day ago
parent
commit
af92475251
2 changed files with 9 additions and 33 deletions
  1. +9
    -22
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/PublicController.java
  2. +0
    -11
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SnGenController.java

+ 9
- 22
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/PublicController.java View File

@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@ -64,29 +65,15 @@ public class PublicController extends BaseController {
*/
@GetMapping("/getSn")
public AjaxResult getSn(Integer count) {
if (count == null || count.intValue() <= 0) {
return AjaxResult.error("参数错误");
if (count == null || count.intValue() <= 1) {
return AjaxResult.success("操作成功",snGenService.getNewSn());
}else{
List<String> list = new ArrayList<>();
for (int i = 0; i < count;i++){
list.add(snGenService.getNewSn());
}
return AjaxResult.success(list);
}
// Integer start = 1;
// SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
// String today = sdf.format(new Date());
// //获取当前最大编号
// String maxNum = redisService.getCacheObject(today);
// if (StringUtils.isNoneBlank(maxNum)) {
// start = Integer.parseInt(maxNum)+1;
// }
// HashMap<String, Object> map = new HashMap<String, Object>(count);
// for (int i = 0; i < count;i++){
// map.put("sn"+i,today+String.format("%04d", start));
// start++;
// }
// //更新当前最大编号
// redisService.setCacheObject(today,start,60*60*24L, TimeUnit.SECONDS);
HashMap<String, Object> map = new HashMap<String, Object>(count);
for (int i = 0; i < count;i++){
map.put("sn"+i,snGenService.getNewSn());
}
return AjaxResult.success(map);
}
/**

+ 0
- 11
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SnGenController.java View File

@ -25,17 +25,6 @@ public class SnGenController extends BaseController
private ISnGenService snGenService;
/**
* 查询每日编号生成记录列表
*/
@GetMapping("/list")
public TableDataInfo list(SnGen snGen)
{
startPage();
List<SnGen> list = snGenService.queryList(snGen);
return getDataTable(list);
}
/**
* 获取每日编号生成记录详细信息
*/
@GetMapping(value = "/info")

Loading…
Cancel
Save