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;