Просмотр исходного кода

用户更新一级造价师信息

徐滕 2 недель назад
Родитель
Сommit
eaa51a1ac2
16 измененных файлов с 922 добавлено и 55 удалено
  1. 66 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectSignatureOldMessageDisposeController.java
  2. 64 3
      src/main/java/com/jeeplus/modules/workcalendar/service/WorkCalendarTaskService.java
  3. 9 3
      src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java
  4. 7 0
      src/main/java/com/jeeplus/modules/workstaff/dao/WorkStaffBasicInfoDao.java
  5. 6 0
      src/main/java/com/jeeplus/modules/workstaff/dao/WorkStaffCertificateDao.java
  6. 30 3
      src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffCertificate.java
  7. 60 14
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffBasicInfoService.java
  8. 352 23
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffCertificateService.java
  9. 180 0
      src/main/java/com/jeeplus/modules/workstaff/utils/PdfSignUtil.java
  10. BIN
      src/main/java/com/jeeplus/modules/workstaff/utils/font.ttf
  11. 19 5
      src/main/java/com/jeeplus/modules/workstaff/web/WorkStaffBasicInfoController.java
  12. 8 1
      src/main/resources/mappings/modules/workstaff/WorkStaffBasicInfoDao.xml
  13. 32 0
      src/main/resources/mappings/modules/workstaff/WorkStaffCertificateDao.xml
  14. 20 0
      src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailAudit.jsp
  15. 67 3
      src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailModify.jsp
  16. 2 0
      src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoForm.jsp

+ 66 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectSignatureOldMessageDisposeController.java

@@ -42,7 +42,9 @@ import com.jeeplus.modules.workinvoice.service.WorkInvoiceService;
 import com.jeeplus.modules.workinvoice.utils.HttpPostJsonUtil;
 import com.jeeplus.modules.workinvoice.utils.HttpPostJsonUtil;
 import com.jeeplus.modules.workinvoice.utils.OMSNationUtil;
 import com.jeeplus.modules.workinvoice.utils.OMSNationUtil;
 import com.jeeplus.modules.workreimbursement.service.WorkReimbursementService;
 import com.jeeplus.modules.workreimbursement.service.WorkReimbursementService;
+import com.jeeplus.modules.workstaff.entity.WorkStaffCertificate;
 import com.jeeplus.modules.workstaff.service.WorkStaffBasicInfoService;
 import com.jeeplus.modules.workstaff.service.WorkStaffBasicInfoService;
+import com.jeeplus.modules.workstaff.service.WorkStaffCertificateService;
 import freemarker.template.Configuration;
 import freemarker.template.Configuration;
 import freemarker.template.Template;
 import freemarker.template.Template;
 import org.activiti.engine.HistoryService;
 import org.activiti.engine.HistoryService;
@@ -68,6 +70,8 @@ import java.io.File;
 import java.io.FileWriter;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 import java.nio.charset.StandardCharsets;
+import java.time.LocalDate;
+import java.time.ZoneId;
 import java.util.*;
 import java.util.*;
 
 
 /**
 /**
@@ -125,6 +129,9 @@ public class RuralProjectSignatureOldMessageDisposeController extends BaseContro
     @Autowired
     @Autowired
     private OMSDisposeService omsDisposeService;
     private OMSDisposeService omsDisposeService;
 
 
+    @Autowired
+    private WorkStaffCertificateService workStaffCertificateService;
+
     private static final String HTTPTOP = Global.getConfig("signature_http_top");
     private static final String HTTPTOP = Global.getConfig("signature_http_top");
 
 
     private final static String apptoken = Global.getConfig("apptoken");
     private final static String apptoken = Global.getConfig("apptoken");
@@ -1204,4 +1211,63 @@ public class RuralProjectSignatureOldMessageDisposeController extends BaseContro
         return map;
         return map;
     }
     }
 
 
+
+    /**
+     * 报表处理
+     * @return
+     */
+    @RequestMapping(value = "/disposeCertificateValidityPeriodReminder", method = RequestMethod.GET)
+    @ResponseBody
+    @Transactional(readOnly = false)
+    public void disposeCertificateValidityPeriodReminder() {
+        logger.info("-----------一级造价师人员证书过期通知操作定时任务开始------------------");
+        //查询一级造价师的信息
+        List<WorkStaffCertificate> firstCostEngineerList = workStaffCertificateService.getFirstCostEngineerList();
+        for (WorkStaffCertificate workStaffCertificate : firstCostEngineerList) {
+            if(null != workStaffCertificate.getValidEndDate()){
+                //如果有使用有效期,则让其进行和当前时间进行判定,提前7天进行提醒
+                // 获取结束时间(数据库取出来的 Date)
+                Date validEndDate = workStaffCertificate.getValidEndDate();
+
+                // 1. 把 Date 转成 LocalDate(只看日期,不看时分秒,最准确)
+                LocalDate endDate = validEndDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
+                LocalDate nowDate = LocalDate.now(); // 当前日期
+
+                // 2. 计算相差天数(正数:还剩多少天;负数:已过期多少天)
+                long days = java.time.temporal.ChronoUnit.DAYS.between(nowDate, endDate);
+                if(days>=0){
+                    if(days<=7){
+                        workStaffBasicInfoService.completeFirstCostEngineer(workStaffCertificate.getStaffId(),"您的一级造价师的使用有效期即将到期 ", days);
+                    }
+                }else{
+                    workStaffBasicInfoService.completeFirstCostEngineer(workStaffCertificate.getStaffId(),"您的一级造价师的使用有效期已过期 ", days);
+                }
+            }else if(null != workStaffCertificate.getEndDate()){
+                //如果有效期快到期或者已到期,则提前15天进行提醒
+                // 获取结束时间(数据库取出来的 Date)
+                Date endDate = workStaffCertificate.getEndDate();
+
+                // 1. 把 Date 转成 LocalDate(只看日期,不看时分秒,最准确)
+                LocalDate endDateL = endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
+                LocalDate nowDate = LocalDate.now(); // 当前日期
+
+                // 2. 计算相差天数(正数:还剩多少天;负数:已过期多少天)
+                long days = java.time.temporal.ChronoUnit.DAYS.between(nowDate, endDateL);
+                if(days>=0){
+                    if(days <= 15){
+                        workStaffBasicInfoService.completeFirstCostEngineer(workStaffCertificate.getStaffId(),"您的一级造价师的有效期即将到期 ", days);
+                    }
+                }else{
+                    workStaffBasicInfoService.completeFirstCostEngineer(workStaffCertificate.getStaffId(),"您的一级造价师的有效期已过期 ", days);
+                }
+            }else if(null == workStaffCertificate.getEndDate() && null == workStaffCertificate.getValidEndDate()){
+                //如果没有使用有效期或有效期,则直接进行提醒
+                workStaffBasicInfoService.completeFirstCostEngineer(workStaffCertificate.getStaffId(),"您的一级造价师证书信息不全,请及时补充完整。",null);
+            }
+
+        }
+
+        logger.info("-----------一级造价师人员证书过期通知操作定时任务结束------------------");
+    }
+
 }
 }

+ 64 - 3
src/main/java/com/jeeplus/modules/workcalendar/service/WorkCalendarTaskService.java

@@ -12,13 +12,14 @@ import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.service.UserService;
 import com.jeeplus.modules.sys.service.UserService;
 import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.workcalendar.entity.WorkCalendar;
 import com.jeeplus.modules.workcalendar.entity.WorkCalendar;
-import com.jeeplus.modules.workinvoice.entity.WorkInvoice;
 import com.jeeplus.modules.workinvoice.service.OMS.InvoiceDownloadService;
 import com.jeeplus.modules.workinvoice.service.OMS.InvoiceDownloadService;
 import com.jeeplus.modules.workinvoice.service.OMS.RedInvoiceDownloadService;
 import com.jeeplus.modules.workinvoice.service.OMS.RedInvoiceDownloadService;
 import com.jeeplus.modules.workinvoice.service.OMS.RedInvoiceRetryScheduledService;
 import com.jeeplus.modules.workinvoice.service.OMS.RedInvoiceRetryScheduledService;
 import com.jeeplus.modules.workinvoice.service.OMS.RedInvoiceScheduledService;
 import com.jeeplus.modules.workinvoice.service.OMS.RedInvoiceScheduledService;
 import com.jeeplus.modules.workinvoice.service.WorkInvoiceService;
 import com.jeeplus.modules.workinvoice.service.WorkInvoiceService;
+import com.jeeplus.modules.workstaff.entity.WorkStaffCertificate;
 import com.jeeplus.modules.workstaff.service.WorkStaffBasicInfoService;
 import com.jeeplus.modules.workstaff.service.WorkStaffBasicInfoService;
+import com.jeeplus.modules.workstaff.service.WorkStaffCertificateService;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -28,8 +29,8 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
 import java.io.File;
 import java.io.File;
-import java.time.LocalDateTime;
-import java.time.temporal.ChronoUnit;
+import java.time.LocalDate;
+import java.time.ZoneId;
 import java.util.Calendar;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
