Browse Source

人力资源管理 人员信息登记部分代码提交

徐滕 1 week ago
parent
commit
a2466604fc
49 changed files with 6423 additions and 384 deletions
  1. 150 0
      src/main/java/com/jeeplus/common/oss/OSSClientUtil.java
  2. 57 0
      src/main/java/com/jeeplus/modules/sys/service/WorkattachmentService.java
  3. 7 0
      src/main/java/com/jeeplus/modules/workprojectnotify/dao/WorkProjectNotifyDao.java
  4. 6 0
      src/main/java/com/jeeplus/modules/workprojectnotify/service/WorkProjectNotifyService.java
  5. 20 3
      src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java
  6. 2 0
      src/main/java/com/jeeplus/modules/workstaff/dao/WorkStaffAchivesDao.java
  7. 27 0
      src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffBasicInfo.java
  8. 9 0
      src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffCertificate.java
  9. 19 0
      src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffEducation.java
  10. 9 0
      src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffLaborContract.java
  11. 9 0
      src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffLanguages.java
  12. 9 0
      src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffRecord.java
  13. 9 0
      src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffRewards.java
  14. 9 0
      src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffTitle.java
  15. 9 0
      src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffTraining.java
  16. 297 0
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffAchievementService.java
  17. 292 12
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffBasicInfoService.java
  18. 369 8
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffCertificateService.java
  19. 454 1
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffEducationService.java
  20. 309 0
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffExperienceService.java
  21. 293 0
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffFamilyService.java
  22. 377 8
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffLaborContractService.java
  23. 375 4
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffLanguagesService.java
  24. 342 0
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffRecordService.java
  25. 297 0
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffRewardsService.java
  26. 297 0
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffSocialPositionService.java
  27. 341 0
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffTitleService.java
  28. 362 0
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffTrainingService.java
  29. 99 6
      src/main/java/com/jeeplus/modules/workstaff/web/WorkStaffBasicInfoController.java
  30. 29 0
      src/main/java/com/jeeplus/modules/workstaff/web/WorkStaffBasicInfoEmploymentInController.java
  31. 11 0
      src/main/java/com/jeeplus/modules/workstaffachiveslog/dao/WorkStaffAchivesLogDao.java
  32. 45 0
      src/main/java/com/jeeplus/modules/workstaffachiveslog/service/WorkStaffAchivesLogService.java
  33. 10 0
      src/main/resources/mappings/modules/workprojectnotify/WorkProjectNotifyDao.xml
  34. 16 2
      src/main/resources/mappings/modules/workstaff/WorkStaffAchivesDao.xml
  35. 0 7
      src/main/resources/mappings/modules/workstaff/WorkStaffBasicInfoDao.xml
  36. 16 0
      src/main/resources/mappings/modules/workstaffachiveslog/WorkStaffAchivesLogDao.xml
  37. 1 1
      src/main/webapp/webpage/modules/sys/sysHome.jsp
  38. 77 13
      src/main/webapp/webpage/modules/sys/userInfo.jsp
  39. 3 3
      src/main/webapp/webpage/modules/workprojectnotify/workProjectNotifyList.jsp
  40. 5 5
      src/main/webapp/webpage/modules/workstaff/workStaffBasicCertificateModify.jsp
  41. 26 18
      src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailAudit.jsp
  42. 241 143
      src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailForm.jsp
  43. 227 143
      src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailModify.jsp
  44. 2 2
      src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailModifyDirectly.jsp
  45. 2 2
      src/main/webapp/webpage/modules/workstaff/workStaffBasicDirectlyAudit.jsp
  46. 2 2
      src/main/webapp/webpage/modules/workstaff/workStaffBasicDirectlyModify.jsp
  47. 436 0
      src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoDimissionList.jsp
  48. 418 0
      src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoEmploymentInList.jsp
  49. 1 1
      src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoList.jsp

+ 150 - 0
src/main/java/com/jeeplus/common/oss/OSSClientUtil.java

@@ -6,6 +6,8 @@ import com.aliyun.oss.OSSException;
 import com.aliyun.oss.model.*;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.utils.Encodes;
+import com.aliyun.oss.HttpMethod;
+import java.util.Base64;
 import com.jeeplus.common.utils.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -967,6 +969,154 @@ public class OSSClientUtil {
         return url.toString();
     }
 
+
+    /**
+     * 获取阿里云 OSS 上图片的缩略图临时访问地址
+     * @param file 图片完整路径(包含 http(s)://)
+     * @return 带缩略图样式的临时URL
+     */
+    public String getThumbnailTemporaryLookUrl(String file) {
+        try {
+            file = file.replace("amp;", "");
+
+            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;
+            }
+
+            // 获取 key(即 OSS 路径)
+            String key = file.split(cons + "/")[1];
+
+            // 设置过期时间(24小时)
+            Date expiration = new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 24);
+
+            // 设置图片处理参数,这里按宽度200缩放
+            GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucketName, key, HttpMethod.GET);
+            request.setExpiration(expiration);
+            request.setProcess("image/resize,w_200"); // ✅ 这里是关键:缩略图处理样式
+
+            // 生成带签名的URL
+            URL url = ossClient.generatePresignedUrl(request);
+            return url.toString();
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "";
+        }
+    }
+
+    /**
+     * 阿里云获取临时文件查看url(带水印)
+     * @param file OSS 文件完整 URL
+     * @return 带临时访问权限的 URL
+     */
+    public String getFileTemporaryLookUrlWithWatermark(String file) {
+        try {
+            file = file.replace("amp;", "");
+
+            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 key = file.split(cons + "/")[1];
+
+            // 过期时间 24 小时
+            Date expiration = new Date(System.currentTimeMillis() + 1000L * 60 * 60 * 24);
+
+            // 构建预签名请求(带水印)
+            GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucketName, key, HttpMethod.GET);
+
+            String text = "仅用于公司人员信息备案,其他用途无效";
+            // 将字符串转为 UTF-8 字节
+            byte[] bytes = text.getBytes(java.nio.charset.StandardCharsets.UTF_8);
+
+            // 使用 URL Safe Base64 编码
+            String base64Text = Base64.getUrlEncoder().withoutPadding().encodeToString(bytes);
+
+            // 设置水印参数:中间 g_center,红色 FF0000,字号 40
+            String imageProcess = "image/blur,r_50,s_5" + "/watermark,text_" + base64Text + ",color_FF0000,size_40,g_center,rotate_45";
+
+            request.setProcess(imageProcess);
+
+            request.setExpiration(expiration);
+
+            URL url = ossClient.generatePresignedUrl(request);
+            return url.toString();
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "";
+        }
+    }
+
+
+    /**
+     * 获取阿里云 OSS 上图片的缩略图临时访问地址(带签名、缩略图、图片虚化)
+     * @param file 图片完整路径(包含 http(s)://)
+     * @return 带缩略图样式的临时URL
+     */
+    public String getThumbnailTemporaryWithWatermarkDimLookUrl(String file) {
+        try {
+            file = file.replace("amp;", "");
+
+            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;
+            }
+
+            // 获取 key(即 OSS 路径)
+            String key = file.split(cons + "/")[1];
+
+            // 设置过期时间(24小时)
+            Date expiration = new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 24);
+
+            // 设置图片处理参数,这里按宽度200缩放
+            GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucketName, key, HttpMethod.GET);
+            request.setExpiration(expiration);
+
+            String text = "仅用于公司人员信息备案,其他用途无效";
+            // 将字符串转为 UTF-8 字节
+            byte[] bytes = text.getBytes(java.nio.charset.StandardCharsets.UTF_8);
+
+            // 使用 URL Safe Base64 编码
+            String base64Text = Base64.getUrlEncoder().withoutPadding().encodeToString(bytes);
+
+            String imageProcess = "image/blur,r_50,s_5" + "/watermark,text_" + base64Text + ",color_FF0000,size_40,g_center,rotate_45"+ "/resize,w_200";
+
+            request.setProcess(imageProcess);
+
+            // 生成带签名的URL
+            URL url = ossClient.generatePresignedUrl(request);
+            return url.toString();
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "";
+        }
+    }
+
+
     /**
      * 阿里云获取临时文件查看url
      * 签章文件查看

+ 57 - 0
src/main/java/com/jeeplus/modules/sys/service/WorkattachmentService.java

@@ -1087,6 +1087,63 @@ public class WorkattachmentService extends CrudService<WorkattachmentDao, Workat
 	}
 
 	/**
+	 * 数据处理(如果为阿里云文件服务器,则对查看的路径进行处理)
+	 * @param url
+	 */
+	public static String fileUrlThumbnailManage(String url){
+		String newUrl = null;
+		// 判断文件存储方式(0:本地服务器存储。1:云端存储)
+			switch (uploadMode){
+				case "1":
+
+					break;
+				case "2":
+					newUrl = new OSSClientUtil().getThumbnailTemporaryLookUrl(url);
+					break;
+
+			}
+			return newUrl;
+	}
+
+	/**
+	 * 数据处理(如果为阿里云文件服务器,则对查看的路径进行处理)
+	 * @param url
+	 */
+	public static String fileUrlThumbnailManageWithWatermark(String url){
+		String newUrl = null;
+		// 判断文件存储方式(0:本地服务器存储。1:云端存储)
+			switch (uploadMode){
+				case "1":
+
+					break;
+				case "2":
+					newUrl = new OSSClientUtil().getFileTemporaryLookUrlWithWatermark(url);
+					break;
+
+			}
+			return newUrl;
+	}
+
+	/**
+	 * 获取阿里云 OSS 上图片的缩略图临时访问地址(带签名、缩略图、图片虚化)
+	 * @param url
+	 */
+	public static String getThumbnailTemporaryWithWatermarkDimLookUrl(String url){
+		String newUrl = null;
+		// 判断文件存储方式(0:本地服务器存储。1:云端存储)
+			switch (uploadMode){
+				case "1":
+
+					break;
+				case "2":
+					newUrl = new OSSClientUtil().getThumbnailTemporaryWithWatermarkDimLookUrl(url);
+					break;
+
+			}
+			return newUrl;
+	}
+
+	/**
 	 * 数据处理
 	 * @param url
 	 */

+ 7 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/dao/WorkProjectNotifyDao.java

@@ -144,4 +144,11 @@ public interface WorkProjectNotifyDao extends CrudDao<WorkProjectNotify> {
      * @param type
      */
     void updateCaseBaseNotifyStatus(@Param("notifyId") String notifyId,@Param("type")String type);
+
+    /**
+     * 根据title查询通知信息
+     * @param title
+     * @return
+     */
+    List<WorkProjectNotify> getByNotifyIdAndNotifyUserAndTitle(@Param("title") String title, @Param("notifyId")String notifyId, @Param("notifyUserId")String notifyUserId);
 }

+ 6 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/service/WorkProjectNotifyService.java

@@ -464,4 +464,10 @@ public class WorkProjectNotifyService extends CrudService<WorkProjectNotifyDao,
 		}
 		return workProjectNotify;
 	}
+
+
+	public List<WorkProjectNotify> getByNotifyIdAndNotifyUserAndTitle(String title,String notifyId, String notifyUserId) {
+		List<WorkProjectNotify> list = dao.getByNotifyIdAndNotifyUserAndTitle(title, notifyId, notifyUserId);
+		return list;
+	}
 }

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

@@ -7702,10 +7702,27 @@ public class WorkProjectNotifyController extends BaseController {
 						WorkStaffBasicInfo select = new WorkStaffBasicInfo();
 						select.setAchiveId(workProjectNotify.getNotifyId());
 						WorkStaffBasicInfo workStaffBasicInfo = workStaffBasicInfoService.getAchive(select);
-						if (StringUtils.isNotBlank(workStaffBasicInfo.getId())) {
-							workStaffBasicInfoService.queryDetails(workStaffBasicInfo);
+
+						if ("1".equals(workStaffBasicInfo.getAuditStatus())) {
+							if (StringUtils.isNotBlank(workStaffBasicInfo.getId())) {
+								workStaffBasicInfoService.queryStoreDetailsApply(workStaffBasicInfo);
+							}
+							workStaffBasicInfoService.storeQuerys(workStaffBasicInfo);
+						}else{
+							if(StringUtils.isNotBlank(workStaffBasicInfo.getId())){
+								workStaffBasicInfoService.queryDetails(workStaffBasicInfo);
+							}
+						}
+						if(StringUtils.isBlank(workProjectNotify.getHome())){
+							workStaffBasicInfo.setHome("home");
+						}else{
+							workStaffBasicInfo.setHome(workProjectNotify.getHome());
+						}
+
+						if(StringUtils.isNotBlank(workStaffBasicInfo.getPicture())){
+							String urlManage = WorkattachmentService.fileUrlManage(workStaffBasicInfo.getPicture());
+							workStaffBasicInfo.setPictureStr(urlManage);
 						}
-						workStaffBasicInfo.setHome("home");
 						model.addAttribute("workStaffBasicInfo", workStaffBasicInfo);
 						String view = "modules/workstaff/workStaffAchiveInfoForm";
 						if (UserUtils.getUser().getId().equals(workStaffBasicInfo.getUserId())) {

+ 2 - 0
src/main/java/com/jeeplus/modules/workstaff/dao/WorkStaffAchivesDao.java

@@ -58,5 +58,7 @@ public interface WorkStaffAchivesDao extends CrudDao<WorkStaffBasicInfo> {
 
     void updateAlterationDate(String id);
 
+    void updateAuditStatus(@Param("id")String id, @Param("status")String status);
+
     public String getHightEduByAchiveId(String achiveId);
 }

+ 27 - 0
src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffBasicInfo.java

@@ -136,10 +136,13 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
     private String idCardPortraitName;        // 身份证人身箱照片名称
     private String idCardPortraitPath;        // 身份证人身箱照片路径
     private String idCardPortraitPathStr;        // 身份证人身箱照片路径
+    private String idCardPortraitPathThumbnailStr;        // 身份证人身箱照片路径(缩略图)
     private MultipartFile idCardNationalEmblem;        // 身份证国徽照片
     private String idCardNationalEmblemName;        // 身份证国徽照片名称
     private String idCardNationalEmblemPath;        // 身份证国徽照片路径
     private String idCardNationalEmblemPathStr;        // 身份证国徽照片路径
+    private String idCardNationalEmblemPathThumbnailStr;        // 身份证国徽照片路径(缩略图)
+    private String auditStatus;        // 审核状态
 
     public String getDdId() {
         return ddId;
@@ -1056,4 +1059,28 @@ public class WorkStaffBasicInfo extends DataEntity<WorkStaffBasicInfo> {
     public void setIdCardNationalEmblemPathStr(String idCardNationalEmblemPathStr) {
         this.idCardNationalEmblemPathStr = idCardNationalEmblemPathStr;
     }
+
+    public String getAuditStatus() {
+        return auditStatus;
+    }
+
+    public void setAuditStatus(String auditStatus) {
+        this.auditStatus = auditStatus;
+    }
+
+    public String getIdCardPortraitPathThumbnailStr() {
+        return idCardPortraitPathThumbnailStr;
+    }
+
+    public void setIdCardPortraitPathThumbnailStr(String idCardPortraitPathThumbnailStr) {
+        this.idCardPortraitPathThumbnailStr = idCardPortraitPathThumbnailStr;
+    }
+
+    public String getIdCardNationalEmblemPathThumbnailStr() {
+        return idCardNationalEmblemPathThumbnailStr;
+    }
+
+    public void setIdCardNationalEmblemPathThumbnailStr(String idCardNationalEmblemPathThumbnailStr) {
+        this.idCardNationalEmblemPathThumbnailStr = idCardNationalEmblemPathThumbnailStr;
+    }
 }

+ 9 - 0
src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffCertificate.java

@@ -30,6 +30,7 @@ public class WorkStaffCertificate extends DataEntity<WorkStaffCertificate> {
 	private String issType;		// 取得方式
 	private String filePath;		// 文件
 	private String filePathStr;		// 文件
+	private String filePathThumbnailStr;		// 文件缩略图
     private String fileName;		// 文件名
     private MultipartFile file;
     private String idCard;		//身份证号
@@ -201,4 +202,12 @@ public class WorkStaffCertificate extends DataEntity<WorkStaffCertificate> {
 	public void setFilePathStr(String filePathStr) {
 		this.filePathStr = filePathStr;
 	}
+
+	public String getFilePathThumbnailStr() {
+		return filePathThumbnailStr;
+	}
+
+	public void setFilePathThumbnailStr(String filePathThumbnailStr) {
+		this.filePathThumbnailStr = filePathThumbnailStr;
+	}
 }

+ 19 - 0
src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffEducation.java

@@ -34,6 +34,9 @@ public class WorkStaffEducation extends DataEntity<WorkStaffEducation> {
 	private String degreePhotoStr;		// 学位证书
 	private String heightEdu;		// 是否最高学历
 
+	private String eduPhotoThumbnailStr;		// 学历证书
+	private String degreePhotoThumbnailStr;		// 学位证书
+
     public MultipartFile getDegreePhotoFile() {
         return degreePhotoFile;
     }
@@ -173,4 +176,20 @@ public class WorkStaffEducation extends DataEntity<WorkStaffEducation> {
 	public void setHeightEdu(String heightEdu) {
 		this.heightEdu = heightEdu;
 	}
+
+	public String getEduPhotoThumbnailStr() {
+		return eduPhotoThumbnailStr;
+	}
+
+	public void setEduPhotoThumbnailStr(String eduPhotoThumbnailStr) {
+		this.eduPhotoThumbnailStr = eduPhotoThumbnailStr;
+	}
+
+	public String getDegreePhotoThumbnailStr() {
+		return degreePhotoThumbnailStr;
+	}
+
+	public void setDegreePhotoThumbnailStr(String degreePhotoThumbnailStr) {
+		this.degreePhotoThumbnailStr = degreePhotoThumbnailStr;
+	}
 }

+ 9 - 0
src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffLaborContract.java

@@ -35,6 +35,7 @@ public class WorkStaffLaborContract extends DataEntity<WorkStaffLaborContract> {
 
 	private String filePath;		// 文件
 	private String filePathStr;		// 文件
+	private String filePathThumbnailStr;		// 文件
     private String fileName;		// 文件名
     private MultipartFile file;
 	private String zixunyuanId;		//咨询员id
@@ -208,4 +209,12 @@ public class WorkStaffLaborContract extends DataEntity<WorkStaffLaborContract> {
 	public void setFilePath(String filePath) {
 		this.filePath = filePath;
 	}
+
+	public String getFilePathThumbnailStr() {
+		return filePathThumbnailStr;
+	}
+
+	public void setFilePathThumbnailStr(String filePathThumbnailStr) {
+		this.filePathThumbnailStr = filePathThumbnailStr;
+	}
 }

+ 9 - 0
src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffLanguages.java

@@ -25,6 +25,7 @@ public class WorkStaffLanguages extends DataEntity<WorkStaffLanguages> {
 	private Date certifDate;		// 获证日期
 	private String filePath;		// 文件
 	private String filePathStr;		// 文件
+	private String filePathThumbnailStr;		// 文件
 	private String fileName;		// 文件名
     private MultipartFile file;
 
@@ -113,4 +114,12 @@ public class WorkStaffLanguages extends DataEntity<WorkStaffLanguages> {
 	public void setFilePathStr(String filePathStr) {
 		this.filePathStr = filePathStr;
 	}
+
+	public String getFilePathThumbnailStr() {
+		return filePathThumbnailStr;
+	}
+
+	public void setFilePathThumbnailStr(String filePathThumbnailStr) {
+		this.filePathThumbnailStr = filePathThumbnailStr;
+	}
 }

+ 9 - 0
src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffRecord.java

@@ -21,6 +21,7 @@ public class WorkStaffRecord extends DataEntity<WorkStaffRecord> {
 	private String num;		// 编号
 	private String filePath;		// 文件
 	private String filePathStr;		// 文件
+	private String filePathThumbnailStr;		// 文件
 	private String status;		// 验证
     private String fileName;		// 文件名
     private MultipartFile file;
@@ -101,4 +102,12 @@ public class WorkStaffRecord extends DataEntity<WorkStaffRecord> {
 	public void setFilePathStr(String filePathStr) {
 		this.filePathStr = filePathStr;
 	}
+
+	public String getFilePathThumbnailStr() {
+		return filePathThumbnailStr;
+	}
+
+	public void setFilePathThumbnailStr(String filePathThumbnailStr) {
+		this.filePathThumbnailStr = filePathThumbnailStr;
+	}
 }

+ 9 - 0
src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffRewards.java

@@ -25,6 +25,7 @@ public class WorkStaffRewards extends DataEntity<WorkStaffRewards> {
 	private String organization;		// 授予机构
 	private String filePath;		// 文件
 	private String filePathStr;		// 文件
+	private String filePathThumbnailStr;		// 文件
 	private String fileName;		// 文件名
 	private MultipartFile file;
 	
@@ -130,4 +131,12 @@ public class WorkStaffRewards extends DataEntity<WorkStaffRewards> {
 	public void setFile(MultipartFile file) {
 		this.file = file;
 	}
+
+	public String getFilePathThumbnailStr() {
+		return filePathThumbnailStr;
+	}
+
+	public void setFilePathThumbnailStr(String filePathThumbnailStr) {
+		this.filePathThumbnailStr = filePathThumbnailStr;
+	}
 }

+ 9 - 0
src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffTitle.java

@@ -26,6 +26,7 @@ public class WorkStaffTitle extends DataEntity<WorkStaffTitle> {
 	private String approvalAuthority;		// 审批单位
 	private String filePath;		// 文件
 	private String filePathStr;		// 文件
+	private String filePathThumbnailStr;		// 文件
     private String fileName;		// 文件名
     private MultipartFile file;
 
@@ -123,4 +124,12 @@ public class WorkStaffTitle extends DataEntity<WorkStaffTitle> {
 	public void setFilePathStr(String filePathStr) {
 		this.filePathStr = filePathStr;
 	}
+
+	public String getFilePathThumbnailStr() {
+		return filePathThumbnailStr;
+	}
+
+	public void setFilePathThumbnailStr(String filePathThumbnailStr) {
+		this.filePathThumbnailStr = filePathThumbnailStr;
+	}
 }

+ 9 - 0
src/main/java/com/jeeplus/modules/workstaff/entity/WorkStaffTraining.java

@@ -29,6 +29,7 @@ public class WorkStaffTraining extends DataEntity<WorkStaffTraining> {
 	private String certificate;		// 所获证书
 	private String filePath;		// 文件
 	private String filePathStr;		// 文件
+	private String filePathThumbnailStr;		// 文件
     private String fileName;		// 文件名
     private MultipartFile file;
 
@@ -153,4 +154,12 @@ public class WorkStaffTraining extends DataEntity<WorkStaffTraining> {
 	public void setFilePathStr(String filePathStr) {
 		this.filePathStr = filePathStr;
 	}
+
+	public String getFilePathThumbnailStr() {
+		return filePathThumbnailStr;
+	}
+
+	public void setFilePathThumbnailStr(String filePathThumbnailStr) {
+		this.filePathThumbnailStr = filePathThumbnailStr;
+	}
 }

+ 297 - 0
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffAchievementService.java

@@ -9,6 +9,7 @@ import java.lang.reflect.Method;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -20,6 +21,7 @@ import com.jeeplus.modules.sys.dao.UserDao;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
+import com.jeeplus.modules.workstaff.entity.WorkStaffFamily;
 import com.jeeplus.modules.workstaff.entity.WorkStaffLanguages;
 import com.jeeplus.modules.workstaffachiveslog.entity.WorkStaffAchivesLog;
 import com.jeeplus.modules.workstaffachiveslog.service.WorkStaffAchivesLogService;
@@ -271,6 +273,141 @@ public class WorkStaffAchievementService extends CrudService<WorkStaffAchievemen
         }
         workStaffBasicInfo.setAchievementList(newList);
     }
+
+    public void storeQuerys(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
+        if(workStaffBasicInfo==null|| StringUtils.isBlank(workStaffBasicInfo.getId())){
+            return;
+        }
+        WorkStaffAchievement entity = new WorkStaffAchievement();
+        entity.setStaff(workStaffBasicInfo.getId());
+        List<WorkStaffAchievement> list=this.findList(entity);
+        List<WorkStaffAchievement> newList=Lists.newArrayList();
+        if(list!=null&&list.size()>0){//修改
+            for(WorkStaffAchievement workStaffAchievement:list){
+                Class<? extends WorkStaffAchievement> newClass = workStaffAchievement.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("projName".equals(name)||"projClient".equals(name)||"category".equals(name)||"unitNumber".equals(name)||"duty".equals(name)
+                            || "content".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                        workStaffAchivesLog.setModule("工作业绩");
+                        workStaffAchivesLog.setSonId(workStaffAchievement.getId());
+                        workStaffAchivesLog.setFields(name);
+                        workStaffAchivesLog.setType("修改");
+                        workStaffAchivesLog.setState("3");
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            Object newInvoke = newClass.getMethod(getMethod).invoke(workStaffAchievement);//修改后
+                            if(newInvoke instanceof String){
+                                Method setReadOnly = workStaffAchievement.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffAchievement,logs.get(0).getNewKey());
+                                }
+                            }
+                            if(newInvoke instanceof Date){//日期
+                                Method setReadOnly = workStaffAchievement.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffAchievement,myDate);
+                                }
+                            }
+                            if(null == newInvoke){
+                                try {
+                                    Method setReadOnly = workStaffAchievement.getClass().getMethod(setMethod, String.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        setReadOnly.invoke(workStaffAchievement,logs.get(0).getNewKey());
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    Method setReadOnly = workStaffAchievement.getClass().getMethod(setMethod, Date.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                        setReadOnly.invoke(workStaffAchievement,myDate);
+                                    }
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                newList.add(workStaffAchievement);
+            }
+        }
+        //新增
+        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+        workStaffAchivesLog.setModule("工作业绩");
+        workStaffAchivesLog.setType("新增");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> sonIds=workStaffAchivesLogService.findSonId(workStaffAchivesLog);
+        if(sonIds!=null&&sonIds.size()>0){
+            for(WorkStaffAchivesLog w:sonIds){
+                workStaffAchivesLog.setSonId(w.getSonId());
+                WorkStaffAchievement workStaffAchievement = new WorkStaffAchievement();
+                workStaffAchievement.setId(w.getSonId());
+                workStaffAchievement.setDelFlag("0");
+                workStaffAchievement.setStaff(workStaffBasicInfo.getId());
+                Class<? extends WorkStaffAchievement> newClass = workStaffAchievement.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("projName".equals(name)||"projClient".equals(name)||"category".equals(name)||"unitNumber".equals(name)||"duty".equals(name)
+                            || "content".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        workStaffAchivesLog.setFields(name);
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            Method setReadOnly = workStaffAchievement.getClass().getMethod(setMethod, String.class);
+                            if(logs!=null&&logs.size()>0){
+                                setReadOnly.invoke(workStaffAchievement,logs.get(0).getNewKey());
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                newList.add(workStaffAchievement);
+            }
+        }
+        //删除
+        WorkStaffAchivesLog delLog=new WorkStaffAchivesLog();
+        delLog.setStaffId(workStaffBasicInfo.getId());
+        delLog.setModule("工作业绩");
+        delLog.setType("删除");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> dellogs=workStaffAchivesLogService.findList(delLog);
+        if (dellogs != null && !dellogs.isEmpty()) {
+            List<String> sonIdLists = Lists.newArrayList();
+            for (WorkStaffAchivesLog log : dellogs) {
+                sonIdLists.add(log.getSonId());
+            }
+
+            Iterator<WorkStaffAchievement> iterator = newList.iterator();
+            while (iterator.hasNext()) {
+                WorkStaffAchievement staff = iterator.next();
+                if (sonIdLists.contains(staff.getId())) {
+                    iterator.remove();
+                }
+            }
+        }
+        workStaffBasicInfo.setAchievementList(newList);
+    }
     @Transactional(readOnly = false)
     public void saveEdu(WorkStaffBasicInfo workStaffBasicInfo) {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -334,6 +471,47 @@ public class WorkStaffAchievementService extends CrudService<WorkStaffAchievemen
                             }
                         }
 
+                    }else{
+                        if("1".equals(workStaffBasicInfo.getAuditStatus())){
+                            String newId=IdGen.uuid();
+                            for (Field field : declaredFields) {
+                                String name = field.getName();
+                                if("projName".equals(name)||"projClient".equals(name)||"category".equals(name)||"unitNumber".equals(name)||"duty".equals(name)
+                                        || "content".equals(name)){
+                                    String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                    workStaffAchivesLog.setModule("工作业绩");
+                                    workStaffAchivesLog.setSonId(newId);
+                                    workStaffAchivesLog.setFields(name);
+                                    workStaffAchivesLog.setState("1");
+                                    try {
+                                        Object newInvoke = newClass.getMethod(methodName).invoke(newAchievement);//修改后
+                                        String describes=EDU_MAP.get(name);
+                                        if(newInvoke instanceof String){
+                                            String newValue=newInvoke.toString();
+                                            workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "工作业绩",describes,name,
+                                                    "",newInvoke.toString(),
+                                                    "",newInvoke.toString(),newId,"新增");
+
+                                        }
+                                        if(newInvoke instanceof Date){//日期
+                                            String newDate=sdf.format(newInvoke);
+                                            workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "工作业绩",describes,name,
+                                                    "",newDate,"",newDate,newId,"新增");
+                                        };
+                                    } catch (NoSuchMethodException e) {
+                                        e.printStackTrace();
+                                    } catch (IllegalAccessException e) {
+                                        e.printStackTrace();
+                                    } catch (InvocationTargetException e) {
+                                        e.printStackTrace();
+                                    }
+                                }
+                            }
+                        }
                     }
                 }else if((newAchievement.getId()==null||"".equals(newAchievement.getId()))&&"0".equals(newAchievement.getDelFlag())){//新增
                     String newId=IdGen.uuid();
@@ -389,4 +567,123 @@ public class WorkStaffAchievementService extends CrudService<WorkStaffAchievemen
             }
         }
     }
+
+    @Transactional(readOnly = false)
+    public void storeEdu(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        List<WorkStaffAchievement> achievementList =workStaffBasicInfo.getAchievementList();
+        if(achievementList!=null&&achievementList.size()>0){
+            for(WorkStaffAchievement newAchievement:achievementList){
+                Class<? extends WorkStaffAchievement> newClass = newAchievement.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                if(newAchievement.getId()!=null&&!"1".equals(newAchievement.getDelFlag())&&!"".equals(newAchievement.getId())){
+                    WorkStaffAchievement oldAchievement=this.get(newAchievement.getId());
+                    if(oldAchievement!=null){
+                        Class<? extends WorkStaffAchievement> oldClass = oldAchievement.getClass();
+                        for (Field field : declaredFields) {
+                            String name = field.getName();
+                            if("projName".equals(name)||"projClient".equals(name)||"category".equals(name)||"unitNumber".equals(name)||"duty".equals(name)
+                                    || "content".equals(name)){
+                                String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                workStaffAchivesLog.setModule("工作业绩");
+                                workStaffAchivesLog.setSonId(newAchievement.getId());
+                                workStaffAchivesLog.setFields(name);
+                                workStaffAchivesLog.setState("3");
+                                try {
+                                    Object newInvoke = newClass.getMethod(methodName).invoke(newAchievement);//修改后
+                                    Object oldInvoke = oldClass.getMethod(methodName).invoke(oldAchievement);//修改前
+                                    String describes=EDU_MAP.get(name);
+                                    if(newInvoke instanceof String){
+                                        String newValue=newInvoke.toString();
+                                        String oldValue=oldInvoke.toString();
+                                        if(!newValue.equals(oldValue)){
+                                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "工作业绩",describes,name,
+                                                    oldInvoke.toString(),newInvoke.toString(),
+                                                    oldInvoke.toString(),newInvoke.toString(),newAchievement.getId(),"修改");
+
+                                        }
+                                    }
+                                    if(newInvoke instanceof Date){//日期
+                                        String newDate="";
+                                        String oldDate="";
+                                        if(newInvoke!=null){
+                                            newDate=sdf.format(newInvoke);
+                                        }
+                                        if (oldInvoke!=null){
+                                            oldDate=sdf.format(oldInvoke);
+                                        }
+                                        if(!newDate.equals(oldDate)){
+                                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "工作业绩",describes,name,
+                                                    oldDate,newDate,oldDate,newDate,newAchievement.getId(),"修改");
+                                        }
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    e.printStackTrace();
+                                } catch (IllegalAccessException e) {
+                                    e.printStackTrace();
+                                } catch (InvocationTargetException e) {
+                                    e.printStackTrace();
+                                }
+                            }
+                        }
+
+                    }
+                }else if((newAchievement.getId()==null||"".equals(newAchievement.getId()))&&"0".equals(newAchievement.getDelFlag())){//新增
+                    String newId=IdGen.uuid();
+                    for (Field field : declaredFields) {
+                        String name = field.getName();
+                        if("projName".equals(name)||"projClient".equals(name)||"category".equals(name)||"unitNumber".equals(name)||"duty".equals(name)
+                                || "content".equals(name)){
+                            String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                            WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                            workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                            workStaffAchivesLog.setModule("工作业绩");
+                            workStaffAchivesLog.setSonId(newId);
+                            workStaffAchivesLog.setFields(name);
+                            workStaffAchivesLog.setState("3");
+                            try {
+                                Object newInvoke = newClass.getMethod(methodName).invoke(newAchievement);//修改后
+                                String describes=EDU_MAP.get(name);
+                                if(newInvoke instanceof String){
+                                    String newValue=newInvoke.toString();
+                                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                            "工作业绩",describes,name,
+                                            "",newInvoke.toString(),
+                                            "",newInvoke.toString(),newId,"新增");
+
+                                }
+                                if(newInvoke instanceof Date){//日期
+                                    String newDate=sdf.format(newInvoke);
+                                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                            "工作业绩",describes,name,
+                                            "",newDate,"",newDate,newId,"新增");
+                                };
+                            } catch (NoSuchMethodException e) {
+                                e.printStackTrace();
+                            } catch (IllegalAccessException e) {
+                                e.printStackTrace();
+                            } catch (InvocationTargetException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    }
+                }else if(newAchievement.getId()!=null&&"1".equals(newAchievement.getDelFlag())&&!"".equals(newAchievement.getId())){//删除
+                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                    workStaffAchivesLog.setModule("工作业绩");
+                    workStaffAchivesLog.setSonId(newAchievement.getId());
+                    workStaffAchivesLog.setType("删除");
+                    workStaffAchivesLog.setState("3");
+                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                            "工作业绩","","",
+                            "","",
+                            "","",newAchievement.getId(),"删除");
+                }
+            }
+        }
+    }
 }

+ 292 - 12
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffBasicInfoService.java

@@ -652,7 +652,10 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
         workProjectNotify.setUser(new User(workStaffBasicInfo.getUserId()));
         workProjectNotify.setId("");
         workProjectNotify.setNotifyRole("");
-        workProjectNotifyService.save(workProjectNotify);
+        List<WorkProjectNotify> byNotifyIdAndNotifyUserAndTitle = workProjectNotifyService.getByNotifyIdAndNotifyUserAndTitle(workProjectNotify.getTitle(), workProjectNotify.getNotifyId(), workProjectNotify.getUser().getId());
+        if(byNotifyIdAndNotifyUserAndTitle.isEmpty()){
+            workProjectNotifyService.save(workProjectNotify);
+        }
         UserUtils.pushIm(userIds, contentStr);
     }
 
@@ -667,7 +670,10 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
         workProjectNotify.setUser(new User(workStaffBasicInfo.getUserId()));
         workProjectNotify.setId("");
         workProjectNotify.setNotifyRole("");
-        workProjectNotifyService.save(workProjectNotify);
+        List<WorkProjectNotify> byNotifyIdAndNotifyUserAndTitle = workProjectNotifyService.getByNotifyIdAndNotifyUserAndTitle(workProjectNotify.getTitle(), workProjectNotify.getNotifyId(), workProjectNotify.getUser().getId());
+        if(byNotifyIdAndNotifyUserAndTitle.isEmpty()){
+            workProjectNotifyService.save(workProjectNotify);
+        }
         UserUtils.pushIm(userIds, contentStr);
     }
 
@@ -682,7 +688,10 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
         workProjectNotify.setUser(new User(workStaffBasicInfo.getUserId()));
         workProjectNotify.setId("");
         workProjectNotify.setNotifyRole("");
-        workProjectNotifyService.save(workProjectNotify);
+        List<WorkProjectNotify> byNotifyIdAndNotifyUserAndTitle = workProjectNotifyService.getByNotifyIdAndNotifyUserAndTitle(workProjectNotify.getTitle(), workProjectNotify.getNotifyId(), workProjectNotify.getUser().getId());
+        if(byNotifyIdAndNotifyUserAndTitle.isEmpty()){
+            workProjectNotifyService.save(workProjectNotify);
+        }
         UserUtils.pushIm(userIds, contentStr);
     }
 
@@ -958,14 +967,17 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
         workStaffBasicInfo = workStaffAchivesDao.get(workStaffBasicInfo.getId());
         if (null != workStaffBasicInfo) {
             if (StringUtils.isNotEmpty(workStaffBasicInfo.getIdCardPortraitPath())) {
-                workStaffBasicInfo.setIdCardPortraitPathStr(WorkattachmentService.fileUrlManage(workStaffBasicInfo.getIdCardPortraitPath()));
+                workStaffBasicInfo.setIdCardPortraitPathStr(WorkattachmentService.fileUrlThumbnailManageWithWatermark(workStaffBasicInfo.getIdCardPortraitPath()));
+                workStaffBasicInfo.setIdCardPortraitPathThumbnailStr(WorkattachmentService.getThumbnailTemporaryWithWatermarkDimLookUrl(workStaffBasicInfo.getIdCardPortraitPath()));
             }
             if (StringUtils.isNotEmpty(workStaffBasicInfo.getIdCardNationalEmblemPath())) {
-                workStaffBasicInfo.setIdCardNationalEmblemPathStr(WorkattachmentService.fileUrlManage(workStaffBasicInfo.getIdCardNationalEmblemPath()));
+                //获取水印图
+                workStaffBasicInfo.setIdCardNationalEmblemPathStr(WorkattachmentService.fileUrlThumbnailManageWithWatermark(workStaffBasicInfo.getIdCardNationalEmblemPath()));
+                //获取虚化图
+                workStaffBasicInfo.setIdCardNationalEmblemPathThumbnailStr(WorkattachmentService.getThumbnailTemporaryWithWatermarkDimLookUrl(workStaffBasicInfo.getIdCardNationalEmblemPath()));
             }
         }
-        WorkStaffBasicInfo staffBasicInfo = workStaffAchivesDao.get(workStaffBasicInfo.getId());
-        return staffBasicInfo;
+        return workStaffBasicInfo;
     }
 
     public boolean validateStaff(WorkStaffBasicInfo workStaffBasicInfo, StringBuilder errInfo) {
@@ -1028,6 +1040,22 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
         queryRelationShips(workStaffBasicInfo);
     }
 
