From af9247525106f3e033e9456b74302ed0c168b443 Mon Sep 17 00:00:00 2001 From: memorylkf <312904636@qq.com> Date: Mon, 12 Jan 2026 10:36:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86]?= =?UTF-8?q?=20=E7=BC=96=E5=8F=B7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hxhq/business/controller/PublicController.java | 31 +++++++--------------- .../hxhq/business/controller/SnGenController.java | 11 -------- 2 files changed, 9 insertions(+), 33 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/PublicController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/PublicController.java index 204b7e4..aef4d5d 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/PublicController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/PublicController.java @@ -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 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 map = new HashMap(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 map = new HashMap(count); - for (int i = 0; i < count;i++){ - map.put("sn"+i,snGenService.getNewSn()); - } - return AjaxResult.success(map); } /** diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SnGenController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SnGenController.java index 4040365..501f5ab 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SnGenController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SnGenController.java @@ -25,17 +25,6 @@ public class SnGenController extends BaseController private ISnGenService snGenService; /** - * 查询每日编号生成记录列表 - */ - @GetMapping("/list") - public TableDataInfo list(SnGen snGen) - { - startPage(); - List list = snGenService.queryList(snGen); - return getDataTable(list); - } - - /** * 获取每日编号生成记录详细信息 */ @GetMapping(value = "/info")