@@ -77,6 +78,9 @@ public class WorkCalendarTaskService  {
     @Autowired
     @Autowired
     private RedInvoiceRetryScheduledService redInvoiceRetryScheduledService;
     private RedInvoiceRetryScheduledService redInvoiceRetryScheduledService;
 
 
+    @Autowired
+    private WorkStaffCertificateService workStaffCertificateService;
+
     //@Scheduled(cron= "0 0/1 * * * ?")
     //@Scheduled(cron= "0 0/1 * * * ?")
     public void notifyTask() {
     public void notifyTask() {
         logger.info("-----------定时任务开始------------------");
         logger.info("-----------定时任务开始------------------");
@@ -598,4 +602,61 @@ public class WorkCalendarTaskService  {
         logger.info("-----------发票批量导入临时文件清理结束------------------");
         logger.info("-----------发票批量导入临时文件清理结束------------------");
     }
     }
 
 
+
+    /**
+     * 定时查询一级造价师使用时限临期或过期提醒
+     */
+    //设置每日凌晨10分调用通知方法
+    @Scheduled(cron= "0 10 0 * * ?")
+    @Transactional(readOnly = false)
+    public void disposeCertificateValidityPeriodReminder() {
+        logger.info("-----------一级造价师人员证书过期通知操作定时任务开始------------------");
+        //查询一级造价师的信息
+        List<WorkStaffCertificate> firstCostEngineerList = workStaffCertificateService.getFirstCostEngineerList();
+        for (WorkStaffCertificate workStaffCertificate : firstCostEngineerList) {
+            if(null != workStaffCertificate.getValidEndDate()){
+                //如果有使用有效期,则让其进行和当前时间进行判定,提前7天进行提醒
+                // 获取结束时间(数据库取出来的 Date)
+                Date validEndDate = workStaffCertificate.getValidEndDate();
+
+                // 1. 把 Date 转成 LocalDate(只看日期,不看时分秒,最准确)
+                LocalDate endDate = validEndDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
+                LocalDate nowDate = LocalDate.now(); // 当前日期
+
+                // 2. 计算相差天数(正数:还剩多少天;负数:已过期多少天)
+                long days = java.time.temporal.ChronoUnit.DAYS.between(nowDate, endDate);
+                if(days>=0){
+                    if(days<=7){
+                        workStaffBasicInfoService.completeFirstCostEngineer(workStaffCertificate.getStaffId(),"您的一级造价师的使用有效期即将到期 ", days);
+                    }
+                }else{
+                    workStaffBasicInfoService.completeFirstCostEngineer(workStaffCertificate.getStaffId(),"您的一级造价师的使用有效期已过期 ", days);
+                }
+            }else if(null != workStaffCertificate.getEndDate()){
+                //如果有效期快到期或者已到期,则提前15天进行提醒
+                // 获取结束时间(数据库取出来的 Date)
+                Date endDate = workStaffCertificate.getEndDate();
+
+                // 1. 把 Date 转成 LocalDate(只看日期,不看时分秒,最准确)
+                LocalDate endDateL = endDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
+                LocalDate nowDate = LocalDate.now(); // 当前日期
+
+                // 2. 计算相差天数(正数:还剩多少天;负数:已过期多少天)
+                long days = java.time.temporal.ChronoUnit.DAYS.between(nowDate, endDateL);
+                if(days>=0){
+                    if(days <= 15){
+                        workStaffBasicInfoService.completeFirstCostEngineer(workStaffCertificate.getStaffId(),"您的一级造价师的有效期即将到期 ", days);
+                    }
+                }else{
+                    workStaffBasicInfoService.completeFirstCostEngineer(workStaffCertificate.getStaffId(),"您的一级造价师的有效期已过期 ", days);
+                }
+            }else if(null == workStaffCertificate.getEndDate() && null == workStaffCertificate.getValidEndDate()){
+                //如果没有使用有效期或有效期,则直接进行提醒
+                workStaffBasicInfoService.completeFirstCostEngineer(workStaffCertificate.getStaffId(),"您的一级造价师证书信息不全,请及时补充完整。",null);
+            }
+
+        }
+
+        logger.info("-----------一级造价师人员证书过期通知操作定时任务结束------------------");
+    }
 }
 }

+ 9 - 3
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -11,7 +11,6 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Lists;
-import com.google.gson.Gson;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.oss.OSSClientUtil;
 import com.jeeplus.common.oss.OSSClientUtil;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.persistence.Page;
@@ -117,8 +116,6 @@ import com.jeeplus.modules.szCenterservice.service.szCloud.SzFlowRequest;
 import com.jeeplus.modules.szCenterservice.task.SzTaskFlowService;
 import com.jeeplus.modules.szCenterservice.task.SzTaskFlowService;
 import com.jeeplus.modules.szCenterservice.utils.SzConvertServiceUtil;
 import com.jeeplus.modules.szCenterservice.utils.SzConvertServiceUtil;
 import com.jeeplus.modules.test.service.act.ActTestService;
 import com.jeeplus.modules.test.service.act.ActTestService;
-import com.jeeplus.modules.workOrder.dao.WorkOrderDao;
-import com.jeeplus.modules.workOrder.entity.WorkOrderProcessing;
 import com.jeeplus.modules.workactivity.entity.WorkActivityProcess;
 import com.jeeplus.modules.workactivity.entity.WorkActivityProcess;
 import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
 import com.jeeplus.modules.workactivity.service.WorkActivityProcessService;
 import com.jeeplus.modules.workadministrativeatamp.entity.WorkAdministrativeAtamp;
 import com.jeeplus.modules.workadministrativeatamp.entity.WorkAdministrativeAtamp;
@@ -11352,6 +11349,15 @@ public class WorkProjectNotifyController extends BaseController {
 		WorkStaffBasicInfo select = new WorkStaffBasicInfo();
 		WorkStaffBasicInfo select = new WorkStaffBasicInfo();
 		select.setAchiveId(workProjectNotify.getNotifyId());
 		select.setAchiveId(workProjectNotify.getNotifyId());
 		WorkStaffBasicInfo workStaffBasicInfo = workStaffBasicInfoService.getAchive(select);
 		WorkStaffBasicInfo workStaffBasicInfo = workStaffBasicInfoService.getAchive(select);
+
+		WorkStaffBasicInfo byUserId = workStaffBasicInfoService.getWorkStaffBasicInfoByUserId(workStaffBasicInfo.getUserId());
+		WorkStaffBasicInfo workStaffBasicInfo1 = workStaffBasicInfoService.get(byUserId.getId());
+
+		if(StringUtils.isNotBlank(workStaffBasicInfo1.getHandSignature()) && StringUtils.isBlank(workStaffBasicInfo.getHandSignature())){
+			workStaffBasicInfo.setHandSignature(workStaffBasicInfo1.getHandSignature());
+			workStaffBasicInfo.setHandSignatureUrl(workStaffBasicInfo1.getHandSignatureUrl());
+        }
+
 		if (StringUtils.isNotBlank(workStaffBasicInfo.getId())) {
 		if (StringUtils.isNotBlank(workStaffBasicInfo.getId())) {
 			workStaffBasicInfoService.queryDetailsApply(workStaffBasicInfo);
 			workStaffBasicInfoService.queryDetailsApply(workStaffBasicInfo);
 		}
 		}

+ 7 - 0
src/main/java/com/jeeplus/modules/workstaff/dao/WorkStaffBasicInfoDao.java

@@ -127,4 +127,11 @@ public interface WorkStaffBasicInfoDao extends CrudDao<WorkStaffBasicInfo> {
      */
      */
     void updateAge(WorkStaffBasicInfo workStaffBasicInfo);
     void updateAge(WorkStaffBasicInfo workStaffBasicInfo);
 
 
+    /**
+     * 修改手签章
+     * @param workStaffBasicInfo
+     * @return
+     */
+    void updateHandSignatureByUserId(WorkStaffBasicInfo workStaffBasicInfo);
+
 }
 }

+ 6 - 0
src/main/java/com/jeeplus/modules/workstaff/dao/WorkStaffCertificateDao.java

@@ -36,4 +36,10 @@ public interface WorkStaffCertificateDao extends CrudDao<WorkStaffCertificate> {
      * @param info
      * @param info
      */
      */
     void updateImport(WorkStaffCertificateImport info);
     void updateImport(WorkStaffCertificateImport info);
+
+    /**
+     * 查询所有的一级造价师信息
+     * @return
+     */
+    List<WorkStaffCertificate> getFirstCostEngineerList();
 }
 }

+ 30 - 3
src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffCertificate.java

@@ -3,13 +3,13 @@
  */
  */
 package com.jeeplus.modules.workstaff.entity;
 package com.jeeplus.modules.workstaff.entity;
 
 
-import java.util.Date;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
-
 import com.jeeplus.common.persistence.DataEntity;
 import com.jeeplus.common.persistence.DataEntity;
 import com.jeeplus.common.utils.excel.annotation.ExcelField;
 import com.jeeplus.common.utils.excel.annotation.ExcelField;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartFile;
 
 