+    public void queryStoreDetailsApply(WorkStaffBasicInfo workStaffBasicInfo) {
+        achievementService.storeQuerys(workStaffBasicInfo);
+        certificateService.storeQuerys(workStaffBasicInfo);
+        educationService.storeQuerys(workStaffBasicInfo);
+        experienceService.storeQuerys(workStaffBasicInfo);
+        familyService.storeQuerys(workStaffBasicInfo);
+        languagesService.storeQuerys(workStaffBasicInfo);
+        recordService.storeQuerys(workStaffBasicInfo);
+        rewardsService.storeQuerys(workStaffBasicInfo);
+        socialPositionService.storeQuerys(workStaffBasicInfo);
+        titleService.storeQuerys(workStaffBasicInfo);
+        trainingService.storeQuerys(workStaffBasicInfo);
+        labourContractService.storeQuerys(workStaffBasicInfo);
+        queryRelationShips(workStaffBasicInfo);
+    }
+
 
     public void querys(WorkStaffBasicInfo workStaffBasicInfo) {
         SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
@@ -1041,7 +1069,8 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
                     if ("picture".equals(name) || "marriage".equals(name) || "politics".equals(name) || "exSoldier".equals(name) || "address".equals(name)
                             || "nativePlace".equals(name) || "household".equals(name) || "industryDate".equals(name) || "idCard".equals(name) || "age".equals(name)
                             || "idCardPortraitName".equals(name) || "idCardPortraitPath".equals(name) || "idCardNationalEmblemName".equals(name) || "idCardNationalEmblemPath".equals(name)
-                            || "birthday".equals(name) || "email".equals(name) || "nation".equals(name)) {
+                            || "birthday".equals(name) || "email".equals(name) || "nation".equals(name) || "exIdCard".equals(name) || "bankName".equals(name) || "bankCard".equals(name)
+                            || "pictureFile".equals(name)) {
                         String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
                         String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
                         WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
@@ -1114,6 +1143,97 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
         }
     }
 
