From 781a7d6db3a4592cb04081fba43e033c95e01802 Mon Sep 17 00:00:00 2001 From: Gitea Date: Wed, 17 May 2023 17:49:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=BC=96=E5=8F=B7=E8=A7=84?= =?UTF-8?q?=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ZyOrdersController.java | 13 +++++-------- .../service/impl/ZyOrdersServiceImpl.java | 18 ++++++++++-------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/controller/ZyOrdersController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/controller/ZyOrdersController.java index 7f10c6ea..8bf3841e 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/controller/ZyOrdersController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/controller/ZyOrdersController.java @@ -129,7 +129,8 @@ public class ZyOrdersController extends JeecgController list = zyOrdersService.list(); + List collect = list.stream().map(ZyOrders::getOrdersNum).collect(Collectors.toList()); + String OrdersNum = String.format("%018d", zyClothsTypeService.getListMax(collect, 18)); return OrdersNum; } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java index b1f0a47b..b592a03f 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java @@ -2,6 +2,7 @@ package org.jeecg.modules.demo.zyorders.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.jeecg.common.util.CommonUtils; +import org.jeecg.modules.demo.base.service.IZyClothsTypeService; import org.jeecg.modules.demo.customerinvoice.entity.CustomerInvoice; import org.jeecg.modules.demo.customerinvoice.mapper.CustomerInvoiceMapper; import org.jeecg.modules.demo.customerreceivingaddress.entity.CustomerReceivingAddress; @@ -40,6 +41,7 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; +import java.util.stream.Collectors; /** * @Description: 订单基本信息管理 @@ -97,6 +99,11 @@ public class ZyOrdersServiceImpl extends ServiceImpl i @Autowired private ZySpeechMessageMapper zySpeechMessageMapper; + @Autowired + private IZyOrdersService zyOrdersService; + + @Autowired + private IZyClothsTypeService zyClothsTypeService; /** * 大屏数据-获取订单的状态 @@ -341,14 +348,9 @@ public class ZyOrdersServiceImpl extends ServiceImpl i * @return */ public String getOrdersNum() { - String mrstr = "000000000000000000"; - QueryWrapper qw = new QueryWrapper(); - int listsize = baseMapper.selectCount(qw); - int strsize = listsize + 1; - String str = strsize + ""; - int strlength = str.length(); - String substr = mrstr.substring(0, mrstr.length() - strlength); - String OrdersNum = substr + str; + List list = zyOrdersService.list(); + List collect = list.stream().map(ZyOrders::getOrdersNum).collect(Collectors.toList()); + String OrdersNum = String.format("%018d", zyClothsTypeService.getListMax(collect, 18)); return OrdersNum; }