+import java.util.Date;
+
 /**
 /**
  * 执业资格证书Entity
  * 执业资格证书Entity
  * @author ssrh
  * @author ssrh
@@ -34,9 +34,12 @@ public class WorkStaffCertificate extends DataEntity<WorkStaffCertificate> {
     private String fileName;		// 文件名
     private String fileName;		// 文件名
     private MultipartFile file;
     private MultipartFile file;
     private String idCard;		//身份证号
     private String idCard;		//身份证号
-    private Date endDate;		//结束时间
 	private String zixunyuanId;		//咨询员id
 	private String zixunyuanId;		//咨询员id
 	private String zixunyuanName;		//咨询员name
 	private String zixunyuanName;		//咨询员name
+	private Date validStartDate;		//文件可使用有效开始时间
+	private Date validEndDate;		//文件可使用有效结束时间
+	private Date startDate;		//文件完整的有效开始时间
+	private Date endDate;		//文件完整的有效结束时间
 
 
     public String getFileName() {
     public String getFileName() {
         return fileName;
         return fileName;
@@ -210,4 +213,28 @@ public class WorkStaffCertificate extends DataEntity<WorkStaffCertificate> {
 	public void setFilePathThumbnailStr(String filePathThumbnailStr) {
 	public void setFilePathThumbnailStr(String filePathThumbnailStr) {
 		this.filePathThumbnailStr = filePathThumbnailStr;
 		this.filePathThumbnailStr = filePathThumbnailStr;
 	}
 	}
+
+	public Date getValidStartDate() {
+		return validStartDate;
+	}
+
+	public void setValidStartDate(Date validStartDate) {
+		this.validStartDate = validStartDate;
+	}
+
+	public Date getValidEndDate() {
+		return validEndDate;
+	}
+
+	public void setValidEndDate(Date validEndDate) {
+		this.validEndDate = validEndDate;
+	}
+
+	public Date getStartDate() {
+		return startDate;
+	}
+
+	public void setStartDate(Date startDate) {
+		this.startDate = startDate;
+	}
 }
 }

+ 60 - 14
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffBasicInfoService.java

@@ -3,14 +3,10 @@
  */
  */
 package com.jeeplus.modules.workstaff.service;
 package com.jeeplus.modules.workstaff.service;
 
 
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.io.FileUtil;
-import cn.hutool.extra.spring.SpringUtil;
 import com.dingtalk.api.response.OapiV2DepartmentListsubResponse;
 import com.dingtalk.api.response.OapiV2DepartmentListsubResponse;
 import com.dingtalk.api.response.OapiV2UserCreateResponse;
 import com.dingtalk.api.response.OapiV2UserCreateResponse;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Maps;
-import com.jeeplus.common.bos.BOSClientUtil;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.oss.OSSClientUtil;
 import com.jeeplus.common.oss.OSSClientUtil;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.persistence.Page;
@@ -18,10 +14,6 @@ import com.jeeplus.common.service.CrudService;
 import com.jeeplus.common.utils.MenuStatusEnum;
 import com.jeeplus.common.utils.MenuStatusEnum;
 import com.jeeplus.common.utils.MyBeanUtils;
 import com.jeeplus.common.utils.MyBeanUtils;
 import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.common.utils.StringUtils;
-import com.jeeplus.modules.caseinfo.entity.CaseInfo;
-import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo;
-import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
-import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.sys.dao.AreaDao;
 import com.jeeplus.modules.sys.dao.AreaDao;
 import com.jeeplus.modules.sys.entity.Area;
 import com.jeeplus.modules.sys.entity.Area;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
@@ -34,7 +26,6 @@ import com.jeeplus.modules.sysuseroffice.entity.Useroffice;
 import com.jeeplus.modules.sysuseroffice.service.UserofficeService;
 import com.jeeplus.modules.sysuseroffice.service.UserofficeService;
 import com.jeeplus.modules.utils.SftpClientUtil;
 import com.jeeplus.modules.utils.SftpClientUtil;
 import com.jeeplus.modules.utils.ZipCompressUtil;
 import com.jeeplus.modules.utils.ZipCompressUtil;
-import com.jeeplus.modules.workactivity.entity.WorkActivityProcess;
 import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
 import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
 import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
@@ -66,9 +57,6 @@ import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Method;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.net.URLEncoder;
 import java.net.URLEncoder;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.text.NumberFormat;
 import java.text.NumberFormat;
 import java.text.ParseException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
@@ -1483,7 +1471,7 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
     }
     }
 
 
     @Transactional(readOnly = false)
     @Transactional(readOnly = false)
-    public void saveLog(WorkStaffBasicInfo workStaffBasicInfo) {
+    public String saveLog(WorkStaffBasicInfo workStaffBasicInfo) {
         workStaffBasicInfo.setAchiveId(workStaffBasicInfo.getId());
         workStaffBasicInfo.setAchiveId(workStaffBasicInfo.getId());
         WorkStaffBasicInfo info = this.getAchive(workStaffBasicInfo);
         WorkStaffBasicInfo info = this.getAchive(workStaffBasicInfo);
         workStaffBasicInfo.setAuditStatus(info.getAuditStatus());
         workStaffBasicInfo.setAuditStatus(info.getAuditStatus());
@@ -1608,7 +1596,7 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
         languagesService.saveEdu(workStaffBasicInfo);//外语语种
         languagesService.saveEdu(workStaffBasicInfo);//外语语种
         experienceService.saveEdu(workStaffBasicInfo);//工作经历
         experienceService.saveEdu(workStaffBasicInfo);//工作经历
         achievementService.saveEdu(workStaffBasicInfo);//工作业绩
         achievementService.saveEdu(workStaffBasicInfo);//工作业绩
-        certificateService.saveEdu(workStaffBasicInfo);//执业资格证书
+        String result = certificateService.saveEdu(workStaffBasicInfo);//执业资格证书
         familyService.saveEdu(workStaffBasicInfo);//家庭情况
         familyService.saveEdu(workStaffBasicInfo);//家庭情况
         recordService.saveEdu(workStaffBasicInfo);//电子档案
         recordService.saveEdu(workStaffBasicInfo);//电子档案
         rewardsService.saveEdu(workStaffBasicInfo);//奖惩情况
         rewardsService.saveEdu(workStaffBasicInfo);//奖惩情况
@@ -1622,6 +1610,14 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
         if("1".equals(workStaffBasicInfo.getAuditStatus())){
         if("1".equals(workStaffBasicInfo.getAuditStatus())){
             workStaffAchivesLogService.deleteByAchiveId(workStaffBasicInfo.getId());
             workStaffAchivesLogService.deleteByAchiveId(workStaffBasicInfo.getId());
         }
         }
+
+        if (StringUtils.isNotBlank(workStaffBasicInfo.getHandSignature())) {
+            if (workStaffBasicInfo.getHandSignature().indexOf(aliyunUrl) != -1) {
+                workStaffBasicInfo.setHandSignature(workStaffBasicInfo.getHandSignature().replace(aliyunUrl, ""));
+                workStaffBasicInfoDao.updateHandSignatureByUserId(workStaffBasicInfo);
+            }
+        }
+        return result;
     }
     }
 
 
     @Transactional(readOnly = false)
     @Transactional(readOnly = false)
@@ -2292,4 +2288,54 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
         }
         }
     }
     }
 
 
+    @Transactional(readOnly = false)
+    public void completeFirstCostEngineer(String id,String message, Long day) {
+        if (StringUtils.isBlank(id) || StringUtils.isBlank(message)) {
+            return;
+        }
+        String remark = "待通知";
+
+        WorkStaffBasicInfo workStaffBasicInfo = workStaffAchivesDao.get(id);
+        this.sendFirstCostEngineerMessage(workStaffBasicInfo, message, message, day, remark);
+    }
+
+
+    private void sendFirstCostEngineerMessage(WorkStaffBasicInfo workStaffBasicInfo, String contentStr, String titleStr, Long day, String remark) {
+        if (workStaffBasicInfo == null || StringUtils.isBlank(workStaffBasicInfo.getId()) || StringUtils.isBlank(workStaffBasicInfo.getUserId())) {
+            return;
+        }
+        //查询现有表中是否已经存在了数据,若存在,则直接修改已读状态 或者直接修改通知次数
+
+        //根据标题查询通知信息中是否存在未读的信息,有则进行更新并对重复数量进行+1操作
+        WorkProjectNotify byTitleAndUnread = workProjectNotifyService.getByTitleAndUnread(contentStr,workStaffBasicInfo.getUserId());
+
+        if(null != byTitleAndUnread){
+            //将所有的被通知人的该条通知均调整为已读,然后将最后一条数据进行调整
+            workProjectNotifyService.deleteByNotifyUser(contentStr,workStaffBasicInfo.getUserId());
+            /*byTitleAndUnread.setExigency("1");
+            workProjectNotifyService.updateOverDueInfo(byTitleAndUnread);*/
+        }
+
+        if(null != day){
+            if(day>=0){
+                titleStr = titleStr + ",距离到期时间还剩" + day + "天。请及时更新。";
+            }else{
+                titleStr = titleStr + -day + "天。请及时更新。";
+            }
+        }
+
+
+        WorkProjectNotify workProjectNotify = UtilNotify.saveNotify(workStaffBasicInfo.getId(), null, workStaffBasicInfo.getCompany().getId(),
+                titleStr, contentStr, "86", "0", remark, "");
+        List<String> userIds = new ArrayList<>();
+        userIds.add(workStaffBasicInfo.getUserId());
+        workProjectNotify.setUser(new User(workStaffBasicInfo.getUserId()));
+        workProjectNotify.setId("");
+        workProjectNotify.setNotifyRole("");
+        List<WorkProjectNotify> byNotifyIdAndNotifyUserAndTitle = workProjectNotifyService.getByNotifyIdAndNotifyUserAndTitle(workProjectNotify.getTitle(), workProjectNotify.getNotifyId(), workProjectNotify.getUser().getId());
+        if(byNotifyIdAndNotifyUserAndTitle.isEmpty()){
+            workProjectNotifyService.save(workProjectNotify);
+        }
+        UserUtils.pushIm(userIds, contentStr);
+    }
 }
 }

+ 352 - 23
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffCertificateService.java

@@ -3,19 +3,12 @@
  */
  */
 package com.jeeplus.modules.workstaff.service;
 package com.jeeplus.modules.workstaff.service;
 
 