+
+    public void storeQuerys(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
+        if(workStaffBasicInfo==null|| StringUtils.isBlank(workStaffBasicInfo.getId())){
+            return;
+        }
+                Class<? extends WorkStaffBasicInfo> newClass = workStaffBasicInfo.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if ("picture".equals(name) || "marriage".equals(name) || "politics".equals(name) || "exSoldier".equals(name) || "address".equals(name)
+                            || "nativePlace".equals(name) || "household".equals(name) || "industryDate".equals(name) || "idCard".equals(name) || "age".equals(name)
+                            || "idCardPortraitName".equals(name) || "idCardPortraitPath".equals(name) || "idCardNationalEmblemName".equals(name) || "idCardNationalEmblemPath".equals(name)
+                            || "birthday".equals(name) || "email".equals(name) || "nation".equals(name) || "exIdCard".equals(name) || "bankName".equals(name) || "bankCard".equals(name)
+                            || "pictureFile".equals(name)) {
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                        workStaffAchivesLog.setModule("基本信息");
+                        workStaffAchivesLog.setFields(name);
+                        workStaffAchivesLog.setType("修改");
+                        workStaffAchivesLog.setState("3");
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            Object newInvoke = newClass.getMethod(getMethod).invoke(workStaffBasicInfo);//修改后
+                            if(newInvoke instanceof String){
+                                Method setReadOnly = workStaffBasicInfo.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffBasicInfo,logs.get(0).getNewKey());
+                                }
+                            }
+                            if(newInvoke instanceof Integer){
+                                Method setReadOnly = workStaffBasicInfo.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffBasicInfo,logs.get(0).getNewKey());
+                                }
+                            }
+                            if(newInvoke instanceof Date){//日期
+                                Method setReadOnly = workStaffBasicInfo.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffBasicInfo,myDate);
+                                }
+                            }
+                            if(null == newInvoke){
+                                try {
+                                    Method setReadOnly = workStaffBasicInfo.getClass().getMethod(setMethod, String.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        setReadOnly.invoke(workStaffBasicInfo,logs.get(0).getNewKey());
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    try {
+                                        Method setReadOnly = workStaffBasicInfo.getClass().getMethod(setMethod, Integer.class);
+                                        if(logs!=null&& !logs.isEmpty()){
+                                            Integer newKey = Integer.valueOf(logs.get(0).getNewKey());
+                                            setReadOnly.invoke(workStaffBasicInfo,newKey);
+                                        }
+                                    } catch (NoSuchMethodException ex) {
+                                        Method setReadOnly = workStaffBasicInfo.getClass().getMethod(setMethod, Date.class);
+                                        if(logs!=null&&logs.size()>0){
+                                            Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                            setReadOnly.invoke(workStaffBasicInfo,myDate);
+                                        }
+                                    }
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+
+        if (StringUtils.isNotEmpty(workStaffBasicInfo.getIdCardPortraitPath())) {
+            workStaffBasicInfo.setIdCardPortraitPathStr(WorkattachmentService.fileUrlThumbnailManageWithWatermark(workStaffBasicInfo.getIdCardPortraitPath()));
+            workStaffBasicInfo.setIdCardPortraitPathThumbnailStr(WorkattachmentService.getThumbnailTemporaryWithWatermarkDimLookUrl(workStaffBasicInfo.getIdCardPortraitPath()));
+        }
+        if (StringUtils.isNotEmpty(workStaffBasicInfo.getIdCardNationalEmblemPath())) {
+            //获取水印图
+            workStaffBasicInfo.setIdCardNationalEmblemPathStr(WorkattachmentService.fileUrlThumbnailManageWithWatermark(workStaffBasicInfo.getIdCardNationalEmblemPath()));
+            //获取虚化图
+            workStaffBasicInfo.setIdCardNationalEmblemPathThumbnailStr(WorkattachmentService.getThumbnailTemporaryWithWatermarkDimLookUrl(workStaffBasicInfo.getIdCardNationalEmblemPath()));
+        }
+    }
+
     private int saveDetailsApply(WorkStaffBasicInfo workStaffBasicInfo, boolean first) {
         int count = 0;
         if (achievementService.saveApply(workStaffBasicInfo, first)) count++;
@@ -1158,7 +1278,10 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
             workProjectNotify.setUser(u);
             workProjectNotify.setId("");
             workProjectNotify.setNotifyRole("");
-            workProjectNotifyService.save(workProjectNotify);
+            List<WorkProjectNotify> byNotifyIdAndNotifyUserAndTitle = workProjectNotifyService.getByNotifyIdAndNotifyUserAndTitle(workProjectNotify.getTitle(), workProjectNotify.getNotifyId(), workProjectNotify.getUser().getId());
+            if(byNotifyIdAndNotifyUserAndTitle.isEmpty()){
+                workProjectNotifyService.save(workProjectNotify);
+            }
         }
         UserUtils.pushIm(userIds, contentStr);
         return "";
@@ -1173,6 +1296,15 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
         workStaffAchivesDao.updateAlterationDate(achiveId);
     }
 
+    /**
+     * 如果修改,则变更修改时间
+     * @param achiveId
+     */
+    @Transactional(readOnly = false)
+    public void updateAuditStatus(String achiveId, String status){
+        workStaffAchivesDao.updateAuditStatus(achiveId, status);
+    }
+
     @Transactional(readOnly = false)
     public String completeCertificateApply(String achiveIds) {
         if (StringUtils.isBlank(achiveIds)) {
@@ -1194,7 +1326,10 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
             workProjectNotify.setUser(u);
             workProjectNotify.setId("");
             workProjectNotify.setNotifyRole("");
-            workProjectNotifyService.save(workProjectNotify);
+            List<WorkProjectNotify> byNotifyIdAndNotifyUserAndTitle = workProjectNotifyService.getByNotifyIdAndNotifyUserAndTitle(workProjectNotify.getTitle(), workProjectNotify.getNotifyId(), workProjectNotify.getUser().getId());
+            if(byNotifyIdAndNotifyUserAndTitle.isEmpty()){
+                workProjectNotifyService.save(workProjectNotify);
+            }
         }
         UserUtils.pushIm(userIds, contentStr);
         return "";
@@ -1264,11 +1399,17 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
         CODE_MAP.put("birthday", "生日");
         CODE_MAP.put("email", "油箱");
         CODE_MAP.put("nation", "民族");
+        CODE_MAP.put("bankCard", "银行卡号");
+        CODE_MAP.put("bankName", "开户银行");
+        CODE_MAP.put("pictureFile", "头像");
     }
 
     @Transactional(readOnly = false)
     public void saveLog(WorkStaffBasicInfo workStaffBasicInfo) {
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+        workStaffBasicInfo.setAchiveId(workStaffBasicInfo.getId());
+        WorkStaffBasicInfo info = this.getAchive(workStaffBasicInfo);
+        workStaffBasicInfo.setAuditStatus(info.getAuditStatus());
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         WorkStaffBasicInfo select1 = new WorkStaffBasicInfo();
         select1.setAchiveId(workStaffBasicInfo.getId());
         WorkStaffBasicInfo w = this.getAchive(select1);//从数据库取出记录的值
@@ -1287,7 +1428,8 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
             if ("picture".equals(name) || "marriage".equals(name) || "politics".equals(name) || "exSoldier".equals(name) || "address".equals(name)
                     || "nativePlace".equals(name) || "household".equals(name) || "industryDate".equals(name) || "idCard".equals(name) || "age".equals(name)
                     || "idCardPortraitName".equals(name) || "idCardPortraitPath".equals(name) || "idCardNationalEmblemName".equals(name) || "idCardNationalEmblemPath".equals(name)
-                    || "birthday".equals(name) || "email".equals(name) || "nation".equals(name)) {
+                    || "birthday".equals(name) || "email".equals(name) || "nation".equals(name) || "exIdCard".equals(name) || "bankName".equals(name) || "bankCard".equals(name)
+                    || "pictureFile".equals(name)) {
                 String methodName = "get" + name.substring(0, 1).toUpperCase() + name.substring(1);
                 WorkStaffAchivesLog workStaffAchivesLog = new WorkStaffAchivesLog();
                 workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
@@ -1395,6 +1537,144 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
         titleService.saveEdu(workStaffBasicInfo);//职称
         trainingService.saveEdu(workStaffBasicInfo);//培训经历
         labourContractService.saveEdu(workStaffBasicInfo);//劳动合同
+
+
+        //判定审核状态。审核状态为1(暂存),则对暂存的数据进行删除
+        if("1".equals(workStaffBasicInfo.getAuditStatus())){
+            workStaffAchivesLogService.deleteByAchiveId(workStaffBasicInfo.getId());
+        }
+    }
+
+    @Transactional(readOnly = false)
+    public void storeLog(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+        WorkStaffBasicInfo select1 = new WorkStaffBasicInfo();
+        select1.setAchiveId(workStaffBasicInfo.getId());
+        WorkStaffBasicInfo w = this.getAchive(select1);//从数据库取出记录的值
+        Class<? extends WorkStaffBasicInfo> basicInfoClass = workStaffBasicInfo.getClass();
+        Class<? extends WorkStaffBasicInfo> wClass = w.getClass();
+        Field[] declaredFields = basicInfoClass.getDeclaredFields();
+        if ((workStaffBasicInfo.getPictureFile() != null && !workStaffBasicInfo.getPictureFile().isEmpty() && workStaffBasicInfo.getPictureFile().getSize() > 0) ||
+                (workStaffBasicInfo.getIdCardPortrait() != null && !workStaffBasicInfo.getIdCardPortrait().isEmpty() && workStaffBasicInfo.getIdCardPortrait().getSize() > 0) ||
+                (workStaffBasicInfo.getIdCardNationalEmblem() != null && !workStaffBasicInfo.getIdCardNationalEmblem().isEmpty() && workStaffBasicInfo.getIdCardNationalEmblem().getSize() > 0)
+        ) {
+            MultipartFile file = workStaffBasicInfo.getPictureFile();
+            this.uploadFile(workStaffBasicInfo);
+        }
+        for (Field field : declaredFields) {
+            String name = field.getName();
+            if ("picture".equals(name) || "marriage".equals(name) || "politics".equals(name) || "exSoldier".equals(name) || "address".equals(name)
+                    || "nativePlace".equals(name) || "household".equals(name) || "industryDate".equals(name) || "idCard".equals(name) || "age".equals(name)
+                    || "idCardPortraitName".equals(name) || "idCardPortraitPath".equals(name) || "idCardNationalEmblemName".equals(name) || "idCardNationalEmblemPath".equals(name)
+                    || "birthday".equals(name) || "email".equals(name) || "nation".equals(name) || "exIdCard".equals(name) || "bankName".equals(name) || "bankCard".equals(name)
+                    || "pictureFile".equals(name)) {
+                String methodName = "get" + name.substring(0, 1).toUpperCase() + name.substring(1);
+                WorkStaffAchivesLog workStaffAchivesLog = new WorkStaffAchivesLog();
+                workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                workStaffAchivesLog.setModule("基本信息");
+                workStaffAchivesLog.setFields(name);
+                workStaffAchivesLog.setState("3");
+                try {
+                    Object newInvoke = basicInfoClass.getMethod(methodName).invoke(workStaffBasicInfo);//修改后
+                    Object oldInvoke = wClass.getMethod(methodName).invoke(w);//修改前
+                    String describes = CODE_MAP.get(name);
+                    if (newInvoke == null) continue;
+                    if (newInvoke instanceof String) {
+                        String newValue = newInvoke.toString();
+                        String oldValue = "";
+                        if (oldInvoke != null)
+                            oldValue = oldInvoke.toString();
+                        if (!newValue.equals(oldValue)) {
+                            if ("exSoldier".equals(name)) {
+                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog, workStaffBasicInfo.getId(),
+                                        "基本信息", describes, name,
+                                        DictUtils.getDictLabel(oldValue, "yes_no", ""),
+                                        DictUtils.getDictLabel(newValue, "yes_no", ""),
+                                        oldValue,
+                                        newValue,
+                                        "", "修改");
+                            } else {
+                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog, workStaffBasicInfo.getId(),
+                                        "基本信息", describes, name,
+                                        oldValue, newValue, oldValue, newValue, "", "修改");
+                            }
+
+                        }
+                    }
+                    if (newInvoke instanceof Integer) {
+                        String newValue = newInvoke.toString();
+                        String oldValue = "";
+                        if (oldInvoke != null)
+                            oldValue = oldInvoke.toString();
+                        if (!newValue.equals(oldValue)) {
+                            if ("exSoldier".equals(name)) {
+                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog, workStaffBasicInfo.getId(),
+                                        "基本信息", describes, name,
+                                        DictUtils.getDictLabel(oldValue, "yes_no", ""),
+                                        DictUtils.getDictLabel(newValue, "yes_no", ""),
+                                        oldValue,
+                                        newValue,
+                                        "", "修改");
+                            } else {
+                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog, workStaffBasicInfo.getId(),
+                                        "基本信息", describes, name,
+                                        oldValue, newValue, oldValue, newValue, "", "修改");
+                            }
+
+                        }
+                    }
+
+                    if (newInvoke instanceof Date) {//日期
+                        String newDate = "";
+                        String oldDate = "";
+                        if (newInvoke != null) {
+                            newDate = sdf.format(newInvoke);
+                        }
+                        if (oldInvoke != null) {
+                            oldDate = sdf.format(oldInvoke);
+                        }
+                        if (!newDate.equals(oldDate)) {
+                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog, workStaffBasicInfo.getId(),
+                                    "基本信息", describes, name,
+                                    oldDate, newDate, oldDate, newDate, "", "修改");
+                        }
+                    }
+                    ;
+                    if (newInvoke instanceof Area) {
+                        String id = ((Area) newInvoke).getId();
+                        Area a = areaDao.get(id);
+                        if (!((Area) newInvoke).getId().equals(((Area) oldInvoke).getId())) {
+                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog, workStaffBasicInfo.getId(),
+                                    "基本信息", describes, name,
+                                    ((Area) oldInvoke).getName(), a.getName(),
+                                    ((Area) oldInvoke).getId(), id, "", "修改");
+                        }
+                    }
+                } catch (NoSuchMethodException e) {
+                    e.printStackTrace();
+                    logger.error("Exception e:" + e);
+                } catch (IllegalAccessException e) {
+                    e.printStackTrace();
+                    logger.error("Exception e:" + e);
+                } catch (InvocationTargetException e) {
+                    e.printStackTrace();
+                    logger.error("Exception e:" + e);
+                }
+            }
+
+        }
+        educationService.storeEdu(workStaffBasicInfo);//教育经历
+        languagesService.storeEdu(workStaffBasicInfo);//外语语种
+        experienceService.storeEdu(workStaffBasicInfo);//工作经历
+        achievementService.storeEdu(workStaffBasicInfo);//工作业绩
+        certificateService.storeEdu(workStaffBasicInfo);//执业资格证书
+        familyService.storeEdu(workStaffBasicInfo);//家庭情况
+        recordService.storeEdu(workStaffBasicInfo);//电子档案
+        rewardsService.storeEdu(workStaffBasicInfo);//奖惩情况
+        socialPositionService.storeEdu(workStaffBasicInfo);//社会及行业职务
+        titleService.storeEdu(workStaffBasicInfo);//职称
+        trainingService.storeEdu(workStaffBasicInfo);//培训经历
+        labourContractService.storeEdu(workStaffBasicInfo);//劳动合同
     }
 
     /**

+ 369 - 8
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffCertificateService.java

@@ -9,10 +9,7 @@ import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
@@ -28,9 +25,7 @@ import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.service.WorkattachmentService;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.workstaff.dao.WorkStaffBasicInfoDao;
-import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
-import com.jeeplus.modules.workstaff.entity.WorkStaffCertificateImport;
-import com.jeeplus.modules.workstaff.entity.WorkStaffEducation;
+import com.jeeplus.modules.workstaff.entity.*;
 import com.jeeplus.modules.workstaffachiveslog.entity.WorkStaffAchivesLog;
 import com.jeeplus.modules.workstaffachiveslog.service.WorkStaffAchivesLogService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -39,7 +34,6 @@ import org.springframework.transaction.annotation.Transactional;
 
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
-import com.jeeplus.modules.workstaff.entity.WorkStaffCertificate;
 import com.jeeplus.modules.workstaff.dao.WorkStaffCertificateDao;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -68,6 +62,7 @@ public class WorkStaffCertificateService extends CrudService<WorkStaffCertificat
         for (WorkStaffCertificate staffCertificate : list) {
             if(StringUtils.isNotEmpty(staffCertificate.getFilePath())) {
                 staffCertificate.setFilePathStr(WorkattachmentService.fileUrlManage(staffCertificate.getFilePath()));
+                staffCertificate.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(staffCertificate.getFilePath()));
             }
         }
         return super.findList(workStaffCertificate);
@@ -409,11 +404,13 @@ public class WorkStaffCertificateService extends CrudService<WorkStaffCertificat
                 }
                 if(StringUtils.isNotBlank(workStaffCertificate.getFilePath())){
                     workStaffCertificate.setFilePathStr(WorkattachmentService.fileUrlManage(workStaffCertificate.getFilePath()));
+                    workStaffCertificate.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(workStaffCertificate.getFilePath()));
                 }
                 newList.add(workStaffCertificate);
                 for (WorkStaffCertificate staffCertificate : newList) {
                     if(StringUtils.isNotEmpty(staffCertificate.getFilePath())) {
                         staffCertificate.setFilePathStr(WorkattachmentService.fileUrlManage(staffCertificate.getFilePath()));
+                        staffCertificate.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(staffCertificate.getFilePath()));
                     }
                 }
             }
@@ -469,6 +466,7 @@ public class WorkStaffCertificateService extends CrudService<WorkStaffCertificat
                 }
                 if(StringUtils.isNotBlank(workStaffCertificate.getFilePath())){
                     workStaffCertificate.setFilePathStr(WorkattachmentService.fileUrlManage(workStaffCertificate.getFilePath()));
+                    workStaffCertificate.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(workStaffCertificate.getFilePath()));
                 }
                 newList.add(workStaffCertificate);
             }
@@ -487,6 +485,167 @@ public class WorkStaffCertificateService extends CrudService<WorkStaffCertificat
         }
         workStaffBasicInfo.setCertificateList(newList);
     }
+
+    public void storeQuerys(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
+        if(workStaffBasicInfo==null|| StringUtils.isBlank(workStaffBasicInfo.getId())){
+            return;
+        }
+        WorkStaffCertificate entity = new WorkStaffCertificate();
+        entity.setStaffId(workStaffBasicInfo.getId());
+        List<WorkStaffCertificate> list=this.findList(entity);
+        List<WorkStaffCertificate> newList=Lists.newArrayList();
+        if(list!=null&&list.size()>0){//修改
+            for(WorkStaffCertificate workStaffCertificate:list){
+                Class<? extends WorkStaffCertificate> newClass = workStaffCertificate.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("name".equals(name)||"num".equals(name)||"issuingAuthority".equals(name)||"issuingDate".equals(name)||"registDate".equals(name)
+                            || "registNum".equals(name)||"major".equals(name)||"grade".equals(name)
+                            ||"issType".equals(name)||"filePath".equals(name)||"fileName".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                        workStaffAchivesLog.setModule("执业资格证书");
+                        workStaffAchivesLog.setSonId(workStaffCertificate.getId());
+                        workStaffAchivesLog.setFields(name);
+                        workStaffAchivesLog.setType("修改");
+                        workStaffAchivesLog.setState("3");
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            Object newInvoke = newClass.getMethod(getMethod).invoke(workStaffCertificate);//修改后
+                            if(newInvoke instanceof String){
+                                Method setReadOnly = workStaffCertificate.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffCertificate,logs.get(0).getNewKey());
+                                }
+                            }
+                            if(newInvoke instanceof Date){//日期
+                                Method setReadOnly = workStaffCertificate.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffCertificate,myDate);
+                                }
+                            }
+                            if(null == newInvoke){
+                                try {
+                                    Method setReadOnly = workStaffCertificate.getClass().getMethod(setMethod, String.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        setReadOnly.invoke(workStaffCertificate,logs.get(0).getNewKey());
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    Method setReadOnly = workStaffCertificate.getClass().getMethod(setMethod, Date.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                        setReadOnly.invoke(workStaffCertificate,myDate);
+                                    }
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                if(StringUtils.isNotBlank(workStaffCertificate.getFilePath())){
+                    workStaffCertificate.setFilePathStr(WorkattachmentService.fileUrlManage(workStaffCertificate.getFilePath()));
+                    workStaffCertificate.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(workStaffCertificate.getFilePath()));
+                }
+                newList.add(workStaffCertificate);
+                for (WorkStaffCertificate staffCertificate : newList) {
+                    if(StringUtils.isNotEmpty(staffCertificate.getFilePath())) {
+                        staffCertificate.setFilePathStr(WorkattachmentService.fileUrlManage(staffCertificate.getFilePath()));
+                        staffCertificate.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(staffCertificate.getFilePath()));
+                    }
+                }
+            }
+        }
+        //新增
+        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+        workStaffAchivesLog.setModule("执业资格证书");
+        workStaffAchivesLog.setType("新增");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> sonIds=workStaffAchivesLogService.findSonId(workStaffAchivesLog);
+        if(sonIds!=null&&sonIds.size()>0){
+            for(WorkStaffAchivesLog w:sonIds){
+                workStaffAchivesLog.setSonId(w.getSonId());
+                WorkStaffCertificate workStaffCertificate = new WorkStaffCertificate();
+                workStaffCertificate.setId(w.getSonId());
+                workStaffCertificate.setDelFlag("0");
+                workStaffCertificate.setStaffId(workStaffBasicInfo.getId());
+                Class<? extends WorkStaffCertificate> newClass = workStaffCertificate.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("name".equals(name)||"num".equals(name)||"issuingAuthority".equals(name)||"issuingDate".equals(name)||"registDate".equals(name)
+                            || "registNum".equals(name)||"major".equals(name)||"grade".equals(name)
+                            ||"issType".equals(name)||"filePath".equals(name)||"fileName".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        workStaffAchivesLog.setFields(name);
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            if("registDate".equals(name)||"issuingDate".equals(name)){//日期
+                                Method setReadOnly = workStaffCertificate.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffCertificate,myDate);
+                                }
+                            }else{
+                                Method setReadOnly = workStaffCertificate.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffCertificate,logs.get(0).getNewKey());
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                if(StringUtils.isNotBlank(workStaffCertificate.getFilePath())){
+                    workStaffCertificate.setFilePathStr(WorkattachmentService.fileUrlManage(workStaffCertificate.getFilePath()));
+                    workStaffCertificate.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(workStaffCertificate.getFilePath()));
+                }
+                newList.add(workStaffCertificate);
+            }
+        }
+        //删除
+        WorkStaffAchivesLog delLog=new WorkStaffAchivesLog();
+        delLog.setStaffId(workStaffBasicInfo.getId());
+        delLog.setModule("执业资格证书");
+        delLog.setType("删除");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> dellogs=workStaffAchivesLogService.findList(delLog);
+        if (dellogs != null && !dellogs.isEmpty()) {
+            List<String> sonIdLists = Lists.newArrayList();
+            for (WorkStaffAchivesLog log : dellogs) {
+                sonIdLists.add(log.getSonId());
+            }
+
+            Iterator<WorkStaffCertificate> iterator = newList.iterator();
+            while (iterator.hasNext()) {
+                WorkStaffCertificate staff = iterator.next();
+                if (sonIdLists.contains(staff.getId())) {
+                    iterator.remove();
+                }
+            }
+        }
+        workStaffBasicInfo.setCertificateList(newList);
+    }
     @Transactional(readOnly = false)
     public void saveEdu(WorkStaffBasicInfo workStaffBasicInfo) {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -568,6 +727,59 @@ public class WorkStaffCertificateService extends CrudService<WorkStaffCertificat
                                 }
                             }
                         }
+                    }else{
+                        if("1".equals(workStaffBasicInfo.getAuditStatus())){
+                            if(newCertificate.getFile()!=null&&!newCertificate.getFile().isEmpty()&&newCertificate.getFile().getSize()>0){
+                                MultipartFile file = newCertificate.getFile();
+                                newCertificate.setFilePath(this.uploadFile(file,newCertificate.getFilePath()));
+                            }
+                            String newId=IdGen.uuid();
+                            for (Field field : declaredFields) {
+                                String name = field.getName();
+                                if("name".equals(name)||"num".equals(name)||"issuingAuthority".equals(name)||"issuingDate".equals(name)||"registDate".equals(name)
+                                        || "registNum".equals(name)||"major".equals(name)||"grade".equals(name)
+                                        ||"issType".equals(name)||"filePath".equals(name)||"fileName".equals(name)){
+                                    String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                    workStaffAchivesLog.setModule("执业资格证书");
+                                    workStaffAchivesLog.setSonId(newId);
+                                    workStaffAchivesLog.setFields(name);
+                                    workStaffAchivesLog.setState("1");
+                                    try {
+                                        Object newInvoke = newClass.getMethod(methodName).invoke(newCertificate);//修改后
+                                        String describes=EDU_MAP.get(name);
+                                        if(newInvoke instanceof String){
+                                            String newValue=newInvoke.toString();
+                                            if("name".equals(name)){
+                                                workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "执业资格证书",describes,name,
+                                                        "",
+                                                        DictUtils.getMainDictLabel(newValue,"certificate_type",""),
+                                                        "",newValue,newId,"新增");
+                                            }else{
+                                                workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "执业资格证书",describes,name,
+                                                        "",newInvoke.toString(),
+                                                        "",newInvoke.toString(),newId,"新增");
+                                            }
+                                        }
+                                        if(newInvoke instanceof Date){//日期
+                                            String newDate=sdf.format(newInvoke);
+                                            workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "执业资格证书",describes,name,
+                                                    "",newDate,"",newDate,newId,"新增");
+                                        };
+                                    } catch (NoSuchMethodException e) {
+                                        e.printStackTrace();
+                                    } catch (IllegalAccessException e) {
+                                        e.printStackTrace();
+                                    } catch (InvocationTargetException e) {
+                                        e.printStackTrace();
+                                    }
+                                }
+                            }
+                        }
                     }
                 }else if((newCertificate.getId()==null||"".equals(newCertificate.getId()))&&"0".equals(newCertificate.getDelFlag())){//新增
                     if(newCertificate.getFile()!=null&&!newCertificate.getFile().isEmpty()&&newCertificate.getFile().getSize()>0){
@@ -635,4 +847,153 @@ public class WorkStaffCertificateService extends CrudService<WorkStaffCertificat
             }
         }
     }
+
+    @Transactional(readOnly = false)
+    public void storeEdu(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        List<WorkStaffCertificate> certificateList =workStaffBasicInfo.getCertificateList();
+        if(certificateList!=null&&certificateList.size()>0){
+            for(WorkStaffCertificate newCertificate:certificateList){
+                if(null != newCertificate.getFile() && StringUtils.isNotBlank(newCertificate.getFile().getOriginalFilename())){
+                    String fileName = newCertificate.getFile().getOriginalFilename();
+                    newCertificate.setFileName(fileName);
+                }
+                Class<? extends WorkStaffCertificate> newClass = newCertificate.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                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()));
+                    }
+                    WorkStaffCertificate oldCertificate=this.get(newCertificate.getId());
+                    if(oldCertificate!=null){
+                        Class<? extends WorkStaffCertificate> oldClass = oldCertificate.getClass();
+                        for (Field field : declaredFields) {
+                            String name = field.getName();
+                            if("name".equals(name)||"num".equals(name)||"issuingAuthority".equals(name)||"issuingDate".equals(name)||"registDate".equals(name)
+                                    || "registNum".equals(name)||"major".equals(name)||"grade".equals(name)
+                                    ||"issType".equals(name)||"filePath".equals(name)||"fileName".equals(name)){
+                                String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                workStaffAchivesLog.setModule("执业资格证书");
+                                workStaffAchivesLog.setSonId(newCertificate.getId());
+                                workStaffAchivesLog.setFields(name);
+                                workStaffAchivesLog.setState("3");
+                                try {
+                                    Object newInvoke = newClass.getMethod(methodName).invoke(newCertificate);//修改后
+                                    Object oldInvoke = oldClass.getMethod(methodName).invoke(oldCertificate);//修改前
+                                    if(null == oldInvoke){
+                                        oldInvoke = "";
+                                    }
+                                    String describes=EDU_MAP.get(name);
+                                    if(newInvoke instanceof String){
+                                        String newValue=newInvoke.toString();
+                                        String oldValue=oldInvoke.toString();
+                                        if(!newValue.equals(oldValue)){
+                                            if("name".equals(name)){
+                                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "执业资格证书",describes,name,
+                                                        DictUtils.getMainDictLabel(oldValue,"certificate_type",""),
+                                                        DictUtils.getMainDictLabel(newValue,"certificate_type",""),
+                                                        oldValue,newValue,newCertificate.getId(),"修改");
+                                            }else{
+                                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "执业资格证书",describes,name,
+                                                        oldInvoke.toString(),newInvoke.toString(),
+                                                        oldInvoke.toString(),newInvoke.toString(),newCertificate.getId(),"修改");
+                                            }
+                                        }
+                                    }
+                                    if(newInvoke instanceof Date){//日期
+                                        String newDate="";
+                                        String oldDate="";
+                                        if(newInvoke!=null){
+                                            newDate=sdf.format(newInvoke);
+                                        }
+                                        if (oldInvoke!=null && StringUtils.isNotBlank(oldInvoke.toString())){
+                                            oldDate=sdf.format(oldInvoke);
+                                        }
+                                        if(!newDate.equals(oldDate)){
+                                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "执业资格证书",describes,name,
+                                                    oldDate,newDate,oldDate,newDate,newCertificate.getId(),"修改");
+                                        }
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    e.printStackTrace();
+                                } catch (IllegalAccessException e) {
+                                    e.printStackTrace();
+                                } catch (InvocationTargetException e) {
+                                    e.printStackTrace();
+                                }
+                            }
+                        }
+                    }
+                }else if((newCertificate.getId()==null||"".equals(newCertificate.getId()))&&"0".equals(newCertificate.getDelFlag())){//新增
+                    if(newCertificate.getFile()!=null&&!newCertificate.getFile().isEmpty()&&newCertificate.getFile().getSize()>0){
+                        MultipartFile file = newCertificate.getFile();
+                        newCertificate.setFilePath(this.uploadFile(file,newCertificate.getFilePath()));
+                    }
+                    String newId=IdGen.uuid();
+                    for (Field field : declaredFields) {
+                        String name = field.getName();
+                        if("name".equals(name)||"num".equals(name)||"issuingAuthority".equals(name)||"issuingDate".equals(name)||"registDate".equals(name)
+                                || "registNum".equals(name)||"major".equals(name)||"grade".equals(name)
+                                ||"issType".equals(name)||"filePath".equals(name)||"fileName".equals(name)){
+                            String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                            WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                            workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                            workStaffAchivesLog.setModule("执业资格证书");
+                            workStaffAchivesLog.setSonId(newId);
+                            workStaffAchivesLog.setFields(name);
+                            workStaffAchivesLog.setState("3");
+                            try {
+                                Object newInvoke = newClass.getMethod(methodName).invoke(newCertificate);//修改后
+                                String describes=EDU_MAP.get(name);
+                                if(newInvoke instanceof String){
+                                    String newValue=newInvoke.toString();
+                                    if("name".equals(name)){
+                                        workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                "执业资格证书",describes,name,
+                                                "",
+                                                DictUtils.getMainDictLabel(newValue,"certificate_type",""),
+                                                "",newValue,newId,"新增");
+                                    }else{
+                                        workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                "执业资格证书",describes,name,
+                                                "",newInvoke.toString(),
+                                                "",newInvoke.toString(),newId,"新增");
+                                    }
+                                }
+                                if(newInvoke instanceof Date){//日期
+                                    String newDate=sdf.format(newInvoke);
+                                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                            "执业资格证书",describes,name,
+                                            "",newDate,"",newDate,newId,"新增");
+                                };
+                            } catch (NoSuchMethodException e) {
+                                e.printStackTrace();
+                            } catch (IllegalAccessException e) {
+                                e.printStackTrace();
+                            } catch (InvocationTargetException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    }
+                }else if(newCertificate.getId()!=null&&"1".equals(newCertificate.getDelFlag())&&!"".equals(newCertificate.getId())){//删除
+                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                    workStaffAchivesLog.setModule("执业资格证书");
+                    workStaffAchivesLog.setSonId(newCertificate.getId());
+                    workStaffAchivesLog.setType("删除");
+                    workStaffAchivesLog.setState("3");
+                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                            "执业资格证书","","",
+                            "","",
+                            "","",newCertificate.getId(),"删除");
+                }
+            }
+        }
+    }
 }

+ 454 - 1
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffEducationService.java

@@ -10,6 +10,7 @@ import java.lang.reflect.Method;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Iterator;
 import java.util.List;
 import java.lang.reflect.Field;
 import java.util.Map;
@@ -63,9 +64,11 @@ public class WorkStaffEducationService extends CrudService<WorkStaffEducationDao
         for (WorkStaffEducation info : list) {
             if(StringUtils.isNotBlank(info.getDegreePhoto())){
                 info.setDegreePhotoStr( WorkattachmentService.fileUrlManage(info.getDegreePhoto()));
+                info.setDegreePhotoThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(info.getDegreePhoto()));
             }
             if(StringUtils.isNotBlank(info.getEduPhoto())){
                 info.setEduPhotoStr( WorkattachmentService.fileUrlManage(info.getEduPhoto()));
+                info.setEduPhotoThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(info.getEduPhoto()));
             }
         }
 		return list;
@@ -163,6 +166,7 @@ public class WorkStaffEducationService extends CrudService<WorkStaffEducationDao
         EDU_MAP.put("endDate", "毕业日期");
         EDU_MAP.put("eduPhoto", "学历证书");
         EDU_MAP.put("degreePhoto", "学位证书");
+        EDU_MAP.put("heightEdu", "最高学历");
     }
     public boolean saveApply(WorkStaffBasicInfo workStaffBasicInfo,boolean first) {
         if(workStaffBasicInfo==null|| StringUtils.isBlank(workStaffBasicInfo.getId())){
@@ -264,17 +268,21 @@ public class WorkStaffEducationService extends CrudService<WorkStaffEducationDao
                 }
                 if(StringUtils.isNotBlank(workStaffEducation.getDegreePhoto())){
                     workStaffEducation.setDegreePhotoStr( WorkattachmentService.fileUrlManage(workStaffEducation.getDegreePhoto()));
+                    workStaffEducation.setDegreePhotoThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffEducation.getDegreePhoto()));
                 }
                 if(StringUtils.isNotBlank(workStaffEducation.getEduPhoto())){
                     workStaffEducation.setEduPhotoStr( WorkattachmentService.fileUrlManage(workStaffEducation.getEduPhoto()));
+                    workStaffEducation.setEduPhotoThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffEducation.getEduPhoto()));
                 }
                 newList.add(workStaffEducation);
                 for (WorkStaffEducation info : newList) {
                     if(StringUtils.isNotBlank(info.getDegreePhoto())){
                         info.setDegreePhotoStr( WorkattachmentService.fileUrlManage(info.getDegreePhoto()));
+                        info.setDegreePhotoThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(info.getDegreePhoto()));
                     }
                     if(StringUtils.isNotBlank(info.getEduPhoto())){
                         info.setEduPhotoStr( WorkattachmentService.fileUrlManage(info.getEduPhoto()));
+                        info.setEduPhotoThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(info.getEduPhoto()));
                     }
                 }
             }
@@ -329,9 +337,11 @@ public class WorkStaffEducationService extends CrudService<WorkStaffEducationDao
                 }
                 if(StringUtils.isNotBlank(workStaffEducation.getDegreePhoto())){
                     workStaffEducation.setDegreePhotoStr( WorkattachmentService.fileUrlManage(workStaffEducation.getDegreePhoto()));
+                    workStaffEducation.setDegreePhotoThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffEducation.getDegreePhoto()));
                 }
                 if(StringUtils.isNotBlank(workStaffEducation.getEduPhoto())){
                     workStaffEducation.setEduPhotoStr( WorkattachmentService.fileUrlManage(workStaffEducation.getEduPhoto()));
+                    workStaffEducation.setEduPhotoThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffEducation.getEduPhoto()));
                 }
                 newList.add(workStaffEducation);
             }
@@ -350,6 +360,176 @@ public class WorkStaffEducationService extends CrudService<WorkStaffEducationDao
         }
         workStaffBasicInfo.setEducationList(newList);
     }
+    public void storeQuerys(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
+        if(workStaffBasicInfo==null|| StringUtils.isBlank(workStaffBasicInfo.getId())){
+            return;
+        }
+        WorkStaffEducation entity = new WorkStaffEducation();
+        entity.setStaff(workStaffBasicInfo.getId());
+        List<WorkStaffEducation> list=this.findList(entity);
+        List<WorkStaffEducation> newList=Lists.newArrayList();
+        if(list!=null&&list.size()>0){//修改
+            for(WorkStaffEducation workStaffEducation:list){
+                Class<? extends WorkStaffEducation> newClass = workStaffEducation.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("school".equals(name)||"major".equals(name)||"edu".equals(name)||"degree".equals(name)||"eduType".equals(name) || "heightEdu".equals(name)
+                            || "startDate".equals(name)||"endDate".equals(name)||"eduPhoto".equals(name)||"degreePhoto".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                        workStaffAchivesLog.setModule("教育经历");
+                        workStaffAchivesLog.setSonId(workStaffEducation.getId());
+                        workStaffAchivesLog.setFields(name);
+                        workStaffAchivesLog.setType("修改");
+                        workStaffAchivesLog.setState("3");
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            Object newInvoke = newClass.getMethod(getMethod).invoke(workStaffEducation);//修改后
+                            if(newInvoke instanceof String){
+                                Method setReadOnly = workStaffEducation.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffEducation,logs.get(0).getNewKey());
+                                }
+                            }
+                            if(newInvoke instanceof Date){//日期
+                                Method setReadOnly = workStaffEducation.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffEducation,myDate);
+                                }
+                            }
+                            if(null == newInvoke){
+                                try {
+                                    Method setReadOnly = workStaffEducation.getClass().getMethod(setMethod, String.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        setReadOnly.invoke(workStaffEducation,logs.get(0).getNewKey());
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    Method setReadOnly = workStaffEducation.getClass().getMethod(setMethod, Date.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                        setReadOnly.invoke(workStaffEducation,myDate);
+                                    }
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                if(StringUtils.isNotBlank(workStaffEducation.getDegreePhoto())){
+                    workStaffEducation.setDegreePhotoStr( WorkattachmentService.fileUrlManage(workStaffEducation.getDegreePhoto()));
+                    workStaffEducation.setDegreePhotoThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffEducation.getDegreePhoto()));
+                }
+                if(StringUtils.isNotBlank(workStaffEducation.getEduPhoto())){
+                    workStaffEducation.setEduPhotoStr( WorkattachmentService.fileUrlManage(workStaffEducation.getEduPhoto()));
+                    workStaffEducation.setEduPhotoThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffEducation.getEduPhoto()));
+                }
+                newList.add(workStaffEducation);
+                for (WorkStaffEducation info : newList) {
+                    if(StringUtils.isNotBlank(info.getDegreePhoto())){
+                        info.setDegreePhotoStr( WorkattachmentService.fileUrlManage(info.getDegreePhoto()));
+                        info.setDegreePhotoThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(info.getDegreePhoto()));
+                    }
+                    if(StringUtils.isNotBlank(info.getEduPhoto())){
+                        info.setEduPhotoStr( WorkattachmentService.fileUrlManage(info.getEduPhoto()));
+                        info.setEduPhotoThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(info.getEduPhoto()));
+                    }
+                }
+            }
+        }
+        //新增
+        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+        workStaffAchivesLog.setModule("教育经历");
+        workStaffAchivesLog.setType("新增");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> sonIds=workStaffAchivesLogService.findSonId(workStaffAchivesLog);
+        if(sonIds!=null&&sonIds.size()>0){
+            for(WorkStaffAchivesLog w:sonIds){
+                workStaffAchivesLog.setSonId(w.getSonId());
+                WorkStaffEducation workStaffEducation = new WorkStaffEducation();
+                workStaffEducation.setId(w.getSonId());
+                workStaffEducation.setDelFlag("0");
+                workStaffEducation.setStaff(workStaffBasicInfo.getId());
+                Class<? extends WorkStaffEducation> newClass = workStaffEducation.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("school".equals(name)||"major".equals(name)||"edu".equals(name)||"degree".equals(name)||"eduType".equals(name) || "heightEdu".equals(name)
+                            || "startDate".equals(name)||"endDate".equals(name)||"eduPhoto".equals(name)||"degreePhoto".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        workStaffAchivesLog.setFields(name);
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            if("startDate".equals(name)||"endDate".equals(name)){//日期
+                                Method setReadOnly = workStaffEducation.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffEducation,myDate);
+                                }
+                            }else{
+                                Method setReadOnly = workStaffEducation.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffEducation,logs.get(0).getNewKey());
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                if(StringUtils.isNotBlank(workStaffEducation.getDegreePhoto())){
+                    workStaffEducation.setDegreePhotoStr( WorkattachmentService.fileUrlManage(workStaffEducation.getDegreePhoto()));
+                    workStaffEducation.setDegreePhotoThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffEducation.getDegreePhoto()));
+                }
+                if(StringUtils.isNotBlank(workStaffEducation.getEduPhoto())){
+                    workStaffEducation.setEduPhotoStr( WorkattachmentService.fileUrlManage(workStaffEducation.getEduPhoto()));
+                    workStaffEducation.setEduPhotoThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffEducation.getEduPhoto()));
+                }
+                newList.add(workStaffEducation);
+            }
+        }
+        //删除
+        WorkStaffAchivesLog delLog=new WorkStaffAchivesLog();
+        delLog.setStaffId(workStaffBasicInfo.getId());
+        delLog.setModule("教育经历");
+        delLog.setType("删除");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> dellogs=workStaffAchivesLogService.findList(delLog);
+        if (dellogs != null && !dellogs.isEmpty()) {
+            List<String> sonIdLists = Lists.newArrayList();
+            for (WorkStaffAchivesLog log : dellogs) {
+                sonIdLists.add(log.getSonId());
+            }
+
+            Iterator<WorkStaffEducation> iterator = newList.iterator();
+            while (iterator.hasNext()) {
+                WorkStaffEducation staff = iterator.next();
+                if (sonIdLists.contains(staff.getId())) {
+                    iterator.remove();
+                }
+            }
+        }
+        workStaffBasicInfo.setEducationList(newList);
+    }
 
     @Transactional(readOnly = false)
     public void saveEdu(WorkStaffBasicInfo workStaffBasicInfo) {
@@ -389,7 +569,12 @@ public class WorkStaffEducationService extends CrudService<WorkStaffEducationDao
                                     String describes=EDU_MAP.get(name);
                                     if(newInvoke instanceof String){
                                         String newValue=newInvoke.toString();
-                                        String oldValue=oldInvoke.toString();
+                                        String oldValue = null;
+                                        if(null == oldInvoke){
+                                            oldValue = "";
+                                        }else{
+                                            oldValue=oldInvoke.toString();
+                                        }
                                         if(!newValue.equals(oldValue)){
                                             if("edu".equals(name)){
                                                 workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
@@ -448,6 +633,82 @@ public class WorkStaffEducationService extends CrudService<WorkStaffEducationDao
                             }
                         }
 
+                    }else{
+                        ////判定审核状态。审核状态为1(暂存),则对暂存的数据进行删除
+                        if("1".equals(workStaffBasicInfo.getAuditStatus())){
+                            if(newEducation.getDegreePhotoFile()!=null&&!newEducation.getDegreePhotoFile().isEmpty()&&newEducation.getDegreePhotoFile().getSize()>0){
+                                MultipartFile file = newEducation.getDegreePhotoFile();
+                                newEducation.setDegreePhoto(this.uploadFile(file,newEducation.getDegreePhoto()));
+                            }
+                            if(newEducation.getEduPhotoFile()!=null&&!newEducation.getEduPhotoFile().isEmpty()&&newEducation.getEduPhotoFile().getSize()>0){
+                                MultipartFile file = newEducation.getEduPhotoFile();
+                                newEducation.setEduPhoto(this.uploadFile(file,newEducation.getEduPhoto()));
+                            }
+                            String newId=IdGen.uuid();
+                            for (Field field : declaredFields) {
+                                String name = field.getName();
+                                if("school".equals(name)||"major".equals(name)||"edu".equals(name)||"degree".equals(name)||"eduType".equals(name)
+                                        || "startDate".equals(name)||"endDate".equals(name)||"eduPhoto".equals(name)||"degreePhoto".equals(name) || "heightEdu".equals(name)
+                                        ||"degreePhotoFile".equals(name)||"eduPhotoFile".equals(name)){
+                                    String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                    workStaffAchivesLog.setModule("教育经历");
+                                    workStaffAchivesLog.setSonId(newId);
+                                    workStaffAchivesLog.setFields(name);
+                                    workStaffAchivesLog.setState("1");
+                                    try {
+                                        Object newInvoke = newClass.getMethod(methodName).invoke(newEducation);//修改后
+                                        String describes=EDU_MAP.get(name);
+                                        if(newInvoke instanceof String){
+                                            String newValue=newInvoke.toString();
+                                            if("edu".equals(name)){
+                                                workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "教育经历",describes,name,
+                                                        "",
+                                                        DictUtils.getDictLabel(newValue,"education_level",""),
+                                                        "",newValue,newId,"新增");
+                                            }else if("degree".equals(name)){
+                                                workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "教育经历",describes,name,
+                                                        "",
+                                                        DictUtils.getDictLabel(newValue,"degree_level",""),
+                                                        "",newValue,newId,"新增");
+                                            }else if("eduType".equals(name)){
+                                                workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "教育经历",describes,name,
+                                                        "",
+                                                        DictUtils.getDictLabel(newValue,"edu_type",""),
+                                                        "",newValue,newId,"新增");
+                                            }else if("heightEdu".equals(name)){
+                                                workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "教育经历",describes,name,
+                                                        "",
+                                                        DictUtils.getDictLabel(newValue,"yes_no",""),
+                                                        "",newValue,newId,"新增");
+                                            }else{
+                                                workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "教育经历",describes,name,
+                                                        "",newInvoke.toString(),
+                                                        "",newInvoke.toString(),newId,"新增");
+                                            }
+                                        }
+                                        if(newInvoke instanceof Date){//日期
+                                            String newDate=sdf.format(newInvoke);
+                                            workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "教育经历",describes,name,
+                                                    "",newDate,"",newDate,newId,"新增");
+                                        };
+                                    } catch (NoSuchMethodException e) {
+                                        e.printStackTrace();
+                                    } catch (IllegalAccessException e) {
+                                        e.printStackTrace();
+                                    } catch (InvocationTargetException e) {
+                                        e.printStackTrace();
+                                    }
+                                }
+                            }
+                        }
                     }
                 }else if((newEducation.getId()==null||"".equals(newEducation.getId()))&&"0".equals(newEducation.getDelFlag())){//新增
                     if(newEducation.getDegreePhotoFile()!=null&&!newEducation.getDegreePhotoFile().isEmpty()&&newEducation.getDegreePhotoFile().getSize()>0){
@@ -537,4 +798,196 @@ public class WorkStaffEducationService extends CrudService<WorkStaffEducationDao
             }
         }
     }
+
+    @Transactional(readOnly = false)
+    public void storeEdu(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        List<WorkStaffEducation> educationList =workStaffBasicInfo.getEducationList();
+        if(educationList!=null&&educationList.size()>0){
+            for(WorkStaffEducation newEducation:educationList){
+                Class<? extends WorkStaffEducation> newClass = newEducation.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                if(newEducation.getId()!=null&&!"1".equals(newEducation.getDelFlag())&&!"".equals(newEducation.getId())){
+                    if(newEducation.getDegreePhotoFile()!=null&&!newEducation.getDegreePhotoFile().isEmpty()&&newEducation.getDegreePhotoFile().getSize()>0){
+                        MultipartFile file = newEducation.getDegreePhotoFile();
+                        newEducation.setDegreePhoto(this.uploadFile(file,newEducation.getDegreePhoto()));
+                    }
+                    if(newEducation.getEduPhotoFile()!=null&&!newEducation.getEduPhotoFile().isEmpty()&&newEducation.getEduPhotoFile().getSize()>0){
+                        MultipartFile file = newEducation.getEduPhotoFile();
+                        newEducation.setEduPhoto(this.uploadFile(file,newEducation.getEduPhoto()));
+                    }
+                    WorkStaffEducation oldEducation=this.get(newEducation.getId());
+                    if(oldEducation!=null){
+                        Class<? extends WorkStaffEducation> oldClass = oldEducation.getClass();
+                        for (Field field : declaredFields) {
+                            String name = field.getName();
+                            if("school".equals(name)||"major".equals(name)||"edu".equals(name)||"degree".equals(name)||"eduType".equals(name)
+                                    || "startDate".equals(name)||"endDate".equals(name)||"eduPhoto".equals(name)||"degreePhoto".equals(name) || "heightEdu".equals(name)
+                                    ||"degreePhotoFile".equals(name)||"eduPhotoFile".equals(name)){
+                                String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                workStaffAchivesLog.setModule("教育经历");
+                                workStaffAchivesLog.setSonId(newEducation.getId());
+                                workStaffAchivesLog.setFields(name);
+                                workStaffAchivesLog.setState("3");
+                                try {
+                                    Object newInvoke = newClass.getMethod(methodName).invoke(newEducation);//修改后
+                                    Object oldInvoke = oldClass.getMethod(methodName).invoke(oldEducation);//修改前
+                                    String describes=EDU_MAP.get(name);
+                                    if(newInvoke instanceof String){
+                                        String newValue=newInvoke.toString();
+                                        String oldValue = null;
+                                        if(null == oldInvoke){
+                                            oldValue = "";
+                                        }else{
+                                            oldValue=oldInvoke.toString();
+                                        }
+                                        if(!newValue.equals(oldValue)){
+                                            if("edu".equals(name)){
+                                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "教育经历",describes,name,
+                                                        DictUtils.getDictLabel(oldValue,"education_level",""),
+                                                        DictUtils.getDictLabel(newValue,"education_level",""),
+                                                        oldValue,newValue,newEducation.getId(),"修改");
+                                            }else if("degree".equals(name)){
+                                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "教育经历",describes,name,
+                                                        DictUtils.getDictLabel(oldValue,"degree_level",""),
+                                                        DictUtils.getDictLabel(newValue,"degree_level",""),
+                                                        oldValue,newValue,newEducation.getId(),"修改");
+                                            }else if("eduType".equals(name)){
+                                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "教育经历",describes,name,
+                                                        DictUtils.getDictLabel(oldValue,"edu_type",""),
+                                                        DictUtils.getDictLabel(newValue,"edu_type",""),
+                                                        oldValue,newValue,newEducation.getId(),"修改");
+                                            }else if("heightEdu".equals(name)){
+                                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "教育经历",describes,name,
+                                                        DictUtils.getDictLabel(oldValue,"yes_no",""),
+                                                        DictUtils.getDictLabel(newValue,"yes_no",""),
+                                                        oldValue,newValue,newEducation.getId(),"修改");
+                                            }else{
+                                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "教育经历",describes,name,
+                                                        oldInvoke.toString(),newInvoke.toString(),
+                                                        oldInvoke.toString(),newInvoke.toString(),newEducation.getId(),"修改");
+                                            }
+                                        }
+                                    }
+                                    if(newInvoke instanceof Date){//日期
+                                        String newDate="";
+                                        String oldDate="";
+                                        if(newInvoke!=null){
+                                            newDate=sdf.format(newInvoke);
+                                        }
+                                        if (oldInvoke!=null){
+                                            oldDate=sdf.format(oldInvoke);
+                                        }
+                                        if(!newDate.equals(oldDate)){
+                                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "教育经历",describes,name,
+                                                    oldDate,newDate,oldDate,newDate,newEducation.getId(),"修改");
+                                        }
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    e.printStackTrace();
+                                } catch (IllegalAccessException e) {
+                                    e.printStackTrace();
+                                } catch (InvocationTargetException e) {
+                                    e.printStackTrace();
+                                }
+                            }
+                        }
+
+                    }
+                }else if((newEducation.getId()==null||"".equals(newEducation.getId()))&&"0".equals(newEducation.getDelFlag())){//新增
+                    if(newEducation.getDegreePhotoFile()!=null&&!newEducation.getDegreePhotoFile().isEmpty()&&newEducation.getDegreePhotoFile().getSize()>0){
+                        MultipartFile file = newEducation.getDegreePhotoFile();
+                        newEducation.setDegreePhoto(this.uploadFile(file,newEducation.getDegreePhoto()));
+                    }
+                    if(newEducation.getEduPhotoFile()!=null&&!newEducation.getEduPhotoFile().isEmpty()&&newEducation.getEduPhotoFile().getSize()>0){
+                        MultipartFile file = newEducation.getEduPhotoFile();
+                        newEducation.setEduPhoto(this.uploadFile(file,newEducation.getEduPhoto()));
+                    }
+                    String newId=IdGen.uuid();
+                    for (Field field : declaredFields) {
+                        String name = field.getName();
+                        if("school".equals(name)||"major".equals(name)||"edu".equals(name)||"degree".equals(name)||"eduType".equals(name)
+                                || "startDate".equals(name)||"endDate".equals(name)||"eduPhoto".equals(name)||"degreePhoto".equals(name) || "heightEdu".equals(name)
+                                ||"degreePhotoFile".equals(name)||"eduPhotoFile".equals(name)){
+                            String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                            WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                            workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                            workStaffAchivesLog.setModule("教育经历");
+                            workStaffAchivesLog.setSonId(newId);
+                            workStaffAchivesLog.setFields(name);
+                            workStaffAchivesLog.setState("3");
+                            try {
+                                Object newInvoke = newClass.getMethod(methodName).invoke(newEducation);//修改后
+                                String describes=EDU_MAP.get(name);
+                                if(newInvoke instanceof String){
+                                    String newValue=newInvoke.toString();
+                                    if("edu".equals(name)){
+                                        workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                "教育经历",describes,name,
+                                                "",
+                                                DictUtils.getDictLabel(newValue,"education_level",""),
+                                                "",newValue,newId,"新增");
+                                    }else if("degree".equals(name)){
+                                        workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                "教育经历",describes,name,
+                                                "",
+                                                DictUtils.getDictLabel(newValue,"degree_level",""),
+                                                "",newValue,newId,"新增");
+                                    }else if("eduType".equals(name)){
+                                        workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                "教育经历",describes,name,
+                                                "",
+                                                DictUtils.getDictLabel(newValue,"edu_type",""),
+                                                "",newValue,newId,"新增");
+                                    }else if("heightEdu".equals(name)){
+                                        workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                "教育经历",describes,name,
+                                                "",
+                                                DictUtils.getDictLabel(newValue,"yes_no",""),
+                                                "",newValue,newId,"新增");
+                                    }else{
+                                        workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                "教育经历",describes,name,
+                                                "",newInvoke.toString(),
+                                                "",newInvoke.toString(),newId,"新增");
+                                    }
+                                }
+                                if(newInvoke instanceof Date){//日期
+                                    String newDate=sdf.format(newInvoke);
+                                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                            "教育经历",describes,name,
+                                            "",newDate,"",newDate,newId,"新增");
+                                };
+                            } catch (NoSuchMethodException e) {
+                                e.printStackTrace();
+                            } catch (IllegalAccessException e) {
+                                e.printStackTrace();
+                            } catch (InvocationTargetException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    }
+                }else if(newEducation.getId()!=null&&"1".equals(newEducation.getDelFlag())&&!"".equals(newEducation.getId())){//删除
+                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                    workStaffAchivesLog.setModule("教育经历");
+                    workStaffAchivesLog.setSonId(newEducation.getId());
+                    workStaffAchivesLog.setType("删除");
+                    workStaffAchivesLog.setState("3");
+                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                            "教育经历","","",
+                            "","",
+                            "","",newEducation.getId(),"删除");
+                }
+            }
+        }
+    }
 }

+ 309 - 0
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffExperienceService.java

@@ -9,6 +9,7 @@ import java.lang.reflect.Method;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -20,6 +21,7 @@ import com.jeeplus.modules.sys.dao.UserDao;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
+import com.jeeplus.modules.workstaff.entity.WorkStaffCertificate;
 import com.jeeplus.modules.workstaff.entity.WorkStaffEducation;
 import com.jeeplus.modules.workstaffachiveslog.entity.WorkStaffAchivesLog;
 import com.jeeplus.modules.workstaffachiveslog.service.WorkStaffAchivesLogService;
@@ -282,6 +284,153 @@ public class WorkStaffExperienceService extends CrudService<WorkStaffExperienceD
         }
         workStaffBasicInfo.setExperienceList(newList);
     }
+
+    public void storeQuerys(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
+        if(workStaffBasicInfo==null|| StringUtils.isBlank(workStaffBasicInfo.getId())){
+            return;
+        }
+        WorkStaffExperience entity = new WorkStaffExperience();
+        entity.setStaffId(workStaffBasicInfo.getId());
+        List<WorkStaffExperience> list=this.findList(entity);
+        List<WorkStaffExperience> newList=Lists.newArrayList();
+        if(list!=null&&list.size()>0){//修改
+            for(WorkStaffExperience workStaffExperience:list){
+                Class<? extends WorkStaffExperience> newClass = workStaffExperience.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("company".equals(name)||"dept".equals(name)||"duty".equals(name)||"startDate".equals(name)||"endDate".equals(name)
+                            || "certifier".equals(name)||"certifierTel".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                        workStaffAchivesLog.setModule("工作经历");
+                        workStaffAchivesLog.setSonId(workStaffExperience.getId());
+                        workStaffAchivesLog.setFields(name);
+                        workStaffAchivesLog.setType("修改");
+                        workStaffAchivesLog.setState("3");
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            Object newInvoke = newClass.getMethod(getMethod).invoke(workStaffExperience);//修改后
+                            if(newInvoke instanceof String){
+                                Method setReadOnly = workStaffExperience.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffExperience,logs.get(0).getNewKey());
+                                }
+                            }
+                            if(newInvoke instanceof Date){//日期
+                                Method setReadOnly = workStaffExperience.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffExperience,myDate);
+                                }
+                            }
+                            if(null == newInvoke){
+                                try {
+                                    Method setReadOnly = workStaffExperience.getClass().getMethod(setMethod, String.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        setReadOnly.invoke(workStaffExperience,logs.get(0).getNewKey());
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    Method setReadOnly = workStaffExperience.getClass().getMethod(setMethod, Date.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                        setReadOnly.invoke(workStaffExperience,myDate);
+                                    }
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                newList.add(workStaffExperience);
+            }
+        }
+        //新增
+        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+        workStaffAchivesLog.setModule("工作经历");
+        workStaffAchivesLog.setType("新增");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> sonIds=workStaffAchivesLogService.findSonId(workStaffAchivesLog);
+        if(sonIds!=null&&sonIds.size()>0){
+            for(WorkStaffAchivesLog w:sonIds){
+                workStaffAchivesLog.setSonId(w.getSonId());
+                WorkStaffExperience workStaffExperience = new WorkStaffExperience();
+                workStaffExperience.setId(w.getSonId());
+                workStaffExperience.setDelFlag("0");
+                workStaffExperience.setStaffId(workStaffBasicInfo.getId());
+                Class<? extends WorkStaffExperience> newClass = workStaffExperience.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("company".equals(name)||"dept".equals(name)||"duty".equals(name)||"startDate".equals(name)||"endDate".equals(name)
+                            || "certifier".equals(name)||"certifierTel".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        workStaffAchivesLog.setFields(name);
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            if("startDate".equals(name)||"endDate".equals(name)){//日期
+                                Method setReadOnly = workStaffExperience.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffExperience,myDate);
+                                }
+                            }else{
+                                Method setReadOnly = workStaffExperience.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffExperience,logs.get(0).getNewKey());
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                newList.add(workStaffExperience);
+            }
+        }
+        //删除
+        WorkStaffAchivesLog delLog=new WorkStaffAchivesLog();
+        delLog.setStaffId(workStaffBasicInfo.getId());
+        delLog.setModule("工作经历");
+        delLog.setType("删除");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> dellogs=workStaffAchivesLogService.findList(delLog);
+        if (dellogs != null && !dellogs.isEmpty()) {
+            List<String> sonIdLists = Lists.newArrayList();
+            for (WorkStaffAchivesLog log : dellogs) {
+                sonIdLists.add(log.getSonId());
+            }
+
+            Iterator<WorkStaffExperience> iterator = newList.iterator();
+            while (iterator.hasNext()) {
+                WorkStaffExperience staff = iterator.next();
+                if (sonIdLists.contains(staff.getId())) {
+                    iterator.remove();
+                }
+            }
+        }
+        workStaffBasicInfo.setExperienceList(newList);
+    }
+
+
     @Transactional(readOnly = false)
     public void saveEdu(WorkStaffBasicInfo workStaffBasicInfo) {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -345,6 +494,47 @@ public class WorkStaffExperienceService extends CrudService<WorkStaffExperienceD
                             }
                         }
 
+                    }else{
+                        if("1".equals(workStaffBasicInfo.getAuditStatus())){
+                            String newId=IdGen.uuid();
+                            for (Field field : declaredFields) {
+                                String name = field.getName();
+                                if("company".equals(name)||"dept".equals(name)||"duty".equals(name)||"startDate".equals(name)||"endDate".equals(name)
+                                        || "certifier".equals(name)||"certifierTel".equals(name)){
+                                    String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                    workStaffAchivesLog.setModule("工作经历");
+                                    workStaffAchivesLog.setSonId(newId);
+                                    workStaffAchivesLog.setFields(name);
+                                    workStaffAchivesLog.setState("1");
+                                    try {
+                                        Object newInvoke = newClass.getMethod(methodName).invoke(newExperience);//修改后
+                                        String describes=EDU_MAP.get(name);
+                                        if(newInvoke instanceof String){
+                                            String newValue=newInvoke.toString();
+                                            workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "工作经历",describes,name,
+                                                    "",newInvoke.toString(),
+                                                    "",newInvoke.toString(),newId,"新增");
+
+                                        }
+                                        if(newInvoke instanceof Date){//日期
+                                            String newDate=sdf.format(newInvoke);
+                                            workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "工作经历",describes,name,
+                                                    "",newDate,"",newDate,newId,"新增");
+                                        };
+                                    } catch (NoSuchMethodException e) {
+                                        e.printStackTrace();
+                                    } catch (IllegalAccessException e) {
+                                        e.printStackTrace();
+                                    } catch (InvocationTargetException e) {
+                                        e.printStackTrace();
+                                    }
+                                }
+                            }
+                        }
                     }
                 }else if((newExperience.getId()==null||"".equals(newExperience.getId()))&&"0".equals(newExperience.getDelFlag())){//新增
                     String newId=IdGen.uuid();
@@ -400,4 +590,123 @@ public class WorkStaffExperienceService extends CrudService<WorkStaffExperienceD
             }
         }
     }
+
+    @Transactional(readOnly = false)
+    public void storeEdu(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        List<WorkStaffExperience> experienceList =workStaffBasicInfo.getExperienceList();
+        if(experienceList!=null&&experienceList.size()>0){
+            for(WorkStaffExperience newExperience:experienceList){
+                Class<? extends WorkStaffExperience> newClass = newExperience.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                if(newExperience.getId()!=null&&!"1".equals(newExperience.getDelFlag())&&!"".equals(newExperience.getId())){
+                    WorkStaffExperience oldExperience=this.get(newExperience.getId());
+                    if(oldExperience!=null){
+                        Class<? extends WorkStaffExperience> oldClass = oldExperience.getClass();
+                        for (Field field : declaredFields) {
+                            String name = field.getName();
+                            if("company".equals(name)||"dept".equals(name)||"duty".equals(name)||"startDate".equals(name)||"endDate".equals(name)
+                                    || "certifier".equals(name)||"certifierTel".equals(name)){
+                                String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                workStaffAchivesLog.setModule("工作经历");
+                                workStaffAchivesLog.setSonId(newExperience.getId());
+                                workStaffAchivesLog.setFields(name);
+                                workStaffAchivesLog.setState("3");
+                                try {
+                                    Object newInvoke = newClass.getMethod(methodName).invoke(newExperience);//修改后
+                                    Object oldInvoke = oldClass.getMethod(methodName).invoke(oldExperience);//修改前
+                                    String describes=EDU_MAP.get(name);
+                                    if(newInvoke instanceof String){
+                                        String newValue=newInvoke.toString();
+                                        String oldValue=oldInvoke.toString();
+                                        if(!newValue.equals(oldValue)){
+                                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "工作经历",describes,name,
+                                                    oldInvoke.toString(),newInvoke.toString(),
+                                                    oldInvoke.toString(),newInvoke.toString(),newExperience.getId(),"修改");
+
+                                        }
+                                    }
+                                    if(newInvoke instanceof Date){//日期
+                                        String newDate="";
+                                        String oldDate="";
+                                        if(newInvoke!=null){
+                                            newDate=sdf.format(newInvoke);
+                                        }
+                                        if (oldInvoke!=null){
+                                            oldDate=sdf.format(oldInvoke);
+                                        }
+                                        if(!newDate.equals(oldDate)){
+                                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "工作经历",describes,name,
+                                                    oldDate,newDate,oldDate,newDate,newExperience.getId(),"修改");
+                                        }
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    e.printStackTrace();
+                                } catch (IllegalAccessException e) {
+                                    e.printStackTrace();
+                                } catch (InvocationTargetException e) {
+                                    e.printStackTrace();
+                                }
+                            }
+                        }
+
+                    }
+                }else if((newExperience.getId()==null||"".equals(newExperience.getId()))&&"0".equals(newExperience.getDelFlag())){//新增
+                    String newId=IdGen.uuid();
+                    for (Field field : declaredFields) {
+                        String name = field.getName();
+                        if("company".equals(name)||"dept".equals(name)||"duty".equals(name)||"startDate".equals(name)||"endDate".equals(name)
+                                || "certifier".equals(name)||"certifierTel".equals(name)){
+                            String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                            WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                            workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                            workStaffAchivesLog.setModule("工作经历");
+                            workStaffAchivesLog.setSonId(newId);
+                            workStaffAchivesLog.setFields(name);
+                            workStaffAchivesLog.setState("3");
+                            try {
+                                Object newInvoke = newClass.getMethod(methodName).invoke(newExperience);//修改后
+                                String describes=EDU_MAP.get(name);
+                                if(newInvoke instanceof String){
+                                    String newValue=newInvoke.toString();
+                                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                            "工作经历",describes,name,
+                                            "",newInvoke.toString(),
+                                            "",newInvoke.toString(),newId,"新增");
+
+                                }
+                                if(newInvoke instanceof Date){//日期
+                                    String newDate=sdf.format(newInvoke);
+                                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                            "工作经历",describes,name,
+                                            "",newDate,"",newDate,newId,"新增");
+                                };
+                            } catch (NoSuchMethodException e) {
+                                e.printStackTrace();
+                            } catch (IllegalAccessException e) {
+                                e.printStackTrace();
+                            } catch (InvocationTargetException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    }
+                }else if(newExperience.getId()!=null&&"1".equals(newExperience.getDelFlag())&&!"".equals(newExperience.getId())){//删除
+                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                    workStaffAchivesLog.setModule("工作经历");
+                    workStaffAchivesLog.setSonId(newExperience.getId());
+                    workStaffAchivesLog.setType("删除");
+                    workStaffAchivesLog.setState("3");
+                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                            "工作经历","","",
+                            "","",
+                            "","",newExperience.getId(),"删除");
+                }
+            }
+        }
+    }
 }

+ 293 - 0
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffFamilyService.java

@@ -9,6 +9,7 @@ import java.lang.reflect.Method;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -270,6 +271,141 @@ public class WorkStaffFamilyService extends CrudService<WorkStaffFamilyDao, Work
         }
         workStaffBasicInfo.setFamilyList(newList);
     }
+    public void storeQuerys(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
+        if(workStaffBasicInfo==null|| StringUtils.isBlank(workStaffBasicInfo.getId())){
+            return;
+        }
+        WorkStaffFamily entity = new WorkStaffFamily();
+        entity.setStaff(workStaffBasicInfo.getId());
+        List<WorkStaffFamily> list=this.findList(entity);
+        List<WorkStaffFamily> newList=Lists.newArrayList();
+        if(list!=null&&list.size()>0){//修改
+            for(WorkStaffFamily workStaffFamily:list){
+                Class<? extends WorkStaffFamily> newClass = workStaffFamily.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("relation".equals(name)||"name".equals(name)||"idCard".equals(name)||"gender".equals(name)||"contact".equals(name)
+                    ){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                        workStaffAchivesLog.setModule("家庭情况");
+                        workStaffAchivesLog.setSonId(workStaffFamily.getId());
+                        workStaffAchivesLog.setFields(name);
+                        workStaffAchivesLog.setType("修改");
+                        workStaffAchivesLog.setState("3");
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            Object newInvoke = newClass.getMethod(getMethod).invoke(workStaffFamily);//修改后
+                            if(newInvoke instanceof String){
+                                Method setReadOnly = workStaffFamily.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffFamily,logs.get(0).getNewKey());
+                                }
+                            }
+                            if(newInvoke instanceof Date){//日期
+                                Method setReadOnly = workStaffFamily.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffFamily,myDate);
+                                }
+                            }
+                            if(null == newInvoke){
+                                try {
+                                    Method setReadOnly = workStaffFamily.getClass().getMethod(setMethod, String.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        setReadOnly.invoke(workStaffFamily,logs.get(0).getNewKey());
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    Method setReadOnly = workStaffFamily.getClass().getMethod(setMethod, Date.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                        setReadOnly.invoke(workStaffFamily,myDate);
+                                    }
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                newList.add(workStaffFamily);
+            }
+        }
+        //新增
+        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+        workStaffAchivesLog.setModule("家庭情况");
+        workStaffAchivesLog.setType("新增");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> sonIds=workStaffAchivesLogService.findSonId(workStaffAchivesLog);
+        if(sonIds!=null&&sonIds.size()>0){
+            for(WorkStaffAchivesLog w:sonIds){
+                workStaffAchivesLog.setSonId(w.getSonId());
+                WorkStaffFamily workStaffFamily = new WorkStaffFamily();
+                workStaffFamily.setId(w.getSonId());
+                workStaffFamily.setDelFlag("0");
+                workStaffFamily.setStaff(workStaffBasicInfo.getId());
+                Class<? extends WorkStaffFamily> newClass = workStaffFamily.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("relation".equals(name)||"name".equals(name)||"idCard".equals(name)||"gender".equals(name)||"contact".equals(name)
+                    ){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        workStaffAchivesLog.setFields(name);
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            Method setReadOnly = workStaffFamily.getClass().getMethod(setMethod, String.class);
+                            if(logs!=null&&logs.size()>0){
+                                setReadOnly.invoke(workStaffFamily,logs.get(0).getNewKey());
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                newList.add(workStaffFamily);
+            }
+        }
+        //删除
+        WorkStaffAchivesLog delLog=new WorkStaffAchivesLog();
+        delLog.setStaffId(workStaffBasicInfo.getId());
+        delLog.setModule("家庭情况");
+        delLog.setType("删除");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> dellogs=workStaffAchivesLogService.findList(delLog);
+        if (dellogs != null && !dellogs.isEmpty()) {
+            List<String> sonIdLists = Lists.newArrayList();
+            for (WorkStaffAchivesLog log : dellogs) {
+                sonIdLists.add(log.getSonId());
+            }
+
+            Iterator<WorkStaffFamily> iterator = newList.iterator();
+            while (iterator.hasNext()) {
+                WorkStaffFamily staff = iterator.next();
+                if (sonIdLists.contains(staff.getId())) {
+                    iterator.remove();
+                }
+            }
+        }
+        workStaffBasicInfo.setFamilyList(newList);
+    }
+
     @Transactional(readOnly = false)
     public void saveEdu(WorkStaffBasicInfo workStaffBasicInfo) {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -332,6 +468,46 @@ public class WorkStaffFamilyService extends CrudService<WorkStaffFamilyDao, Work
                             }
                         }
 
+                    }else{
+                        if("1".equals(workStaffBasicInfo.getAuditStatus())){
+                            String newId=IdGen.uuid();
+                            for (Field field : declaredFields) {
+                                String name = field.getName();
+                                if("relation".equals(name)||"name".equals(name)||"idCard".equals(name)||"gender".equals(name)||"contact".equals(name)
+                                ){
+                                    String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                    workStaffAchivesLog.setModule("家庭情况");
+                                    workStaffAchivesLog.setSonId(newId);
+                                    workStaffAchivesLog.setFields(name);
+                                    workStaffAchivesLog.setState("1");
+                                    try {
+                                        Object newInvoke = newClass.getMethod(methodName).invoke(newFamily);//修改后
+                                        String describes=EDU_MAP.get(name);
+                                        if(newInvoke instanceof String){
+                                            String newValue=newInvoke.toString();
+                                            workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "家庭情况",describes,name,
+                                                    "",newInvoke.toString(),
+                                                    "",newInvoke.toString(),newId,"新增");
+                                        }
+                                        if(newInvoke instanceof Date){//日期
+                                            String newDate=sdf.format(newInvoke);
+                                            workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "家庭情况",describes,name,
+                                                    "",newDate,"",newDate,newId,"新增");
+                                        };
+                                    } catch (NoSuchMethodException e) {
+                                        e.printStackTrace();
+                                    } catch (IllegalAccessException e) {
+                                        e.printStackTrace();
+                                    } catch (InvocationTargetException e) {
+                                        e.printStackTrace();
+                                    }
+                                }
+                            }
+                        }
                     }
                 }else if((newFamily.getId()==null||"".equals(newFamily.getId()))&&"0".equals(newFamily.getDelFlag())){//新增
                     String newId=IdGen.uuid();
@@ -386,4 +562,121 @@ public class WorkStaffFamilyService extends CrudService<WorkStaffFamilyDao, Work
             }
         }
     }
+
+    @Transactional(readOnly = false)
+    public void storeEdu(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        List<WorkStaffFamily> familyList =workStaffBasicInfo.getFamilyList();
+        if(familyList!=null&&familyList.size()>0){
+            for(WorkStaffFamily newFamily:familyList){
+                Class<? extends WorkStaffFamily> newClass = newFamily.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                if(newFamily.getId()!=null&&!"1".equals(newFamily.getDelFlag())&&!"".equals(newFamily.getId())){
+                    WorkStaffFamily oldFamily=this.get(newFamily.getId());
+                    if(oldFamily!=null){
+                        Class<? extends WorkStaffFamily> oldClass = oldFamily.getClass();
+                        for (Field field : declaredFields) {
+                            String name = field.getName();
+                            if("relation".equals(name)||"name".equals(name)||"idCard".equals(name)||"gender".equals(name)||"contact".equals(name)
+                            ){
+                                String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                workStaffAchivesLog.setModule("家庭情况");
+                                workStaffAchivesLog.setSonId(newFamily.getId());
+                                workStaffAchivesLog.setFields(name);
+                                workStaffAchivesLog.setState("3");
+                                try {
+                                    Object newInvoke = newClass.getMethod(methodName).invoke(newFamily);//修改后
+                                    Object oldInvoke = oldClass.getMethod(methodName).invoke(oldFamily);//修改前
+                                    String describes=EDU_MAP.get(name);
+                                    if(newInvoke instanceof String){
+                                        String newValue=newInvoke.toString();
+                                        String oldValue=oldInvoke.toString();
+                                        if(!newValue.equals(oldValue)){
+                                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "家庭情况",describes,name,
+                                                    oldInvoke.toString(),newInvoke.toString(),
+                                                    oldInvoke.toString(),newInvoke.toString(),newFamily.getId(),"修改");
+                                        }
+                                    }
+                                    if(newInvoke instanceof Date){//日期
+                                        String newDate="";
+                                        String oldDate="";
+                                        if(newInvoke!=null){
+                                            newDate=sdf.format(newInvoke);
+                                        }
+                                        if (oldInvoke!=null){
+                                            oldDate=sdf.format(oldInvoke);
+                                        }
+                                        if(!newDate.equals(oldDate)){
+                                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "家庭情况",describes,name,
+                                                    oldDate,newDate,oldDate,newDate,newFamily.getId(),"修改");
+                                        }
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    e.printStackTrace();
+                                } catch (IllegalAccessException e) {
+                                    e.printStackTrace();
+                                } catch (InvocationTargetException e) {
+                                    e.printStackTrace();
+                                }
+                            }
+                        }
+
+                    }
+                }else if((newFamily.getId()==null||"".equals(newFamily.getId()))&&"0".equals(newFamily.getDelFlag())){//新增
+                    String newId=IdGen.uuid();
+                    for (Field field : declaredFields) {
+                        String name = field.getName();
+                        if("relation".equals(name)||"name".equals(name)||"idCard".equals(name)||"gender".equals(name)||"contact".equals(name)
+                        ){
+                            String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                            WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                            workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                            workStaffAchivesLog.setModule("家庭情况");
+                            workStaffAchivesLog.setSonId(newId);
+                            workStaffAchivesLog.setFields(name);
+                            workStaffAchivesLog.setState("3");
+                            try {
+                                Object newInvoke = newClass.getMethod(methodName).invoke(newFamily);//修改后
+                                String describes=EDU_MAP.get(name);
+                                if(newInvoke instanceof String){
+                                    String newValue=newInvoke.toString();
+                                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                            "家庭情况",describes,name,
+                                            "",newInvoke.toString(),
+                                            "",newInvoke.toString(),newId,"新增");
+                                }
+                                if(newInvoke instanceof Date){//日期
+                                    String newDate=sdf.format(newInvoke);
+                                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                            "家庭情况",describes,name,
+                                            "",newDate,"",newDate,newId,"新增");
+                                };
+                            } catch (NoSuchMethodException e) {
+                                e.printStackTrace();
+                            } catch (IllegalAccessException e) {
+                                e.printStackTrace();
+                            } catch (InvocationTargetException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    }
+                }else if(newFamily.getId()!=null&&"1".equals(newFamily.getDelFlag())&&!"".equals(newFamily.getId())){//删除
+                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                    workStaffAchivesLog.setModule("家庭情况");
+                    workStaffAchivesLog.setSonId(newFamily.getId());
+                    workStaffAchivesLog.setType("删除");
+                    workStaffAchivesLog.setState("3");
+                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                            "家庭情况","","",
+                            "","",
+                            "","",newFamily.getId(),"删除");
+                }
+            }
+        }
+    }
 }

+ 377 - 8
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffLaborContractService.java

@@ -19,10 +19,7 @@ import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.workstaff.dao.WorkStaffBasicInfoDao;
 import com.jeeplus.modules.workstaff.dao.WorkStaffCertificateDao;
 import com.jeeplus.modules.workstaff.dao.WorkStaffLaborContractDao;
-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.entity.WorkStaffLaborContract;
+import com.jeeplus.modules.workstaff.entity.*;
 import com.jeeplus.modules.workstaffachiveslog.entity.WorkStaffAchivesLog;
 import com.jeeplus.modules.workstaffachiveslog.service.WorkStaffAchivesLogService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,10 +33,7 @@ import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * 劳动合同Service
@@ -64,6 +58,7 @@ public class WorkStaffLaborContractService extends CrudService<WorkStaffLaborCon
         for (WorkStaffLaborContract staffCertificate : list) {
             if(StringUtils.isNotEmpty(staffCertificate.getFilePath())) {
                 staffCertificate.setFilePathStr(WorkattachmentService.fileUrlManage(staffCertificate.getFilePath()));
+                staffCertificate.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(staffCertificate.getFilePath()));
             }
         }
         return super.findList(workStaffLaborContract);
@@ -267,11 +262,13 @@ public class WorkStaffLaborContractService extends CrudService<WorkStaffLaborCon
                 }
                 if(StringUtils.isNotBlank(workStaffLaborContract.getFilePath())){
                     workStaffLaborContract.setFilePathStr(WorkattachmentService.fileUrlManage(workStaffLaborContract.getFilePath()));
+                    workStaffLaborContract.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(workStaffLaborContract.getFilePath()));
                 }
                 newList.add(workStaffLaborContract);
                 for (WorkStaffLaborContract staffCertificate : newList) {
                     if(StringUtils.isNotEmpty(staffCertificate.getFilePath())) {
                         staffCertificate.setFilePathStr(WorkattachmentService.fileUrlManage(staffCertificate.getFilePath()));
+                        staffCertificate.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(staffCertificate.getFilePath()));
                     }
                 }
             }
@@ -326,6 +323,7 @@ public class WorkStaffLaborContractService extends CrudService<WorkStaffLaborCon
                 }
                 if(StringUtils.isNotBlank(workStaffLaborContract.getFilePath())){
                     workStaffLaborContract.setFilePathStr(WorkattachmentService.fileUrlManage(workStaffLaborContract.getFilePath()));
+                    workStaffLaborContract.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(workStaffLaborContract.getFilePath()));
                 }
                 newList.add(workStaffLaborContract);
             }
@@ -344,6 +342,164 @@ public class WorkStaffLaborContractService extends CrudService<WorkStaffLaborCon
         }
         workStaffBasicInfo.setLaborContractList(newList);
     }
+    public void storeQuerys(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
+        if(workStaffBasicInfo==null|| StringUtils.isBlank(workStaffBasicInfo.getId())){
+            return;
+        }
+        WorkStaffLaborContract entity = new WorkStaffLaborContract();
+        entity.setStaffId(workStaffBasicInfo.getId());
+        List<WorkStaffLaborContract> list=this.findList(entity);
+        List<WorkStaffLaborContract> newList=Lists.newArrayList();
+        if(list!=null&&list.size()>0){//修改
+            for(WorkStaffLaborContract workStaffLaborContract:list){
+                Class<? extends WorkStaffLaborContract> newClass = workStaffLaborContract.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("contractType".equals(name)||"contractNum".equals(name)||"contractLimit".equals(name)||"contractStartTime".equals(name)||"contractEndTime".equals(name)
+                            || "tryEndTime".equals(name)||"transactTime".equals(name)||"filePath".equals(name)||"fileName".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                        workStaffAchivesLog.setModule("劳动合同");
+                        workStaffAchivesLog.setSonId(workStaffLaborContract.getId());
+                        workStaffAchivesLog.setFields(name);
+                        workStaffAchivesLog.setType("修改");
+                        workStaffAchivesLog.setState("3");
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            Object newInvoke = newClass.getMethod(getMethod).invoke(workStaffLaborContract);//修改后
+                            if(newInvoke instanceof String){
+                                Method setReadOnly = workStaffLaborContract.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffLaborContract,logs.get(0).getNewKey());
+                                }
+                            }
+                            if(newInvoke instanceof Date){//日期
+                                Method setReadOnly = workStaffLaborContract.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffLaborContract,myDate);
+                                }
+                            }
+                            if(null == newInvoke){
+                                try {
+                                    Method setReadOnly = workStaffLaborContract.getClass().getMethod(setMethod, String.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        setReadOnly.invoke(workStaffLaborContract,logs.get(0).getNewKey());
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    Method setReadOnly = workStaffLaborContract.getClass().getMethod(setMethod, Date.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                        setReadOnly.invoke(workStaffLaborContract,myDate);
+                                    }
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                if(StringUtils.isNotBlank(workStaffLaborContract.getFilePath())){
+                    workStaffLaborContract.setFilePathStr(WorkattachmentService.fileUrlManage(workStaffLaborContract.getFilePath()));
+                    workStaffLaborContract.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(workStaffLaborContract.getFilePath()));
+                }
+                newList.add(workStaffLaborContract);
+                for (WorkStaffLaborContract staffCertificate : newList) {
+                    if(StringUtils.isNotEmpty(staffCertificate.getFilePath())) {
+                        staffCertificate.setFilePathStr(WorkattachmentService.fileUrlManage(staffCertificate.getFilePath()));
+                        staffCertificate.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(staffCertificate.getFilePath()));
+                    }
+                }
+            }
+        }
+        //新增
+        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+        workStaffAchivesLog.setModule("劳动合同");
+        workStaffAchivesLog.setType("新增");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> sonIds=workStaffAchivesLogService.findSonId(workStaffAchivesLog);
+        if(sonIds!=null&&sonIds.size()>0){
+            for(WorkStaffAchivesLog w:sonIds){
+                workStaffAchivesLog.setSonId(w.getSonId());
+                WorkStaffLaborContract workStaffLaborContract = new WorkStaffLaborContract();
+                workStaffLaborContract.setId(w.getSonId());
+                workStaffLaborContract.setDelFlag("0");
+                workStaffLaborContract.setStaffId(workStaffBasicInfo.getId());
+                Class<? extends WorkStaffLaborContract> newClass = workStaffLaborContract.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("contractType".equals(name)||"contractNum".equals(name)||"contractLimit".equals(name)||"contractStartTime".equals(name)||"contractEndTime".equals(name)
+                            || "tryEndTime".equals(name)||"transactTime".equals(name)||"filePath".equals(name)||"fileName".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        workStaffAchivesLog.setFields(name);
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            if("contractStartTime".equals(name)||"contractEndTime".equals(name)||"tryEndTime".equals(name)||"transactTime".equals(name)){//日期
+                                Method setReadOnly = workStaffLaborContract.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffLaborContract,myDate);
+                                }
+                            }else{
+                                Method setReadOnly = workStaffLaborContract.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffLaborContract,logs.get(0).getNewKey());
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                if(StringUtils.isNotBlank(workStaffLaborContract.getFilePath())){
+                    workStaffLaborContract.setFilePathStr(WorkattachmentService.fileUrlManage(workStaffLaborContract.getFilePath()));
+                    workStaffLaborContract.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(workStaffLaborContract.getFilePath()));
+                }
+                newList.add(workStaffLaborContract);
+            }
+        }
+        //删除
+        WorkStaffAchivesLog delLog=new WorkStaffAchivesLog();
+        delLog.setStaffId(workStaffBasicInfo.getId());
+        delLog.setModule("劳动合同");
+        delLog.setType("删除");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> dellogs=workStaffAchivesLogService.findList(delLog);
+        if (dellogs != null && !dellogs.isEmpty()) {
+            List<String> sonIdLists = Lists.newArrayList();
+            for (WorkStaffAchivesLog log : dellogs) {
+                sonIdLists.add(log.getSonId());
+            }
+
+            Iterator<WorkStaffLaborContract> iterator = newList.iterator();
+            while (iterator.hasNext()) {
+                WorkStaffLaborContract staff = iterator.next();
+                if (sonIdLists.contains(staff.getId())) {
+                    iterator.remove();
+                }
+            }
+        }
+        workStaffBasicInfo.setLaborContractList(newList);
+    }
     @Transactional(readOnly = false)
     public void saveEdu(WorkStaffBasicInfo workStaffBasicInfo) {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -426,6 +582,64 @@ public class WorkStaffLaborContractService extends CrudService<WorkStaffLaborCon
                                 }
                             }
                         }
+                    }else{
+                        if("1".equals(workStaffBasicInfo.getAuditStatus())){
+                            if(newCertificate.getFile()!=null&&!newCertificate.getFile().isEmpty()&&newCertificate.getFile().getSize()>0){
+                                MultipartFile file = newCertificate.getFile();
+                                newCertificate.setFilePath(this.uploadFile(file,newCertificate.getFilePath()));
+                            }
+                            String newId=IdGen.uuid();
+                            for (Field field : declaredFields) {
+                                String name = field.getName();
+                                if("contractType".equals(name)||"contractNum".equals(name)||"contractLimit".equals(name)||"contractStartTime".equals(name)||"contractEndTime".equals(name)
+                                        || "tryEndTime".equals(name)||"transactTime".equals(name)||"filePath".equals(name)||"fileName".equals(name)){
+                                    String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                    workStaffAchivesLog.setModule("劳动合同");
+                                    workStaffAchivesLog.setSonId(newId);
+                                    workStaffAchivesLog.setFields(name);
+                                    workStaffAchivesLog.setState("1");
+                                    try {
+                                        Object newInvoke = newClass.getMethod(methodName).invoke(newCertificate);//修改后
+                                        String describes=EDU_MAP.get(name);
+                                        if(newInvoke instanceof String){
+                                            String newValue=newInvoke.toString();
+                                            if("contractType".equals(name)){
+                                                workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "劳动合同",describes,name,
+                                                        "",
+                                                        DictUtils.getMainDictLabel(newValue,"relsp_cType",""),
+                                                        "",newValue,newId,"新增");
+                                            }else if("contractLimit".equals(name)){
+                                                workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "劳动合同",describes,name,
+                                                        "",
+                                                        DictUtils.getMainDictLabel(newValue,"contract_limit",""),
+                                                        "",newValue,newId,"新增");
+                                            }else{
+                                                workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "劳动合同",describes,name,
+                                                        "",newInvoke.toString(),
+                                                        "",newInvoke.toString(),newId,"新增");
+                                            }
+                                        }
+                                        if(newInvoke instanceof Date){//日期
+                                            String newDate=sdf.format(newInvoke);
+                                            workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "劳动合同",describes,name,
+                                                    "",newDate,"",newDate,newId,"新增");
+                                        };
+                                    } catch (NoSuchMethodException e) {
+                                        e.printStackTrace();
+                                    } catch (IllegalAccessException e) {
+                                        e.printStackTrace();
+                                    } catch (InvocationTargetException e) {
+                                        e.printStackTrace();
+                                    }
+                                }
+                            }
+                        }
                     }
                 }else if((newCertificate.getId()==null||"".equals(newCertificate.getId()))&&"0".equals(newCertificate.getDelFlag())){//新增
                     if(newCertificate.getFile()!=null&&!newCertificate.getFile().isEmpty()&&newCertificate.getFile().getSize()>0){
@@ -498,4 +712,159 @@ public class WorkStaffLaborContractService extends CrudService<WorkStaffLaborCon
             }
         }
     }
+
+    @Transactional(readOnly = false)
+    public void storeEdu(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        List<WorkStaffLaborContract> certificateList =workStaffBasicInfo.getLaborContractList();
+        if(certificateList!=null&&certificateList.size()>0){
+            for(WorkStaffLaborContract newCertificate:certificateList){
+                Class<? extends WorkStaffLaborContract> newClass = newCertificate.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                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()));
+                    }
+                    WorkStaffLaborContract oldCertificate=this.get(newCertificate.getId());
+                    if(oldCertificate!=null){
+                        Class<? extends WorkStaffLaborContract> oldClass = oldCertificate.getClass();
+                        for (Field field : declaredFields) {
+                            String name = field.getName();
+                            if("contractType".equals(name)||"contractNum".equals(name)||"contractLimit".equals(name)||"contractStartTime".equals(name)||"contractEndTime".equals(name)
+                                    || "tryEndTime".equals(name)||"transactTime".equals(name)||"filePath".equals(name)||"fileName".equals(name)){
+                                String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                workStaffAchivesLog.setModule("劳动合同");
+                                workStaffAchivesLog.setSonId(newCertificate.getId());
+                                workStaffAchivesLog.setFields(name);
+                                workStaffAchivesLog.setState("3");
+                                try {
+                                    Object newInvoke = newClass.getMethod(methodName).invoke(newCertificate);//修改后
+                                    Object oldInvoke = oldClass.getMethod(methodName).invoke(oldCertificate);//修改前
+                                    if(null == oldInvoke){
+                                        oldInvoke = "";
+                                    }
+                                    String describes=EDU_MAP.get(name);
+                                    if(newInvoke instanceof String){
+                                        String newValue=newInvoke.toString();
+                                        String oldValue=oldInvoke.toString();
+                                        if(!newValue.equals(oldValue)){
+                                            if("contractType".equals(name)){
+                                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "劳动合同",describes,name,
+                                                        DictUtils.getMainDictLabel(oldValue,"relsp_cType",""),
+                                                        DictUtils.getMainDictLabel(newValue,"relsp_cType",""),
+                                                        oldValue,newValue,newCertificate.getId(),"修改");
+                                            }else if("contractLimit".equals(name)){
+                                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "劳动合同",describes,name,
+                                                        DictUtils.getMainDictLabel(oldValue,"contract_limit",""),
+                                                        DictUtils.getMainDictLabel(newValue,"contract_limit",""),
+                                                        oldValue,newValue,newCertificate.getId(),"修改");
+                                            }else{
+                                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "劳动合同",describes,name,
+                                                        oldInvoke.toString(),newInvoke.toString(),
+                                                        oldInvoke.toString(),newInvoke.toString(),newCertificate.getId(),"修改");
+                                            }
+                                        }
+                                    }
+                                    if(newInvoke instanceof Date){//日期
+                                        String newDate="";
+                                        String oldDate="";
+                                        if(newInvoke!=null){
+                                            newDate=sdf.format(newInvoke);
+                                        }
+                                        if (oldInvoke!=null && StringUtils.isNotBlank(oldInvoke.toString())){
+                                            oldDate=sdf.format(oldInvoke);
+                                        }
+                                        if(!newDate.equals(oldDate)){
+                                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "劳动合同",describes,name,
+                                                    oldDate,newDate,oldDate,newDate,newCertificate.getId(),"修改");
+                                        }
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    e.printStackTrace();
+                                } catch (IllegalAccessException e) {
+                                    e.printStackTrace();
+                                } catch (InvocationTargetException e) {
+                                    e.printStackTrace();
+                                }
+                            }
+                        }
+                    }
+                }else if((newCertificate.getId()==null||"".equals(newCertificate.getId()))&&"0".equals(newCertificate.getDelFlag())){//新增
+                    if(newCertificate.getFile()!=null&&!newCertificate.getFile().isEmpty()&&newCertificate.getFile().getSize()>0){
+                        MultipartFile file = newCertificate.getFile();
+                        newCertificate.setFilePath(this.uploadFile(file,newCertificate.getFilePath()));
+                    }
+                    String newId=IdGen.uuid();
+                    for (Field field : declaredFields) {
+                        String name = field.getName();
+                        if("contractType".equals(name)||"contractNum".equals(name)||"contractLimit".equals(name)||"contractStartTime".equals(name)||"contractEndTime".equals(name)
+                                || "tryEndTime".equals(name)||"transactTime".equals(name)||"filePath".equals(name)||"fileName".equals(name)){
+                            String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                            WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                            workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                            workStaffAchivesLog.setModule("劳动合同");
+                            workStaffAchivesLog.setSonId(newId);
+                            workStaffAchivesLog.setFields(name);
+                            workStaffAchivesLog.setState("3");
+                            try {
+                                Object newInvoke = newClass.getMethod(methodName).invoke(newCertificate);//修改后
+                                String describes=EDU_MAP.get(name);
+                                if(newInvoke instanceof String){
+                                    String newValue=newInvoke.toString();
+                                    if("contractType".equals(name)){
+                                        workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                "劳动合同",describes,name,
+                                                "",
+                                                DictUtils.getMainDictLabel(newValue,"relsp_cType",""),
+                                                "",newValue,newId,"新增");
+                                    }else if("contractLimit".equals(name)){
+                                        workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                "劳动合同",describes,name,
+                                                "",
+                                                DictUtils.getMainDictLabel(newValue,"contract_limit",""),
+                                                "",newValue,newId,"新增");
+                                    }else{
+                                        workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                "劳动合同",describes,name,
+                                                "",newInvoke.toString(),
+                                                "",newInvoke.toString(),newId,"新增");
+                                    }
+                                }
+                                if(newInvoke instanceof Date){//日期
+                                    String newDate=sdf.format(newInvoke);
+                                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                            "劳动合同",describes,name,
+                                            "",newDate,"",newDate,newId,"新增");
+                                };
+                            } catch (NoSuchMethodException e) {
+                                e.printStackTrace();
+                            } catch (IllegalAccessException e) {
+                                e.printStackTrace();
+                            } catch (InvocationTargetException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    }
+                }else if(newCertificate.getId()!=null&&"1".equals(newCertificate.getDelFlag())&&!"".equals(newCertificate.getId())){//删除
+                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                    workStaffAchivesLog.setModule("劳动合同");
+                    workStaffAchivesLog.setSonId(newCertificate.getId());
+                    workStaffAchivesLog.setType("删除");
+                    workStaffAchivesLog.setState("3");
+                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                            "劳动合同","","",
+                            "","",
+                            "","",newCertificate.getId(),"删除");
+                }
+            }
+        }
+    }
 }

+ 375 - 4
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffLanguagesService.java

@@ -9,6 +9,7 @@ import java.lang.reflect.Method;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -23,9 +24,7 @@ import com.jeeplus.modules.sys.dao.UserDao;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.service.WorkattachmentService;
 import com.jeeplus.modules.sys.utils.DictUtils;
-import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
-import com.jeeplus.modules.workstaff.entity.WorkStaffCertificate;
-import com.jeeplus.modules.workstaff.entity.WorkStaffEducation;
+import com.jeeplus.modules.workstaff.entity.*;
 import com.jeeplus.modules.workstaffachiveslog.entity.WorkStaffAchivesLog;
 import com.jeeplus.modules.workstaffachiveslog.service.WorkStaffAchivesLogService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,7 +33,6 @@ import org.springframework.transaction.annotation.Transactional;
 
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
-import com.jeeplus.modules.workstaff.entity.WorkStaffLanguages;
 import com.jeeplus.modules.workstaff.dao.WorkStaffLanguagesDao;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -59,6 +57,7 @@ public class WorkStaffLanguagesService extends CrudService<WorkStaffLanguagesDao
         for (WorkStaffLanguages staffLanguages : list) {
             if(StringUtils.isNotEmpty(staffLanguages.getFilePath())) {
                 staffLanguages.setFilePathStr(WorkattachmentService.fileUrlManage(staffLanguages.getFilePath()));
+                staffLanguages.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(staffLanguages.getFilePath()));
             }
         }
         return super.findList(workStaffLanguages);
@@ -271,11 +270,13 @@ public class WorkStaffLanguagesService extends CrudService<WorkStaffLanguagesDao
                 }
                 if(StringUtils.isNotBlank(workStaffLanguages.getFilePath())){
                     workStaffLanguages.setFilePathStr( WorkattachmentService.fileUrlManage(workStaffLanguages.getFilePath()));
+                    workStaffLanguages.setFilePathThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffLanguages.getFilePath()));
                 }
                 newList.add(workStaffLanguages);
                 for (WorkStaffLanguages staffCertificate : newList) {
                     if(StringUtils.isNotEmpty(staffCertificate.getFilePath())) {
                         staffCertificate.setFilePathStr(WorkattachmentService.fileUrlManage(staffCertificate.getFilePath()));
+                        staffCertificate.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(staffCertificate.getFilePath()));
                     }
                 }
             }
@@ -330,6 +331,7 @@ public class WorkStaffLanguagesService extends CrudService<WorkStaffLanguagesDao
                 }
                 if(StringUtils.isNotBlank(workStaffLanguages.getFilePath())){
                     workStaffLanguages.setFilePathStr( WorkattachmentService.fileUrlManage(workStaffLanguages.getFilePath()));
+                    workStaffLanguages.setFilePathThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffLanguages.getFilePath()));
                 }
                 newList.add(workStaffLanguages);
             }
@@ -348,6 +350,164 @@ public class WorkStaffLanguagesService extends CrudService<WorkStaffLanguagesDao
         }
         workStaffBasicInfo.setLanguageList(newList);
     }
+    public void storeQuerys(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
+        if(workStaffBasicInfo==null|| StringUtils.isBlank(workStaffBasicInfo.getId())){
+            return;
+        }
+        WorkStaffLanguages entity = new WorkStaffLanguages();
+        entity.setStaffId(workStaffBasicInfo.getId());
+        List<WorkStaffLanguages> list=this.findList(entity);
+        List<WorkStaffLanguages> newList=Lists.newArrayList();
+        if(list!=null&&list.size()>0){//修改
+            for(WorkStaffLanguages workStaffLanguages:list){
+                Class<? extends WorkStaffLanguages> newClass = workStaffLanguages.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("language".equals(name)||"proficiency".equals(name)||"certificate".equals(name)||"certifDate".equals(name)||"filePath".equals(name)
+                            || "fileName".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                        workStaffAchivesLog.setModule("外语语种");
+                        workStaffAchivesLog.setSonId(workStaffLanguages.getId());
+                        workStaffAchivesLog.setFields(name);
+                        workStaffAchivesLog.setType("修改");
+                        workStaffAchivesLog.setState("3");
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            Object newInvoke = newClass.getMethod(getMethod).invoke(workStaffLanguages);//修改后
+                            if(newInvoke instanceof String){
+                                Method setReadOnly = workStaffLanguages.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffLanguages,logs.get(0).getNewKey());
+                                }
+                            }
+                            if(newInvoke instanceof Date){//日期
+                                Method setReadOnly = workStaffLanguages.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffLanguages,myDate);
+                                }
+                            }
+                            if(null == newInvoke){
+                                try {
+                                    Method setReadOnly = workStaffLanguages.getClass().getMethod(setMethod, String.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        setReadOnly.invoke(workStaffLanguages,logs.get(0).getNewKey());
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    Method setReadOnly = workStaffLanguages.getClass().getMethod(setMethod, Date.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                        setReadOnly.invoke(workStaffLanguages,myDate);
+                                    }
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                if(StringUtils.isNotBlank(workStaffLanguages.getFilePath())){
+                    workStaffLanguages.setFilePathStr( WorkattachmentService.fileUrlManage(workStaffLanguages.getFilePath()));
+                    workStaffLanguages.setFilePathThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffLanguages.getFilePath()));
+                }
+                newList.add(workStaffLanguages);
+                for (WorkStaffLanguages staffCertificate : newList) {
+                    if(StringUtils.isNotEmpty(staffCertificate.getFilePath())) {
+                        staffCertificate.setFilePathStr(WorkattachmentService.fileUrlManage(staffCertificate.getFilePath()));
+                        staffCertificate.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(staffCertificate.getFilePath()));
+                    }
+                }
+            }
+        }
+        //新增
+        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+        workStaffAchivesLog.setModule("外语语种");
+        workStaffAchivesLog.setType("新增");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> sonIds=workStaffAchivesLogService.findSonId(workStaffAchivesLog);
+        if(sonIds!=null&&sonIds.size()>0){
+            for(WorkStaffAchivesLog w:sonIds){
+                workStaffAchivesLog.setSonId(w.getSonId());
+                WorkStaffLanguages workStaffLanguages = new WorkStaffLanguages();
+                workStaffLanguages.setId(w.getSonId());
+                workStaffLanguages.setDelFlag("0");
+                workStaffLanguages.setStaffId(workStaffBasicInfo.getId());
+                Class<? extends WorkStaffLanguages> newClass = workStaffLanguages.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("language".equals(name)||"proficiency".equals(name)||"certificate".equals(name)||"certifDate".equals(name)||"filePath".equals(name)
+                            || "fileName".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        workStaffAchivesLog.setFields(name);
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            if("certifDate".equals(name)){//日期
+                                Method setReadOnly = workStaffLanguages.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffLanguages,myDate);
+                                }
+                            }else{
+                                Method setReadOnly = workStaffLanguages.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffLanguages,logs.get(0).getNewKey());
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                if(StringUtils.isNotBlank(workStaffLanguages.getFilePath())){
+                    workStaffLanguages.setFilePathStr( WorkattachmentService.fileUrlManage(workStaffLanguages.getFilePath()));
+                    workStaffLanguages.setFilePathThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffLanguages.getFilePath()));
+                }
+                newList.add(workStaffLanguages);
+            }
+        }
+        //删除
+        WorkStaffAchivesLog delLog=new WorkStaffAchivesLog();
+        delLog.setStaffId(workStaffBasicInfo.getId());
+        delLog.setModule("外语语种");
+        delLog.setType("删除");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> dellogs=workStaffAchivesLogService.findList(delLog);
+        if (dellogs != null && !dellogs.isEmpty()) {
+            List<String> sonIdLists = Lists.newArrayList();
+            for (WorkStaffAchivesLog log : dellogs) {
+                sonIdLists.add(log.getSonId());
+            }
+
+            Iterator<WorkStaffLanguages> iterator = newList.iterator();
+            while (iterator.hasNext()) {
+                WorkStaffLanguages staff = iterator.next();
+                if (sonIdLists.contains(staff.getId())) {
+                    iterator.remove();
+                }
+            }
+        }
+        workStaffBasicInfo.setLanguageList(newList);
+    }
     @Transactional(readOnly = false)
     public void saveEdu(WorkStaffBasicInfo workStaffBasicInfo) {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -428,6 +588,65 @@ public class WorkStaffLanguagesService extends CrudService<WorkStaffLanguagesDao
                             }
                         }
 
+                    }else{
+                        ////判定审核状态。审核状态为1(暂存),则对暂存的数据进行删除
+                        if("1".equals(workStaffBasicInfo.getAuditStatus())){
+                            if(newLanguages.getFile()!=null&&!newLanguages.getFile().isEmpty()&&newLanguages.getFile().getSize()>0){
+                                MultipartFile file = newLanguages.getFile();
+                                newLanguages.setFilePath(this.uploadFile(file,newLanguages.getFilePath()));
+                            }
+                            String newId=IdGen.uuid();
+                            for (Field field : declaredFields) {
+                                String name = field.getName();
+                                if("language".equals(name)||"proficiency".equals(name)||"certificate".equals(name)||"certifDate".equals(name)||"filePath".equals(name)
+                                        || "fileName".equals(name)){
+                                    String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                    workStaffAchivesLog.setModule("外语语种");
+                                    workStaffAchivesLog.setSonId(newId);
+                                    workStaffAchivesLog.setFields(name);
+                                    workStaffAchivesLog.setState("1");
+                                    try {
+                                        Object newInvoke = newClass.getMethod(methodName).invoke(newLanguages);//修改后
+                                        String describes=EDU_MAP.get(name);
+                                        if(newInvoke instanceof String){
+                                            String newValue=newInvoke.toString();
+                                            if("language".equals(name)){
+                                                workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "外语语种",describes,name,
+                                                        "",
+                                                        DictUtils.getMainDictLabel(newValue,"language",""),
+                                                        "",newValue,newId,"新增");
+                                            }else if("proficiency".equals(name)){
+                                                workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "外语语种",describes,name,
+                                                        "",
+                                                        DictUtils.getDictLabel(newValue,"proficiency",""),
+                                                        "",newValue,newId,"新增");
+                                            }else{
+                                                workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "外语语种",describes,name,
+                                                        "",newInvoke.toString(),
+                                                        "",newInvoke.toString(),newId,"新增");
+                                            }
+                                        }
+                                        if(newInvoke instanceof Date){//日期
+                                            String newDate=sdf.format(newInvoke);
+                                            workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "外语语种",describes,name,
+                                                    "",newDate,"",newDate,newId,"新增");
+                                        };
+                                    } catch (NoSuchMethodException e) {
+                                        e.printStackTrace();
+                                    } catch (IllegalAccessException e) {
+                                        e.printStackTrace();
+                                    } catch (InvocationTargetException e) {
+                                        e.printStackTrace();
+                                    }
+                                }
+                            }
+                        }
                     }
                 }else if((newLanguages.getId()==null||"".equals(newLanguages.getId()))&&"0".equals(newLanguages.getDelFlag())){//新增
                     if(newLanguages.getFile()!=null&&!newLanguages.getFile().isEmpty()&&newLanguages.getFile().getSize()>0){
@@ -500,4 +719,156 @@ public class WorkStaffLanguagesService extends CrudService<WorkStaffLanguagesDao
             }
         }
     }
+    @Transactional(readOnly = false)
+    public void storeEdu(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        List<WorkStaffLanguages> languagesList =workStaffBasicInfo.getLanguageList();
+        if(languagesList!=null&&languagesList.size()>0){
+            for(WorkStaffLanguages newLanguages:languagesList){
+                Class<? extends WorkStaffLanguages> newClass = newLanguages.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                if(newLanguages.getId()!=null&&!"1".equals(newLanguages.getDelFlag())&&!"".equals(newLanguages.getId())){
+                    if(newLanguages.getFile()!=null&&!newLanguages.getFile().isEmpty()&&newLanguages.getFile().getSize()>0){
+                        MultipartFile file = newLanguages.getFile();
+                        newLanguages.setFilePath(this.uploadFile(file,newLanguages.getFilePath()));
+                    }
+                    WorkStaffLanguages oldLanguages=this.get(newLanguages.getId());
+                    if(oldLanguages!=null){
+                        Class<? extends WorkStaffLanguages> oldClass = oldLanguages.getClass();
+                        for (Field field : declaredFields) {
+                            String name = field.getName();
+                            if("language".equals(name)||"proficiency".equals(name)||"certificate".equals(name)||"certifDate".equals(name)||"filePath".equals(name)
+                                    || "fileName".equals(name)){
+                                String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                workStaffAchivesLog.setModule("外语语种");
+                                workStaffAchivesLog.setSonId(newLanguages.getId());
+                                workStaffAchivesLog.setFields(name);
+                                workStaffAchivesLog.setState("3");
+                                try {
+                                    Object newInvoke = newClass.getMethod(methodName).invoke(newLanguages);//修改后
+                                    Object oldInvoke = oldClass.getMethod(methodName).invoke(oldLanguages);//修改前
+                                    String describes=EDU_MAP.get(name);
+                                    if(newInvoke instanceof String){
+                                        String newValue=newInvoke.toString();
+                                        String oldValue=oldInvoke.toString();
+                                        if(!newValue.equals(oldValue)){
+                                            if("language".equals(name)){
+                                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "外语语种",describes,name,
+                                                        DictUtils.getMainDictLabel(oldValue,"language",""),
+                                                        DictUtils.getMainDictLabel(newValue,"language",""),
+                                                        oldValue,newValue,newLanguages.getId(),"修改");
+                                            }else if("proficiency".equals(name)){
+                                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "外语语种",describes,name,
+                                                        DictUtils.getDictLabel(oldValue,"proficiency",""),
+                                                        DictUtils.getDictLabel(newValue,"proficiency",""),
+                                                        oldValue,newValue,newLanguages.getId(),"修改");
+                                            }else{
+                                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "外语语种",describes,name,
+                                                        oldInvoke.toString(),newInvoke.toString(),
+                                                        oldInvoke.toString(),newInvoke.toString(),newLanguages.getId(),"修改");
+                                            }
+                                        }
+                                    }
+                                    if(newInvoke instanceof Date){//日期
+                                        String newDate="";
+                                        String oldDate="";
+                                        if(newInvoke!=null){
+                                            newDate=sdf.format(newInvoke);
+                                        }
+                                        if (oldInvoke!=null){
+                                            oldDate=sdf.format(oldInvoke);
+                                        }
+                                        if(!newDate.equals(oldDate)){
+                                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "外语语种",describes,name,
+                                                    oldDate,newDate,oldDate,newDate,newLanguages.getId(),"修改");
+                                        }
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    e.printStackTrace();
+                                } catch (IllegalAccessException e) {
+                                    e.printStackTrace();
+                                } catch (InvocationTargetException e) {
+                                    e.printStackTrace();
+                                }
+                            }
+                        }
+
+                    }
+                }else if((newLanguages.getId()==null||"".equals(newLanguages.getId()))&&"0".equals(newLanguages.getDelFlag())){//新增
+                    if(newLanguages.getFile()!=null&&!newLanguages.getFile().isEmpty()&&newLanguages.getFile().getSize()>0){
+                        MultipartFile file = newLanguages.getFile();
+                        newLanguages.setFilePath(this.uploadFile(file,newLanguages.getFilePath()));
+                    }
+                    String newId=IdGen.uuid();
+                    for (Field field : declaredFields) {
+                        String name = field.getName();
+                        if("language".equals(name)||"proficiency".equals(name)||"certificate".equals(name)||"certifDate".equals(name)||"filePath".equals(name)
+                                || "fileName".equals(name)){
+                            String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                            WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                            workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                            workStaffAchivesLog.setModule("外语语种");
+                            workStaffAchivesLog.setSonId(newId);
+                            workStaffAchivesLog.setFields(name);
+                            workStaffAchivesLog.setState("3");
+                            try {
+                                Object newInvoke = newClass.getMethod(methodName).invoke(newLanguages);//修改后
+                                String describes=EDU_MAP.get(name);
+                                if(newInvoke instanceof String){
+                                    String newValue=newInvoke.toString();
+                                    if("language".equals(name)){
+                                        workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                "外语语种",describes,name,
+                                                "",
+                                                DictUtils.getMainDictLabel(newValue,"language",""),
+                                                "",newValue,newId,"新增");
+                                    }else if("proficiency".equals(name)){
+                                        workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                "外语语种",describes,name,
+                                                "",
+                                                DictUtils.getDictLabel(newValue,"proficiency",""),
+                                                "",newValue,newId,"新增");
+                                    }else{
+                                        workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                "外语语种",describes,name,
+                                                "",newInvoke.toString(),
+                                                "",newInvoke.toString(),newId,"新增");
+                                    }
+                                }
+                                if(newInvoke instanceof Date){//日期
+                                    String newDate=sdf.format(newInvoke);
+                                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                            "外语语种",describes,name,
+                                            "",newDate,"",newDate,newId,"新增");
+                                };
+                            } catch (NoSuchMethodException e) {
+                                e.printStackTrace();
+                            } catch (IllegalAccessException e) {
+                                e.printStackTrace();
+                            } catch (InvocationTargetException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    }
+                }else if(newLanguages.getId()!=null&&"1".equals(newLanguages.getDelFlag())&&!"".equals(newLanguages.getId())){//删除
+                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                    workStaffAchivesLog.setModule("外语语种");
+                    workStaffAchivesLog.setSonId(newLanguages.getId());
+                    workStaffAchivesLog.setType("删除");
+                    workStaffAchivesLog.setState("3");
+                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                            "外语语种","","",
+                            "","",
+                            "","",newLanguages.getId(),"删除");
+                }
+            }
+        }
+    }
 }

+ 342 - 0
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffRecordService.java

@@ -9,6 +9,7 @@ import java.lang.reflect.Method;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -59,6 +60,7 @@ public class WorkStaffRecordService extends CrudService<WorkStaffRecordDao, Work
         for (WorkStaffRecord staffRecord : list) {
             if(StringUtils.isNotEmpty(staffRecord.getFilePath())) {
                 staffRecord.setFilePathStr(WorkattachmentService.fileUrlManage(staffRecord.getFilePath()));
+                staffRecord.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(staffRecord.getFilePath()));
             }
         }
         return super.findList(workStaffRecord);
@@ -269,11 +271,13 @@ public class WorkStaffRecordService extends CrudService<WorkStaffRecordDao, Work
                 }
                 if(StringUtils.isNotBlank(workStaffRecord.getFilePath())){
                     workStaffRecord.setFilePathStr( WorkattachmentService.fileUrlManage(workStaffRecord.getFilePath()));
+                    workStaffRecord.setFilePathThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffRecord.getFilePath()));
                 }
                 newList.add(workStaffRecord);
                 for (WorkStaffRecord staffCertificate : newList) {
                     if(StringUtils.isNotEmpty(staffCertificate.getFilePath())) {
                         staffCertificate.setFilePathStr(WorkattachmentService.fileUrlManage(staffCertificate.getFilePath()));
+                        staffCertificate.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(staffCertificate.getFilePath()));
                     }
                 }
             }
@@ -317,6 +321,7 @@ public class WorkStaffRecordService extends CrudService<WorkStaffRecordDao, Work
                 }
                 if(StringUtils.isNotBlank(workStaffRecord.getFilePath())){
                     workStaffRecord.setFilePathStr( WorkattachmentService.fileUrlManage(workStaffRecord.getFilePath()));
+                    workStaffRecord.setFilePathThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffRecord.getFilePath()));
                 }
                 newList.add(workStaffRecord);
             }
@@ -335,6 +340,153 @@ public class WorkStaffRecordService extends CrudService<WorkStaffRecordDao, Work
         }
         workStaffBasicInfo.setRecordList(newList);
     }
+    public void storeQuerys(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
+        if(workStaffBasicInfo==null|| StringUtils.isBlank(workStaffBasicInfo.getId())){
+            return;
+        }
+        WorkStaffRecord entity = new WorkStaffRecord();
+        entity.setStaff(workStaffBasicInfo.getId());
+        List<WorkStaffRecord> list=this.findList(entity);
+        List<WorkStaffRecord> newList=Lists.newArrayList();
+        if(list!=null&&list.size()>0){//修改
+            for(WorkStaffRecord workStaffRecord:list){
+                Class<? extends WorkStaffRecord> newClass = workStaffRecord.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("name".equals(name)||"num".equals(name)||"filePath".equals(name)||"status".equals(name)||"fileName".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                        workStaffAchivesLog.setModule("电子档案");
+                        workStaffAchivesLog.setSonId(workStaffRecord.getId());
+                        workStaffAchivesLog.setFields(name);
+                        workStaffAchivesLog.setType("修改");
+                        workStaffAchivesLog.setState("3");
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            Object newInvoke = newClass.getMethod(getMethod).invoke(workStaffRecord);//修改后
+                            if(newInvoke instanceof String){
+                                Method setReadOnly = workStaffRecord.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffRecord,logs.get(0).getNewKey());
+                                }
+                            }
+                            if(newInvoke instanceof Date){//日期
+                                Method setReadOnly = workStaffRecord.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffRecord,myDate);
+                                }
+                            }
+                            if(null == newInvoke){
+                                try {
+                                    Method setReadOnly = workStaffRecord.getClass().getMethod(setMethod, String.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        setReadOnly.invoke(workStaffRecord,logs.get(0).getNewKey());
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    Method setReadOnly = workStaffRecord.getClass().getMethod(setMethod, Date.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                        setReadOnly.invoke(workStaffRecord,myDate);
+                                    }
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                if(StringUtils.isNotBlank(workStaffRecord.getFilePath())){
+                    workStaffRecord.setFilePathStr( WorkattachmentService.fileUrlManage(workStaffRecord.getFilePath()));
+                    workStaffRecord.setFilePathThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffRecord.getFilePath()));
+                }
+                newList.add(workStaffRecord);
+                for (WorkStaffRecord staffCertificate : newList) {
+                    if(StringUtils.isNotEmpty(staffCertificate.getFilePath())) {
+                        staffCertificate.setFilePathStr(WorkattachmentService.fileUrlManage(staffCertificate.getFilePath()));
+                        staffCertificate.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(staffCertificate.getFilePath()));
+                    }
+                }
+            }
+        }
+        //新增
+        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+        workStaffAchivesLog.setModule("电子档案");
+        workStaffAchivesLog.setType("新增");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> sonIds=workStaffAchivesLogService.findSonId(workStaffAchivesLog);
+        if(sonIds!=null&&sonIds.size()>0){
+            for(WorkStaffAchivesLog w:sonIds){
+                workStaffAchivesLog.setSonId(w.getSonId());
+                WorkStaffRecord workStaffRecord = new WorkStaffRecord();
+                workStaffRecord.setId(w.getSonId());
+                workStaffRecord.setDelFlag("0");
+                workStaffRecord.setStaff(workStaffBasicInfo.getId());
+                Class<? extends WorkStaffRecord> newClass = workStaffRecord.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("name".equals(name)||"num".equals(name)||"filePath".equals(name)||"status".equals(name)||"fileName".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        workStaffAchivesLog.setFields(name);
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            Method setReadOnly = workStaffRecord.getClass().getMethod(setMethod, String.class);
+                            if(logs!=null&&logs.size()>0){
+                                setReadOnly.invoke(workStaffRecord,logs.get(0).getNewKey());
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                if(StringUtils.isNotBlank(workStaffRecord.getFilePath())){
+                    workStaffRecord.setFilePathStr( WorkattachmentService.fileUrlManage(workStaffRecord.getFilePath()));
+                    workStaffRecord.setFilePathThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffRecord.getFilePath()));
+                }
+                newList.add(workStaffRecord);
+            }
+        }
+        //删除
+        WorkStaffAchivesLog delLog=new WorkStaffAchivesLog();
+        delLog.setStaffId(workStaffBasicInfo.getId());
+        delLog.setModule("电子档案");
+        delLog.setType("删除");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> dellogs=workStaffAchivesLogService.findList(delLog);
+        if (dellogs != null && !dellogs.isEmpty()) {
+            List<String> sonIdLists = Lists.newArrayList();
+            for (WorkStaffAchivesLog log : dellogs) {
+                sonIdLists.add(log.getSonId());
+            }
+
+            Iterator<WorkStaffRecord> iterator = newList.iterator();
+            while (iterator.hasNext()) {
+                WorkStaffRecord staff = iterator.next();
+                if (sonIdLists.contains(staff.getId())) {
+                    iterator.remove();
+                }
+            }
+        }
+        workStaffBasicInfo.setRecordList(newList);
+    }
+
     @Transactional(readOnly = false)
     public void saveEdu(WorkStaffBasicInfo workStaffBasicInfo) {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -408,6 +560,57 @@ public class WorkStaffRecordService extends CrudService<WorkStaffRecordDao, Work
                             }
                         }
 
+                    }else{
+                        if("1".equals(workStaffBasicInfo.getAuditStatus())){
+                            if(newRecord.getFile()!=null&&!newRecord.getFile().isEmpty()&&newRecord.getFile().getSize()>0){
+                                MultipartFile file = newRecord.getFile();
+                                newRecord.setFilePath(this.uploadFile(file,newRecord.getFilePath()));
+                            }
+                            String newId=IdGen.uuid();
+                            for (Field field : declaredFields) {
+                                String name = field.getName();
+                                if("name".equals(name)||"num".equals(name)||"filePath".equals(name)||"status".equals(name)||"fileName".equals(name)){
+                                    String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                    workStaffAchivesLog.setModule("电子档案");
+                                    workStaffAchivesLog.setSonId(newId);
+                                    workStaffAchivesLog.setFields(name);
+                                    workStaffAchivesLog.setState("1");
+                                    try {
+                                        Object newInvoke = newClass.getMethod(methodName).invoke(newRecord);//修改后
+                                        String describes=EDU_MAP.get(name);
+                                        if(newInvoke instanceof String){
+                                            String newValue=newInvoke.toString();
+                                            if("name".equals(name)){
+                                                workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "电子档案",describes,name,
+                                                        "",
+                                                        newValue,
+                                                        "",newValue,newId,"新增");
+                                            }else{
+                                                workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "电子档案",describes,name,
+                                                        "",newInvoke.toString(),
+                                                        "",newInvoke.toString(),newId,"新增");
+                                            }
+                                        }
+                                        if(newInvoke instanceof Date){//日期
+                                            String newDate=sdf.format(newInvoke);
+                                            workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "电子档案",describes,name,
+                                                    "",newDate,"",newDate,newId,"新增");
+                                        };
+                                    } catch (NoSuchMethodException e) {
+                                        e.printStackTrace();
+                                    } catch (IllegalAccessException e) {
+                                        e.printStackTrace();
+                                    } catch (InvocationTargetException e) {
+                                        e.printStackTrace();
+                                    }
+                                }
+                            }
+                        }
                     }
                 }else if((newRecord.getId()==null||"".equals(newRecord.getId()))&&"0".equals(newRecord.getDelFlag())){//新增
                     if(newRecord.getFile()!=null&&!newRecord.getFile().isEmpty()&&newRecord.getFile().getSize()>0){
@@ -473,4 +676,143 @@ public class WorkStaffRecordService extends CrudService<WorkStaffRecordDao, Work
             }
         }
     }
+
+    @Transactional(readOnly = false)
+    public void storeEdu(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        List<WorkStaffRecord> recordList =workStaffBasicInfo.getRecordList();
+        if(recordList!=null&&recordList.size()>0){
+            for(WorkStaffRecord newRecord:recordList){
+                Class<? extends WorkStaffRecord> newClass = newRecord.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                if(newRecord.getId()!=null&&!"1".equals(newRecord.getDelFlag())&&!"".equals(newRecord.getId())){
+                    if(newRecord.getFile()!=null&&!newRecord.getFile().isEmpty()&&newRecord.getFile().getSize()>0){
+                        MultipartFile file = newRecord.getFile();
+                        newRecord.setFilePath(this.uploadFile(file,newRecord.getFilePath()));
+                    }
+                    WorkStaffRecord oldRecord=this.get(newRecord.getId());
+                    if(oldRecord!=null){
+                        Class<? extends WorkStaffRecord> oldClass = oldRecord.getClass();
+                        for (Field field : declaredFields) {
+                            String name = field.getName();
+                            if("name".equals(name)||"num".equals(name)||"filePath".equals(name)||"status".equals(name)||"fileName".equals(name)){
+                                String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                workStaffAchivesLog.setModule("电子档案");
+                                workStaffAchivesLog.setSonId(newRecord.getId());
+                                workStaffAchivesLog.setFields(name);
+                                workStaffAchivesLog.setState("3");
+                                try {
+                                    Object newInvoke = newClass.getMethod(methodName).invoke(newRecord);//修改后
+                                    Object oldInvoke = oldClass.getMethod(methodName).invoke(oldRecord);//修改前
+                                    String describes=EDU_MAP.get(name);
+                                    if(newInvoke instanceof String){
+                                        String newValue=newInvoke.toString();
+                                        String oldValue=oldInvoke.toString();
+                                        if(!newValue.equals(oldValue)){
+                                            if("name".equals(name)){
+                                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "电子档案",describes,name,
+                                                        oldValue,
+                                                        newValue,
+                                                        oldValue,newValue,newRecord.getId(),"修改");
+                                            }else{
+                                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "电子档案",describes,name,
+                                                        oldInvoke.toString(),newInvoke.toString(),
+                                                        oldInvoke.toString(),newInvoke.toString(),newRecord.getId(),"修改");
+                                            }
+                                        }
+                                    }
+                                    if(newInvoke instanceof Date){//日期
+                                        String newDate="";
+                                        String oldDate="";
+                                        if(newInvoke!=null){
+                                            newDate=sdf.format(newInvoke);
+                                        }
+                                        if (oldInvoke!=null){
+                                            oldDate=sdf.format(oldInvoke);
+                                        }
+                                        if(!newDate.equals(oldDate)){
+                                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "电子档案",describes,name,
+                                                    oldDate,newDate,oldDate,newDate,newRecord.getId(),"修改");
+                                        }
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    e.printStackTrace();
+                                } catch (IllegalAccessException e) {
+                                    e.printStackTrace();
+                                } catch (InvocationTargetException e) {
+                                    e.printStackTrace();
+                                }
+                            }
+                        }
+
+                    }
+                }else if((newRecord.getId()==null||"".equals(newRecord.getId()))&&"0".equals(newRecord.getDelFlag())){//新增
+                    if(newRecord.getFile()!=null&&!newRecord.getFile().isEmpty()&&newRecord.getFile().getSize()>0){
+                        MultipartFile file = newRecord.getFile();
+                        newRecord.setFilePath(this.uploadFile(file,newRecord.getFilePath()));
+                    }
+                    String newId=IdGen.uuid();
+                    for (Field field : declaredFields) {
+                        String name = field.getName();
+                        if("name".equals(name)||"num".equals(name)||"filePath".equals(name)||"status".equals(name)||"fileName".equals(name)){
+                            String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                            WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                            workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                            workStaffAchivesLog.setModule("电子档案");
+                            workStaffAchivesLog.setSonId(newId);
+                            workStaffAchivesLog.setFields(name);
+                            workStaffAchivesLog.setState("3");
+                            try {
+                                Object newInvoke = newClass.getMethod(methodName).invoke(newRecord);//修改后
+                                String describes=EDU_MAP.get(name);
+                                if(newInvoke instanceof String){
+                                    String newValue=newInvoke.toString();
+                                    if("name".equals(name)){
+                                        workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                "电子档案",describes,name,
+                                                "",
+                                                newValue,
+                                                "",newValue,newId,"新增");
+                                    }else{
+                                        workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                "电子档案",describes,name,
+                                                "",newInvoke.toString(),
+                                                "",newInvoke.toString(),newId,"新增");
+                                    }
+                                }
+                                if(newInvoke instanceof Date){//日期
+                                    String newDate=sdf.format(newInvoke);
+                                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                            "电子档案",describes,name,
+                                            "",newDate,"",newDate,newId,"新增");
+                                };
+                            } catch (NoSuchMethodException e) {
+                                e.printStackTrace();
+                            } catch (IllegalAccessException e) {
+                                e.printStackTrace();
+                            } catch (InvocationTargetException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    }
+                }else if(newRecord.getId()!=null&&"1".equals(newRecord.getDelFlag())&&!"".equals(newRecord.getId())){//删除
+                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                    workStaffAchivesLog.setModule("电子档案");
+                    workStaffAchivesLog.setSonId(newRecord.getId());
+                    workStaffAchivesLog.setType("删除");
+                    workStaffAchivesLog.setState("3");
+                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                            "电子档案","","",
+                            "","",
+                            "","",newRecord.getId(),"删除");
+                }
+            }
+        }
+    }
 }

+ 297 - 0
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffRewardsService.java

@@ -9,6 +9,7 @@ import java.lang.reflect.Method;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -21,6 +22,7 @@ import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
 import com.jeeplus.modules.workstaff.entity.WorkStaffLanguages;
+import com.jeeplus.modules.workstaff.entity.WorkStaffRecord;
 import com.jeeplus.modules.workstaffachiveslog.entity.WorkStaffAchivesLog;
 import com.jeeplus.modules.workstaffachiveslog.service.WorkStaffAchivesLogService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -273,6 +275,142 @@ public class WorkStaffRewardsService extends CrudService<WorkStaffRewardsDao, Wo
         }
         workStaffBasicInfo.setRewardsList(newList);
     }
+    public void storeQuerys(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
+        if(workStaffBasicInfo==null|| StringUtils.isBlank(workStaffBasicInfo.getId())){
+            return;
+        }
+        WorkStaffRewards entity = new WorkStaffRewards();
+        entity.setStaff(workStaffBasicInfo.getId());
+        List<WorkStaffRewards> list=this.findList(entity);
+        List<WorkStaffRewards> newList=Lists.newArrayList();
+        if(list!=null&&list.size()>0){//修改
+            for(WorkStaffRewards workStaffRewards:list){
+                Class<? extends WorkStaffRewards> newClass = workStaffRewards.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("type".equals(name)||"name".equals(name)||"atTime".equals(name)||"grade".equals(name)||"reason".equals(name)
+                            || "organization".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                        workStaffAchivesLog.setModule("表彰与奖励");
+                        workStaffAchivesLog.setSonId(workStaffRewards.getId());
+                        workStaffAchivesLog.setFields(name);
+                        workStaffAchivesLog.setType("修改");
+                        workStaffAchivesLog.setState("3");
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            Object newInvoke = newClass.getMethod(getMethod).invoke(workStaffRewards);//修改后
+                            if(newInvoke instanceof String){
+                                Method setReadOnly = workStaffRewards.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffRewards,logs.get(0).getNewKey());
+                                }
+                            }
+                            if(newInvoke instanceof Date){//日期
+                                Method setReadOnly = workStaffRewards.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffRewards,myDate);
+                                }
+                            }
+                            if(null == newInvoke){
+                                try {
+                                    Method setReadOnly = workStaffRewards.getClass().getMethod(setMethod, String.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        setReadOnly.invoke(workStaffRewards,logs.get(0).getNewKey());
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    Method setReadOnly = workStaffRewards.getClass().getMethod(setMethod, Date.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                        setReadOnly.invoke(workStaffRewards,myDate);
+                                    }
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                newList.add(workStaffRewards);
+            }
+        }
+        //新增
+        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+        workStaffAchivesLog.setModule("表彰与奖励");
+        workStaffAchivesLog.setType("新增");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> sonIds=workStaffAchivesLogService.findSonId(workStaffAchivesLog);
+        if(sonIds!=null&&sonIds.size()>0){
+            for(WorkStaffAchivesLog w:sonIds){
+                workStaffAchivesLog.setSonId(w.getSonId());
+                WorkStaffRewards workStaffRewards = new WorkStaffRewards();
+                workStaffRewards.setId(w.getSonId());
+                workStaffRewards.setDelFlag("0");
+                workStaffRewards.setStaff(workStaffBasicInfo.getId());
+                Class<? extends WorkStaffRewards> newClass = workStaffRewards.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("type".equals(name)||"name".equals(name)||"atTime".equals(name)||"grade".equals(name)||"reason".equals(name)
+                            || "organization".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        workStaffAchivesLog.setFields(name);
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            Method setReadOnly = workStaffRewards.getClass().getMethod(setMethod, String.class);
+                            if(logs!=null&&logs.size()>0){
+                                setReadOnly.invoke(workStaffRewards,logs.get(0).getNewKey());
+                            }
+
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                newList.add(workStaffRewards);
+            }
+        }
+        //删除
+        WorkStaffAchivesLog delLog=new WorkStaffAchivesLog();
+        delLog.setStaffId(workStaffBasicInfo.getId());
+        delLog.setModule("表彰与奖励");
+        delLog.setType("删除");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> dellogs=workStaffAchivesLogService.findList(delLog);
+        if (dellogs != null && !dellogs.isEmpty()) {
+            List<String> sonIdLists = Lists.newArrayList();
+            for (WorkStaffAchivesLog log : dellogs) {
+                sonIdLists.add(log.getSonId());
+            }
+
+            Iterator<WorkStaffRewards> iterator = newList.iterator();
+            while (iterator.hasNext()) {
+                WorkStaffRewards staff = iterator.next();
+                if (sonIdLists.contains(staff.getId())) {
+                    iterator.remove();
+                }
+            }
+        }
+        workStaffBasicInfo.setRewardsList(newList);
+    }
+
     @Transactional(readOnly = false)
     public void saveEdu(WorkStaffBasicInfo workStaffBasicInfo) {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -336,6 +474,47 @@ public class WorkStaffRewardsService extends CrudService<WorkStaffRewardsDao, Wo
                             }
                         }
 
+                    }else{
+                        if("1".equals(workStaffBasicInfo.getAuditStatus())){
+                            String newId=IdGen.uuid();
+                            for (Field field : declaredFields) {
+                                String name = field.getName();
+                                if("type".equals(name)||"name".equals(name)||"atTime".equals(name)||"grade".equals(name)||"reason".equals(name)
+                                        || "organization".equals(name)){
+                                    String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                    workStaffAchivesLog.setModule("表彰与奖励");
+                                    workStaffAchivesLog.setSonId(newId);
+                                    workStaffAchivesLog.setFields(name);
+                                    workStaffAchivesLog.setState("1");
+                                    try {
+                                        Object newInvoke = newClass.getMethod(methodName).invoke(newRewards);//修改后
+                                        String describes=EDU_MAP.get(name);
+                                        if(newInvoke instanceof String){
+                                            String newValue=newInvoke.toString();
+                                            workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "表彰与奖励",describes,name,
+                                                    "",newInvoke.toString(),
+                                                    "",newInvoke.toString(),newId,"新增");
+
+                                        }
+                                        if(newInvoke instanceof Date){//日期
+                                            String newDate=sdf.format(newInvoke);
+                                            workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "表彰与奖励",describes,name,
+                                                    "",newDate,"",newDate,newId,"新增");
+                                        };
+                                    } catch (NoSuchMethodException e) {
+                                        e.printStackTrace();
+                                    } catch (IllegalAccessException e) {
+                                        e.printStackTrace();
+                                    } catch (InvocationTargetException e) {
+                                        e.printStackTrace();
+                                    }
+                                }
+                            }
+                        }
                     }
                 }else if((newRewards.getId()==null||"".equals(newRewards.getId()))&&"0".equals(newRewards.getDelFlag())){//新增
                     String newId=IdGen.uuid();
@@ -391,4 +570,122 @@ public class WorkStaffRewardsService extends CrudService<WorkStaffRewardsDao, Wo
             }
         }
     }
+    @Transactional(readOnly = false)
+    public void storeEdu(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        List<WorkStaffRewards> rewardsList =workStaffBasicInfo.getRewardsList();
+        if(rewardsList!=null&&rewardsList.size()>0){
+            for(WorkStaffRewards newRewards:rewardsList){
+                Class<? extends WorkStaffRewards> newClass = newRewards.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                if(newRewards.getId()!=null&&!"1".equals(newRewards.getDelFlag())&&!"".equals(newRewards.getId())){
+                    WorkStaffRewards oldRewards=this.get(newRewards.getId());
+                    if(oldRewards!=null){
+                        Class<? extends WorkStaffRewards> oldClass = oldRewards.getClass();
+                        for (Field field : declaredFields) {
+                            String name = field.getName();
+                            if("type".equals(name)||"name".equals(name)||"atTime".equals(name)||"grade".equals(name)||"reason".equals(name)
+                                    || "organization".equals(name)){
+                                String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                workStaffAchivesLog.setModule("表彰与奖励");
+                                workStaffAchivesLog.setSonId(newRewards.getId());
+                                workStaffAchivesLog.setFields(name);
+                                workStaffAchivesLog.setState("3");
+                                try {
+                                    Object newInvoke = newClass.getMethod(methodName).invoke(newRewards);//修改后
+                                    Object oldInvoke = oldClass.getMethod(methodName).invoke(oldRewards);//修改前
+                                    String describes=EDU_MAP.get(name);
+                                    if(newInvoke instanceof String){
+                                        String newValue=newInvoke.toString();
+                                        String oldValue=oldInvoke.toString();
+                                        if(!newValue.equals(oldValue)){
+                                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "表彰与奖励",describes,name,
+                                                    oldInvoke.toString(),newInvoke.toString(),
+                                                    oldInvoke.toString(),newInvoke.toString(),newRewards.getId(),"修改");
+
+                                        }
+                                    }
+                                    if(newInvoke instanceof Date){//日期
+                                        String newDate="";
+                                        String oldDate="";
+                                        if(newInvoke!=null){
+                                            newDate=sdf.format(newInvoke);
+                                        }
+                                        if (oldInvoke!=null){
+                                            oldDate=sdf.format(oldInvoke);
+                                        }
+                                        if(!newDate.equals(oldDate)){
+                                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "表彰与奖励",describes,name,
+                                                    oldDate,newDate,oldDate,newDate,newRewards.getId(),"修改");
+                                        }
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    e.printStackTrace();
+                                } catch (IllegalAccessException e) {
+                                    e.printStackTrace();
+                                } catch (InvocationTargetException e) {
+                                    e.printStackTrace();
+                                }
+                            }
+                        }
+
+                    }
+                }else if((newRewards.getId()==null||"".equals(newRewards.getId()))&&"0".equals(newRewards.getDelFlag())){//新增
+                    String newId=IdGen.uuid();
+                    for (Field field : declaredFields) {
+                        String name = field.getName();
+                        if("type".equals(name)||"name".equals(name)||"atTime".equals(name)||"grade".equals(name)||"reason".equals(name)
+                                || "organization".equals(name)){
+                            String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                            WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                            workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                            workStaffAchivesLog.setModule("表彰与奖励");
+                            workStaffAchivesLog.setSonId(newId);
+                            workStaffAchivesLog.setFields(name);
+                            workStaffAchivesLog.setState("3");
+                            try {
+                                Object newInvoke = newClass.getMethod(methodName).invoke(newRewards);//修改后
+                                String describes=EDU_MAP.get(name);
+                                if(newInvoke instanceof String){
+                                    String newValue=newInvoke.toString();
+                                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                            "表彰与奖励",describes,name,
+                                            "",newInvoke.toString(),
+                                            "",newInvoke.toString(),newId,"新增");
+
+                                }
+                                if(newInvoke instanceof Date){//日期
+                                    String newDate=sdf.format(newInvoke);
+                                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                            "表彰与奖励",describes,name,
+                                            "",newDate,"",newDate,newId,"新增");
+                                };
+                            } catch (NoSuchMethodException e) {
+                                e.printStackTrace();
+                            } catch (IllegalAccessException e) {
+                                e.printStackTrace();
+                            } catch (InvocationTargetException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    }
+                }else if(newRewards.getId()!=null&&"1".equals(newRewards.getDelFlag())&&!"".equals(newRewards.getId())){//删除
+                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                    workStaffAchivesLog.setModule("表彰与奖励");
+                    workStaffAchivesLog.setSonId(newRewards.getId());
+                    workStaffAchivesLog.setType("删除");
+                    workStaffAchivesLog.setState("3");
+                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                            "表彰与奖励","","",
+                            "","",
+                            "","",newRewards.getId(),"删除");
+                }
+            }
+        }
+    }
 }

+ 297 - 0
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffSocialPositionService.java

@@ -9,6 +9,7 @@ import java.lang.reflect.Method;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -21,6 +22,7 @@ import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
 import com.jeeplus.modules.workstaff.entity.WorkStaffEducation;
+import com.jeeplus.modules.workstaff.entity.WorkStaffRewards;
 import com.jeeplus.modules.workstaffachiveslog.entity.WorkStaffAchivesLog;
 import com.jeeplus.modules.workstaffachiveslog.service.WorkStaffAchivesLogService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -277,6 +279,149 @@ public class WorkStaffSocialPositionService extends CrudService<WorkStaffSocialP
         }
         workStaffBasicInfo.setSocialPositionList(newList);
     }
+    public void storeQuerys(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
+        if(workStaffBasicInfo==null|| StringUtils.isBlank(workStaffBasicInfo.getId())){
+            return;
+        }
+        WorkStaffSocialPosition entity = new WorkStaffSocialPosition();
+        entity.setStaff(workStaffBasicInfo.getId());
+        List<WorkStaffSocialPosition> list=this.findList(entity);
+        List<WorkStaffSocialPosition> newList=Lists.newArrayList();
+        if(list!=null&&list.size()>0){//修改
+            for(WorkStaffSocialPosition workStaffSocialPosition:list){
+                Class<? extends WorkStaffSocialPosition> newClass = workStaffSocialPosition.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("name".equals(name)||"startDate".equals(name)||"endDate".equals(name)||"organization".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                        workStaffAchivesLog.setModule("社会及行业职务");
+                        workStaffAchivesLog.setSonId(workStaffSocialPosition.getId());
+                        workStaffAchivesLog.setFields(name);
+                        workStaffAchivesLog.setType("修改");
+                        workStaffAchivesLog.setState("3");
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            Object newInvoke = newClass.getMethod(getMethod).invoke(workStaffSocialPosition);//修改后
+                            if(newInvoke instanceof String){
+                                Method setReadOnly = workStaffSocialPosition.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffSocialPosition,logs.get(0).getNewKey());
+                                }
+                            }
+                            if(newInvoke instanceof Date){//日期
+                                Method setReadOnly = workStaffSocialPosition.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffSocialPosition,myDate);
+                                }
+                            }
+                            if(null == newInvoke){
+                                try {
+                                    Method setReadOnly = workStaffSocialPosition.getClass().getMethod(setMethod, String.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        setReadOnly.invoke(workStaffSocialPosition,logs.get(0).getNewKey());
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    Method setReadOnly = workStaffSocialPosition.getClass().getMethod(setMethod, Date.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                        setReadOnly.invoke(workStaffSocialPosition,myDate);
+                                    }
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                newList.add(workStaffSocialPosition);
+            }
+        }
+        //新增
+        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+        workStaffAchivesLog.setModule("社会及行业职务");
+        workStaffAchivesLog.setType("新增");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> sonIds=workStaffAchivesLogService.findSonId(workStaffAchivesLog);
+        if(sonIds!=null&&sonIds.size()>0){
+            for(WorkStaffAchivesLog w:sonIds){
+                workStaffAchivesLog.setSonId(w.getSonId());
+                WorkStaffSocialPosition workStaffSocialPosition = new WorkStaffSocialPosition();
+                workStaffSocialPosition.setId(w.getSonId());
+                workStaffSocialPosition.setDelFlag("0");
+                workStaffSocialPosition.setStaff(workStaffBasicInfo.getId());
+                Class<? extends WorkStaffSocialPosition> newClass = workStaffSocialPosition.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("name".equals(name)||"startDate".equals(name)||"endDate".equals(name)||"organization".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        workStaffAchivesLog.setFields(name);
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            if("startDate".equals(name)||"endDate".equals(name)){//日期
+                                Method setReadOnly = workStaffSocialPosition.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffSocialPosition,myDate);
+                                }
+                            }else{
+                                Method setReadOnly = workStaffSocialPosition.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffSocialPosition,logs.get(0).getNewKey());
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                newList.add(workStaffSocialPosition);
+            }
+        }
+        //删除
+        WorkStaffAchivesLog delLog=new WorkStaffAchivesLog();
+        delLog.setStaffId(workStaffBasicInfo.getId());
+        delLog.setModule("社会及行业职务");
+        delLog.setType("删除");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> dellogs=workStaffAchivesLogService.findList(delLog);
+        if (dellogs != null && !dellogs.isEmpty()) {
+            List<String> sonIdLists = Lists.newArrayList();
+            for (WorkStaffAchivesLog log : dellogs) {
+                sonIdLists.add(log.getSonId());
+            }
+
+            Iterator<WorkStaffSocialPosition> iterator = newList.iterator();
+            while (iterator.hasNext()) {
+                WorkStaffSocialPosition staff = iterator.next();
+                if (sonIdLists.contains(staff.getId())) {
+                    iterator.remove();
+                }
+            }
+        }
+        workStaffBasicInfo.setSocialPositionList(newList);
+    }
+
     @Transactional(readOnly = false)
     public void saveEdu(WorkStaffBasicInfo workStaffBasicInfo) {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -337,6 +482,45 @@ public class WorkStaffSocialPositionService extends CrudService<WorkStaffSocialP
                                 }
                             }
                         }
+                    }else{
+                        if("1".equals(workStaffBasicInfo.getAuditStatus())){
+                            String newId=IdGen.uuid();
+                            for (Field field : declaredFields) {
+                                String name = field.getName();
+                                if("name".equals(name)||"startDate".equals(name)||"endDate".equals(name)||"organization".equals(name)){
+                                    String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                    workStaffAchivesLog.setModule("社会及行业职务");
+                                    workStaffAchivesLog.setSonId(newId);
+                                    workStaffAchivesLog.setFields(name);
+                                    workStaffAchivesLog.setState("1");
+                                    try {
+                                        Object newInvoke = newClass.getMethod(methodName).invoke(newSocialPosition);//修改后
+                                        String describes=EDU_MAP.get(name);
+                                        if(newInvoke instanceof String){
+                                            String newValue=newInvoke.toString();
+                                            workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "社会及行业职务",describes,name,
+                                                    "",newInvoke.toString(),
+                                                    "",newInvoke.toString(),newId,"新增");
+                                        }
+                                        if(newInvoke instanceof Date){//日期
+                                            String newDate=sdf.format(newInvoke);
+                                            workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "社会及行业职务",describes,name,
+                                                    "",newDate,"",newDate,newId,"新增");
+                                        };
+                                    } catch (NoSuchMethodException e) {
+                                        e.printStackTrace();
+                                    } catch (IllegalAccessException e) {
+                                        e.printStackTrace();
+                                    } catch (InvocationTargetException e) {
+                                        e.printStackTrace();
+                                    }
+                                }
+                            }
+                        }
                     }
                 }else if((newSocialPosition.getId()==null||"".equals(newSocialPosition.getId()))&&"0".equals(newSocialPosition.getDelFlag())){//新增
                     String newId=IdGen.uuid();
@@ -390,4 +574,117 @@ public class WorkStaffSocialPositionService extends CrudService<WorkStaffSocialP
             }
         }
     }
+    @Transactional(readOnly = false)
+    public void storeEdu(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        List<WorkStaffSocialPosition> socialPositionList =workStaffBasicInfo.getSocialPositionList();
+        if(socialPositionList!=null&&socialPositionList.size()>0){
+            for(WorkStaffSocialPosition newSocialPosition:socialPositionList){
+                Class<? extends WorkStaffSocialPosition> newClass = newSocialPosition.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                if(newSocialPosition.getId()!=null&&!"1".equals(newSocialPosition.getDelFlag())&&!"".equals(newSocialPosition.getId())){
+                    WorkStaffSocialPosition oldSocialPosition=this.get(newSocialPosition.getId());
+                    if(oldSocialPosition!=null){
+                        Class<? extends WorkStaffSocialPosition> oldClass = oldSocialPosition.getClass();
+                        for (Field field : declaredFields) {
+                            String name = field.getName();
+                            if("name".equals(name)||"startDate".equals(name)||"endDate".equals(name)||"organization".equals(name)){
+                                String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                workStaffAchivesLog.setModule("社会及行业职务");
+                                workStaffAchivesLog.setSonId(newSocialPosition.getId());
+                                workStaffAchivesLog.setFields(name);
+                                workStaffAchivesLog.setState("3");
+                                try {
+                                    Object newInvoke = newClass.getMethod(methodName).invoke(newSocialPosition);//修改后
+                                    Object oldInvoke = oldClass.getMethod(methodName).invoke(oldSocialPosition);//修改前
+                                    String describes=EDU_MAP.get(name);
+                                    if(newInvoke instanceof String){
+                                        String newValue=newInvoke.toString();
+                                        String oldValue=oldInvoke.toString();
+                                        if(!newValue.equals(oldValue)){
+                                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "社会及行业职务",describes,name,
+                                                    oldInvoke.toString(),newInvoke.toString(),
+                                                    oldInvoke.toString(),newInvoke.toString(),newSocialPosition.getId(),"修改");
+                                        }
+                                    }
+                                    if(newInvoke instanceof Date){//日期
+                                        String newDate="";
+                                        String oldDate="";
+                                        if(newInvoke!=null){
+                                            newDate=sdf.format(newInvoke);
+                                        }
+                                        if (oldInvoke!=null){
+                                            oldDate=sdf.format(oldInvoke);
+                                        }
+                                        if(!newDate.equals(oldDate)){
+                                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "社会及行业职务",describes,name,
+                                                    oldDate,newDate,oldDate,newDate,newSocialPosition.getId(),"修改");
+                                        }
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    e.printStackTrace();
+                                } catch (IllegalAccessException e) {
+                                    e.printStackTrace();
+                                } catch (InvocationTargetException e) {
+                                    e.printStackTrace();
+                                }
+                            }
+                        }
+                    }
+                }else if((newSocialPosition.getId()==null||"".equals(newSocialPosition.getId()))&&"0".equals(newSocialPosition.getDelFlag())){//新增
+                    String newId=IdGen.uuid();
+                    for (Field field : declaredFields) {
+                        String name = field.getName();
+                        if("name".equals(name)||"startDate".equals(name)||"endDate".equals(name)||"organization".equals(name)){
+                            String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                            WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                            workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                            workStaffAchivesLog.setModule("社会及行业职务");
+                            workStaffAchivesLog.setSonId(newId);
+                            workStaffAchivesLog.setFields(name);
+                            workStaffAchivesLog.setState("3");
+                            try {
+                                Object newInvoke = newClass.getMethod(methodName).invoke(newSocialPosition);//修改后
+                                String describes=EDU_MAP.get(name);
+                                if(newInvoke instanceof String){
+                                    String newValue=newInvoke.toString();
+                                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                            "社会及行业职务",describes,name,
+                                            "",newInvoke.toString(),
+                                            "",newInvoke.toString(),newId,"新增");
+                                }
+                                if(newInvoke instanceof Date){//日期
+                                    String newDate=sdf.format(newInvoke);
+                                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                            "社会及行业职务",describes,name,
+                                            "",newDate,"",newDate,newId,"新增");
+                                };
+                            } catch (NoSuchMethodException e) {
+                                e.printStackTrace();
+                            } catch (IllegalAccessException e) {
+                                e.printStackTrace();
+                            } catch (InvocationTargetException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    }
+                }else if(newSocialPosition.getId()!=null&&"1".equals(newSocialPosition.getDelFlag())&&!"".equals(newSocialPosition.getId())){//删除
+                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                    workStaffAchivesLog.setModule("社会及行业职务");
+                    workStaffAchivesLog.setSonId(newSocialPosition.getId());
+                    workStaffAchivesLog.setType("删除");
+                    workStaffAchivesLog.setState("3");
+                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                            "社会及行业职务","","",
+                            "","",
+                            "","",newSocialPosition.getId(),"删除");
+                }
+            }
+        }
+    }
 }

+ 341 - 0
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffTitleService.java

@@ -10,6 +10,7 @@ import java.lang.reflect.Method;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -58,6 +59,7 @@ public class WorkStaffTitleService extends CrudService<WorkStaffTitleDao, WorkSt
         for (WorkStaffTitle info : list) {
             if(StringUtils.isNotEmpty(info.getFilePath())) {
                 info.setFilePathStr(WorkattachmentService.fileUrlManage(info.getFilePath()));
+                info.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(info.getFilePath()));
             }
         }
 		return list;
@@ -252,11 +254,13 @@ public class WorkStaffTitleService extends CrudService<WorkStaffTitleDao, WorkSt
                 }
                 if(StringUtils.isNotBlank(workStaffTitle.getFilePath())){
                     workStaffTitle.setFilePathStr(WorkattachmentService.fileUrlManage(workStaffTitle.getFilePath()));
+                    workStaffTitle.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(workStaffTitle.getFilePath()));
                 }
                 newList.add(workStaffTitle);
                 for (WorkStaffTitle staffCertificate : newList) {
                     if(StringUtils.isNotEmpty(staffCertificate.getFilePath())) {
                         staffCertificate.setFilePathStr(WorkattachmentService.fileUrlManage(staffCertificate.getFilePath()));
+                        staffCertificate.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(staffCertificate.getFilePath()));
                     }
                 }
             }
@@ -311,6 +315,7 @@ public class WorkStaffTitleService extends CrudService<WorkStaffTitleDao, WorkSt
                 }
                 if(StringUtils.isNotBlank(workStaffTitle.getFilePath())){
                     workStaffTitle.setFilePathStr(WorkattachmentService.fileUrlManage(workStaffTitle.getFilePath()));
+                    workStaffTitle.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(workStaffTitle.getFilePath()));
                 }
                 newList.add(workStaffTitle);
             }
@@ -329,6 +334,164 @@ public class WorkStaffTitleService extends CrudService<WorkStaffTitleDao, WorkSt
         }
         workStaffBasicInfo.setTitleList(newList);
     }
+    public void storeQuerys(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
+        if(workStaffBasicInfo==null|| StringUtils.isBlank(workStaffBasicInfo.getId())){
+            return;
+        }
+        WorkStaffTitle entity = new WorkStaffTitle();
+        entity.setStaffId(workStaffBasicInfo.getId());
+        List<WorkStaffTitle> list=this.findList(entity);
+        List<WorkStaffTitle> newList=Lists.newArrayList();
+        if(list!=null&&list.size()>0){//修改
+            for(WorkStaffTitle workStaffTitle:list){
+                Class<? extends WorkStaffTitle> newClass = workStaffTitle.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("name".equals(name)||"grade".equals(name)||"startDate".equals(name)||"pathway".equals(name)||"approvalAuthority".equals(name)
+                            || "startDate".equals(name)||"filePath".equals(name)||"fileName".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                        workStaffAchivesLog.setModule("职称");
+                        workStaffAchivesLog.setSonId(workStaffTitle.getId());
+                        workStaffAchivesLog.setFields(name);
+                        workStaffAchivesLog.setType("修改");
+                        workStaffAchivesLog.setState("3");
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            Object newInvoke = newClass.getMethod(getMethod).invoke(workStaffTitle);//修改后
+                            if(newInvoke instanceof String){
+                                Method setReadOnly = workStaffTitle.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffTitle,logs.get(0).getNewKey());
+                                }
+                            }
+                            if(newInvoke instanceof Date){//日期
+                                Method setReadOnly = workStaffTitle.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffTitle,myDate);
+                                }
+                            }
+                            if(null == newInvoke){
+                                try {
+                                    Method setReadOnly = workStaffTitle.getClass().getMethod(setMethod, String.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        setReadOnly.invoke(workStaffTitle,logs.get(0).getNewKey());
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    Method setReadOnly = workStaffTitle.getClass().getMethod(setMethod, Date.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                        setReadOnly.invoke(workStaffTitle,myDate);
+                                    }
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                if(StringUtils.isNotBlank(workStaffTitle.getFilePath())){
+                    workStaffTitle.setFilePathStr(WorkattachmentService.fileUrlManage(workStaffTitle.getFilePath()));
+                    workStaffTitle.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(workStaffTitle.getFilePath()));
+                }
+                newList.add(workStaffTitle);
+                for (WorkStaffTitle staffCertificate : newList) {
+                    if(StringUtils.isNotEmpty(staffCertificate.getFilePath())) {
+                        staffCertificate.setFilePathStr(WorkattachmentService.fileUrlManage(staffCertificate.getFilePath()));
+                        staffCertificate.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(staffCertificate.getFilePath()));
+                    }
+                }
+            }
+        }
+        //新增
+        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+        workStaffAchivesLog.setModule("职称");
+        workStaffAchivesLog.setType("新增");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> sonIds=workStaffAchivesLogService.findSonId(workStaffAchivesLog);
+        if(sonIds!=null&&sonIds.size()>0){
+            for(WorkStaffAchivesLog w:sonIds){
+                workStaffAchivesLog.setSonId(w.getSonId());
+                WorkStaffTitle workStaffTitle = new WorkStaffTitle();
+                workStaffTitle.setId(w.getSonId());
+                workStaffTitle.setDelFlag("0");
+                workStaffTitle.setStaffId(workStaffBasicInfo.getId());
+                Class<? extends WorkStaffTitle> newClass = workStaffTitle.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("name".equals(name)||"grade".equals(name)||"startDate".equals(name)||"pathway".equals(name)||"approvalAuthority".equals(name)
+                            || "startDate".equals(name)||"filePath".equals(name)||"fileName".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        workStaffAchivesLog.setFields(name);
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            if("startDate".equals(name)){//日期
+                                Method setReadOnly = workStaffTitle.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffTitle,myDate);
+                                }
+                            }else{
+                                Method setReadOnly = workStaffTitle.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffTitle,logs.get(0).getNewKey());
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                if(StringUtils.isNotBlank(workStaffTitle.getFilePath())){
+                    workStaffTitle.setFilePathStr(WorkattachmentService.fileUrlManage(workStaffTitle.getFilePath()));
+                    workStaffTitle.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(workStaffTitle.getFilePath()));
+                }
+                newList.add(workStaffTitle);
+            }
+        }
+        //删除
+        WorkStaffAchivesLog delLog=new WorkStaffAchivesLog();
+        delLog.setStaffId(workStaffBasicInfo.getId());
+        delLog.setModule("职称");
+        delLog.setType("删除");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> dellogs=workStaffAchivesLogService.findList(delLog);
+        if (dellogs != null && !dellogs.isEmpty()) {
+            List<String> sonIdLists = Lists.newArrayList();
+            for (WorkStaffAchivesLog log : dellogs) {
+                sonIdLists.add(log.getSonId());
+            }
+
+            Iterator<WorkStaffTitle> iterator = newList.iterator();
+            while (iterator.hasNext()) {
+                WorkStaffTitle staff = iterator.next();
+                if (sonIdLists.contains(staff.getId())) {
+                    iterator.remove();
+                }
+            }
+        }
+        workStaffBasicInfo.setTitleList(newList);
+    }
 
     @Transactional(readOnly = false)
     public void saveEdu(WorkStaffBasicInfo workStaffBasicInfo) {
@@ -403,6 +566,51 @@ public class WorkStaffTitleService extends CrudService<WorkStaffTitleDao, WorkSt
                             }
                         }
 
+                    }else{
+                        if("1".equals(workStaffBasicInfo.getAuditStatus())){
+                            if(newTitle.getFile()!=null&&!newTitle.getFile().isEmpty()&&newTitle.getFile().getSize()>0){
+                                MultipartFile file = newTitle.getFile();
+                                newTitle.setFilePath(this.uploadFile(file,newTitle.getFilePath()));
+                            }
+                            String newId=IdGen.uuid();
+                            for (Field field : declaredFields) {
+                                String name = field.getName();
+                                if("name".equals(name)||"grade".equals(name)||"startDate".equals(name)||"pathway".equals(name)||"approvalAuthority".equals(name)
+                                        || "startDate".equals(name)||"filePath".equals(name)||"fileName".equals(name)){
+                                    String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                    workStaffAchivesLog.setModule("职称");
+                                    workStaffAchivesLog.setSonId(newId);
+                                    workStaffAchivesLog.setFields(name);
+                                    workStaffAchivesLog.setState("1");
+                                    try {
+                                        Object newInvoke = newClass.getMethod(methodName).invoke(newTitle);//修改后
+                                        String describes=EDU_MAP.get(name);
+                                        if(newInvoke instanceof String){
+                                            String newValue=newInvoke.toString();
+                                            workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "职称",describes,name,
+                                                    "",newInvoke.toString(),
+                                                    "",newInvoke.toString(),newId,"新增");
+
+                                        }
+                                        if(newInvoke instanceof Date){//日期
+                                            String newDate=sdf.format(newInvoke);
+                                            workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "职称",describes,name,
+                                                    "",newDate,"",newDate,newId,"新增");
+                                        };
+                                    } catch (NoSuchMethodException e) {
+                                        e.printStackTrace();
+                                    } catch (IllegalAccessException e) {
+                                        e.printStackTrace();
+                                    } catch (InvocationTargetException e) {
+                                        e.printStackTrace();
+                                    }
+                                }
+                            }
+                        }
                     }
                 }else if((newTitle.getId()==null||"".equals(newTitle.getId()))&&"0".equals(newTitle.getDelFlag())){//新增
                     if(newTitle.getFile()!=null&&!newTitle.getFile().isEmpty()&&newTitle.getFile().getSize()>0){
@@ -462,4 +670,137 @@ public class WorkStaffTitleService extends CrudService<WorkStaffTitleDao, WorkSt
             }
         }
     }
+
+    @Transactional(readOnly = false)
+    public void storeEdu(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        List<WorkStaffTitle> titleList =workStaffBasicInfo.getTitleList();
+        if(titleList!=null&&titleList.size()>0){
+            for(WorkStaffTitle newTitle:titleList){
+
+                if(null != newTitle.getFile() && StringUtils.isNotBlank(newTitle.getFile().getOriginalFilename())){
+                    String fileName = newTitle.getFile().getOriginalFilename();
+                    newTitle.setFileName(fileName);
+                }
+
+                Class<? extends WorkStaffTitle> newClass = newTitle.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                if(newTitle.getId()!=null&&!"1".equals(newTitle.getDelFlag())&&!"".equals(newTitle.getId())){
+                    if(newTitle.getFile()!=null&&!newTitle.getFile().isEmpty()&&newTitle.getFile().getSize()>0){
+                        MultipartFile file = newTitle.getFile();
+                        newTitle.setFilePath(this.uploadFile(file,newTitle.getFilePath()));
+                    }
+                    WorkStaffTitle oldTitle=this.get(newTitle.getId());
+                    if(oldTitle!=null){
+                        Class<? extends WorkStaffTitle> oldClass = oldTitle.getClass();
+                        for (Field field : declaredFields) {
+                            String name = field.getName();
+                            if("name".equals(name)||"grade".equals(name)||"startDate".equals(name)||"pathway".equals(name)||"approvalAuthority".equals(name)
+                                    || "startDate".equals(name)||"filePath".equals(name)||"fileName".equals(name)){
+                                String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                workStaffAchivesLog.setModule("职称");
+                                workStaffAchivesLog.setSonId(newTitle.getId());
+                                workStaffAchivesLog.setFields(name);
+                                workStaffAchivesLog.setState("3");
+                                try {
+                                    Object newInvoke = newClass.getMethod(methodName).invoke(newTitle);//修改后
+                                    Object oldInvoke = oldClass.getMethod(methodName).invoke(oldTitle);//修改前
+                                    String describes=EDU_MAP.get(name);
+                                    if(newInvoke instanceof String){
+                                        String newValue=newInvoke.toString();
+                                        String oldValue=oldInvoke.toString();
+                                        if(!newValue.equals(oldValue)){
+                                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "职称",describes,name,
+                                                    oldInvoke.toString(),newInvoke.toString(),
+                                                    oldInvoke.toString(),newInvoke.toString(),newTitle.getId(),"修改");
+
+                                        }
+                                    }
+                                    if(newInvoke instanceof Date){//日期
+                                        String newDate="";
+                                        String oldDate="";
+                                        if(newInvoke!=null){
+                                            newDate=sdf.format(newInvoke);
+                                        }
+                                        if (oldInvoke!=null){
+                                            oldDate=sdf.format(oldInvoke);
+                                        }
+                                        if(!newDate.equals(oldDate)){
+                                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "职称",describes,name,
+                                                    oldDate,newDate,oldDate,newDate,newTitle.getId(),"修改");
+                                        }
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    e.printStackTrace();
+                                } catch (IllegalAccessException e) {
+                                    e.printStackTrace();
+                                } catch (InvocationTargetException e) {
+                                    e.printStackTrace();
+                                }
+                            }
+                        }
+
+                    }
+                }else if((newTitle.getId()==null||"".equals(newTitle.getId()))&&"0".equals(newTitle.getDelFlag())){//新增
+                    if(newTitle.getFile()!=null&&!newTitle.getFile().isEmpty()&&newTitle.getFile().getSize()>0){
+                        MultipartFile file = newTitle.getFile();
+                        newTitle.setFilePath(this.uploadFile(file,newTitle.getFilePath()));
+                    }
+                    String newId=IdGen.uuid();
+                    for (Field field : declaredFields) {
+                        String name = field.getName();
+                        if("name".equals(name)||"grade".equals(name)||"startDate".equals(name)||"pathway".equals(name)||"approvalAuthority".equals(name)
+                                || "startDate".equals(name)||"filePath".equals(name)||"fileName".equals(name)){
+                            String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                            WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                            workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                            workStaffAchivesLog.setModule("职称");
+                            workStaffAchivesLog.setSonId(newId);
+                            workStaffAchivesLog.setFields(name);
+                            workStaffAchivesLog.setState("3");
+                            try {
+                                Object newInvoke = newClass.getMethod(methodName).invoke(newTitle);//修改后
+                                String describes=EDU_MAP.get(name);
+                                if(newInvoke instanceof String){
+                                    String newValue=newInvoke.toString();
+                                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                            "职称",describes,name,
+                                            "",newInvoke.toString(),
+                                            "",newInvoke.toString(),newId,"新增");
+
+                                }
+                                if(newInvoke instanceof Date){//日期
+                                    String newDate=sdf.format(newInvoke);
+                                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                            "职称",describes,name,
+                                            "",newDate,"",newDate,newId,"新增");
+                                };
+                            } catch (NoSuchMethodException e) {
+                                e.printStackTrace();
+                            } catch (IllegalAccessException e) {
+                                e.printStackTrace();
+                            } catch (InvocationTargetException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    }
+                }else if(newTitle.getId()!=null&&"1".equals(newTitle.getDelFlag())&&!"".equals(newTitle.getId())){//删除
+                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                    workStaffAchivesLog.setModule("职称");
+                    workStaffAchivesLog.setSonId(newTitle.getId());
+                    workStaffAchivesLog.setType("删除");
+                    workStaffAchivesLog.setState("3");
+                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                            "职称","","",
+                            "","",
+                            "","",newTitle.getId(),"删除");
+                }
+            }
+        }
+    }
 }

+ 362 - 0
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffTrainingService.java

@@ -10,6 +10,7 @@ import java.lang.reflect.Method;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -61,6 +62,7 @@ public class WorkStaffTrainingService extends CrudService<WorkStaffTrainingDao,
         for (WorkStaffTraining staffTraining : list) {
             if(StringUtils.isNotEmpty(staffTraining.getFilePath())) {
                 staffTraining.setFilePathStr(WorkattachmentService.fileUrlManage(staffTraining.getFilePath()));
+                staffTraining.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(staffTraining.getFilePath()));
             }
         }
         return super.findList(workStaffTraining);
@@ -261,12 +263,14 @@ public class WorkStaffTrainingService extends CrudService<WorkStaffTrainingDao,
                 }
                 if(StringUtils.isNotBlank(workStaffTraining.getFilePath())){
                     workStaffTraining.setFilePathStr( WorkattachmentService.fileUrlManage(workStaffTraining.getFilePath()));
+                    workStaffTraining.setFilePathThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffTraining.getFilePath()));
                 }
                 newList.add(workStaffTraining);
 
                 for (WorkStaffTraining staffCertificate : newList) {
                     if(StringUtils.isNotEmpty(staffCertificate.getFilePath())) {
                         staffCertificate.setFilePathStr(WorkattachmentService.fileUrlManage(staffCertificate.getFilePath()));
+                        staffCertificate.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(staffCertificate.getFilePath()));
                     }
                 }
             }
@@ -322,6 +326,7 @@ public class WorkStaffTrainingService extends CrudService<WorkStaffTrainingDao,
                 }
                 if(StringUtils.isNotBlank(workStaffTraining.getFilePath())){
                     workStaffTraining.setFilePathStr( WorkattachmentService.fileUrlManage(workStaffTraining.getFilePath()));
+                    workStaffTraining.setFilePathThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffTraining.getFilePath()));
                 }
                 newList.add(workStaffTraining);
             }
@@ -340,6 +345,167 @@ public class WorkStaffTrainingService extends CrudService<WorkStaffTrainingDao,
         }
         workStaffBasicInfo.setTrainingList(newList);
     }
+    public void storeQuerys(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
+        if(workStaffBasicInfo==null|| StringUtils.isBlank(workStaffBasicInfo.getId())){
+            return;
+        }
+        WorkStaffTraining entity = new WorkStaffTraining();
+        entity.setStaff(workStaffBasicInfo.getId());
+        List<WorkStaffTraining> list=this.findList(entity);
+        List<WorkStaffTraining> newList=Lists.newArrayList();
+        if(list!=null&&list.size()>0){//修改
+            for(WorkStaffTraining workStaffTraining:list){
+                Class<? extends WorkStaffTraining> newClass = workStaffTraining.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("name".equals(name)||"agency".equals(name)||"address".equals(name)||"startDate".equals(name)||"endDate".equals(name)
+                            || "type".equals(name)||"hours".equals(name)||"certificate".equals(name)||"filePath".equals(name)
+                            ||"fileName".equals(name)||"remarks".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                        workStaffAchivesLog.setModule("培训经历");
+                        workStaffAchivesLog.setSonId(workStaffTraining.getId());
+                        workStaffAchivesLog.setFields(name);
+                        workStaffAchivesLog.setType("修改");
+                        workStaffAchivesLog.setState("3");
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            Object newInvoke = newClass.getMethod(getMethod).invoke(workStaffTraining);//修改后
+                            if(newInvoke instanceof String){
+                                Method setReadOnly = workStaffTraining.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffTraining,logs.get(0).getNewKey());
+                                }
+                            }
+                            if(newInvoke instanceof Date){//日期
+                                Method setReadOnly = workStaffTraining.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffTraining,myDate);
+                                }
+                            }
+                            if(null == newInvoke){
+                                try {
+                                    Method setReadOnly = workStaffTraining.getClass().getMethod(setMethod, String.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        setReadOnly.invoke(workStaffTraining,logs.get(0).getNewKey());
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    Method setReadOnly = workStaffTraining.getClass().getMethod(setMethod, Date.class);
+                                    if(logs!=null&&logs.size()>0){
+                                        Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                        setReadOnly.invoke(workStaffTraining,myDate);
+                                    }
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                if(StringUtils.isNotBlank(workStaffTraining.getFilePath())){
+                    workStaffTraining.setFilePathStr( WorkattachmentService.fileUrlManage(workStaffTraining.getFilePath()));
+                    workStaffTraining.setFilePathThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffTraining.getFilePath()));
+                }
+                newList.add(workStaffTraining);
+
+                for (WorkStaffTraining staffCertificate : newList) {
+                    if(StringUtils.isNotEmpty(staffCertificate.getFilePath())) {
+                        staffCertificate.setFilePathStr(WorkattachmentService.fileUrlManage(staffCertificate.getFilePath()));
+                        staffCertificate.setFilePathThumbnailStr(WorkattachmentService.fileUrlThumbnailManage(staffCertificate.getFilePath()));
+                    }
+                }
+            }
+        }
+        //新增
+        WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+        workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+        workStaffAchivesLog.setModule("培训经历");
+        workStaffAchivesLog.setType("新增");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> sonIds=workStaffAchivesLogService.findSonId(workStaffAchivesLog);
+        if(sonIds!=null&&sonIds.size()>0){
+            for(WorkStaffAchivesLog w:sonIds){
+                workStaffAchivesLog.setSonId(w.getSonId());
+                WorkStaffTraining workStaffTraining = new WorkStaffTraining();
+                workStaffTraining.setId(w.getSonId());
+                workStaffTraining.setDelFlag("0");
+                workStaffTraining.setStaff(workStaffBasicInfo.getId());
+                Class<? extends WorkStaffTraining> newClass = workStaffTraining.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                for (Field field : declaredFields) {
+                    String name = field.getName();
+                    if("name".equals(name)||"agency".equals(name)||"address".equals(name)||"startDate".equals(name)||"endDate".equals(name)
+                            || "type".equals(name)||"hours".equals(name)||"certificate".equals(name)||"filePath".equals(name)
+                            ||"fileName".equals(name)||"remarks".equals(name)){
+                        String setMethod = "set"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        String getMethod = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                        workStaffAchivesLog.setFields(name);
+                        List<WorkStaffAchivesLog> logs=workStaffAchivesLogService.findList(workStaffAchivesLog);
+                        try {
+                            if("startDate".equals(name)||"endDate".equals(name)){//日期
+                                Method setReadOnly = workStaffTraining.getClass().getMethod(setMethod, Date.class);
+                                if(logs!=null&&logs.size()>0){
+                                    Date myDate = dateFormat1.parse(logs.get(0).getNewKey());
+                                    setReadOnly.invoke(workStaffTraining,myDate);
+                                }
+                            }else{
+                                Method setReadOnly = workStaffTraining.getClass().getMethod(setMethod, String.class);
+                                if(logs!=null&&logs.size()>0){
+                                    setReadOnly.invoke(workStaffTraining,logs.get(0).getNewKey());
+                                }
+                            }
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                if(StringUtils.isNotBlank(workStaffTraining.getFilePath())){
+                    workStaffTraining.setFilePathStr( WorkattachmentService.fileUrlManage(workStaffTraining.getFilePath()));
+                    workStaffTraining.setFilePathThumbnailStr( WorkattachmentService.fileUrlThumbnailManage(workStaffTraining.getFilePath()));
+                }
+                newList.add(workStaffTraining);
+            }
+        }
+        //删除
+        WorkStaffAchivesLog delLog=new WorkStaffAchivesLog();
+        delLog.setStaffId(workStaffBasicInfo.getId());
+        delLog.setModule("培训经历");
+        delLog.setType("删除");
+        workStaffAchivesLog.setState("3");
+        List<WorkStaffAchivesLog> dellogs=workStaffAchivesLogService.findList(delLog);
+        if (dellogs != null && !dellogs.isEmpty()) {
+            List<String> sonIdLists = Lists.newArrayList();
+            for (WorkStaffAchivesLog log : dellogs) {
+                sonIdLists.add(log.getSonId());
+            }
+
+            Iterator<WorkStaffTraining> iterator = newList.iterator();
+            while (iterator.hasNext()) {
+                WorkStaffTraining staff = iterator.next();
+                if (sonIdLists.contains(staff.getId())) {
+                    iterator.remove();
+                }
+            }
+        }
+        workStaffBasicInfo.setTrainingList(newList);
+    }
     @Transactional(readOnly = false)
     public void saveEdu(WorkStaffBasicInfo workStaffBasicInfo) {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -415,6 +581,59 @@ public class WorkStaffTrainingService extends CrudService<WorkStaffTrainingDao,
                             }
                         }
 
+                    }else{
+                        if("1".equals(workStaffBasicInfo.getAuditStatus())){
+                            if(newTraining.getFile()!=null&&!newTraining.getFile().isEmpty()&&newTraining.getFile().getSize()>0){
+                                MultipartFile file = newTraining.getFile();
+                                newTraining.setFilePath(this.uploadFile(file,newTraining.getFilePath()));
+                            }
+                            String newId=IdGen.uuid();
+                            for (Field field : declaredFields) {
+                                String name = field.getName();
+                                if("name".equals(name)||"agency".equals(name)||"address".equals(name)||"startDate".equals(name)||"endDate".equals(name)
+                                        || "type".equals(name)||"hours".equals(name)||"certificate".equals(name)||"filePath".equals(name)
+                                        ||"fileName".equals(name)||"remarks".equals(name)){
+                                    String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                    workStaffAchivesLog.setModule("培训经历");
+                                    workStaffAchivesLog.setSonId(newId);
+                                    workStaffAchivesLog.setFields(name);
+                                    workStaffAchivesLog.setState("1");
+                                    try {
+                                        Object newInvoke = newClass.getMethod(methodName).invoke(newTraining);//修改后
+                                        String describes=EDU_MAP.get(name);
+                                        if(newInvoke instanceof String){
+                                            String newValue=newInvoke.toString();
+                                            if("type".equals(name)){
+                                                workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "培训经历",describes,name,
+                                                        "",
+                                                        DictUtils.getMainDictLabel(newValue,"training_type",""),
+                                                        "",newValue,newId,"新增");
+                                            }else{
+                                                workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "培训经历",describes,name,
+                                                        "",newInvoke.toString(),
+                                                        "",newInvoke.toString(),newId,"新增");
+                                            }
+                                        }
+                                        if(newInvoke instanceof Date){//日期
+                                            String newDate=sdf.format(newInvoke);
+                                            workStaffAchivesLogService.saveStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "培训经历",describes,name,
+                                                    "",newDate,"",newDate,newId,"新增");
+                                        };
+                                    } catch (NoSuchMethodException e) {
+                                        e.printStackTrace();
+                                    } catch (IllegalAccessException e) {
+                                        e.printStackTrace();
+                                    } catch (InvocationTargetException e) {
+                                        e.printStackTrace();
+                                    }
+                                }
+                            }
+                        }
                     }
                 }else if((newTraining.getId()==null||"".equals(newTraining.getId()))&&"0".equals(newTraining.getDelFlag())){//新增
                     if(newTraining.getFile()!=null&&!newTraining.getFile().isEmpty()&&newTraining.getFile().getSize()>0){
@@ -482,4 +701,147 @@ public class WorkStaffTrainingService extends CrudService<WorkStaffTrainingDao,
             }
         }
     }
+
+    @Transactional(readOnly = false)
+    public void storeEdu(WorkStaffBasicInfo workStaffBasicInfo) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        List<WorkStaffTraining> trainingList =workStaffBasicInfo.getTrainingList();
+        if(trainingList!=null&&trainingList.size()>0){
+            for(WorkStaffTraining newTraining:trainingList){
+                Class<? extends WorkStaffTraining> newClass = newTraining.getClass();
+                Field[] declaredFields = newClass.getDeclaredFields();
+                if(newTraining.getId()!=null&&!"1".equals(newTraining.getDelFlag())&&!"".equals(newTraining.getId())){
+                    if(newTraining.getFile()!=null&&!newTraining.getFile().isEmpty()&&newTraining.getFile().getSize()>0){
+                        MultipartFile file = newTraining.getFile();
+                        newTraining.setFilePath(this.uploadFile(file,newTraining.getFilePath()));
+                    }
+                    WorkStaffTraining oldTraining=this.get(newTraining.getId());
+                    if(oldTraining!=null){
+                        Class<? extends WorkStaffTraining> oldClass = oldTraining.getClass();
+                        for (Field field : declaredFields) {
+                            String name = field.getName();
+                            if("name".equals(name)||"agency".equals(name)||"address".equals(name)||"startDate".equals(name)||"endDate".equals(name)
+                                    || "type".equals(name)||"hours".equals(name)||"certificate".equals(name)||"filePath".equals(name)
+                                    ||"fileName".equals(name)||"remarks".equals(name)){
+                                String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                                WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                                workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                                workStaffAchivesLog.setModule("培训经历");
+                                workStaffAchivesLog.setSonId(newTraining.getId());
+                                workStaffAchivesLog.setFields(name);
+                                workStaffAchivesLog.setState("3");
+                                try {
+                                    Object newInvoke = newClass.getMethod(methodName).invoke(newTraining);//修改后
+                                    Object oldInvoke = oldClass.getMethod(methodName).invoke(oldTraining);//修改前
+                                    String describes=EDU_MAP.get(name);
+                                    if(newInvoke instanceof String){
+                                        String newValue=newInvoke.toString();
+                                        String oldValue=oldInvoke.toString();
+                                        if(!newValue.equals(oldValue)){
+                                            if("type".equals(name)){
+                                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "培训经历",describes,name,
+                                                        DictUtils.getMainDictLabel(oldValue,"training_type",""),
+                                                        DictUtils.getMainDictLabel(newValue,"training_type",""),
+                                                        oldValue,newValue,newTraining.getId(),"修改");
+                                            }else{
+                                                workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                        "培训经历",describes,name,
+                                                        oldInvoke.toString(),newInvoke.toString(),
+                                                        oldInvoke.toString(),newInvoke.toString(),newTraining.getId(),"修改");
+                                            }
+                                        }
+                                    }
+                                    if(newInvoke instanceof Date){//日期
+                                        String newDate="";
+                                        String oldDate="";
+                                        if(newInvoke!=null){
+                                            newDate=sdf.format(newInvoke);
+                                        }
+                                        if (oldInvoke!=null){
+                                            oldDate=sdf.format(oldInvoke);
+                                        }
+                                        if(!newDate.equals(oldDate)){
+                                            workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                    "培训经历",describes,name,
+                                                    oldDate,newDate,oldDate,newDate,newTraining.getId(),"修改");
+                                        }
+                                    }
+                                } catch (NoSuchMethodException e) {
+                                    e.printStackTrace();
+                                } catch (IllegalAccessException e) {
+                                    e.printStackTrace();
+                                } catch (InvocationTargetException e) {
+                                    e.printStackTrace();
+                                }
+                            }
+                        }
+
+                    }
+                }else if((newTraining.getId()==null||"".equals(newTraining.getId()))&&"0".equals(newTraining.getDelFlag())){//新增
+                    if(newTraining.getFile()!=null&&!newTraining.getFile().isEmpty()&&newTraining.getFile().getSize()>0){
+                        MultipartFile file = newTraining.getFile();
+                        newTraining.setFilePath(this.uploadFile(file,newTraining.getFilePath()));
+                    }
+                    String newId=IdGen.uuid();
+                    for (Field field : declaredFields) {
+                        String name = field.getName();
+                        if("name".equals(name)||"agency".equals(name)||"address".equals(name)||"startDate".equals(name)||"endDate".equals(name)
+                                || "type".equals(name)||"hours".equals(name)||"certificate".equals(name)||"filePath".equals(name)
+                                ||"fileName".equals(name)||"remarks".equals(name)){
+                            String methodName = "get"+name.substring(0,1).toUpperCase()+name.substring(1);
+                            WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                            workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                            workStaffAchivesLog.setModule("培训经历");
+                            workStaffAchivesLog.setSonId(newId);
+                            workStaffAchivesLog.setFields(name);
+                            workStaffAchivesLog.setState("3");
+                            try {
+                                Object newInvoke = newClass.getMethod(methodName).invoke(newTraining);//修改后
+                                String describes=EDU_MAP.get(name);
+                                if(newInvoke instanceof String){
+                                    String newValue=newInvoke.toString();
+                                    if("type".equals(name)){
+                                        workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                "培训经历",describes,name,
+                                                "",
+                                                DictUtils.getMainDictLabel(newValue,"training_type",""),
+                                                "",newValue,newId,"新增");
+                                    }else{
+                                        workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                                "培训经历",describes,name,
+                                                "",newInvoke.toString(),
+                                                "",newInvoke.toString(),newId,"新增");
+                                    }
+                                }
+                                if(newInvoke instanceof Date){//日期
+                                    String newDate=sdf.format(newInvoke);
+                                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                                            "培训经历",describes,name,
+                                            "",newDate,"",newDate,newId,"新增");
+                                };
+                            } catch (NoSuchMethodException e) {
+                                e.printStackTrace();
+                            } catch (IllegalAccessException e) {
+                                e.printStackTrace();
+                            } catch (InvocationTargetException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    }
+                }else if(newTraining.getId()!=null&&"1".equals(newTraining.getDelFlag())&&!"".equals(newTraining.getId())){//删除
+                    WorkStaffAchivesLog workStaffAchivesLog=new WorkStaffAchivesLog();
+                    workStaffAchivesLog.setStaffId(workStaffBasicInfo.getId());
+                    workStaffAchivesLog.setModule("培训经历");
+                    workStaffAchivesLog.setSonId(newTraining.getId());
+                    workStaffAchivesLog.setType("删除");
+                    workStaffAchivesLog.setState("3");
+                    workStaffAchivesLogService.storeStaffLog(workStaffAchivesLog,workStaffBasicInfo.getId(),
+                            "培训经历","","",
+                            "","",
+                            "","",newTraining.getId(),"删除");
+                }
+            }
+        }
+    }
 }

+ 99 - 6
src/main/java/com/jeeplus/modules/workstaff/web/WorkStaffBasicInfoController.java

@@ -55,6 +55,7 @@ import java.net.URLDecoder;
 import java.text.ParseException;
 import java.util.*;
 import java.util.stream.Collectors;
+import java.text.SimpleDateFormat;
 
 /**
  * 员工基本信息Controller
@@ -131,7 +132,12 @@ public class WorkStaffBasicInfoController extends BaseController {
 			info.setRoleId(roleService.getRoleIdByUserId(info.getUserId()));
 			info.setRoleName(roleService.getRoleNameByUserId(info.getUserId()));
 			//获取人员最高学历信息
-			workStaffAchivesDao.getHightEduByAchiveId(info.getAchiveId());
+			String hightEduByAchiveId = workStaffAchivesDao.getHightEduByAchiveId(info.getAchiveId());
+			if(StringUtils.isNotBlank(hightEduByAchiveId)){
+				String educationLevel = DictUtils.getDictLabel(hightEduByAchiveId, "education_level", "");
+				info.setHighestEducation(educationLevel);
+			}
+			System.out.println(hightEduByAchiveId);
 
 		}
 		model.addAttribute("page", page);
@@ -735,9 +741,22 @@ public class WorkStaffBasicInfoController extends BaseController {
 		workStaffBasicInfo.setRoleId(roleIdStr);
 		workStaffBasicInfo.setRoleName(roleNameStr);
 
-		if(StringUtils.isNotBlank(workStaffBasicInfo.getId())){
-			workStaffBasicInfoService.queryDetails(workStaffBasicInfo);
+		if ("1".equals(workStaffBasicInfo.getAuditStatus())) {
+			if (StringUtils.isNotBlank(workStaffBasicInfo.getId())) {
+				workStaffBasicInfoService.queryStoreDetailsApply(workStaffBasicInfo);
+			}
+			workStaffBasicInfoService.storeQuerys(workStaffBasicInfo);
+		}else{
+			if(StringUtils.isNotBlank(workStaffBasicInfo.getId())){
+				workStaffBasicInfoService.queryDetails(workStaffBasicInfo);
+			}
+		}
+		if(StringUtils.isNotBlank(workStaffBasicInfo.getPicture())){
+			String urlManage = WorkattachmentService.fileUrlManage(workStaffBasicInfo.getPicture());
+			workStaffBasicInfo.setPictureStr(urlManage);
 		}
+		System.out.println(workStaffBasicInfo.getPictureStr());
+		model.addAttribute("pictureStr", workStaffBasicInfo.getPictureStr());
 		model.addAttribute("workStaffBasicInfo", workStaffBasicInfo);
 		return "modules/workstaff/workStaffBasicDetailModify";
 	}
@@ -855,7 +874,7 @@ public class WorkStaffBasicInfoController extends BaseController {
 		if (!beanValidator(model, workStaffBasicInfo)){
 			return form(workStaffBasicInfo, model,false);
 		}
-		if (StringUtils.isNotBlank(workStaffBasicInfo.getHome()) && "home".equals(workStaffBasicInfo.getHome())){
+		if (StringUtils.isNotBlank(workStaffBasicInfo.getHome()) && ("home".equals(workStaffBasicInfo.getHome())  || "notifyList".equals(workStaffBasicInfo.getHome()))){
 			WorkProjectNotify workProjectNotify = new WorkProjectNotify();
 			workProjectNotify.setNotifyId(workStaffBasicInfo.getId());
 			workProjectNotify.setType("69");
@@ -864,10 +883,52 @@ public class WorkStaffBasicInfoController extends BaseController {
 		if (workStaffBasicInfo.getPictureFile() == null || workStaffBasicInfo.getPictureFile().getSize() < 0) {
 			workStaffBasicInfo.setPicture("");
 		}
+		if (StringUtils.isNotBlank(workStaffBasicInfo.getIdCard())) {
+			Date birthDate = getBirthDateFromIdCard(workStaffBasicInfo.getIdCard());
+			if(birthDate != null){
+				workStaffBasicInfo.setBirthday(birthDate);
+			}
+		}
 		workStaffBasicInfoService.completeApply(workStaffBasicInfo.getId());
 		workStaffBasicInfoService.saveLog(workStaffBasicInfo);
 		addMessage(redirectAttributes, "申请员工档案信息成功");
-		return "redirect:" + Global.getAdminPath() + "/home/?repage";
+		if (StringUtils.isNotBlank(workStaffBasicInfo.getHome()) && "home".equals(workStaffBasicInfo.getHome())){
+			return "redirect:" + Global.getAdminPath() + "/home/?repage";
+		}else if (StringUtils.isNotBlank(workStaffBasicInfo.getHome()) && "notifyList".equals(workStaffBasicInfo.getHome())){
+			return "redirect:" + Global.getAdminPath() + "/workprojectnotify/workProjectNotify/list/?repage";
+		}
+		return "redirect:"+Global.getAdminPath()+"/sys/user/info?repage";
+	}
+
+	/**
+	 * 保存员工信息
+	 */
+	@RequestMapping(value = "storeAchiveModify")
+	public String storeAchiveModify(WorkStaffBasicInfo workStaffBasicInfo, Model model, RedirectAttributes redirectAttributes,HttpServletRequest request) throws Exception{
+		if (!beanValidator(model, workStaffBasicInfo)){
+			return form(workStaffBasicInfo, model,false);
+		}
+		/*if (StringUtils.isNotBlank(workStaffBasicInfo.getHome()) && ("home".equals(workStaffBasicInfo.getHome()) || "notifyList".equals(workStaffBasicInfo.getHome()))) {
+			WorkProjectNotify workProjectNotify = new WorkProjectNotify();
+			workProjectNotify.setNotifyId(workStaffBasicInfo.getId());
+			workProjectNotifyService.readByNotifyId(workProjectNotify);
+		}*/
+
+		if (StringUtils.isNotBlank(workStaffBasicInfo.getIdCard())) {
+			Date birthDate = getBirthDateFromIdCard(workStaffBasicInfo.getIdCard());
+			if(birthDate != null){
+				workStaffBasicInfo.setBirthday(birthDate);
+			}
+		}
+		workStaffBasicInfoService.updateAuditStatus(workStaffBasicInfo.getId(), "1");
+		workStaffBasicInfoService.storeLog(workStaffBasicInfo);
+		addMessage(redirectAttributes, "暂存员工档案信息成功");
+		if (StringUtils.isNotBlank(workStaffBasicInfo.getHome()) && "home".equals(workStaffBasicInfo.getHome())){
+			return "redirect:" + Global.getAdminPath() + "/home/?repage";
+		}else if (StringUtils.isNotBlank(workStaffBasicInfo.getHome()) && "notifyList".equals(workStaffBasicInfo.getHome())){
+			return "redirect:" + Global.getAdminPath() + "/workprojectnotify/workProjectNotify/list/?repage";
+		}
+		return "redirect:"+Global.getAdminPath()+"/sys/user/info?repage";
 	}
 
 	/**
@@ -883,9 +944,17 @@ public class WorkStaffBasicInfoController extends BaseController {
 			workProjectNotify.setNotifyId(workStaffBasicInfo.getId());
 			workProjectNotifyService.readByNotifyId(workProjectNotify);
 		}
+
+		if (StringUtils.isNotBlank(workStaffBasicInfo.getIdCard())) {
+			Date birthDate = getBirthDateFromIdCard(workStaffBasicInfo.getIdCard());
+			if(birthDate != null){
+				workStaffBasicInfo.setBirthday(birthDate);
+			}
+		}
 		workStaffBasicInfoService.completeApply(workStaffBasicInfo.getId());
 		workStaffBasicInfoService.updateAlterationDate(workStaffBasicInfo.getId());
 		workStaffBasicInfoService.saveLog(workStaffBasicInfo);
+		workStaffBasicInfoService.updateAuditStatus(workStaffBasicInfo.getId(), "2");
 		addMessage(redirectAttributes, "申请员工档案信息成功");
 		if (StringUtils.isNotBlank(workStaffBasicInfo.getHome()) && "home".equals(workStaffBasicInfo.getHome())){
 			return "redirect:" + Global.getAdminPath() + "/home/?repage";
@@ -1068,7 +1137,9 @@ public class WorkStaffBasicInfoController extends BaseController {
 		if(null != workStaffBasicInfo.getAct() && StringUtils.isNotBlank(workStaffBasicInfo.getAct().getComment())){
 			workStaffBasicInfoService.updateActComment(workStaffBasicInfo);
 		}
-		workStaffAchivesLogDao.deleteBack(workStaffBasicInfo.getId());
+		workStaffBasicInfoService.updateAuditStatus(workStaffBasicInfo.getId(), "1");
+
+		workStaffAchivesLogDao.updateBackOnTS(workStaffBasicInfo.getId());
 		addMessage(redirectAttributes, "驳回成功");
 		return "redirect:" + Global.getAdminPath() + "/home/?repage";
 	}
@@ -1222,4 +1293,26 @@ public class WorkStaffBasicInfoController extends BaseController {
 		}
 		return "redirect:"+Global.getAdminPath()+"/workstaff/workStaffBasicInfo/?repage";
 	}
+
+	/**
+	 * 根据身份证获取出生日期
+	 * @param idCard
+	 * @return
+	 * @throws ParseException
+	 */
+	public Date getBirthDateFromIdCard(String idCard) throws ParseException {
+		if (idCard == null || !(idCard.length() == 18 || idCard.length() == 15)) {
+			throw new IllegalArgumentException("身份证号无效");
+		}
+
+		String birthDateStr;
+		if (idCard.length() == 18) {
+			birthDateStr = idCard.substring(6, 14); // yyyyMMdd
+		} else {
+			birthDateStr = "19" + idCard.substring(6, 12); // yyMMdd → yyyyMMdd
+		}
+
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+		return sdf.parse(birthDateStr);
+	}
 }

