From 471333777a1da01b127e7bb8c57d5cac698af31e Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Mon, 15 Jul 2024 16:23:43 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E5=A7=94=E5=A4=96=E5=8A=A0=E5=B7=A5=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A7=94=E5=A4=96=E5=85=A5=E5=BA=93=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=8D=95=E7=9A=84=E5=90=8E=E7=AB=AF=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/OutsourceStorageOrderServiceImpl.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceStorageOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceStorageOrderServiceImpl.java index 10cbac74..13c360da 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceStorageOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceStorageOrderServiceImpl.java @@ -1,7 +1,10 @@ package com.ruoyi.system.service.impl; import java.util.List; + +import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.system.service.IOutsourceStorageOrderService; import com.ruoyi.warehouse.domain.WarehouseStorageOrder; import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail; @@ -28,6 +31,8 @@ public class OutsourceStorageOrderServiceImpl implements IOutsourceStorageOrderS @Autowired private WarehouseStorageOrderMapper warehouseStorageOrderMapper; + @Autowired + private RedisCache redisCache; @Override public WarehouseStorageOrder selectWarehouseStorageOrderByWarehouseStorageId(Long warehouseStorageId) { @@ -52,11 +57,13 @@ public class OutsourceStorageOrderServiceImpl implements IOutsourceStorageOrderS @Override public int insertWarehouseStorageOrder(WarehouseStorageOrder warehouseStorageOrder) { + String loginName = ShiroUtils.getLoginName(); warehouseStorageOrder.setCreateTime(DateUtils.getNowDate()); warehouseStorageOrder.setWarehouseOrderType("3"); warehouseStorageOrder.setWarehouseStorageType("4"); - warehouseStorageOrder.setWarehouseStorageCode("RK20231102002"); - warehouseStorageOrder.setCreateBy("张三"); + String warehouseStorageCode = redisCache.generateBillNo("RK"); + warehouseStorageOrder.setWarehouseStorageCode(warehouseStorageCode); + warehouseStorageOrder.setCreateBy(loginName); int rows = warehouseStorageOrderMapper.insertWarehouseStorageOrder(warehouseStorageOrder); insertWarehouseStorageOrderDetail(warehouseStorageOrder); return rows;