-import java.io.InputStream;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
 import com.google.common.collect.Lists;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Maps;
-import com.jeeplus.common.bos.BOSClientUtil;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.oss.OSSClientUtil;
 import com.jeeplus.common.oss.OSSClientUtil;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.CrudService;
 import com.jeeplus.common.utils.DateUtils;
 import com.jeeplus.common.utils.DateUtils;
 import com.jeeplus.common.utils.IdGen;
 import com.jeeplus.common.utils.IdGen;
 import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.common.utils.StringUtils;
@@ -25,18 +18,27 @@ import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.service.WorkattachmentService;
 import com.jeeplus.modules.sys.service.WorkattachmentService;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.workstaff.dao.WorkStaffBasicInfoDao;
 import com.jeeplus.modules.workstaff.dao.WorkStaffBasicInfoDao;
-import com.jeeplus.modules.workstaff.entity.*;
+import com.jeeplus.modules.workstaff.dao.WorkStaffCertificateDao;
+import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
+import com.jeeplus.modules.workstaff.entity.WorkStaffCertificate;
+import com.jeeplus.modules.workstaff.entity.WorkStaffCertificateImport;
+import com.jeeplus.modules.workstaff.utils.PdfSignUtil;
 import com.jeeplus.modules.workstaffachiveslog.entity.WorkStaffAchivesLog;
 import com.jeeplus.modules.workstaffachiveslog.entity.WorkStaffAchivesLog;
 import com.jeeplus.modules.workstaffachiveslog.service.WorkStaffAchivesLogService;
 import com.jeeplus.modules.workstaffachiveslog.service.WorkStaffAchivesLogService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.mock.web.MockMultipartFile;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