+ 29 - 0
src/main/java/com/jeeplus/modules/workstaff/web/WorkStaffBasicInfoEmploymentInController.java

@@ -7,9 +7,12 @@ import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.common.utils.excel.ExportExcel;
 import com.jeeplus.common.web.BaseController;
 import com.jeeplus.modules.sys.service.RoleService;
+import com.jeeplus.modules.sys.utils.DictUtils;
+import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
 import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfoExcel;
 import com.jeeplus.modules.workstaff.service.WorkStaffBasicInfoService;
+import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -84,6 +87,32 @@ public class WorkStaffBasicInfoEmploymentInController extends BaseController {
         return "modules/workstaff/workStaffBasicInfoEmploymentInList";
     }
 
+    /**
+     * 查看,增加,编辑员工信息表单页面
+     */
+    @RequiresPermissions(value={"workstaff:workStaffBasicInfo:add","workstaff:workStaffBasicInfo:edit"},logical= Logical.OR)
+    @RequestMapping(value = "form")
+    public String form(WorkStaffBasicInfo workStaffBasicInfo, Model model,boolean reFlag) {
+        if(StringUtils.isBlank(workStaffBasicInfo.getId())&&StringUtils.isNotBlank(workStaffBasicInfo.getAchiveId())) {
+            workStaffBasicInfo = workStaffBasicInfoService.getByAchiveId(workStaffBasicInfo);
+        }
+        if(StringUtils.isNotBlank(workStaffBasicInfo.getId())){
+            workStaffBasicInfoService.queryDetails(workStaffBasicInfo);
+        }else {
+            workStaffBasicInfo.setTs("0");
+            workStaffBasicInfo.setPolitics("普通居民");
+            workStaffBasicInfo.setExSoldier("0");
+            workStaffBasicInfo.setMarriage("未婚");
+            workStaffBasicInfo.setNation(DictUtils.getDictValue("汉族","nation_type",""));
+        }
+        workStaffBasicInfo.setRoleId(roleService.getRoleIdByUserId(workStaffBasicInfo.getUserId()));
+        if(StringUtils.isNotBlank(workStaffBasicInfo.getId())){
+            model.addAttribute("updateFlag","1");
+        }
+        model.addAttribute("workStaffBasicInfo", workStaffBasicInfo);
+        return "modules/workstaff/workStaffBasicInfoForm";
+    }
+
 
     /**
      * 导出excel文件

+ 11 - 0
src/main/java/com/jeeplus/modules/workstaffachiveslog/dao/WorkStaffAchivesLogDao.java

@@ -22,5 +22,16 @@ public interface WorkStaffAchivesLogDao extends CrudDao<WorkStaffAchivesLog> {
 	int updateState(@Param("staffId") String staffId, @Param("applyer") String applyer, @Param("applyDate") Date applyDate);
 	int updateDirectlyState(@Param("module") String module, @Param("staffId") String staffId, @Param("applyer") String applyer, @Param("applyDate") Date applyDate);
     int deleteBack(@Param("staffId") String staffId);
+    int deleteTemporaryStorage(@Param("staffId") String staffId);
     int deleteDirectlyBack(@Param("module") String module, @Param("staffId") String staffId);
+
+
+    int updateStatusById(@Param("id") String id, @Param("status") String status);
+
+    /**
+     * 将审核中的参数调整成暂存格式
+     * @param staffId
+     * @return
+     */
+    int updateBackOnTS(@Param("staffId") String staffId);
 }

