From 894776036e6a8686c81a0db4f6acedd9dae3c566 Mon Sep 17 00:00:00 2001 From: Gitea Date: Thu, 18 May 2023 11:28:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E5=92=8C=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E7=BC=96=E5=8F=B7=E8=A7=84=E5=88=99bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WorkOrderServiceImpl.java | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/impl/WorkOrderServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/impl/WorkOrderServiceImpl.java index 077270eb..b1728939 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/impl/WorkOrderServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/impl/WorkOrderServiceImpl.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.jeecg.common.api.vo.Result; import org.jeecg.common.util.CommonUtils; import org.jeecg.modules.demo.base.mapper.ZyProcessMapper; +import org.jeecg.modules.demo.base.service.IZyClothsTypeService; import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure; import org.jeecg.modules.demo.customermeasure.mapper.CustomerMeasureMapper; import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; @@ -71,6 +72,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; /** * @Description: 工单订单完工 @@ -184,6 +186,11 @@ public class WorkOrderServiceImpl extends ServiceImpl query = new QueryWrapper(); - int listsize = baseMapper.selectList(query).size(); - int strsize = listsize+1; - String str = strsize+""; - int strlength = str.length(); - String substr = mrstr.substring(0,mrstr.length()-strlength); - String workCode = styleCode+modelCode+substr+str; + List list = workOrderService.list(); + List collect = list.stream().map(WorkOrder::getProductCode).collect(Collectors.toList()); + String OrdersNum = String.format("%08d", zyClothsTypeService.getListMax(collect, 8)); + String workCode = styleCode+modelCode+OrdersNum; return workCode; } @@ -624,16 +627,14 @@ public class WorkOrderServiceImpl extends ServiceImpl query = new QueryWrapper(); - int listsize = productMapper.selectList(query).size(); - int strsize = listsize+1; - String str = strsize+""; - int strlength = str.length(); - String substr = mrstr.substring(0,mrstr.length()-strlength); - String produceCode = workCode+substr+str; + query.eq("work_order_id",workId); + List list = productMapper.selectList(query); + List collect = list.stream().map(ZyProduct::getProductCode).collect(Collectors.toList()); + String OrdersNum = String.format("%08d", zyClothsTypeService.getListMax(collect, 8)); + String produceCode = workCode+OrdersNum; return produceCode; }