-
-import com.jeeplus.common.persistence.Page;
-import com.jeeplus.common.service.CrudService;
-import com.jeeplus.modules.workstaff.dao.WorkStaffCertificateDao;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartFile;
 
 
+import java.io.*;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
 /**
 /**
  * 执业资格证书Service
  * 执业资格证书Service
  * @author ssrh
  * @author ssrh
@@ -132,11 +134,106 @@ public class WorkStaffCertificateService extends CrudService<WorkStaffCertificat
                 continue;
                 continue;
             }
             }
             if(entity!=null){
             if(entity!=null){
-                if(entity.getFile()!=null&&!entity.getFile().isEmpty()&&entity.getFile().getSize()>0){
-                    MultipartFile file = entity.getFile();
-                    entity.setFileName(file.getOriginalFilename());
-                    entity.setFilePath(this.uploadFile(file,entity.getFilePath()));
+
+                // 1. 先处理文件上传(按系统区分路径,临时存储)
+                String staffId = workStaffBasicInfo.getId();
+                MultipartFile file = entity.getFile();
+
+                // 临时文件路径(用于try中处理,处理完自动删除)
+                String tempFilePath = null;
+
+                if (file != null && !file.isEmpty() && file.getSize() > 0) {
+
+                    String name = entity.getName();
+                    // 生成临时文件名(避免重名)
+                    String originalFileName = file.getOriginalFilename();
+                    String basePath = "";
+                    try {
+                        if ("161".equals(name)
+                                && StringUtils.isNotBlank(originalFileName)
+                                && originalFileName.toLowerCase().endsWith(".pdf")) {
+                            // -------------------------- 1. 按系统生成临时存储路径 --------------------------
+                            String os = System.getProperty("os.name").toLowerCase();
+                            if (os.contains("win")) {
+                                // Windows系统:D盘根目录
+                                basePath = "D:/attachment-file/staffCertificate/" + staffId + "/";
+                            } else {
+                                // Linux系统:根目录
+                                basePath = "/attachment-file/staffCertificate/" + staffId + "/";
+                            }
+
+                            // 确保目录存在,不存在则自动创建
+                            File dir = new File(basePath);
+                            if (!dir.exists()) {
+                                dir.mkdirs();
+                            }
+
+                            String tempFileName = System.currentTimeMillis() + "_" + originalFileName;
+                            tempFilePath = basePath + tempFileName;
+
+                            // 2. 将上传的文件保存到临时路径
+                            File tempFile = new File(tempFilePath);
+                            file.transferTo(tempFile);
+
+                            Map<String, Object> map = null;
+                            if(null != tempFile && StringUtils.isNotBlank(workStaffBasicInfo.getHandSignature())){
+                                // 入参传临时文件路径,方便你在方法里直接读取处理
+                                map = disposeFile(tempFile, workStaffBasicInfo.getHandSignature(), basePath);
+                            }
+
+                            //获取处理好的一造文件
+                            String outPdfPath = (String) map.get("outPdfPath");
+                            MultipartFile multipartFile = transformFile(new File(outPdfPath));
+
+                            // 3. 调用原有的uploadFile方法,上传到CDN(保持你原有逻辑不变)
+                            String cdnFilePath = this.uploadFile(multipartFile, entity.getFilePath());
+                            entity.setFileName(originalFileName);
+                            entity.setFilePath(cdnFilePath);
+
+                            //获取本次生成的一级造价师的文件的使用时效时间
+                            String startDateStr = (String) map.get("startDate");
+                            String endDateStr = (String) map.get("endDate");
+                            //获取一级造价师文件的有效时间
+                            String certValidStartDateStr = (String) map.get("certValidStart");
+                            String certValidEndDateStr = (String) map.get("certValidEnd");
+
+                            // 转换为 Date
+                            SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
+
+                            entity.setValidStartDate(sdf.parse(startDateStr));
+                            entity.setValidEndDate(sdf.parse(endDateStr));
+                            entity.setStartDate(sdf.parse(certValidStartDateStr));
+                            entity.setEndDate(sdf.parse(certValidEndDateStr));
+
+                            // -------------------------- 4. 条件判断:name=161 且 是PDF,调用disposeFile --------------------------
+
+                        }else{
+                            //如果不是一造  也不是pdf文件的话,按照以前的处理方式进行处理
+                            entity.setFileName(file.getOriginalFilename());
+                            entity.setFilePath(this.uploadFile(file,entity.getFilePath()));
+                        }
+
+                    } catch (Exception e) {
+                        // 异常处理:打印日志,抛出业务异常(可根据你的项目规范调整)
+                        throw new RuntimeException("证书文件处理失败:" + e.getMessage());
+                    } finally {
+                        // -------------------------- 5. 无论成功失败,最终删除临时文件 --------------------------
+                        if (StringUtils.isNotBlank(tempFilePath)) {
+                            File tempFile = new File(tempFilePath);
+                            if (tempFile.exists()) {
+                                tempFile.delete();
+                            }
+                        }
+                        if (StringUtils.isNotBlank(basePath)) {
+                            File basePathFile = new File(basePath);
+                            if (basePathFile.exists() && basePathFile.isDirectory()) {
+                                // 清空目录下所有文件/子文件夹,保留目录本身
+                                clearDirectory(basePathFile);
+                            }
+                        }
+                    }
                 }
                 }
+
                 entity.setStaffId(workStaffBasicInfo.getId());
                 entity.setStaffId(workStaffBasicInfo.getId());
                 this.save(entity);
                 this.save(entity);
                 if(first){
                 if(first){
@@ -150,6 +247,121 @@ public class WorkStaffCertificateService extends CrudService<WorkStaffCertificat
     }
     }
 
 
     /**
     /**
+     * 清空指定目录下的所有内容(文件+子文件夹),保留目录本身
+     */
+    private void clearDirectory(File dir) {
+        if (!dir.exists() || !dir.isDirectory()) {
+            return;
+        }
+        File[] files = dir.listFiles();
+        if (files == null || files.length == 0) {
+            return;
+        }
+        for (File file : files) {
+            deleteRecursively(file);
+        }
+    }
+
+    /**
+     * 递归删除文件/目录(内部工具方法)
+     */
+    private void deleteRecursively(File file) {
+        if (file.isDirectory()) {
+            File[] children = file.listFiles();
+            if (children != null) {
+                for (File child : children) {
+                    deleteRecursively(child);
+                }
+            }
+        }
+        // 删除文件或空目录
+        file.delete();
+    }
+
+    /**
+     * File转MultipartFile
+     * @param file
+     * @return
+     */
+    public static MultipartFile transformFile(File file) {
+        InputStream inputStream = null;
+        MultipartFile multipartFile = null;
+        try {
+            inputStream = new FileInputStream(file);
+            // 完整构造:name(表单字段名), originalFilename(原始文件名), contentType, 输入流
+            multipartFile = new MockMultipartFile(
+                    "certificateList[0].file",  // 对应前端表单的name属性
+                    file.getName(),            // 原始文件名(和前端一致)
+                    "application/pdf",         // 正确的contentType(PDF场景)
+                    inputStream
+            );
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            // 注意:MockMultipartFile会自动关闭流,这里不需要手动关,避免报错
+            // IOUtils.close(inputStream);
+        }
+        return multipartFile;
+    }
+
+    /**
+     *
+     * @param tempFile  一造文件
+     * @param handSignature 个人签名章
+     */
+    private Map<String,Object> disposeFile(File tempFile, String handSignature, String path) {
+        Map<String,Object> map = null;
+        File srcFile = null;
+        try{
+            String file = handSignature;
+            file = file.replace("amp;","");
+            String fileName = file.substring(file.lastIndexOf("/") + 1, file.length());
+            String aliyunUrl = Global.getAliyunUrl();
+            String aliDownloadUrl = Global.getAliDownloadUrl();
+            String cons = "";
+            if (file.contains(aliyunUrl)){
+                cons = aliyunUrl;
+            }else if (file.contains("http://gangwan-app.oss-cn-hangzhou.aliyuncs.com")){
+                cons = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com";
+            }else {
+                cons = aliDownloadUrl;
+            }
+            String ossKey;
+
+            // 判断是否以 / 开头
+            if (file.startsWith("/")) {
+                // 情况1:以 / 开头 → 去掉第一个 /
+                ossKey = file.substring(1);
+            } else {
+                // 情况2:不以 / 开头 → 按 cons/ 分割取后面部分
+                String[] split = file.split(cons + "/");
+                // 安全取值,防止数组越界
+                ossKey = split.length > 1 ? split[1] : file;
+            }
+
+            new OSSClientUtil().downByStreamSaveLocal(ossKey,fileName,path+fileName);
+            //将下载下来的文件转换为file文件
+            srcFile = new File(path+fileName);
+
+            map = PdfSignUtil.disposePdfFile(tempFile, srcFile, path);
+
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            //删除本地文件
+            if (!srcFile.isDirectory()) {
+                srcFile.delete();
+            }
+        }
+        return map;
+    }
+
+
+
+    /**
      * 导入职业资格文件处理
      * 导入职业资格文件处理
      * @param list
      * @param list
      * @return
      * @return
@@ -647,11 +859,26 @@ public class WorkStaffCertificateService extends CrudService<WorkStaffCertificat
         workStaffBasicInfo.setCertificateList(newList);
         workStaffBasicInfo.setCertificateList(newList);
     }
     }
     @Transactional(readOnly = false)
     @Transactional(readOnly = false)
-    public void saveEdu(WorkStaffBasicInfo workStaffBasicInfo) {
+    public String saveEdu(WorkStaffBasicInfo workStaffBasicInfo) {
+
+        String result = "";
+
+        if(StringUtils.isBlank(workStaffBasicInfo.getHandSignature())){
+            WorkStaffBasicInfo workStaffBasicInfo1 = workStaffBasicInfoDao.getWorkStaffBasicInfoByUserId(workStaffBasicInfo.getUserId());
+            workStaffBasicInfo.setHandSignature(workStaffBasicInfo1.getHandSignature());
+        }
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         List<WorkStaffCertificate> certificateList =workStaffBasicInfo.getCertificateList();
         List<WorkStaffCertificate> certificateList =workStaffBasicInfo.getCertificateList();
         if(certificateList!=null&&certificateList.size()>0){
         if(certificateList!=null&&certificateList.size()>0){
             for(WorkStaffCertificate newCertificate:certificateList){
             for(WorkStaffCertificate newCertificate:certificateList){
+                //数据处理
+
+
+
+
+
+
+
                 if(null != newCertificate.getFile() && StringUtils.isNotBlank(newCertificate.getFile().getOriginalFilename())){
                 if(null != newCertificate.getFile() && StringUtils.isNotBlank(newCertificate.getFile().getOriginalFilename())){
                     String fileName = newCertificate.getFile().getOriginalFilename();
                     String fileName = newCertificate.getFile().getOriginalFilename();
                     newCertificate.setFileName(fileName);
                     newCertificate.setFileName(fileName);
@@ -659,10 +886,107 @@ public class WorkStaffCertificateService extends CrudService<WorkStaffCertificat
                 Class<? extends WorkStaffCertificate> newClass = newCertificate.getClass();
                 Class<? extends WorkStaffCertificate> newClass = newCertificate.getClass();
                 Field[] declaredFields = newClass.getDeclaredFields();
                 Field[] declaredFields = newClass.getDeclaredFields();
                 if(newCertificate.getId()!=null&&!"1".equals(newCertificate.getDelFlag())&&!"".equals(newCertificate.getId())){
                 if(newCertificate.getId()!=null&&!"1".equals(newCertificate.getDelFlag())&&!"".equals(newCertificate.getId())){
-                    if(newCertificate.getFile()!=null&&!newCertificate.getFile().isEmpty()&&newCertificate.getFile().getSize()>0){
-                        MultipartFile file = newCertificate.getFile();
-                        newCertificate.setFilePath(this.uploadFile(file,newCertificate.getFilePath()));
+                    // 1. 先处理文件上传(按系统区分路径,临时存储)
+                    String staffId = workStaffBasicInfo.getId();
+                    MultipartFile file = newCertificate.getFile();
+
+                    // 临时文件路径(用于try中处理,处理完自动删除)
+                    String tempFilePath = null;
+
+                    if (file != null && !file.isEmpty() && file.getSize() > 0) {
+
+                        String name = newCertificate.getName();
+                        // 生成临时文件名(避免重名)
+                        String originalFileName = file.getOriginalFilename();
+                        String basePath = "";
+                        try {
+                            if ("161".equals(name)
+                                    && StringUtils.isNotBlank(originalFileName)
+                                    && originalFileName.toLowerCase().endsWith(".pdf") && StringUtils.isNotBlank(workStaffBasicInfo.getHandSignature())) {
+                                // -------------------------- 1. 按系统生成临时存储路径 --------------------------
+                                String os = System.getProperty("os.name").toLowerCase();
+                                if (os.contains("win")) {
+                                    // Windows系统:D盘根目录
+                                    basePath = "D:/attachment-file/staffCertificate/" + staffId + "/";
+                                } else {
+                                    // Linux系统:根目录
+                                    basePath = "/attachment-file/staffCertificate/" + staffId + "/";
+                                }
+
+                                // 确保目录存在,不存在则自动创建
+                                File dir = new File(basePath);
+                                if (!dir.exists()) {
+                                    dir.mkdirs();
+                                }
+
+                                String tempFileName = System.currentTimeMillis() + "_" + originalFileName;
+                                tempFilePath = basePath + tempFileName;
+
+                                // 2. 将上传的文件保存到临时路径
+                                File tempFile = new File(tempFilePath);
+                                file.transferTo(tempFile);
+
+                                Map<String, Object> map = null;
+                                if(null != tempFile && StringUtils.isNotBlank(workStaffBasicInfo.getHandSignature())){
+                                    // 入参传临时文件路径,方便你在方法里直接读取处理
+                                    map = disposeFile(tempFile, workStaffBasicInfo.getHandSignature(), basePath);
+                                }
+
+                                //获取处理好的一造文件
+                                String outPdfPath = (String) map.get("outPdfPath");
+                                MultipartFile multipartFile = transformFile(new File(outPdfPath));
+
+                                // 3. 调用原有的uploadFile方法,上传到CDN(保持你原有逻辑不变)
+                                String cdnFilePath = this.uploadFile(multipartFile, newCertificate.getFilePath());
+                                newCertificate.setFileName(originalFileName);
+                                newCertificate.setFilePath(cdnFilePath);
+
+                                //获取本次生成的一级造价师的文件的使用时效时间
+                                String startDateStr = (String) map.get("startDate");
+                                String endDateStr = (String) map.get("endDate");
+                                //获取一级造价师文件的有效时间
+                                String certValidStartDateStr = (String) map.get("certValidStart");
+                                String certValidEndDateStr = (String) map.get("certValidEnd");
+
+                                // 转换为 Date
+                                sdf = new SimpleDateFormat("yyyy年MM月dd日");
+
+                                newCertificate.setValidStartDate(sdf.parse(startDateStr));
+                                newCertificate.setValidEndDate(sdf.parse(endDateStr));
+                                newCertificate.setStartDate(sdf.parse(certValidStartDateStr));
+                                newCertificate.setEndDate(sdf.parse(certValidEndDateStr));
+
+                                // -------------------------- 4. 条件判断:name=161 且 是PDF,调用disposeFile --------------------------
+
+                            }else{
+                                //如果不是一造  也不是pdf文件的话,按照以前的处理方式进行处理
+                                newCertificate.setFileName(file.getOriginalFilename());
+                                newCertificate.setFilePath(this.uploadFile(file,newCertificate.getFilePath()));
+                            }
+
+                        } catch (Exception e) {
+                            // 异常处理:打印日志,抛出业务异常(可根据你的项目规范调整)
+                            //throw new RuntimeException("证书文件处理失败:" + e.getMessage());
+                            result = "一级造价师证书处理失败" + e.getMessage();
+                            return result;
+                        } finally {
+                            // -------------------------- 5. 无论成功失败,最终删除临时文件 --------------------------
+                            if (StringUtils.isNotBlank(tempFilePath)) {
+                                File tempFile = new File(tempFilePath);
+                                if (tempFile.exists()) {
+                                    tempFile.delete();
+                                }
+                            }
+                            if (StringUtils.isNotBlank(basePath)) {
+                                File basePathFile = new File(basePath);
+                                if (basePathFile.exists() && basePathFile.isDirectory()) {
+                                    // 清空目录下所有文件/子文件夹,保留目录本身
+                                    clearDirectory(basePathFile);
+                                }
+                            }
+                        }
                     }
                     }
+
                     WorkStaffCertificate oldCertificate=this.get(newCertificate.getId());
                     WorkStaffCertificate oldCertificate=this.get(newCertificate.getId());
                     if(oldCertificate!=null){
                     if(oldCertificate!=null){
                         Class<? extends WorkStaffCertificate> oldClass = oldCertificate.getClass();
                         Class<? extends WorkStaffCertificate> oldClass = oldCertificate.getClass();
@@ -730,7 +1054,7 @@ public class WorkStaffCertificateService extends CrudService<WorkStaffCertificat
                     }else{
                     }else{
                         if("1".equals(workStaffBasicInfo.getAuditStatus())){
                         if("1".equals(workStaffBasicInfo.getAuditStatus())){
                             if(newCertificate.getFile()!=null&&!newCertificate.getFile().isEmpty()&&newCertificate.getFile().getSize()>0){
                             if(newCertificate.getFile()!=null&&!newCertificate.getFile().isEmpty()&&newCertificate.getFile().getSize()>0){
-                                MultipartFile file = newCertificate.getFile();
+                                //MultipartFile file = newCertificate.getFile();
                                 newCertificate.setFilePath(this.uploadFile(file,newCertificate.getFilePath()));
                                 newCertificate.setFilePath(this.uploadFile(file,newCertificate.getFilePath()));
                             }
                             }
                             String newId=IdGen.uuid();
                             String newId=IdGen.uuid();
@@ -846,6 +1170,7 @@ public class WorkStaffCertificateService extends CrudService<WorkStaffCertificat
                 }
                 }
             }
             }
         }
         }
+        return result;
     }
     }
 
 
     @Transactional(readOnly = false)
     @Transactional(readOnly = false)
@@ -1060,4 +1385,8 @@ public class WorkStaffCertificateService extends CrudService<WorkStaffCertificat
             }
             }
         }
         }
     }
     }
+
+    public List<WorkStaffCertificate> getFirstCostEngineerList(){
+        return dao.getFirstCostEngineerList();
+    }
 }
 }

+ 180 - 0
src/main/java/com/jeeplus/modules/workstaff/utils/PdfSignUtil.java

@@ -0,0 +1,180 @@
+package com.jeeplus.modules.workstaff.utils;
+
+import org.apache.pdfbox.pdmodel.PDDocument;
+import org.apache.pdfbox.pdmodel.PDPage;
+import org.apache.pdfbox.pdmodel.PDPageContentStream;
+import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject;
+import org.apache.pdfbox.text.PDFTextStripper;
+
+import javax.imageio.ImageIO;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.FileInputStream;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class PdfSignUtil {
+
+    // 原有配置 完全未改动
+    /*private static final String SRC_PDF  = "d:/造价工程师证书.pdf";
+    private static final String SIGN_IMG = "d:/吴明华签字章.png";
+    private static final String OUT_PDF  = "d:/new造价工程师证书.pdf";*/
+
+    private static final float SIGN_WIDTH = 70;
+    private static final float SIGN_HEIGHT = 25;
+    private static final float SIGN_X = 180;
+    private static final float SIGN_Y = 110;
+
+    //private static final String DATE_TEMP_PNG = "d:/date_temp.png";
+    private static final float DATE_X = 180;
+    private static final float DATE_Y = 80;
+    private static final float DATE_WIDTH = 80;
+    private static final float DATE_HEIGHT = 30;
+
+    // 字体文件放在当前类同级目录
+    private static final String HAND_FONT = PdfSignUtil.class.getResource("font.ttf").getPath();
+
+    public static void main(String[] args) {
+        //disposePdfFile(new File(SRC_PDF), new File(SIGN_IMG), "d:/");
+    }
+
+    public static Map<String,Object> disposePdfFile(File file, File signFile, String path) {
+        Map<String,Object> map = new HashMap<String,Object>();
+        PDDocument doc = null;
+        try {
+            doc = PDDocument.load(file);
+
+            PDFTextStripper stripper = new PDFTextStripper();
+            String text = stripper.getText(doc);
+            System.out.println("=== PDF 全文内容 ===");
+            System.out.println(text);
+
+            // ==============================================
+            // 【原有逻辑保留】你原来提取的 startDate / endDate
+            // ==============================================
+            String startDate = null;
+            String endDate = null;
+            Pattern pattern = Pattern.compile("使用有效期[^\\d]*(\\d{4}年\\d{1,2}月\\d{1,2}日)[^\\d]*(\\d{4}年\\d{1,2}月\\d{1,2}日)");
+            Matcher matcher = pattern.matcher(text);
+            if (matcher.find()) {
+                startDate = matcher.group(1);
+                endDate = matcher.group(2);
+            }
+
+            System.out.println("\n====== 原有提取(使用有效期)======");
+            System.out.println("开始时间:" + startDate);
+            System.out.println("结束时间:" + endDate);
+            map.put("startDate", startDate);
+            map.put("endDate", endDate);
+
+            // ==============================================
+            // 【新增】提取 整个证书有效期 格式如:2024年01月01日-2027年12月31日
+            // ==============================================
+            String certValidStart = null;
+            String certValidEnd   = null;
+            // 匹配:2024年01月01日-2027年12月31日 这类证书有效期
+            Pattern certPattern = Pattern.compile("(\\d{4}年\\d{1,2}月\\d{1,2}日)\\s*[-~至]\\s*(\\d{4}年\\d{1,2}月\\d{1,2}日)");
+            Matcher certMatcher = certPattern.matcher(text);
+            if (certMatcher.find()) {
+                certValidStart = certMatcher.group(1);
+                certValidEnd   = certMatcher.group(2);
+            }
+
+            System.out.println("\n====== 新增提取(证书有效期)======");
+            System.out.println("证书生效日:" + certValidStart);
+            System.out.println("证书到期日:" + certValidEnd);
+            // 存入map,key不冲突
+            map.put("certValidStart", certValidStart);
+            map.put("certValidEnd", certValidEnd);
+
+            // 下面原有逻辑全部不动
+            String today = new SimpleDateFormat("yyyy.MM.dd").format(new Date());
+            generateHandWritingDate(today, signFile, path + "/date_temp.png");
+
+            PDPage page = (PDPage) doc.getDocumentCatalog().getPages().get(0);
+            PDImageXObject signImage = PDImageXObject.createFromFile(signFile.getPath(), doc);
+            PDImageXObject dateImage = PDImageXObject.createFromFile(path + "/date_temp.png", doc);
+
+            PDPageContentStream cs = new PDPageContentStream(doc, page, true, true, true);
+            cs.drawImage(signImage, SIGN_X, SIGN_Y, SIGN_WIDTH, SIGN_HEIGHT);
+            cs.drawImage(dateImage, DATE_X, DATE_Y, DATE_WIDTH, DATE_HEIGHT);
+            cs.close();
+
+            // 动态生成输出路径
+            String dateStr = new SimpleDateFormat("yyyyMMdd").format(new Date());
+            String originalFileName = file.getName().replace(".pdf", "");
+            String newFileName = originalFileName + "_" + dateStr + ".pdf";
+            String outPdfPath = path + newFileName;
+
+            doc.save(outPdfPath);
+            System.out.println("✅ 处理完成,文件已保存到:" + outPdfPath);
+            map.put("outPdfPath", outPdfPath);
+
+            new File(path + "/date_temp.png").delete();
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try { if (doc != null) doc.close(); } catch (Exception ignored) {}
+        }
+        return map;
+    }
+
+    // 生成日期:直采签字原色、多层叠加加深、防割裂
+    private static void generateHandWritingDate(String date, File signFile, String outPath) throws Exception {
+        BufferedImage signImg = ImageIO.read(signFile);
+        int pureSignArgb = getSolidSignColor(signImg);
+        Color realInkColor = new Color(pureSignArgb, true);
+
+        File fontFile = new File(HAND_FONT);
+        FileInputStream fontIn = new FileInputStream(fontFile);
+        Font handFont = Font.createFont(Font.TRUETYPE_FONT, fontIn).deriveFont(Font.BOLD,22f);
+        fontIn.close();
+
+        BufferedImage img = new BufferedImage(130, 30, BufferedImage.TYPE_INT_ARGB);
+        Graphics2D g2d = img.createGraphics();
+
+        g2d.setComposite(AlphaComposite.Clear);
+        g2d.fillRect(0,0,130,30);
+        g2d.setComposite(AlphaComposite.SrcOver);
+
+        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+        g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);
+        g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
+        g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
+
+        g2d.setColor(realInkColor);
+        g2d.setFont(handFont);
+
+        g2d.drawString(date, 2, 22);
+        g2d.drawString(date, 2, 22);
+        g2d.drawString(date, 2, 22);
+
+        g2d.dispose();
+        ImageIO.write(img, "png", new File(outPath));
+    }
+
+    // 精准采样:只取签字中心实心墨迹单点原色
+    private static int getSolidSignColor(BufferedImage img) {
+        int midX = img.getWidth() / 2;
+        int midY = img.getHeight() / 2;
+        for (int dy = -8; dy <= 8; dy++) {
+            for (int dx = -8; dx <= 8; dx++) {
+                int x = midX + dx;
+                int y = midY + dy;
+                if(x < 0 || y <0 || x >= img.getWidth() || y >= img.getHeight()) continue;
+                int argb = img.getRGB(x,y);
+                int alpha = (argb >>24) & 0xFF;
+                if(alpha > 220){
+                    return argb;
+                }
+            }
+        }
+        return 0xFF000000;
+    }
+}