+ 45 - 0
src/main/java/com/jeeplus/modules/workstaffachiveslog/service/WorkStaffAchivesLogService.java

@@ -51,6 +51,15 @@ public class WorkStaffAchivesLogService extends CrudService<WorkStaffAchivesLogD
 	}
 
 	@Transactional(readOnly = false)
+	public void deleteByAchiveId(String staffId) {
+		dao.deleteTemporaryStorage(staffId);
+	}
+	@Transactional(readOnly = false)
+	public void updateStatusById(String id,String status) {
+		dao.updateStatusById(id,status);
+	}
+
+	@Transactional(readOnly = false)
 	public  void saveStaffLog(WorkStaffAchivesLog workStaffAchivesLog,String staffId,
 							  String module,String describes,String fields,String oldValue,
 							  String newValue,String oldKey,String newKey,String sonId,String type){
@@ -86,6 +95,42 @@ public class WorkStaffAchivesLogService extends CrudService<WorkStaffAchivesLogD
 			workStaffAchivesLogDao.insert(workStaffAchivesLog);
 		}
 	}
+	@Transactional(readOnly = false)
+	public  void storeStaffLog(WorkStaffAchivesLog workStaffAchivesLog,String staffId,
+							  String module,String describes,String fields,String oldValue,
+							  String newValue,String oldKey,String newKey,String sonId,String type){
+		List<WorkStaffAchivesLog> logs=this.findList(workStaffAchivesLog);
+		if (logs!=null&&logs.size()>0) {
+			workStaffAchivesLog.preUpdate();
+			workStaffAchivesLog.setId(logs.get(0).getId());
+			workStaffAchivesLog.setStaffId(staffId);
+			workStaffAchivesLog.setModule(module);
+			workStaffAchivesLog.setDescribes(describes);
+			workStaffAchivesLog.setFields(fields);
+			workStaffAchivesLog.setOldValue(oldValue);
+			workStaffAchivesLog.setNewValue(newValue);
+			workStaffAchivesLog.setOldKey(oldKey);
+			workStaffAchivesLog.setNewKey(newKey);
+			workStaffAchivesLog.setSonId(sonId);
+			workStaffAchivesLog.setType(type);
+			workStaffAchivesLog.setState("3");
+			workStaffAchivesLogDao.update(workStaffAchivesLog);
+		} else {
+			workStaffAchivesLog.preInsert();
+			workStaffAchivesLog.setStaffId(staffId);
+			workStaffAchivesLog.setModule(module);
+			workStaffAchivesLog.setDescribes(describes);
+			workStaffAchivesLog.setFields(fields);
+			workStaffAchivesLog.setOldValue(oldValue);
+			workStaffAchivesLog.setNewValue(newValue);
+			workStaffAchivesLog.setOldKey(oldKey);
+			workStaffAchivesLog.setNewKey(newKey);
+			workStaffAchivesLog.setSonId(sonId);
+			workStaffAchivesLog.setType(type);
+			workStaffAchivesLog.setState("3");
+			workStaffAchivesLogDao.insert(workStaffAchivesLog);
+		}
+	}
 	
 	
 }

