From e401f50356fbfc3305cd34f832cb1efd9688bcb1 Mon Sep 17 00:00:00 2001 From: cgx <2606784146@qq.com> Date: Tue, 31 Dec 2024 21:46:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/tbDataConf/controller/TbDataConfController.java | 9 +++++++++ .../org/jeecg/modules/alUser/controller/IndexController.java | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/tbDataConf/controller/TbDataConfController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/tbDataConf/controller/TbDataConfController.java index ed8876a..a77a6ff 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/tbDataConf/controller/TbDataConfController.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/tbDataConf/controller/TbDataConfController.java @@ -73,6 +73,15 @@ public class TbDataConfController extends JeecgController add(@RequestBody TbDataConf tbDataConf) { + if (tbDataConf.getType()==null){ + return Result.error("请选择类型!"); + } + if (tbDataConf.getPriceDate()==null){ + return Result.error("请选择日期!"); + } + if (tbDataConf.getPrice()==null){ + return Result.error("请输入价格!"); + } tbDataConfService.save(tbDataConf); return Result.OK("添加成功!"); } diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/alUser/controller/IndexController.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/alUser/controller/IndexController.java index d749909..4f3c563 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/alUser/controller/IndexController.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/alUser/controller/IndexController.java @@ -69,11 +69,11 @@ public class IndexController { - @ApiOperation(value = "铝价接口") + @ApiOperation(value = "新铝价接口") @RequestMapping(value = "/alpriceNew", method = RequestMethod.POST) public Result alpriceNew() { List list = tbDataConfService.list(); - Map> collect = list.stream().sorted(Comparator.comparing(TbDataConf::getType).reversed()).collect(Collectors.groupingBy(TbDataConf::getType)); + Map> collect = list.stream().sorted(Comparator.comparing(TbDataConf::getPriceDate)).collect(Collectors.groupingBy(TbDataConf::getType)); return Result.ok(collect); }