From 75b7a414ef821a07426790cb79c37811ae2f07ac Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期二, 27 一月 2026 10:42:20 +0800
Subject: [PATCH] 浪潮对接单点登录:mis管理系统配置修改
---
src/main/java/com/ruoyi/staff/service/impl/StaffOnJobServiceImpl.java | 96 ------------------------------------------------
1 files changed, 0 insertions(+), 96 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 890a547..9fc8c43 100644
--- a/src/main/java/com/ruoyi/staff/service/impl/StaffOnJobServiceImpl.java
+++ b/src/main/java/com/ruoyi/staff/service/impl/StaffOnJobServiceImpl.java
@@ -6,34 +6,19 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.dto.WordDateDto;
import com.ruoyi.staff.mapper.StaffJoinLeaveRecordMapper;
import com.ruoyi.staff.mapper.StaffOnJobMapper;
import com.ruoyi.staff.pojo.StaffJoinLeaveRecord;
import com.ruoyi.staff.pojo.StaffOnJob;
import com.ruoyi.staff.service.IStaffJoinLeaveRecordService;
import com.ruoyi.staff.service.IStaffOnJobService;
-import freemarker.template.Configuration;
-import freemarker.template.Template;
-import freemarker.template.TemplateException;
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;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
-import java.io.*;
-import java.math.BigDecimal;
-import java.nio.charset.StandardCharsets;
-import java.time.Instant;
-import java.time.LocalDate;
-import java.time.ZoneId;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
@AllArgsConstructor
@Service
@@ -82,87 +67,6 @@
return false;
}
}
-
-
- @Override
- public String exportCopy(HttpServletResponse response, StaffOnJob staffOnJob) throws Exception {
- String url = "/javaWork/product-inventory-management/file/prod/" + staffOnJob.getStaffName() + "-鍔冲姩鍚堝悓涔�.docx";
- Configuration cfg = new Configuration(Configuration.VERSION_2_3_32);
- // 璁剧疆妯℃澘鏂囦欢鎵�鍦ㄧ洰褰曪紙缁濆璺緞锛屼緥濡傦細/templates/锛�
- cfg.setClassForTemplateLoading(StaffOnJobServiceImpl.class, "/static");
- cfg.setDefaultEncoding("UTF-8");
- //2.瀹氫箟闇�瑕佸~鍏呯殑鍙橀噷
- // 鈶� 鏋勯�犲憳宸ヤ俊鎭紙瀹為檯椤圭洰涓彲浠庢暟鎹簱/Excel璇诲彇锛�
- WordDateDto staff = new WordDateDto();
- BeanUtils.copyProperties(staffOnJob, staff);
- // 閫氳繃鍚堝悓骞撮檺锛屽悎鍚屽埌鏈熸棩鏈熻绠楀悎鍚屽紑濮嬫棩鏈燂紝鍦ㄨ幏鍙栧紑濮嬫棩鏈燂紝缁撴潫鏃ユ湡鐨勫勾鏈堟棩鏁板瓧
- // 鍚堝悓鍒版湡鏃ユ湡 - 鍚堝悓骞撮檺锛圖ate绫诲瀷锛�
- // 1. 灏咲ate杞崲涓篒nstant锛堟椂闂存埑锛�
- Instant instant = staff.getContractExpireTime().toInstant();
-
- // 涔熷彲浠ユ寚瀹氬叿浣撴椂鍖猴紝渚嬪Asia/Shanghai锛�
- LocalDate localDate = instant.atZone(ZoneId.of("Asia/Shanghai")).toLocalDate(); // 鍚堝悓缁撴潫鏃堕棿
- LocalDate localDate1 = localDate.minusYears(Integer.parseInt(staff.getContractTerm()));// 鍚堝悓寮�濮嬫椂闂�
-
- // 绛捐鏃ユ湡杞崲lcoaldate
- LocalDate localDate2 = staff.getSignDate().toInstant().atZone(ZoneId.of("Asia/Shanghai")).toLocalDate();
-
- // 璇曠敤鏃ユ湡杞崲lcoaldate
- 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.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.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);
- //3.鍔犺浇XML 妯℃澘
- Template template = cfg.getTemplate("鍔冲姩鍚堝悓涔�.xml");
- //4.鐢熸垚濉厖鍚庣殑 XML 鍐呭
- StringWriter out = new StringWriter();
- template.process(data, out);
- String filledXml = out.toString();
- //5.灏哫ML鍐呭鍐欏叆浜や欢骞舵敼涓�.docx 鏍煎紡
- File outputFile = new File(url);
- try(FileOutputStream fos = new FileOutputStream(outputFile);
- OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8)) {
- osw.write(filledXml);
- }
- return url;
- }
-
}
--
Gitblit v1.9.3