+ 10 - 0
src/main/resources/mappings/modules/workprojectnotify/WorkProjectNotifyDao.xml

@@ -1046,4 +1046,14 @@
 			status = 1
 		where notify_id = #{notifyId} and type = #{type}
 	</update>
+
+
+
+	<select id="getByNotifyIdAndNotifyUserAndTitle" resultType="WorkProjectNotify">
+		SELECT <include refid="workProjectNotifyColumns"/>
+		FROM work_project_notify a
+		<include refid="workProjectNotifyJoins"/>
+		WHERE a.notify_id = #{notifyId} AND a.notify_user = #{notifyUserId} and a.title= #{title} and a.del_flag = 0 and a.status = 0
+	</select>
+
 </mapper>

+ 16 - 2
src/main/resources/mappings/modules/workstaff/WorkStaffAchivesDao.xml

@@ -64,7 +64,8 @@
 		a.id_card_portrait_name As "idCardPortraitName",
 		a.id_card_portrait_path As "idCardPortraitPath",
 		a.id_card_national_emblem_name As "idCardNationalEmblemName",
-		a.id_card_national_emblem_path As "idCardNationalEmblemPath"
+		a.id_card_national_emblem_path As "idCardNationalEmblemPath",
+		a.audit_status as "auditStatus"
 	</sql>
 	
 	<sql id="workStaffBasicInfoJoins">
