From cc0635fdc45d9b0e9396f76ed4074bdb1d81f9d3 Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期二, 11 十一月 2025 11:07:19 +0800
Subject: [PATCH] yys  优化仓储物流模块

---
 src/main/java/com/ruoyi/staff/service/impl/StaffOnJobServiceImpl.java |   48 +++++++++++++++++++++++++++++++++---------------
 1 files changed, 33 insertions(+), 15 deletions(-)

diff --git a/src/main/java/com/ruoyi/staff/service/impl/StaffOnJobServiceImpl.java b/src/main/java/com/ruoyi/staff/service/impl/StaffOnJobServiceImpl.java
index 3a331d2..890a547 100644
--- a/src/main/java/com/ruoyi/staff/service/impl/StaffOnJobServiceImpl.java
+++ b/src/main/java/com/ruoyi/staff/service/impl/StaffOnJobServiceImpl.java
@@ -19,6 +19,7 @@
 import lombok.AllArgsConstructor;
 
 import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -82,11 +83,12 @@
         }
     }
 
+
     @Override
     public String exportCopy(HttpServletResponse response, StaffOnJob staffOnJob) throws Exception {
-        String url = "D:\\files\\寮犱笁-鍔冲姩鍚堝悓2024.docx";
+        String url = "/javaWork/product-inventory-management/file/prod/" + staffOnJob.getStaffName() + "-鍔冲姩鍚堝悓涔�.docx";
         Configuration cfg = new Configuration(Configuration.VERSION_2_3_32);
-        // 璁剧疆妯℃澘鏂囦欢鎵�鍦ㄧ洰褰曪紙缁濆璺緞锛屼緥濡傦細D:/templates/锛�
+        // 璁剧疆妯℃澘鏂囦欢鎵�鍦ㄧ洰褰曪紙缁濆璺緞锛屼緥濡傦細/templates/锛�
         cfg.setClassForTemplateLoading(StaffOnJobServiceImpl.class, "/static");
         cfg.setDefaultEncoding("UTF-8");
         //2.瀹氫箟闇�瑕佸~鍏呯殑鍙橀噷
@@ -109,24 +111,40 @@
         LocalDate localDate3 = staff.getTrialStartDate().toInstant().atZone(ZoneId.of("Asia/Shanghai")).toLocalDate();
         LocalDate localDate4 = staff.getTrialEndDate().toInstant().atZone(ZoneId.of("Asia/Shanghai")).toLocalDate();
 
-        
         staff.setQyear(localDate2.getYear() + "");
         staff.setQmoth(localDate2.getMonthValue() + "");
         staff.setQday(localDate2.getDayOfMonth() + "");
+        if(staff.getDateSelect().equals("A")){
+            staff.setSyear(localDate1.getYear() + "");
+            staff.setSmoth(localDate1.getMonthValue() + "");
+            staff.setSday(localDate1.getDayOfMonth() + "");
+            staff.setEyear(localDate.getDayOfMonth() + "");
+            staff.setEmoth(localDate.getDayOfMonth() + "");
+            staff.setEday(localDate.getDayOfMonth() + "");
 
-        staff.setSyear(localDate1.getYear() + "");
-        staff.setSmoth(localDate1.getMonthValue() + "");
-        staff.setSday(localDate1.getDayOfMonth() + "");
-        staff.setEyear(localDate.getDayOfMonth() + "");
-        staff.setEmoth(localDate.getDayOfMonth() + "");
-        staff.setEday(localDate.getDayOfMonth() + "");
+            staff.setStyear(localDate3.getYear() + "");
+            staff.setStmoth(localDate3.getMonthValue() + "");
+            staff.setStday(localDate3.getDayOfMonth() + "");
+            staff.setSeyear(localDate4.getYear() + "");
+            staff.setSemoth(localDate4.getMonthValue() + "");
+            staff.setSeday(localDate4.getDayOfMonth() + "");
+        }else if (staff.getDateSelect().equals("B")){
 
-        staff.setStyear(localDate3.getYear() + "");
-        staff.setStmoth(localDate3.getMonthValue() + "");
-        staff.setStday(localDate3.getDayOfMonth() + "");
-        staff.setSeyear(localDate4.getYear() + "");
-        staff.setSemoth(localDate4.getMonthValue() + "");
-        staff.setSeday(localDate4.getDayOfMonth() + "");
+            staff.setBsyear(localDate1.getYear() + "");
+            staff.setBsmoth(localDate1.getMonthValue() + "");
+            staff.setBsday(localDate1.getDayOfMonth() + "");
+
+            staff.setBstyear(localDate3.getYear() + "");
+            staff.setBstmoth(localDate3.getMonthValue() + "");
+            staff.setBstday(localDate3.getDayOfMonth() + "");
+            staff.setBseyear(localDate4.getYear() + "");
+            staff.setBsemoth(localDate4.getMonthValue() + "");
+            staff.setBseday(localDate4.getDayOfMonth() + "");
+        }else if (staff.getDateSelect().equals("C")){
+            staff.setCsyear(localDate1.getYear() + "");
+            staff.setCsmoth(localDate1.getMonthValue() + "");
+            staff.setCsday(localDate1.getDayOfMonth() + "");
+        }
 
         Map<String,Object> data = new HashMap<>();
         data.put("item",staff);

--
Gitblit v1.9.3