BIN
src/main/java/com/jeeplus/modules/workstaff/utils/font.ttf


+ 19 - 5
src/main/java/com/jeeplus/modules/workstaff/web/WorkStaffBasicInfoController.java

@@ -33,13 +33,15 @@ import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
 import com.jeeplus.modules.workreceiptsregister.entity.ResponseEntity;
 import com.jeeplus.modules.workreceiptsregister.entity.ResponseEntity;
 import com.jeeplus.modules.workrelationship.entity.WorkRelationship;
 import com.jeeplus.modules.workrelationship.entity.WorkRelationship;
 import com.jeeplus.modules.workstaff.dao.WorkStaffAchivesDao;
 import com.jeeplus.modules.workstaff.dao.WorkStaffAchivesDao;
-import com.jeeplus.modules.workstaff.entity.*;
+import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
+import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfoExcel;
+import com.jeeplus.modules.workstaff.entity.WorkStaffCertificate;
+import com.jeeplus.modules.workstaff.entity.WorkStaffCertificateImport;
 import com.jeeplus.modules.workstaff.service.WorkStaffBasicInfoService;
 import com.jeeplus.modules.workstaff.service.WorkStaffBasicInfoService;
 import com.jeeplus.modules.workstaff.service.WorkStaffCertificateService;
 import com.jeeplus.modules.workstaff.service.WorkStaffCertificateService;
 import com.jeeplus.modules.workstaffachiveslog.dao.WorkStaffAchivesLogDao;
 import com.jeeplus.modules.workstaffachiveslog.dao.WorkStaffAchivesLogDao;
 import com.jeeplus.modules.workstaffachiveslog.entity.WorkStaffAchivesLog;
 import com.jeeplus.modules.workstaffachiveslog.entity.WorkStaffAchivesLog;
 import com.jeeplus.modules.workstaffachiveslog.service.WorkStaffAchivesLogService;
 import com.jeeplus.modules.workstaffachiveslog.service.WorkStaffAchivesLogService;