@@ -865,7 +866,20 @@
 		where id = #{id}
 	</update>
 
+	<update id="updateAuditStatus">
+		update work_staff_achives set
+			audit_status = #{status}
+		where id = #{id}
+	</update>
+
 	<select id="getHightEduByAchiveId" resultType="java.lang.String">
-		
+		select ifnull(a.edu,'') from work_staff_education a
+		left join work_staff_achives b on a.staff_id = b.id
+		<where>
+			b.del_flag = 0 and a.height_edu = 1
+			 and a.staff_id = #{achiveId}
+		</where>
+	 	order by a.create_date asc,a.school asc
+		limit 1
 	</select>
 </mapper>

+ 0 - 7
src/main/resources/mappings/modules/workstaff/WorkStaffBasicInfoDao.xml

@@ -59,7 +59,6 @@
 		a.try_out_job AS "tryOutJob",
 		a.trial_period AS "trialPeriod",
 		a.individual_resume AS "individualResume",
-		a.highest_education As "highestEducation",
 		a.hand_signature As "handSignature",
 		a.other_service_flag As "otherServiceFlag",
 		a.dd_id As "ddId",
@@ -253,9 +252,6 @@
 			<if test="achiveId != null and achiveId !=''">
 				AND a.achive_id = #{achiveId}
 			</if>
-			<if test="highestEducation != null and highestEducation !=''">
-				AND a.highest_education = #{highestEducation}
-			</if>
 			<if test="isHandSignature != null and isHandSignature !=''">
 				<choose>
 					<when test="isHandSignature == 1">
@@ -431,7 +427,6 @@
 			try_out_job,
 			trial_period,
 			individual_resume,
-			highest_education,
 			hand_signature,
 			other_service_flag,
 		    dd_id,
@@ -489,7 +484,6 @@
 			#{tryOutJob},
 			#{trialPeriod},
 			#{individualResume},
-			#{highestEducation},
 			#{handSignature},
 			#{otherServiceFlag},
 			#{ddId},
@@ -547,7 +541,6 @@
 			try_out_job = #{tryOutJob},
 			trial_period = #{trialPeriod},
 			individual_resume = #{individualResume},
-			highest_education = #{highestEducation},
 			hand_signature = #{handSignature},
 			other_service_flag = #{otherServiceFlag},
 			id_card_portrait_name = #{idCardPortraitName},

+ 16 - 0
src/main/resources/mappings/modules/workstaffachiveslog/WorkStaffAchivesLogDao.xml

@@ -197,6 +197,15 @@
 		DELETE FROM work_staff_achives_log
 		WHERE staff_id = #{staffId} and state='1'
 	</update>
+	<update id="updateBackOnTS">
+		update work_staff_achives_log
+		set state = '3'
+		WHERE staff_id = #{staffId} and state='1'
+	</update>
+	<update id="deleteTemporaryStorage">
+		DELETE FROM work_staff_achives_log
+		WHERE staff_id = #{staffId} and state='3'
+	</update>
 	<update id="deleteDirectlyBack">
 		DELETE FROM work_staff_achives_log
 		WHERE staff_id = #{staffId} and module=#{module} and state='1'
@@ -257,4 +266,11 @@
 		</where>
 		group by a.son_id
 	</select>
+
+
+	<update id="updateStatusById">
+		update work_staff_achives_log
+		set status = #{status}
+		where id = #{id}
+	</update>
 </mapper>

+ 1 - 1
src/main/webapp/webpage/modules/sys/sysHome.jsp

@@ -1158,7 +1158,7 @@
         xml = "<a  href=\"javascript:void(0)\" onclick=\"openDialogPass('${fns:getDictLabel(workProjectNotify.type, 'project_notify_type', '')}待处理', '${ctx}/workprojectnotify/workProjectNotify/form?id=${workProjectNotify.id}','95%','95%','','提交,关闭')\">";
         </c:when>
         <c:when test="${workProjectNotify.type == 69 && workProjectNotify.remarks eq '待处理'}">
-        xml = "<a  href=\"javascript:void(0)\" onclick=\"openDialogPass('${fns:getDictLabel(workProjectNotify.type, 'project_notify_type', '')}待处理', '${ctx}/workprojectnotify/workProjectNotify/form?id=${workProjectNotify.id}','95%','95%','','提交,关闭')\">";
+        xml = "<a  href=\"javascript:void(0)\" onclick=\"openDialogreOnCaseBase('${fns:getDictLabel(workProjectNotify.type, 'project_notify_type', '')}待处理', '${ctx}/workprojectnotify/workProjectNotify/form?id=${workProjectNotify.id}','95%','95%','','提交,关闭')\">";
         </c:when>
         <c:when test="${workProjectNotify.type == 113 && workProjectNotify.remarks eq '待处理'}">
         xml = "<a  href=\"javascript:void(0)\" onclick=\"openDialogreOnCaseBase('${fns:getDictLabel(workProjectNotify.type, 'project_notify_type', '')}待处理', '${ctx}/workprojectnotify/workProjectNotify/form?id=${workProjectNotify.id}','95%','95%','','提交,关闭')\">";

+ 77 - 13
src/main/webapp/webpage/modules/sys/userInfo.jsp

@@ -185,7 +185,8 @@
                             title: title,
                             maxmin: true, //开启最大化最小化按钮
                             content: url,
-                            btn: ["提交","关闭"],
+                            skin: 'three-btns',
+                            btn: ["提交","暂存","关闭"],
                             btn1: function(index, layero){
                                 var body = top.layer.getChildFrame('body', index);
                                 var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
@@ -198,13 +199,30 @@
                                 }
                                 inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
 
-                                if(iframeWin.contentWindow.doSubmit(index) ){
+                                if(iframeWin.contentWindow.doSubmit(1) ){
                                     // top.layer.close(index);//关闭对话框。
                                     setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
                                 }
                                 return false;
                             },
-                            btn2: function (index) {
+                            btn2:function(index,layero){
+                                var body = top.layer.getChildFrame('body', index);
+                                var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                                var inputForm = body.find('#inputForm');
+                                var top_iframe;
+                                if(target){
+                                    top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                                }else{
+                                    top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                                }
+                                inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                                if(iframeWin.contentWindow.doSubmit(2) ){
+                                    //top.layer.close(index);//关闭对话框。
+                                    setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                                }
+                                return false;
+                            },
+                            btn3: function (index) {
 
                             }
                         });
@@ -334,6 +352,37 @@
             };
             img.src = imgUrl;
         }
