From e11484bc3b7a2bafad98ed365ebf33eeeb253c9d Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Mon, 15 Jul 2024 16:20:28 +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=E9=A2=86=E6=96=99=E7=9A=84?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/OutsourceRequisitionServiceImpl.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceRequisitionServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceRequisitionServiceImpl.java index acd04a8c..921a431a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceRequisitionServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceRequisitionServiceImpl.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.domain.OutsourceRequisition; import com.ruoyi.system.domain.OutsourceRequisitionDetail; import com.ruoyi.system.mapper.OutsourceRequisitionMapper; @@ -26,6 +29,9 @@ public class OutsourceRequisitionServiceImpl implements IOutsourceRequisitionSer @Autowired private OutsourceRequisitionMapper outsourceRequisitionMapper; + @Autowired + private RedisCache redisCache; + /** * 查询委外领料 * @@ -60,11 +66,14 @@ public class OutsourceRequisitionServiceImpl implements IOutsourceRequisitionSer @Override public int insertOutsourceRequisition(OutsourceRequisition outsourceRequisition) { + String loginName = ShiroUtils.getLoginName(); + outsourceRequisition.setCreateBy(loginName); outsourceRequisition.setCreateTime(DateUtils.getNowDate()); outsourceRequisition.setAuditStatus("0"); outsourceRequisition.setRequisitionStatus("0"); - outsourceRequisition.setOutsourceRequisitionNo("WWLL20231103003"); - outsourceRequisition.setRequisitionPerson("张三"); + String outsourceRequisitionNo = redisCache.generateBillNo("WWLL"); + outsourceRequisition.setRequisitionPerson(loginName); + outsourceRequisition.setOutsourceRequisitionNo(outsourceRequisitionNo); int rows = outsourceRequisitionMapper.insertOutsourceRequisition(outsourceRequisition); insertOutsourceRequisitionDetail(outsourceRequisition); return rows;