From 6c432b3570649596c0fe7117cd5284dce19060cf Mon Sep 17 00:00:00 2001
From: sinake <sinake1@qq.com>
Date: 星期三, 22 四月 2026 18:25:15 +0800
Subject: [PATCH] 查询供者转运登记附件

---
 ruoyi-project/src/main/java/com/ruoyi/project/service/impl/BaseOnlyvalueServiceImpl.java |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/BaseOnlyvalueServiceImpl.java b/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/BaseOnlyvalueServiceImpl.java
index a87095f..56c77ad 100644
--- a/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/BaseOnlyvalueServiceImpl.java
+++ b/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/BaseOnlyvalueServiceImpl.java
@@ -8,10 +8,12 @@
 import com.ruoyi.project.domain.BaseOnlyvalue;
 import com.ruoyi.project.mapper.BaseOnlyvalueMapper;
 import com.ruoyi.project.service.IBaseOnlyvalueService;
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
+import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.util.List;
 
@@ -101,4 +103,39 @@
 
     }
 
+    /**
+     * 鑾峰彇搴忓垪鍙�
+     *
+     * @param businessType
+     * @return
+     */
+    @Override
+    public String getSequence(String businessType, String orgId) {
+        LocalDate currentDate = LocalDate.now();
+        int year = currentDate.getYear();
+        String month = currentDate.getMonthValue()+"";
+        if(month.length()==1)
+            month="0"+month;
+        if(ObjectUtils.isEmpty(orgId)){
+            orgId="";
+        }
+        //閫氳繃骞存湀鏃ユ湡鍘绘煡璇㈣鏈堜唤鏄惁瀛樺湪
+        String data =year + month+orgId;
+        BaseOnlyvalue baseOnlyvalue = new BaseOnlyvalue();
+        baseOnlyvalue.setBusinesstype(businessType);
+
+        List<BaseOnlyvalue> baseOnlyvalues = queryList(baseOnlyvalue);
+        if(baseOnlyvalues.size()==0){
+            baseOnlyvalue.setAppentvalue(businessType);
+            baseOnlyvalue.setCurrentvalue(1L);
+            baseOnlyvalue.setBusinesstype(businessType);
+            save(baseOnlyvalue);
+        }else {
+            baseOnlyvalue= baseOnlyvalues.get(0);
+            baseOnlyvalue.setCurrentvalue(baseOnlyvalue.getCurrentvalue()+1);
+            updateById(baseOnlyvalue);
+        }
+        return baseOnlyvalue.getAppentvalue() + data + baseOnlyvalue.getCurrentvalue();
+    }
+
 }

--
Gitblit v1.9.3