-import com.taobao.api.ApiException;
 import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -54,9 +56,9 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.*;
 import java.io.*;
 import java.net.URLDecoder;
 import java.net.URLDecoder;
 import java.text.ParseException;
 import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
-import java.text.SimpleDateFormat;
 
 
 /**
 /**
  * 员工基本信息Controller
  * 员工基本信息Controller
@@ -771,6 +773,14 @@ public class WorkStaffBasicInfoController extends BaseController {
 		workStaffBasicInfo = workStaffBasicInfoService.getAchive(workStaffBasicInfo);
 		workStaffBasicInfo = workStaffBasicInfoService.getAchive(workStaffBasicInfo);
 		workStaffBasicInfo.setAchiveId(workStaffBasicInfo.getId());
 		workStaffBasicInfo.setAchiveId(workStaffBasicInfo.getId());
 
 
+		WorkStaffBasicInfo byUserId = workStaffBasicInfoService.getWorkStaffBasicInfoByUserId(workStaffBasicInfo.getUserId());
+		WorkStaffBasicInfo workStaffBasicInfo1 = workStaffBasicInfoService.get(byUserId.getId());
+
+		if(StringUtils.isNotBlank(workStaffBasicInfo1.getHandSignature()) && StringUtils.isBlank(workStaffBasicInfo.getHandSignature())){
+			workStaffBasicInfo.setHandSignature(workStaffBasicInfo1.getHandSignature());
+			workStaffBasicInfo.setHandSignatureUrl(workStaffBasicInfo1.getHandSignatureUrl());
+		}
+
 		List<Role> roleList = Lists.newArrayList();
 		List<Role> roleList = Lists.newArrayList();
 		List<String> roleNameList = Lists.newArrayList();
 		List<String> roleNameList = Lists.newArrayList();
 		List<String> roleIdList = Lists.newArrayList();
 		List<String> roleIdList = Lists.newArrayList();
@@ -998,9 +1008,13 @@ public class WorkStaffBasicInfoController extends BaseController {
 		}
 		}
 		workStaffBasicInfoService.completeApply(workStaffBasicInfo.getId());
 		workStaffBasicInfoService.completeApply(workStaffBasicInfo.getId());
 		workStaffBasicInfoService.updateAlterationDate(workStaffBasicInfo.getId());
 		workStaffBasicInfoService.updateAlterationDate(workStaffBasicInfo.getId());
-		workStaffBasicInfoService.saveLog(workStaffBasicInfo);
+		String result = workStaffBasicInfoService.saveLog(workStaffBasicInfo);
 		workStaffBasicInfoService.updateAuditStatus(workStaffBasicInfo.getId(), "2");
 		workStaffBasicInfoService.updateAuditStatus(workStaffBasicInfo.getId(), "2");
-		addMessage(redirectAttributes, "申请员工档案信息成功");
+		if(StringUtils.isNotBlank(result)){
+			addMessage(redirectAttributes, result);
+		}else{
+			addMessage(redirectAttributes, "申请员工档案信息成功");
+		}
 		if (StringUtils.isNotBlank(workStaffBasicInfo.getHome()) && "home".equals(workStaffBasicInfo.getHome())){
 		if (StringUtils.isNotBlank(workStaffBasicInfo.getHome()) && "home".equals(workStaffBasicInfo.getHome())){
 			return "redirect:" + Global.getAdminPath() + "/home/?repage";
 			return "redirect:" + Global.getAdminPath() + "/home/?repage";
 		}else if (StringUtils.isNotBlank(workStaffBasicInfo.getHome()) && "notifyList".equals(workStaffBasicInfo.getHome())){
 		}else if (StringUtils.isNotBlank(workStaffBasicInfo.getHome()) && "notifyList".equals(workStaffBasicInfo.getHome())){

+ 8 - 1
src/main/resources/mappings/modules/workstaff/WorkStaffBasicInfoDao.xml

@@ -265,7 +265,7 @@
 			<if test="isHandSignature != null and isHandSignature !=''">
 			<if test="isHandSignature != null and isHandSignature !=''">
 				<choose>
 				<choose>
 					<when test="isHandSignature == 1">
 					<when test="isHandSignature == 1">
-						and hand_signature is not null
+						and (hand_signature is not null and hand_signature != '')
 					</when>
 					</when>
 					<otherwise>
 					<otherwise>
 						and (hand_signature is null or hand_signature = '')
 						and (hand_signature is null or hand_signature = '')
@@ -841,4 +841,11 @@
 	</update>
 	</update>
 
 
 
 
+	<update id="updateHandSignatureByUserId">
+		update work_staff_basic_info
+		set hand_signature = #{handSignature}
+		where user_id = #{userId}
+	</update>
+
+
 </mapper>
 </mapper>

+ 32 - 0
src/main/resources/mappings/modules/workstaff/WorkStaffCertificateDao.xml

@@ -22,6 +22,9 @@
 		a.iss_type AS "issType",
 		a.iss_type AS "issType",
 		a.file_path AS "filePath",
 		a.file_path AS "filePath",
 		a.file_name AS "fileName",
 		a.file_name AS "fileName",
+		a.valid_start_date AS "validStartDate",
+		a.valid_end_date AS "validEndDate",
+		a.start_date AS "startDate",
 		a.end_date As "endDate"
 		a.end_date As "endDate"
 	</sql>
 	</sql>
 	
 	
@@ -103,6 +106,9 @@
 			iss_type,
 			iss_type,
 			file_path,
 			file_path,
 			file_name,
 			file_name,
+			valid_start_date,
+			valid_end_date,
+			start_date,
 			end_date
 			end_date
 		) VALUES (
 		) VALUES (
 			#{id},
 			#{id},
@@ -124,6 +130,9 @@
 			#{issType},
 			#{issType},
 			#{filePath},
 			#{filePath},
 			#{fileName},
 			#{fileName},
+			#{validStartDate},
+			#{validEndDate},
+			#{startDate},
 			#{endDate}
 			#{endDate}
 		)
 		)
 	</insert>
 	</insert>
@@ -145,6 +154,15 @@
 			iss_type = #{issType},
 			iss_type = #{issType},
 			file_path = #{filePath},
 			file_path = #{filePath},
 			file_name = #{fileName},
 			file_name = #{fileName},
+			<if test="validStartDate !=null">
+				valid_start_date = #{validStartDate},
+			</if>
+			<if test="validEndDate !=null">
+				valid_end_date = #{validEndDate},
+			</if>
+			<if test="startDate !=null">
+				start_date = #{startDate},
+			</if>
 			end_date = #{endDate}
 			end_date = #{endDate}
 		WHERE id = #{id}
 		WHERE id = #{id}
 	</update>
 	</update>
@@ -240,4 +258,18 @@
 			file_name = #{fileName}
 			file_name = #{fileName}
 		WHERE id = #{id}
 		WHERE id = #{id}
 	</update>
 	</update>
+
+
+
+	<select id="getFirstCostEngineerList" resultType="WorkStaffCertificate" >
+		SELECT
+		<include refid="workStaffCertificateColumns"/>
+		FROM work_staff_certificate a
+		<include refid="workStaffCertificateJoins"/>
+		<where>
+			a.del_flag = 0 and name = '161'
+		</where>
+	</select>
+
+
 </mapper>
 </mapper>

+ 20 - 0
src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailAudit.jsp

@@ -442,6 +442,7 @@
                 <form:hidden path="id"/>
                 <form:hidden path="id"/>
                 <form:hidden path="userId"/>
                 <form:hidden path="userId"/>
                 <form:hidden path="home"/>
                 <form:hidden path="home"/>
+                <form:hidden path="handSignature"/>
                 <div class="form-group layui-row first">
                 <div class="form-group layui-row first">
                     <div class="form-group-label"><h2>基本信息</h2></div>
                     <div class="form-group-label"><h2>基本信息</h2></div>
                     <div class="layui-item layui-col-sm6 lw7" style="padding-right: 0;">
                     <div class="layui-item layui-col-sm6 lw7" style="padding-right: 0;">
@@ -726,6 +727,25 @@
                         </div>
                         </div>
                     </div>--%>
                     </div>--%>
                 </div>
                 </div>
+
+                <div class="form-group layui-row">
+                    <div class="form-group-label"><h2>手签章</h2></div>
+                    <div class="layui-item nav-btns">
+                        <div class="layui-upload-list">
+                            <c:choose>
+                                <c:when test="${not empty workStaffBasicInfo.handSignatureUrl}">
+                                    <img class="layui-upload-img" width="200px" height="150px" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workStaffBasicInfo.handSignatureUrl}','90%','90%')" id="handSignatureImg" src="${workStaffBasicInfo.handSignatureUrl}">
+                                </c:when>
+                                <c:otherwise>
+                                    <img class="layui-upload-img" width="100px" height="75px" id="handSignatureImg" src="${ctxStatic}/common/images/not_available_picture.jpg">
+                                </c:otherwise>
+                            </c:choose>
+                            <p id="handSignatureText"></p>
+                        </div>
+                    </div>
+                </div>
+
+
                 <div class="form-group layui-row">
                 <div class="form-group layui-row">
                     <div class="form-group-label"><h2>教育经历</h2></div>
                     <div class="form-group-label"><h2>教育经历</h2></div>
                     <div class="layui-item layui-col-xs12 form-table-container">
                     <div class="layui-item layui-col-xs12 form-table-container">

+ 67 - 3
src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailModify.jsp

@@ -193,10 +193,53 @@
 
 
 
 
 		$(document).ready(function() {
 		$(document).ready(function() {
-            layui.use(['form', 'layer'], function () {
+            layui.use(['form','upload', 'element', 'layer'], function() {
                 var form = layui.form;
                 var form = layui.form;
+                var $ = layui.jquery
+                    , upload = layui.upload
+                    , element = layui.element
+                    , layer = layui.layer;
+
+                //常规使用 - 普通图片上传
+                var uploadInst = upload.render({
+                    elem: '#test1'
+                    ,url: '${ctx}/bos/upLoadHandSignatureImg' //此处用的是第三方的 http 请求演示,实际使用时改成您自己的上传接口即可。
+                    ,before: function(obj){
+                        //预读本地文件示例,不支持ie8
+                        obj.preview(function(index, file, result){
+                            $('#handSignatureImg').attr('src', result); //图片链接(base64)
+                        });
+                        layer.msg('上传中', {icon: 16, time: 0});
+                    }
+                    ,done: function(res){
+                        //如果上传失败
+                        if(res.code != 1){
+                            return layer.msg('上传失败');
+                        }
+                        //上传成功的一些操作
+                        //console.log(res.url)
+                        $("#handSignature").val(res.url);
+                        layer.msg('上传完毕', {icon: 1});
+                        //……
+                        $('#handSignatureText').html(''); //置空上传失败的状态
+                    }
+                    ,error: function(){
+                        //演示失败状态,并实现重传
+                        var handSignatureText = $('#handSignatureText');
+                        handSignatureText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
+                        handSignatureText.find('.demo-reload').on('click', function(){
+                            uploadInst.upload();
+                        });
+                    }
+                    //进度条
+                    /*,progress: function(n, elem, e){
+                        if(n == 100){
+                            layer.msg('上传完毕', {icon: 1});
+                        }
+                    }*/
+                });
+            })
 
 
-            });
 			validateForm = $("#inputForm").validate({
 			validateForm = $("#inputForm").validate({
 				submitHandler: function(form){
 				submitHandler: function(form){
 					loading('正在提交,请稍等...');
 					loading('正在提交,请稍等...');
@@ -663,6 +706,7 @@
                 <form:hidden path="id"/>
                 <form:hidden path="id"/>
                 <form:hidden path="userId"/>
                 <form:hidden path="userId"/>
                 <form:hidden path="home"/>
                 <form:hidden path="home"/>
+                <form:hidden path="handSignature"/>
                 <input type="hidden" id="subbmitFlag" value="0">
                 <input type="hidden" id="subbmitFlag" value="0">
                 <div class="form-group layui-row first">
                 <div class="form-group layui-row first">
                     <div class="form-group-label"><h2>基本信息</h2></div>
                     <div class="form-group-label"><h2>基本信息</h2></div>
@@ -968,6 +1012,26 @@
                         </div>
                         </div>
                     </div>--%>
                     </div>--%>
                 </div>
                 </div>
+
+                <div class="form-group layui-row">
+                    <div class="form-group-label"><h2>手签章</h2></div>
+                    <div class="layui-item nav-btns">
+                        <button type="button" class="layui-btn" id="test1">上传手签章</button>
+                        <div class="layui-upload-list">
+                            <c:choose>
+                                <c:when test="${not empty workStaffBasicInfo.handSignatureUrl}">
+                                    <img class="layui-upload-img" width="200px" height="150px" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workStaffBasicInfo.handSignatureUrl}','90%','90%')" id="handSignatureImg" src="${workStaffBasicInfo.handSignatureUrl}">
+                                </c:when>
+                                <c:otherwise>
+                                    <img class="layui-upload-img" width="100px" height="75px" id="handSignatureImg">
+                                </c:otherwise>
+                            </c:choose>
+                            <p id="handSignatureText"></p>
+                        </div>
+                    </div>
+                </div>
+
+
                 <div class="form-group layui-row">
                 <div class="form-group layui-row">
                     <div class="form-group-label"><h2><span class="require-item">*</span>教育经历<span style="color: #FF7A00;">(必填)</span></h2></div>
                     <div class="form-group-label"><h2><span class="require-item">*</span>教育经历<span style="color: #FF7A00;">(必填)</span></h2></div>
                     <div class="layui-item nav-btns">
                     <div class="layui-item nav-btns">
@@ -1044,7 +1108,7 @@
                                     </td>
                                     </td>
                                     <td class="text-center op-td">
                                     <td class="text-center op-td">
                                         <a class="op-btn op-btn-add" title="修改" onclick="this_upload_file_button('educationList${varStatus.index}_eduPhotoFile')"><i class="fa fa-plus"></i>&nbsp;修改</a><span id="educationList${varStatus.index}_eduPhotoFileName1"><c:if test="${not empty education.eduPhotoThumbnailStr}"><img src="${education.eduPhotoThumbnailStr}" width="24" height="24" onclick="clickPicture('${education.eduPhotoStr}')" alt=""></c:if></span>
                                         <a class="op-btn op-btn-add" title="修改" onclick="this_upload_file_button('educationList${varStatus.index}_eduPhotoFile')"><i class="fa fa-plus"></i>&nbsp;修改</a><span id="educationList${varStatus.index}_eduPhotoFileName1"><c:if test="${not empty education.eduPhotoThumbnailStr}"><img src="${education.eduPhotoThumbnailStr}" width="24" height="24" onclick="clickPicture('${education.eduPhotoStr}')" alt=""></c:if></span>
-                                        <input id="educationList${varStatus.index}_eduPhotoFile" name="educationList[${varStatus.index}].eduPhotoFile" class="judgment" style="display:none" type="file" onchange="changelaborContractFileName(this,1)"/>
+                                        <input id="educationList${varStatus.index}_eduPhotoFile" name="educationList[${varStatus.index}].eduPhotoFile" style="display:none" type="file" onchange="changelaborContractFileName(this,1)"/>
                                     </td>
                                     </td>
                                     <td class="text-center op-td">
                                     <td class="text-center op-td">
                                         <a class="op-btn op-btn-add" title="修改" onclick="this_upload_file_button('educationList${varStatus.index}_degreePhotoFile')"><i class="fa fa-plus"></i>&nbsp;修改</a><span id="educationList${varStatus.index}_degreePhotoFileName1"><c:if test="${not empty education.degreePhotoThumbnailStr}"><img src="${education.degreePhotoThumbnailStr}" width="24" height="24" onclick="clickPicture('${education.degreePhotoStr}')" alt=""></c:if></span>
                                         <a class="op-btn op-btn-add" title="修改" onclick="this_upload_file_button('educationList${varStatus.index}_degreePhotoFile')"><i class="fa fa-plus"></i>&nbsp;修改</a><span id="educationList${varStatus.index}_degreePhotoFileName1"><c:if test="${not empty education.degreePhotoThumbnailStr}"><img src="${education.degreePhotoThumbnailStr}" width="24" height="24" onclick="clickPicture('${education.degreePhotoStr}')" alt=""></c:if></span>

+ 2 - 0
src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoForm.jsp

@@ -671,6 +671,7 @@
         }
         }
 
 
         function changelaborContractFileName(obj, index) {
         function changelaborContractFileName(obj, index) {
+            console.log(1231)
             var file = obj.files[0];
             var file = obj.files[0];
             var url = null;
             var url = null;
             if (window.createObjectURL != undefined) {
             if (window.createObjectURL != undefined) {
@@ -735,6 +736,7 @@
                 // 用字符串拼接构建图片HTML(避免模板字符串)
                 // 用字符串拼接构建图片HTML(避免模板字符串)
                 var imgHtml = "<img style='width: 100%; height: 100%; object-fit: contain; background: #f5f5f5;' src='" + url + "' />";
                 var imgHtml = "<img style='width: 100%; height: 100%; object-fit: contain; background: #f5f5f5;' src='" + url + "' />";
 
 
+                console.log(1231231)
                 // 弹出层
                 // 弹出层
                 top.layer.open({
                 top.layer.open({
                     type: 1,
                     type: 1,