+        //图片模糊处理
+        function openLayerDimPreview(imgUrl) {
+            var img = new Image();
+            img.onload = function () {
+                var imgWidth = img.width;
+                var imgHeight = img.height;
+
+                // 最大限制,防止太大撑爆屏幕
+                var maxWidth = window.innerWidth * 0.8;
+                var maxHeight = window.innerHeight * 0.8;
+
+                // 缩放比例
+                var ratio = Math.min(maxWidth / imgWidth, maxHeight / imgHeight, 1);
+
+                var finalWidth = imgWidth * ratio;
+                var finalHeight = imgHeight * ratio;
+
+                layui.use('layer', function () {
+                    var layer = layui.layer;
+                    layer.open({
+                        type: 1,
+                        title: '图片预览',
+                        shadeClose: true,
+                        shade: 0.2,
+                        area: [finalWidth + 'px', finalHeight + 'px'],
+                        content: '<img src="' + imgUrl + '" style="width:100%;height:100%;object-fit:contain;filter: blur(5px);">'
+                    });
+                });
+            };
+            img.src = imgUrl;
+        }
     </script>
     <style>
         ul.dropdown-menu.dropdown-user li a {
@@ -645,6 +694,15 @@
                                             <input name="status" value="${workStaffBasicInfo.status}" type="text" readonly="true" class="form-control  layui-input" />
                                         </div>
                                     </div>
+                                </div>
+
+                                <div class="form-group layui-row first">
+                                    <div class="layui-item layui-col-sm6 lw7">
+                                        <label class="layui-form-label">开户银行:</label>
+                                        <div class="layui-input-block">
+                                            <input name="bankName" value="${workStaffBasicInfo.bankName}" readonly="true"  type="text" readonly="true" class="form-control  layui-input" />
+                                        </div>
+                                    </div>
                                     <div class="layui-item layui-col-sm6 lw7">
                                         <label class="layui-form-label">银行卡号:</label>
                                         <div class="layui-input-block">
@@ -769,10 +827,10 @@
                                             <span id="idCardPortraitName1">
                                               <c:if test="${not empty workStaffBasicInfo.idCardPortraitPathStr}">
                                                 <div style="position:relative; display:inline-block;">
-                                                  <img src="${workStaffBasicInfo.idCardPortraitPathStr}" width="50" height="50" style="cursor:pointer;" onclick="openLayerPreview('${workStaffBasicInfo.idCardPortraitPathStr}')" alt="身份证照片">
+                                                  <img src="${workStaffBasicInfo.idCardPortraitPathThumbnailStr}" width="50" height="50" style="cursor:pointer;" onclick="openLayerPreview('${workStaffBasicInfo.idCardPortraitPathStr}')" alt="身份证照片">
                                                 </div>
                                                   <!-- 下载按钮(重点)-->
-                                                  <a href="javascript:void(0);" title="下载 ${workStaffBasicInfo.idCardPortraitName}" style="color: #28a745; margin-left: 5px; text-decoration: none;" onclick="downloadFile('${ctx}', '${workStaffBasicInfo.idCardPortraitPath}', '${workStaffBasicInfo.idCardPortraitName}')"><i class="fa fa-download"></i></a>
+                                                  <%--<a href="javascript:void(0);" title="下载 ${workStaffBasicInfo.idCardPortraitName}" style="color: #28a745; margin-left: 5px; text-decoration: none;" onclick="downloadFile('${ctx}', '${workStaffBasicInfo.idCardPortraitPath}', '${workStaffBasicInfo.idCardPortraitName}')"><i class="fa fa-download"></i></a>--%>
                                               </c:if>
                                             </span>
                                         </div>
@@ -786,10 +844,10 @@
                                             <span id="idCardNationalEmblemName1">
                                               <c:if test="${not empty workStaffBasicInfo.idCardNationalEmblemPathStr}">
                                                 <div style="position:relative; display:inline-block;">
-                                                  <img src="${workStaffBasicInfo.idCardNationalEmblemPathStr}" width="50" height="50" style="cursor:pointer;" onclick="openLayerPreview('${workStaffBasicInfo.idCardNationalEmblemPathStr}')" alt="身份证照片">
+                                                  <img src="${workStaffBasicInfo.idCardNationalEmblemPathThumbnailStr}" width="50" height="50" style="cursor:pointer;" onclick="openLayerPreview('${workStaffBasicInfo.idCardNationalEmblemPathStr}')" alt="身份证照片">
                                                 </div>
                                                   <!-- 下载按钮 -->
-                                                  <a href="javascript:void(0);" title="下载 ${workStaffBasicInfo.idCardNationalEmblemName}" style="color: #28a745; margin-left: 5px; text-decoration: none;" onclick="downloadFile('${ctx}', '${workStaffBasicInfo.idCardNationalEmblemPath}', '${workStaffBasicInfo.idCardNationalEmblemName}')"><i class="fa fa-download"></i></a>
+                                                  <%--<a href="javascript:void(0);" title="下载 ${workStaffBasicInfo.idCardNationalEmblemName}" style="color: #28a745; margin-left: 5px; text-decoration: none;" onclick="downloadFile('${ctx}', '${workStaffBasicInfo.idCardNationalEmblemPath}', '${workStaffBasicInfo.idCardNationalEmblemName}')"><i class="fa fa-download"></i></a>--%>
 
                                               </c:if>
                                             </span>
@@ -853,9 +911,10 @@
                                                         <c:if test="${not empty education.eduPhotoStr}">
                                                             <%-- 安全处理带签名链接中的 & 符号 --%>
                                                             <c:set var="safePhotoUrl" value="${fn:replace(education.eduPhotoStr, '&', '&amp;')}" />
+                                                            <c:set var="safePhotoThumbnailUrl" value="${fn:replace(education.eduPhotoThumbnailStr, '&', '&amp;')}" />
 
                                                             <%-- 图片展示 --%>
-                                                            <img src="${safePhotoUrl}" width="24" height="24"
+                                                            <img src="${safePhotoThumbnailUrl}" width="24" height="24"
                                                                  style="cursor:pointer; vertical-align:middle;"
                                                                  onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${safePhotoUrl}','90%','90%')"
                                                                  alt="图片预览" title="点击预览图片" />
@@ -878,9 +937,10 @@
                                                         <c:if test="${not empty education.degreePhotoStr}">
                                                             <%-- 安全处理带签名链接中的 & 符号 --%>
                                                             <c:set var="safeDegreeUrl" value="${fn:replace(education.degreePhotoStr, '&', '&amp;')}" />
+                                                            <c:set var="safeDegreeThumbnailUrl" value="${fn:replace(education.degreePhotoThumbnailStr, '&', '&amp;')}" />
 
                                                             <%-- 图片展示 --%>
-                                                            <img src="${safeDegreeUrl}" width="24" height="24"
+                                                            <img src="${safeDegreeThumbnailUrl}" width="24" height="24"
                                                                  style="cursor:pointer; vertical-align:middle;"
                                                                  onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${safeDegreeUrl}','90%','90%')"
                                                                  alt="图片预览" title="点击预览图片" />
@@ -938,6 +998,7 @@
                                                         <c:if test="${not empty language.filePathStr}">
                                                             <%-- 安全处理URL中的 & --%>
                                                             <c:set var="safeFilePath" value="${fn:replace(language.filePathStr, '&', '&amp;')}" />
+                                                            <c:set var="safeFilePathThumbnail" value="${fn:replace(language.filePathThumbnailStr, '&', '&amp;')}" />
 
                                                             <%-- 先从 language.fileName 里提取扩展名 --%>
                                                             <c:set var="fileNameArr" value="${fn:split(language.fileName, '.')}" />
@@ -960,7 +1021,7 @@
                                                             </c:choose>
 
                                                             <%-- 显示图片缩略图 --%>
-                                                            <img src="${safeFilePath}" width="24" height="24"
+                                                            <img src="${safeFilePathThumbnail}" width="24" height="24"
                                                                  style="cursor:pointer; vertical-align:middle;"
                                                                  onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${safeFilePath}','90%','90%')"
                                                                  alt="文件预览" title="点击预览" />
@@ -1078,6 +1139,7 @@
                                                         <c:if test="${not empty certificate.filePathStr}">
                                                             <%-- 1. 安全处理URL中的 & --%>
                                                             <c:set var="safeFilePath" value="${fn:replace(certificate.filePathStr, '&', '&amp;')}" />
+                                                            <c:set var="safeFilePathThumbnail" value="${fn:replace(certificate.filePathThumbnailStr, '&', '&amp;')}" />
 
                                                             <%-- 2. 提取文件名 --%>
                                                             <c:choose>
@@ -1098,7 +1160,7 @@
                                                             <c:choose>
                                                                 <%-- ✅ 图片预览格式 --%>
                                                                 <c:when test="${ext == 'jpg' || ext == 'jpeg' || ext == 'png' || ext == 'gif' || ext == 'bmp' || ext == 'webp'}">
-                                                                    <img src="${safeFilePath}" width="24" height="24"
+                                                                    <img src="${safeFilePathThumbnail}" width="24" height="24"
                                                                          style="cursor:pointer; vertical-align:middle;"
                                                                          onclick="preview('预览','${safeFilePath}','90%','90%','1')"
                                                                          alt="图片预览" title="点击预览图片" />
@@ -1181,6 +1243,7 @@
                                                         <c:if test="${not empty title.filePathStr}">
                                                             <%-- 1. 安全处理URL中的 & --%>
                                                             <c:set var="safeFilePath" value="${fn:replace(title.filePathStr, '&', '&amp;')}" />
+                                                            <c:set var="safeFilePathThumbnail" value="${fn:replace(title.filePathThumbnailStr, '&', '&amp;')}" />
 
                                                             <%-- 2. 提取文件名 --%>
                                                             <c:choose>
@@ -1201,7 +1264,7 @@
                                                             <c:choose>
                                                                 <%-- ✅ 图片预览格式 --%>
                                                                 <c:when test="${ext == 'jpg' || ext == 'jpeg' || ext == 'png' || ext == 'gif' || ext == 'bmp' || ext == 'webp'}">
-                                                                    <img src="${safeFilePath}" width="24" height="24"
+                                                                    <img src="${safeFilePathThumbnail}" width="24" height="24"
                                                                          style="cursor:pointer; vertical-align:middle;"
                                                                          onclick="preview('预览','${safeFilePath}','90%','90%','1')"
                                                                          alt="图片预览" title="点击预览图片" />
@@ -1332,6 +1395,7 @@
                                                         <c:if test="${not empty training.filePathStr}">
                                                             <%-- 安全处理URL中的 & --%>
                                                             <c:set var="safeFilePath" value="${fn:replace(training.filePathStr, '&', '&amp;')}" />
+                                                            <c:set var="safeFilePathThumbnail" value="${fn:replace(training.filePathThumbnailStr, '&', '&amp;')}" />
 
                                                             <%-- 先从 training.fileName 里提取扩展名 --%>
                                                             <c:set var="fileNameArr" value="${fn:split(training.fileName, '.')}" />
@@ -1354,7 +1418,7 @@
                                                             </c:choose>
 
                                                             <%-- 显示图片缩略图 --%>
-                                                            <img src="${safeFilePath}" width="24" height="24"
+                                                            <img src="${safeFilePathThumbnail}" width="24" height="24"
                                                                  style="cursor:pointer; vertical-align:middle;"
                                                                  onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${safeFilePath}','90%','90%')"
                                                                  alt="文件预览" title="点击预览" />

+ 3 - 3
src/main/webapp/webpage/modules/workprojectnotify/workProjectNotifyList.jsp

@@ -1053,15 +1053,15 @@
                     }
                     else if(d.type == "69" && d.remarks == '待处理'){
 						if (d.isreply == "1"){
-							return "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogPass2('"+ d.type1 +"待处理', '${ctx}/workprojectnotify/workProjectNotify/form?id="+d.id+"&home=notifyList','95%','95%')\">" +
+							return "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogreOnCaseBase('"+ d.type1 +"待处理1', '${ctx}/workprojectnotify/workProjectNotify/form?id="+d.id+"&home=notifyList','95%','95%')\">" +
 									"<span title=\""+ d.title +"\" style=\"color: red;\">"+"【驳回】"+ d.title +"</span>" +
 									"</a>";
 						}else if (d.isreply == "2") {
-							return "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogPass2('"+ d.type1 +"待处理', '${ctx}/workprojectnotify/workProjectNotify/form?id="+d.id+"&home=notifyList','95%','95%')\">" +
+							return "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogreOnCaseBase('"+ d.type1 +"待处理2', '${ctx}/workprojectnotify/workProjectNotify/form?id="+d.id+"&home=notifyList','95%','95%')\">" +
 									"<span title=\""+ d.title +"\">"+"【通过】"+ d.title +"</span>" +
 									"</a>";
 						}else {
-							return "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogPass2('"+ d.type1 +"待处理', '${ctx}/workprojectnotify/workProjectNotify/form?id="+d.id+"&home=notifyList','95%','95%')\">" +
+							return "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogreOnCaseBase('"+ d.type1 +"待处理3', '${ctx}/workprojectnotify/workProjectNotify/form?id="+d.id+"&home=notifyList','95%','95%')\">" +
 									"<span title=\""+ d.title +"\">"+ d.title +"</span>" +
 									"</a>";
 						}

File diff suppressed because it is too large
+ 5 - 5
src/main/webapp/webpage/modules/workstaff/workStaffBasicCertificateModify.jsp


+ 26 - 18
src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailAudit.jsp

@@ -463,6 +463,8 @@
                                         </c:choose>
                                         <input id="picture" type="text" name="picture" style="display: none" class="basicInfo">
                                         <input id="this_upload_file_1" type="file" style="display:none"  name="pictureFile"  onchange="this_upload_show_image(1)"  class="form-control"/>
+                                        <!-- ✅ 后端路径字段(用于提交) -->
+                                        <input type="hidden" id="picture" name="picture" value="${workStaffBasicInfo.picture}">
                                     </div>
                                 </div>
                             </div>
@@ -505,6 +507,15 @@
                                 <input name="status" value="${workStaffBasicInfo.status}" type="text" readonly="true" class="form-control  layui-input" />
                             </div>
                         </div>
+                    </div>
+
+                    <div class="form-group layui-row first">
+                        <div class="layui-item layui-col-sm6 lw7">
+                            <label class="layui-form-label">开户银行:</label>
+                            <div class="layui-input-block">
+                                <input name="bankName" value="${workStaffBasicInfo.bankName}" readonly="true"  type="text" readonly="true" class="form-control  layui-input" />
+                            </div>
+                        </div>
                         <div class="layui-item layui-col-sm6 lw7">
                             <label class="layui-form-label">银行卡号:</label>
                             <div class="layui-input-block">
@@ -533,7 +544,7 @@
                         <div class="layui-item layui-col-sm6 lw7">
                             <label class="layui-form-label">户口所在地:</label>
                             <div class="layui-input-block">
-                                <form:input path="household" htmlEscape="false" class="form-control layui-input basicInfo"/>
+                                <form:input path="household" htmlEscape="false" readonly="true" class="form-control layui-input basicInfo"/>
                             </div>
                         </div>
                         <div class="layui-item layui-col-sm6 lw7">
@@ -556,14 +567,17 @@
                                 <input name="office.id" value="${workStaffBasicInfo.office.id}" type="hidden" readonly="true" class="form-control  layui-input" />
                             </div>
                         </div>
-                        <div class="layui-item layui-col-sm6 lw7">
+                        <%--<div class="layui-item layui-col-sm6 lw7">
                             <input name="roleId" value="${workStaffBasicInfo.roleId}" style="display: none"/>
                             <label class="layui-form-label"><span class="require-item">*</span>岗    位:</label>
                             <div class="layui-input-block">
                                 <input name="roleName" value="${workStaffBasicInfo.roleName}" type="text" readonly="true" class="form-control  layui-input" />
                             </div>
-                        </div>
+                        </div>--%>
 
+                    </div>
+
+                <div class="form-group layui-row first">
                     <div class="layui-item layui-col-sm6 lw7">
                         <label class="layui-form-label double-line"><span class="require-item">*</span>身份证人像面:</label>
                         <div class="layui-input-block">
@@ -571,7 +585,7 @@
                             <span id="idCardPortraitName1">
                               <c:if test="${not empty workStaffBasicInfo.idCardPortraitPathStr}">
                                 <div style="position:relative; display:inline-block;">
-                                  <img src="${workStaffBasicInfo.idCardPortraitPathStr}" width="50" height="50" style="cursor:pointer;" onclick="openLayerPreview('${workStaffBasicInfo.idCardPortraitPathStr}')" alt="身份证照片">
+                                  <img src="${workStaffBasicInfo.idCardPortraitPathThumbnailStr}" width="50" height="50" style="cursor:pointer;" onclick="openLayerPreview('${workStaffBasicInfo.idCardPortraitPathStr}')" alt="身份证照片">
                                 </div>
                                   <!-- 下载按钮(重点)-->
                                   <a href="javascript:void(0);" title="下载 ${workStaffBasicInfo.idCardPortraitName}" style="color: #28a745; margin-left: 5px; text-decoration: none;" onclick="downloadFile('${ctx}', '${workStaffBasicInfo.idCardPortraitPath}', '${workStaffBasicInfo.idCardPortraitName}')"><i class="fa fa-download"></i></a>
@@ -593,7 +607,7 @@
                             <span id="idCardNationalEmblemName1">
                               <c:if test="${not empty workStaffBasicInfo.idCardNationalEmblemPathStr}">
                                 <div style="position:relative; display:inline-block;">
-                                  <img src="${workStaffBasicInfo.idCardNationalEmblemPathStr}" width="50" height="50" style="cursor:pointer;" onclick="openLayerPreview('${workStaffBasicInfo.idCardNationalEmblemPathStr}')" alt="身份证照片">
+                                  <img src="${workStaffBasicInfo.idCardNationalEmblemPathThumbnailStr}" width="50" height="50" style="cursor:pointer;" onclick="openLayerPreview('${workStaffBasicInfo.idCardNationalEmblemPathStr}')" alt="身份证照片">
                                 </div>
                                   <!-- 下载按钮 -->
                                   <a href="javascript:void(0);" title="下载 ${workStaffBasicInfo.idCardNationalEmblemName}" style="color: #28a745; margin-left: 5px; text-decoration: none;" onclick="downloadFile('${ctx}', '${workStaffBasicInfo.idCardNationalEmblemPath}', '${workStaffBasicInfo.idCardNationalEmblemName}')"><i class="fa fa-download"></i></a>
@@ -643,12 +657,6 @@
                             <input name="workDate" value="<fmt:formatDate value="${workStaffBasicInfo.workDate}" pattern="yyyy-MM"/>" type="text" readonly="true" class="form-control  layui-input" />
                         </div>
                     </div>--%>
-                    <div class="layui-item layui-col-sm6 lw7">
-                        <label class="layui-form-label">开户银行:</label>
-                        <div class="layui-input-block">
-                            <input name="bankName" value="${workStaffBasicInfo.bankName}" type="text" readonly="true" class="form-control  layui-input" />
-                        </div>
-                    </div>
 
 
                     <%--<div class="layui-item layui-col-sm6 lw7">
@@ -739,11 +747,11 @@
                                                value="<fmt:formatDate value="${education.endDate}" pattern="yyyy-MM-dd"/>" readOnly="true" />
                                     </td>
                                     <td class="text-left op-td">
-                                        <span id="educationList${varStatus.index}_eduPhotoFileName1"><c:if test="${not empty education.eduPhotoStr}"><img src="${education.eduPhotoStr}" width="24" height="24" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${education.eduPhotoStr}','90%','90%')" alt=""></c:if></span>
+                                        <span id="educationList${varStatus.index}_eduPhotoFileName1"><c:if test="${not empty education.eduPhotoThumbnailStr}"><img src="${education.eduPhotoThumbnailStr}" width="24" height="24" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${education.eduPhotoStr}','90%','90%')" alt=""></c:if></span>
                                         <input id="educationList${varStatus.index}_eduPhotoFile" name="educationList[${varStatus.index}].eduPhotoFile" style="display:none" type="file" onchange="changeFileName(this,1)"/>
                                     </td>
                                     <td class="text-left op-td">
-                                        <span id="educationList${varStatus.index}_degreePhotoFileName1"><c:if test="${not empty education.degreePhotoStr}"><img src="${education.degreePhotoStr}" width="24" height="24" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${education.degreePhotoStr}','90%','90%')" alt=""></c:if></span>
+                                        <span id="educationList${varStatus.index}_degreePhotoFileName1"><c:if test="${not empty education.degreePhotoThumbnailStr}"><img src="${education.degreePhotoThumbnailStr}" width="24" height="24" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${education.degreePhotoStr}','90%','90%')" alt=""></c:if></span>
                                         <input id="educationList${varStatus.index}_degreePhotoFile" name="educationList[${varStatus.index}].degreePhotoFile" style="display:none" type="file" onchange="changeFileName(this,1)"/>
                                     </td>
                                 </tr>
@@ -792,7 +800,7 @@
                                                value="<fmt:formatDate value="${language.certifDate}" pattern="yyyy-MM-dd"/>" readOnly="true" />
                                     </td>
                                     <td class="text-left op-td">
-                                        <span id="languageList${varStatus.index}_fileName1"><c:if test="${not empty language.filePathStr}"><img src="${language.filePathStr}" width="24" height="24" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${language.filePathStr}','90%','90%')" alt="${language.fileName}"></c:if></span>
+                                        <span id="languageList${varStatus.index}_fileName1"><c:if test="${not empty language.filePathThumbnailStr}"><img src="${language.filePathThumbnailStr}" width="24" height="24" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${language.filePathStr}','90%','90%')" alt="${language.fileName}"></c:if></span>
                                         <input id="languageList${varStatus.index}_file" name="languageList[${varStatus.index}].file" style="display:none" type="file" onchange="changeFileName(this,1)"/>
                                     </td>
                                 </tr>
@@ -931,7 +939,7 @@
                                                                 <c:choose>
                                                                     <c:when test="${ext == 'jpg' || ext == 'jpeg' || ext == 'png' || ext == 'gif' || ext == 'bmp' || ext == 'webp'}">
                                                                         <!-- 图片预览 -->
-                                                                        <img src="${certificate.filePathStr}" width="24" height="24"
+                                                                        <img src="${certificate.filePathThumbnailStr}" width="24" height="24"
                                                                              style="cursor:pointer; vertical-align:middle;"
                                                                              onclick="preview('预览','${certificate.filePathStr}','90%','90%','1')"
                                                                              alt="图片预览" title="点击预览图片" />
@@ -1021,7 +1029,7 @@
                                                                 <c:choose>
                                                                     <c:when test="${ext == 'jpg' || ext == 'jpeg' || ext == 'png' || ext == 'gif' || ext == 'bmp' || ext == 'webp'}">
                                                                         <!-- 图片预览 -->
-                                                                        <img src="${title.filePathStr}" width="24" height="24"
+                                                                        <img src="${title.filePathThumbnailStr}" width="24" height="24"
                                                                              style="cursor:pointer; vertical-align:middle;"
                                                                              onclick="preview('预览','${title.filePathStr}','90%','90%','1')"
                                                                              alt="图片预览" title="点击预览图片" />
@@ -1152,7 +1160,7 @@
                                         <input id="trainingList${varStatus.index}_certificate" name="trainingList[${varStatus.index}].certificate" readonly="true" class="form-control required" value="${training.certificate}"/>
                                     </td>
                                     <td class="text-left op-td">
-                                        <span id="trainingList${varStatus.index}_fileName1"><c:if test="${not empty training.filePathStr}"><img src="${training.filePathStr}" width="24" height="24" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${training.filePathStr}','90%','90%')" alt=""></c:if></span>
+                                        <span id="trainingList${varStatus.index}_fileName1"><c:if test="${not empty training.filePathThumbnailStr}"><img src="${training.filePathThumbnailStr}" width="24" height="24" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${training.filePathStr}','90%','90%')" alt=""></c:if></span>
                                         <input id="trainingList${varStatus.index}_file" name="trainingList[${varStatus.index}].file" style="display:none" type="file" onchange="changeFileName(this,1)"/>
                                     </td>
                                     <td>
@@ -1340,7 +1348,7 @@
                                                                 <c:choose>
                                                                     <c:when test="${ext == 'jpg' || ext == 'jpeg' || ext == 'png' || ext == 'gif' || ext == 'bmp' || ext == 'webp'}">
                                                                         <!-- 图片预览 -->
-                                                                        <img src="${buyDetails.filePathStr}" width="24" height="24"
+                                                                        <img src="${buyDetails.filePathThumbnailStr}" width="24" height="24"
                                                                              style="cursor:pointer; vertical-align:middle;"
                                                                              onclick="preview('预览','${buyDetails.filePathStr}','90%','90%','1')"
                                                                              alt="图片预览" title="点击预览图片" />

File diff suppressed because it is too large
+ 241 - 143
src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailForm.jsp


File diff suppressed because it is too large
+ 227 - 143
src/main/webapp/webpage/modules/workstaff/workStaffBasicDetailModify.jsp


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

@@ -393,13 +393,13 @@
                         <input name="office.id" value="${workStaffBasicInfo.office.id}" type="hidden" readonly="true" class="form-control  layui-input" />
                     </div>
                 </div>
-                <div class="layui-item layui-col-sm6 lw7">
+                <%--<div class="layui-item layui-col-sm6 lw7">
                     <input name="roleId" value="${workStaffBasicInfo.roleId}" style="display: none"/>
                     <label class="layui-form-label"><span class="require-item">*</span>岗    位:</label>
                     <div class="layui-input-block">
                         <input name="roleName" value="${workStaffBasicInfo.roleName}" type="text" readonly="true" class="form-control  layui-input" />
                     </div>
-                </div>
+                </div>--%>
                 <%--<div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label"><span class="require-item">*</span>职    位:</label>
                     <div class="layui-input-block">

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

@@ -477,13 +477,13 @@
                                 <input name="office.id" value="${workStaffBasicInfo.office.id}" type="hidden" readonly="true" class="form-control  layui-input" />
                             </div>
                         </div>
-                        <div class="layui-item layui-col-sm6 lw7">
+                        <%--<div class="layui-item layui-col-sm6 lw7">
                             <input name="roleId" value="${workStaffBasicInfo.roleId}" style="display: none"/>
                             <label class="layui-form-label"><span class="require-item">*</span>岗    位:</label>
                             <div class="layui-input-block">
                                 <input name="roleName" value="${workStaffBasicInfo.roleName}" type="text" readonly="true" class="form-control  layui-input" />
                             </div>
-                        </div>
+                        </div>--%>
                 </div>
 
 

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

@@ -331,13 +331,13 @@
                             <input name="office.id" value="${workStaffBasicInfo.office.id}" type="hidden" readonly="true" class="form-control  layui-input" />
                         </div>
                     </div>
-                    <div class="layui-item layui-col-sm6 lw7">
+                    <%--<div class="layui-item layui-col-sm6 lw7">
                         <input name="roleId" value="${workStaffBasicInfo.roleId}" style="display: none"/>
                         <label class="layui-form-label"><span class="require-item">*</span>岗    位:</label>
                         <div class="layui-input-block">
                             <input name="roleName" value="${workStaffBasicInfo.roleName}" type="text" readonly="true" class="form-control  layui-input" />
                         </div>
-                    </div>
+                    </div>--%>
                 </div>
 
                 <div class="form-group layui-row">

+ 436 - 0
src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoDimissionList.jsp

@@ -0,0 +1,436 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>员工信息管理</title>
+	<meta name="decorator" content="default"/>
+    <style>
+        body{
+            background-color:transparent;
+            filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
+            color:#ffffff;
+            background-color:rgba(255,255,255,0);
+            height:100%;
+        }
+    </style>
+    <script type="text/javascript">
+        $(document).ready(function() {
+            $("#cus_name").show();
+            $("#cus_name").siblings().hide();
+            //搜索框收放
+            $('#moresee').click(function(){
+                if($('#moresees').is(':visible'))
+                {
+                    $('#moresees').slideUp(0,resizeListWindow1);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
+                }else{
+                    $('#moresees').slideDown(0,resizeListWindow1);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
+                }
+            });
+            laydate.render({
+                elem: '#beginEntryDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+            laydate.render({
+                elem: '#endEntryDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+
+        });
+
+        function openDialog(title,url,width,height,target) {
+            if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+                width = 'auto';
+                height = 'auto';
+            } else {//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: true, //开启最大化最小化按钮
+                content: url,
+                skin: 'three-btns',
+                btn: ["提交","关闭"],
+                btn1: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+
+                    if(iframeWin.contentWindow.doSubmit(index) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                    return false;
+
+
+                },
+                btn2: function (index) {
+
+                }
+            });
+        }
+
+        function adminModifuPwd(title,url,width,height,target) {
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: "修改密码",
+                content: url,
+                skin: "two-btns",
+                btn: ['确定', '关闭'],
+                yes: function (index, layero) {
+                    var body = top.layer.getChildFrame('body', index);
+                    var inputForm = $(body).find('#inputForm');
+
+
+                    // 直接从表单中获取各个输入字段的值
+                    var newPassword = inputForm.find("#newPassword").val(); // 新密码
+                    var confirmNewPassword = inputForm.find("#confirmNewPassword").val(); // 确认密码
+
+                    // 定义正则表达式
+                    var passwordRegex = /^(?=(.*[A-Z]))(?=(.*[a-z]))(?=(.*\d))|(?=(.*[A-Z]))(?=(.*[a-z]))(?=(.*[!@#$%^&*.,]))|(?=(.*[A-Z]))(?=(.*\d))(?=(.*[!@#$%^&*.,]))|(?=(.*[a-z]))(?=(.*\d))(?=(.*[!@#$%^&*.,]))[A-Za-z\d!@#$%^&*.,]{8,20}$/;
+                    var submitFlag = true;
+                    // 验证密码
+                    if (!passwordRegex.test(newPassword)) {
+                        console.error("新密码不符合要求!");
+                        parent.layer.msg("新密码必须同时包含大写、小写、数字和特殊字符中的三项,且长度在8到20位之间!",{icon:5});
+                        submitFlag = false;
+                        return; // 结束函数,不提交表单
+                    }
+
+                    // 验证确认密码
+                    if (newPassword !== confirmNewPassword) {
+                        console.error("确认密码与新密码不一致!");
+                        parent.layer.msg("确认密码与新密码不一致!",{icon:5});
+                        submitFlag = false;
+                        return; // 结束函数,不提交表单
+                    }
+
+
+                    var btn = body.find('#btnSubmit');
+                    var top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    inputForm.attr("target", top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    inputForm.validate({
+                        rules: {},
+                        messages: {
+                            confirmNewPassword: {equalTo: "输入与上面相同的密码"}
+                        },
+                        submitHandler: function (form) {
+                            loading('正在提交,请稍等...');
+                            form.submit();
+
+                        },
+                        errorContainer: "#messageBox",
+                        errorPlacement: function (error, element) {
+                            $("#messageBox").text("输入有误,请先更正。");
+                            if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
+                                error.appendTo(element.parent().parent());
+                            } else {
+                                error.insertAfter(element);
+                            }
+                        }
+                    });
+                    if (inputForm.valid()) {
+                        loading("正在提交,请稍等...");
+                        inputForm.submit();
+                        top.layer.close(index);//关闭对话框。
+                    } else {
+                        return;
+                    }
+
+
+                },
+                cancel: function (index) {
+                }
+            });
+        }
+
+        function setParentInfo(ids,names,nos,salarys){
+            return;
+        }
+	</script>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+    <sys:message content="${message}"/>
+    <div class="layui-row">
+        <div class="full-width fl">
+            <div class="contentShadow layui-row" id="queryDiv">
+            <form:form id="searchForm" modelAttribute="workStaffBasicInfo" action="${ctx}/workstaff/workStaffBasicInfoDimission/" method="post" class="form-inline">
+                <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+                <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+                <input type="hidden" input="params" value="">
+                <input id="toflag" name="toflag" type="hidden" value="1"/>
+                <table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
+                <div class="commonQuery lw6">
+                    <div class="layui-item query athird">
+                        <label class="layui-form-label">姓    名:</label>
+                        <div class="layui-input-block">
+                            <form:input path="name" htmlEscape="false" maxlength="64"  class=" form-control layui-input"/>
+                        </div>
+                    </div>
+                    <div class="layui-item query athird">
+                        <label class="layui-form-label">移动电话:</label>
+                        <div class="layui-input-block">
+                            <form:input path="mobile" htmlEscape="false" maxlength="64"  class=" form-control layui-input"/>
+                        </div>
+                    </div>
+                    <div class="layui-item athird fr">
+                        <div class="input-group">
+                            <a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
+                            <div class="layui-btn-group search-spacing">
+                                <button id="searchQuery" class="layui-btn layui-btn-sm layui-bg-blue" onclick="search()">查询</button>
+                                <button id="searchReset" class="layui-btn layui-btn-sm " onclick="resetSearch()">重置</button>
+                            </div>
+                        </div>
+                    </div>
+                    <div style="    clear:both;"></div>
+                </div>
+                <div id="moresees" style="clear:both;display:none;" class="form-group layui-row first lw12">
+                    <div class="layui-item query athird">
+                        <label class="layui-form-label">工    号:</label>
+                        <div class="layui-input-block">
+                            <form:input path="no" htmlEscape="false" maxlength="10"  class=" form-control layui-input"/>
+                        </div>
+                    </div>
+                    <div class="layui-item query athird">
+                        <label class="layui-form-label">身份证号码:</label>
+                        <div class="layui-input-block">
+                            <form:input path="idCard" htmlEscape="false" maxlength="20"  class=" form-control layui-input"/>
+                        </div>
+                    </div>
+                    <div class="layui-item query athird">
+                        <label class="layui-form-label">部门:</label>
+                        <div class="layui-input-block with-icon">
+                            <sys:treeselect id="office" name="office.id" value="${workStaffBasicInfo.office.id}" labelName="office.name" labelValue="${workStaffBasicInfo.office.name}"
+                                            title="部门" url="/sys/office/treeDataAll?type=7" cssClass="form-control layui-input required" notAllowSelectParent="false" allowInput="true"/>
+                        </div>
+                    </div>
+
+                    <div class="layui-item query athird">
+                        <label class="layui-form-label">离职日期:</label>
+                        <div class="layui-input-block readOnlyFFF">
+                            <input id="beginEntryDate" name="beginEntryDate" type="text" placeholder="开始时间" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
+                                   value="<fmt:formatDate value="${workStaffBasicInfo.beginEntryDate}" pattern="yyyy-MM-dd"/>"/>
+                            </input>
+                            <span class="group-sep">-</span>
+                            <input id="endEntryDate" name="endEntryDate" type="text" placeholder="结束时间" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
+                                   value="<fmt:formatDate value="${workStaffBasicInfo.endEntryDate}" pattern="yyyy-MM-dd"/>"/>
+                            </input>
+                        </div>
+                    </div>
+
+                </div>
+            </form:form>
+	        </div>
+	    </div>
+
+        <div class="full-width fl">
+            <div class="contentShadow layui-form contentDetails">
+                <div class="nav-btns">
+                    <div class="layui-btn-group">
+                        <shiro:hasPermission name="workstaff:workStaffBasicInfo:export">
+                            <table:exportExcel url="${ctx}/workstaff/workStaffBasicInfoDimission/exportAchive"></table:exportExcel><!-- 导出按钮 -->
+                        </shiro:hasPermission>
+                        <button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
+                    </div>
+                    <div style="clear: both;"></div>
+                </div>
+                <table class="oa-table layui-table" id="contentTable" lay-filter="tableEvent"></table>
+
+                <!-- 分页代码 -->
+                <table:page page="${page}"></table:page>
+                <div style="clear: both;"></div>
+            </div>
+        </div>
+    </div>
+    <div id="changewidth"></div>
+</div>
+<script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+<script charset="utf-8" src="${ctxStatic}/kindeditor/plugins/tableEdit/tableEdit.js"></script>
+<script>
+    $(document).ready(function() {
+
+        window.params;
+        $.ajax({
+            url:"${ctx}/workstaff/workStaffBasicInfo/getAuditUserList",
+            type:"post",
+            success:function(data){
+                params = data;
+            }
+        });
+
+    });
+    layui.use(['table','tableEdit','layer'], function () {
+        var table = layui.table,tableEdit = layui.tableEdit,$ = layui.$;
+
+        var cols = layui.table.render({
+            limit:${ page.pageSize }
+            ,elem: '#contentTable'
+            ,page: false
+            ,cols: [[
+                {checkbox: true, fixed: true},
+                {field:'index',align:'center', title: '序号',width:40}
+                ,{field:'no',align:'center', title: '工号',minWidth:100,templet:function(d){
+                        var xml = "<a class=\"attention-info\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看员工信息', '${ctx}/workstaff/workStaffBasicInfo/view?id="+d.id+"','95%','95%')\">" +
+                            "<span title=" + d.no + ">" + d.no + "</span></a>";
+                        return xml;
+                    }}
+                ,{field:'name',align:'center', title: '姓名',minWidth:100,templet:function(d){
+                    var xml = "<a class=\"attention-info\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看员工信息', '${ctx}/workstaff/workStaffBasicInfo/view?id="+d.id+"','95%','95%')\">" +
+                        "<span title=" + d.name + ">" + d.name + "</span></a>";
+                    return xml;
+                }}
+                ,{field:'idCard',align:'center', title: '身份证号码',minWidth:150}
+                ,{field:'mobile',align:'center', title: '移动电话', minWidth:100}
+                ,{field:'office',align:'center', title: '部门', minWidth:100}
+                ,{field:'role',align:'center', title: '岗位', minWidth:100}
+                /*,{field:'highestEducation',align:'center', title: '最高学历', minWidth:100}*/
+                ,{field:'status',align:'center', title: '员工状态', minWidth:80}
+                ,{field:'entryDate', align:'center',sort:true,title: '入职日期',width:100}
+                ,{field:'dimissionDate', align:'center',sort:true,title: '离职日期',width:100}
+                ,{field:'op',align:'center',title:"操作",width:260,templet:function(d){
+                        ////对操作进行初始化
+                        var xml = "<div class=\"layui-btn-group\">";
+
+                        /*if(d.canedit != undefined && d.canedit == "1"){
+                            xml +="<a href=\"javascript:void(0)\" onclick=\"openDialog('修改', '${ctx}/workstaff/workStaffBasicInfo/form?id="+ d.id + "','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 修改</a>";
+                        }
+
+                        if(d.candelete != undefined && d.candelete == "1")
+                            xml +="<a href=\"${ctx}/workstaff/workStaffBasicInfo/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除信息吗?', this.href)\"   class=\"layui-btn layui-btn-xs layui-bg-red\"> 删除</a>";
+*/
+                            xml+="</div>"
+                        return xml;
+                    }}
+            ]]
+            ,data: [
+                <c:if test="${ not empty page.list}">
+                <c:forEach items="${page.list}" var="workStaffBasicInfo" varStatus="index">
+                <c:if test="${index.index != 0}">,</c:if>
+                {
+                    "index": "${index.index+1}"
+                    ,
+                    "id": "${workStaffBasicInfo.id}"
+                    ,
+                    "auditUserId": "${workStaffBasicInfo.auditUserId}"
+                    ,
+                    "auditUserName": "${workStaffBasicInfo.auditUserName}"
+                    ,
+                    "role": "${workStaffBasicInfo.roleName}"
+                    ,
+                    "userLoginFlag": "${workStaffBasicInfo.userLoginFlag}"
+                    ,
+                    "no": "<c:out value="${workStaffBasicInfo.no}" escapeXml="true"/>"
+                    ,
+                    "name": "<c:out value="${workStaffBasicInfo.name}" escapeXml="false"/>"
+                    ,
+                    "idCard": "<c:out value="${workStaffBasicInfo.idCard}" escapeXml="true"/>"
+                    ,
+                    'mobile': "<c:out value="${workStaffBasicInfo.mobile}" escapeXml="true"/>"
+                    ,
+                    'office': "<c:out value="${workStaffBasicInfo.office.showName}" escapeXml="true"/>"
+                    ,
+                    'jobGrade': "<c:out value="${workStaffBasicInfo.jobGrade.name}" escapeXml="true"/>"
+                    ,
+                    'status': "<c:out value="${workStaffBasicInfo.status}" escapeXml="true"/>"
+                    ,
+                    "userId": "${workStaffBasicInfo.userId}"
+                    ,
+                    'highestEducation': "<c:out value="${workStaffBasicInfo.highestEducation}"/>"
+                    <%--,'ddType':"<c:out value="${workStaffBasicInfo.ddType}"/>"--%>
+                    <c:choose>
+                    <c:when test="${workStaffBasicInfo.ddType == '1'}">
+                    ,
+                    "ddType": "已加入"
+                    </c:when>
+                    <c:otherwise>
+                    ,
+                    "ddType": "未加入"
+                    </c:otherwise>
+                    </c:choose>
+
+                    ,
+                    "entryDate": "<fmt:formatDate value="${workStaffBasicInfo.entryDate}" pattern="yyyy-MM-dd"/>",
+                    "dimissionDate": "<fmt:formatDate value="${workStaffBasicInfo.entryDate}" pattern="yyyy-MM-dd"/>"
+                    <shiro:hasPermission name="workstaff:workStaffBasicInfo:edit">,
+                    "canedit": "1"</shiro:hasPermission>
+                    <shiro:hasPermission name="workstaff:workStaffBasicInfo:freeze">,
+                    "freeze": "1"</shiro:hasPermission>
+                    <shiro:hasPermission name="workstaff:workStaffBasicInfo:del">,
+                    "candelete": "1"</shiro:hasPermission>
+                }
+                </c:forEach>
+                </c:if>
+            ]
+        }).config.cols;
+
+        /* /!**
+          * 参数cols是table.render({})中的cols属性值
+          * aop代理是基于event点击事件进行操作的,
+          * 因此cols中务必开启event点击事件!
+          **!/
+         var aopTable = tableEdit.aopObj(cols); //获取一个aop对象
+         /!**
+          * 注意:
+          * 1、 aopTable.on('tool(xxx)',function (obj) {})
+          * 2、 table.on('tool(yyy)',function (obj) {})
+          * 如果1中的xxx与2中的yyy字符串相同时,
+          * 不能同时用,用了会造成后调用者覆盖前调用者。
+          * 应该直接用1来代替2,因为1中包含了2中的事件。
+          * 如果不相同,则可以同时使用。
+          **!/
+         aopTable.on('tool(tableEvent)',function (obj) {
+             var field = obj.field; //单元格字段
+             console.log(field);
+             var value = obj.value; //修改后的值
+             console.log(value);
+             var data = obj.data; //当前行旧数据
+             console.log(data);
+             var event = obj.event; //当前单元格事件属性值
+             console.log(event);
+             var update = {};
+             update[field] = value;
+             //把value更新到行中
+             obj.update(update);
+
+             $.ajax({
+                 type:'post',
+                 url:"${ctx}/workstaff/workStaffBasicInfo/updateAuditUser",
+                data:{"id":data.id,"auditUserId":value.name},
+                dataType:"json",
+                success:function(data){
+                    var data = data;
+                    parent.layer.msg(data.msg,{icon:1});
+                }
+            });
+        });*/
+
+    })
+
+    resizeListTable(130);/*消除由于有竖向滚动条造成table出现横向滚动条*/
+    $("a").on("click",addLinkVisied);
+</script>
+<script>
+    resizeListWindow1();
+    $(window).resize(function(){
+        resizeListWindow1();
+    });
+
+</script>
+</body>
+</html>

+ 418 - 0
src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoEmploymentInList.jsp

@@ -0,0 +1,418 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>员工信息管理</title>
+	<meta name="decorator" content="default"/>
+    <style>
+        body{
+            background-color:transparent;
+            filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
+            color:#ffffff;
+            background-color:rgba(255,255,255,0);
+            height:100%;
+        }
+    </style>
+    <script type="text/javascript">
+        $(document).ready(function() {
+            $("#cus_name").show();
+            $("#cus_name").siblings().hide();
+            //搜索框收放
+            $('#moresee').click(function(){
+                if($('#moresees').is(':visible'))
+                {
+                    $('#moresees').slideUp(0,resizeListWindow1);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
+                }else{
+                    $('#moresees').slideDown(0,resizeListWindow1);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
+                }
+            });
+            laydate.render({
+                elem: '#beginEntryDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+            laydate.render({
+                elem: '#endEntryDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+
+        });
+
+        function openDialog(title,url,width,height,target) {
+            if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+                width = 'auto';
+                height = 'auto';
+            } else {//如果是PC端,根据用户设置的width和height显示。
+
+            }
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: title,
+                maxmin: true, //开启最大化最小化按钮
+                content: url,
+                skin: 'three-btns',
+                btn: ["提交","关闭"],
+                btn1: function(index, layero){
+                    var body = top.layer.getChildFrame('body', index);
+                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                    var inputForm = body.find('#inputForm');
+                    var top_iframe;
+                    if(target){
+                        top_iframe = target;//如果指定了iframe,则在改frame中跳转
+                    }else{
+                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    }
+                    inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+
+                    if(iframeWin.contentWindow.doSubmit(index) ){
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+                    return false;
+
+
+                },
+                btn2: function (index) {
+
+                }
+            });
+        }
+
+        function adminModifuPwd(title,url,width,height,target) {
+            top.layer.open({
+                type: 2,
+                area: [width, height],
+                title: "修改密码",
+                content: url,
+                skin: "two-btns",
+                btn: ['确定', '关闭'],
+                yes: function (index, layero) {
+                    var body = top.layer.getChildFrame('body', index);
+                    var inputForm = $(body).find('#inputForm');
+
+
+                    // 直接从表单中获取各个输入字段的值
+                    var newPassword = inputForm.find("#newPassword").val(); // 新密码
+                    var confirmNewPassword = inputForm.find("#confirmNewPassword").val(); // 确认密码
+
+                    // 定义正则表达式
+                    var passwordRegex = /^(?=(.*[A-Z]))(?=(.*[a-z]))(?=(.*\d))|(?=(.*[A-Z]))(?=(.*[a-z]))(?=(.*[!@#$%^&*.,]))|(?=(.*[A-Z]))(?=(.*\d))(?=(.*[!@#$%^&*.,]))|(?=(.*[a-z]))(?=(.*\d))(?=(.*[!@#$%^&*.,]))[A-Za-z\d!@#$%^&*.,]{8,20}$/;
+                    var submitFlag = true;
+                    // 验证密码
+                    if (!passwordRegex.test(newPassword)) {
+                        console.error("新密码不符合要求!");
+                        parent.layer.msg("新密码必须同时包含大写、小写、数字和特殊字符中的三项,且长度在8到20位之间!",{icon:5});
+                        submitFlag = false;
+                        return; // 结束函数,不提交表单
+                    }
+
+                    // 验证确认密码
+                    if (newPassword !== confirmNewPassword) {
+                        console.error("确认密码与新密码不一致!");
+                        parent.layer.msg("确认密码与新密码不一致!",{icon:5});
+                        submitFlag = false;
+                        return; // 结束函数,不提交表单
+                    }
+
+
+                    var btn = body.find('#btnSubmit');
+                    var top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+                    inputForm.attr("target", top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+                    inputForm.validate({
+                        rules: {},
+                        messages: {
+                            confirmNewPassword: {equalTo: "输入与上面相同的密码"}
+                        },
+                        submitHandler: function (form) {
+                            loading('正在提交,请稍等...');
+                            form.submit();
+
+                        },
+                        errorContainer: "#messageBox",
+                        errorPlacement: function (error, element) {
+                            $("#messageBox").text("输入有误,请先更正。");
+                            if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
+                                error.appendTo(element.parent().parent());
+                            } else {
+                                error.insertAfter(element);
+                            }
+                        }
+                    });
+                    if (inputForm.valid()) {
+                        loading("正在提交,请稍等...");
+                        inputForm.submit();
+                        top.layer.close(index);//关闭对话框。
+                    } else {
+                        return;
+                    }
+
+
+                },
+                cancel: function (index) {
+                }
+            });
+        }
+
+        function setParentInfo(ids,names,nos,salarys){
+            return;
+        }
+	</script>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+    <sys:message content="${message}"/>
+    <div class="layui-row">
+        <div class="full-width fl">
+            <div class="contentShadow layui-row" id="queryDiv">
+            <form:form id="searchForm" modelAttribute="workStaffBasicInfo" action="${ctx}/workstaff/workStaffBasicInfo/" method="post" class="form-inline">
+                <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+                <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+                <input type="hidden" input="params" value="">
+                <input id="toflag" name="toflag" type="hidden" value="1"/>
+                <table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
+                <div class="commonQuery lw6">
+                    <div class="layui-item query athird">
+                        <label class="layui-form-label">姓    名:</label>
+                        <div class="layui-input-block">
+                            <form:input path="name" htmlEscape="false" maxlength="64"  class=" form-control layui-input"/>
+                        </div>
+                    </div>
+                    <div class="layui-item query athird">
+                        <label class="layui-form-label">移动电话:</label>
+                        <div class="layui-input-block">
+                            <form:input path="mobile" htmlEscape="false" maxlength="64"  class=" form-control layui-input"/>
+                        </div>
+                    </div>
+                    <div class="layui-item athird fr">
+                        <div class="input-group">
+                            <a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
+                            <div class="layui-btn-group search-spacing">
+                                <button id="searchQuery" class="layui-btn layui-btn-sm layui-bg-blue" onclick="search()">查询</button>
+                                <button id="searchReset" class="layui-btn layui-btn-sm " onclick="resetSearch()">重置</button>
+                            </div>
+                        </div>
+                    </div>
+                    <div style="    clear:both;"></div>
+                </div>
+                <div id="moresees" style="clear:both;display:none;" class="form-group layui-row first lw12">
+                    <div class="layui-item query athird">
+                        <label class="layui-form-label">工    号:</label>
+                        <div class="layui-input-block">
+                            <form:input path="no" htmlEscape="false" maxlength="10"  class=" form-control layui-input"/>
+                        </div>
+                    </div>
+                    <div class="layui-item query athird">
+                        <label class="layui-form-label">身份证号码:</label>
+                        <div class="layui-input-block">
+                            <form:input path="idCard" htmlEscape="false" maxlength="20"  class=" form-control layui-input"/>
+                        </div>
+                    </div>
+                    <div class="layui-item query athird">
+                        <label class="layui-form-label">部门:</label>
+                        <div class="layui-input-block with-icon">
+                            <sys:treeselect id="office" name="office.id" value="${workStaffBasicInfo.office.id}" labelName="office.name" labelValue="${workStaffBasicInfo.office.name}"
+                                            title="部门" url="/sys/office/treeDataAll?type=7" cssClass="form-control layui-input required" notAllowSelectParent="false" allowInput="true"/>
+                        </div>
+                    </div>
+                    <div class="layui-item query athird">
+                        <label class="layui-form-label">是否有手签章:</label>
+                        <div class="layui-input-block">
+                            <form:select path="isHandSignature" class="form-control simple-select">
+                                <form:option value="" label=""/>
+                                <form:options items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+                            </form:select>
+                        </div>
+                    </div>
+
+                    <div class="layui-item query athird">
+                        <label class="layui-form-label">入职日期:</label>
+                        <div class="layui-input-block readOnlyFFF">
+                            <input id="beginEntryDate" name="beginEntryDate" type="text" placeholder="开始时间" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
+                                   value="<fmt:formatDate value="${workStaffBasicInfo.beginEntryDate}" pattern="yyyy-MM-dd"/>"/>
+                            </input>
+                            <span class="group-sep">-</span>
+                            <input id="endEntryDate" name="endEntryDate" type="text" placeholder="结束时间" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
+                                   value="<fmt:formatDate value="${workStaffBasicInfo.endEntryDate}" pattern="yyyy-MM-dd"/>"/>
+                            </input>
+                        </div>
+                    </div>
+                </div>
+            </form:form>
+	        </div>
+	    </div>
+
+        <div class="full-width fl">
+            <div class="contentShadow layui-form contentDetails">
+                <div class="nav-btns">
+                    <div class="layui-btn-group">
+                        <shiro:hasPermission name="workstaff:workStaffBasicInfo:add">
+                            <table:addRow url="${ctx}/workstaff/workStaffBasicInfo/form" title="员工信息"></table:addRow><!-- 增加按钮 -->
+                        </shiro:hasPermission>
+                        <shiro:hasPermission name="workstaff:workStaffBasicInfo:export">
+                            <table:exportExcel url="${ctx}/workstaff/workStaffBasicInfoEmploymentIn/exportAchive"></table:exportExcel><!-- 导出按钮 -->
+                        </shiro:hasPermission>
+                        <button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
+                    </div>
+                    <div style="clear: both;"></div>
+                </div>
+                <table class="oa-table layui-table" id="contentTable" lay-filter="tableEvent"></table>
+
+                <!-- 分页代码 -->
+                <table:page page="${page}"></table:page>
+                <div style="clear: both;"></div>
+            </div>
+        </div>
+    </div>
+    <div id="changewidth"></div>
+</div>
+<script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+<script charset="utf-8" src="${ctxStatic}/kindeditor/plugins/tableEdit/tableEdit.js"></script>
+<script>
+    $(document).ready(function() {
+
+        window.params;
+        $.ajax({
+            url:"${ctx}/workstaff/workStaffBasicInfo/getAuditUserList",
+            type:"post",
+            success:function(data){
+                params = data;
+            }
+        });
+
+    });
+    layui.use(['table','tableEdit','layer'], function () {
+        var table = layui.table,tableEdit = layui.tableEdit,$ = layui.$;
+
+        var cols = layui.table.render({
+            limit:${ page.pageSize }
+            ,elem: '#contentTable'
+            ,page: false
+            ,cols: [[
+                {checkbox: true, fixed: true},
+                {field:'index',align:'center', title: '序号',width:40}
+                ,{field:'no',align:'center', title: '工号',minWidth:100,templet:function(d){
+                        var xml = "<a class=\"attention-info\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看员工信息', '${ctx}/workstaff/workStaffBasicInfo/view?id="+d.id+"','95%','95%')\">" +
+                            "<span title=" + d.no + ">" + d.no + "</span></a>";
+                        return xml;
+                    }}
+                ,{field:'name',align:'center', title: '姓名',minWidth:100,templet:function(d){
+                    var xml = "<a class=\"attention-info\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看员工信息', '${ctx}/workstaff/workStaffBasicInfo/view?id="+d.id+"','95%','95%')\">" +
+                        "<span title=" + d.name + ">" + d.name + "</span></a>";
+                    return xml;
+                }}
+                ,{field:'idCard',align:'center', title: '身份证号码',minWidth:150}
+                ,{field:'mobile',align:'center', title: '移动电话', minWidth:100}
+                ,{field:'office',align:'center', title: '部门', minWidth:100}
+                ,{field:'role',align:'center', title: '岗位', minWidth:100}
+                /*,{field:'highestEducation',align:'center', title: '最高学历', minWidth:100}*/
+                ,{field:'status',align:'center', title: '员工状态', minWidth:80}
+                /*,{field:'ddType',align:'center', title: '是否已加入钉钉', minWidth:80}*/
+                ,{field:'entryDate', align:'center',sort:true,title: '入职日期',width:100}
+                ,{field:'op',align:'center',title:"操作",width:260,templet:function(d){
+                        ////对操作进行初始化
+                        var xml = "<div class=\"layui-btn-group\">";
+
+                        if(d.canedit != undefined && d.canedit == "1"){
+                            xml +="<a href=\"javascript:void(0)\" onclick=\"openDialog('修改', '${ctx}/workstaff/workStaffBasicInfo/form?id="+ d.id + "','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 修改</a>";
+                        }
+
+                        if(d.freeze != undefined && d.freeze == "1"){
+                            if(d.userLoginFlag == 1){
+                                xml +="<a href=\"${ctx}/workstaff/workStaffBasicInfo/freeze?userId=" + d.userId + "\" onclick=\"return confirmx('确认要禁用该人员信息吗?', this.href)\"   class=\"layui-btn layui-btn-xs layui-btn-warm\"> 禁用</a>";
+                            }else{
+                                xml +="<a href=\"${ctx}/workstaff/workStaffBasicInfo/freeze?userId=" + d.userId + "\" onclick=\"return confirmx('确认要激活该人员信息吗?', this.href)\"   class=\"layui-btn layui-btn-xs layui-btn-normal\"> 激活</a>";
+                            }
+                        }
+
+                        if(d.candelete != undefined && d.candelete == "1")
+                            xml +="<a href=\"${ctx}/workstaff/workStaffBasicInfo/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除信息吗?', this.href)\"   class=\"layui-btn layui-btn-xs layui-bg-red\"> 删除</a>";
+
+                        if(d.canedit != undefined && d.canedit == "1"){
+                            xml +="<a href=\"${ctx}/sys/user/removeRedis?userId=" + d.userId + "\" onclick=\"return confirmx('确认要清除登录缓存吗?', this.href)\"   class=\"layui-btn layui-btn-xs layui-bg-green\"> 清除登录缓存</a>";
+                        }
+                            xml+="</div>"
+                        return xml;
+                    }}
+            ]]
+            ,data: [
+                <c:if test="${ not empty page.list}">
+                <c:forEach items="${page.list}" var="workStaffBasicInfo" varStatus="index">
+                <c:if test="${index.index != 0}">,</c:if>
+                {
+                    "index": "${index.index+1}"
+                    ,
+                    "id": "${workStaffBasicInfo.id}"
+                    ,
+                    "auditUserId": "${workStaffBasicInfo.auditUserId}"
+                    ,
+                    "auditUserName": "${workStaffBasicInfo.auditUserName}"
+                    ,
+                    "role": "${workStaffBasicInfo.roleName}"
+                    ,
+                    "userLoginFlag": "${workStaffBasicInfo.userLoginFlag}"
+                    ,
+                    "no": "<c:out value="${workStaffBasicInfo.no}" escapeXml="true"/>"
+                    ,
+                    "name": "<c:out value="${workStaffBasicInfo.name}" escapeXml="false"/>"
+                    ,
+                    "idCard": "<c:out value="${workStaffBasicInfo.idCard}" escapeXml="true"/>"
+                    ,
+                    'mobile': "<c:out value="${workStaffBasicInfo.mobile}" escapeXml="true"/>"
+                    ,
+                    'office': "<c:out value="${workStaffBasicInfo.office.showName}" escapeXml="true"/>"
+                    ,
+                    'jobGrade': "<c:out value="${workStaffBasicInfo.jobGrade.name}" escapeXml="true"/>"
+                    ,
+                    'status': "<c:out value="${workStaffBasicInfo.status}" escapeXml="true"/>"
+                    ,
+                    "userId": "${workStaffBasicInfo.userId}"
+                    ,
+                    'highestEducation': "<c:out value="${workStaffBasicInfo.highestEducation}"/>"
+                    <%--,'ddType':"<c:out value="${workStaffBasicInfo.ddType}"/>"--%>
+                    <c:choose>
+                    <c:when test="${workStaffBasicInfo.ddType == '1'}">
+                    ,
+                    "ddType": "已加入"
+                    </c:when>
+                    <c:otherwise>
+                    ,
+                    "ddType": "未加入"
+                    </c:otherwise>
+                    </c:choose>
+
+                    ,
+                    "entryDate": "<fmt:formatDate value="${workStaffBasicInfo.entryDate}" pattern="yyyy-MM-dd"/>"
+                    <shiro:hasPermission name="workstaff:workStaffBasicInfo:edit">,
+                    "canedit": "1"</shiro:hasPermission>
+                    <shiro:hasPermission name="workstaff:workStaffBasicInfo:freeze">,
+                    "freeze": "1"</shiro:hasPermission>
+                    <shiro:hasPermission name="workstaff:workStaffBasicInfo:del">,
+                    "candelete": "1"</shiro:hasPermission>
+                }
+                </c:forEach>
+                </c:if>
+            ]
+        }).config.cols;
+
+
+    })
+
+    resizeListTable(130);
+    $("a").on("click",addLinkVisied);
+</script>
+<script>
+    resizeListWindow1();
+    $(window).resize(function(){
+        resizeListWindow1();
+    });
+
+
+</script>
+</body>
+</html>

+ 1 - 1
src/main/webapp/webpage/modules/workstaff/workStaffBasicInfoList.jsp

@@ -357,7 +357,7 @@
                 ,{field:'mobile',align:'center', title: '移动电话', minWidth:100}
                 ,{field:'office',align:'center', title: '部门', minWidth:100}
                 ,{field:'role',align:'center', title: '岗位', minWidth:100}
-                /*,{field:'highestEducation',align:'center', title: '最高学历', minWidth:100}*/
+                ,{field:'highestEducation',align:'center', title: '最高学历', minWidth:100}
                 // ,{field:'jobGrade',align:'center', title: '职级', minWidth:100}
                 /*,{field:'auditUserName',align:'center', title: '校审人员', minWidth:100
                     ,event:'auditUserId',config:{type:'select',data:params,verify:true}