Explorar o código

修复 代办-个人经历-数据重复

user4 %!s(int64=5) %!d(string=hai) anos
pai
achega
7eb6654b3d

+ 2 - 0
src/main/java/com/jeeplus/modules/sys/dao/RoleDao.java

@@ -89,4 +89,6 @@ public interface RoleDao extends CrudDao<Role> {
 	public String getRoleIdByUserId(String userId);
 
 	public Role getRoleByUserId(String userId);
+
+	int updateRoleByUserId(@Param("roleId") String roleId,@Param("userId") String userId);
 }

+ 3 - 1
src/main/java/com/jeeplus/modules/workofficechange/service/WorkOfficeChangeService.java

@@ -156,7 +156,7 @@ public class WorkOfficeChangeService extends CrudService<WorkOfficeChangeDao, Wo
 	@Transactional(readOnly = false)
 	public void updateWorkOfficeChangeList(WorkOfficeChange workOfficeChange) {
 		if (workOfficeChange.getWorkOfficeChangeUserList() != null && workOfficeChange.getWorkOfficeChangeUserList().size() > 0) {
-			for (WorkOfficeChangeUser workOfficeChangeUser : workOfficeChange.getWorkOfficeChangeUserList()) {
+            for (WorkOfficeChangeUser workOfficeChangeUser : workOfficeChange.getWorkOfficeChangeUserList()) {
 				if (StringUtils.isBlank(workOfficeChangeUser.getId())) {
 					if (StringUtils.isNotBlank(workOfficeChangeUser.getBasicInfoId())) {
 						workOfficeChangeUser.preInsert();
@@ -190,6 +190,8 @@ public class WorkOfficeChangeService extends CrudService<WorkOfficeChangeDao, Wo
 				workStaffBasicInfoDao.updateJobGradeByUserId(userId,jobGradeId);
 				String officeId = workOfficeChangeUser.getOfficeId();
 				workStaffBasicInfoDao.updateOfficeByUserId(userId,officeId);
+                //新岗位
+                roleDao.updateRoleByUserId(workOfficeChange.getRoleId(),userId);
 			}
 		}
 	}

+ 1 - 2
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffAchievementService.java

@@ -101,8 +101,7 @@ public class WorkStaffAchievementService extends CrudService<WorkStaffAchievemen
             return;
         }
         WorkStaffAchievement entity = new WorkStaffAchievement();
-//        entity.setStaff(workStaffBasicInfo.getId());
-        entity.setStaff(workStaffBasicInfo.getAchiveId());
+        entity.setStaff(workStaffBasicInfo.getId());
         workStaffBasicInfo.setAchievementList(this.findList(entity));
     }
     private static Map<String,String> EDU_MAP = Maps.newHashMap();//教育经历

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

@@ -203,7 +203,6 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
             user.setId(workStaffBasicInfo.getUserId());
             user.setName(workStaffBasicInfo.getName());
             user.setMobile(workStaffBasicInfo.getMobile());
-            user.setPhone(workStaffBasicInfo.getPhone());
             user.setLoginName(workStaffBasicInfo.getMobile());
             user.setComId(workStaffBasicInfo.getCompany().getId());
             user.setCompany(workStaffBasicInfo.getCompany());
@@ -213,6 +212,9 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
         }else{
             userService.insertRole(workStaffBasicInfo);
         }
+        //需要逻辑删除数据库中档案表id关联的教育经历等信息
+//        workStaffBasicInfo.setId(workStaffBasicInfo.getAchiveId());
+//        this.deleteDetailById(workStaffBasicInfo);
 	}
 
     /**
@@ -229,12 +231,15 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
         workStaffBasicInfo.setAchiveId(workStaffBasicInfo.getId());
         workStaffBasicInfo.setId(staffId);
         super.save(workStaffBasicInfo);
-        if (StringUtils.isNotBlank(workStaffBasicInfo.getPhone())) {
-            User user = new User();
-            user.setId(workStaffBasicInfo.getUserId());
-            user.setPhone(workStaffBasicInfo.getPhone());
-            userService.updateUser(user);
-        }
+//        this.saveDetails(workStaffBasicInfo,false);
+//        if (workStaffBasicInfo.getPhone() != null) {
+//            User user = new User();
+//            user.setId(workStaffBasicInfo.getUserId());
+//            user.setPhone(workStaffBasicInfo.getPhone());
+//            userService.updateUser(user);
+//        }
+        //需要逻辑删除数据库中员工id关联的教育经历等信息
+//        this.deleteDetailById(workStaffBasicInfo);
     }
     public void preSave(WorkStaffBasicInfo workStaffBasicInfo, HttpServletRequest request) throws IOException {
         if(workStaffBasicInfo.getCompany()==null){

+ 1 - 2
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffCertificateService.java

@@ -148,8 +148,7 @@ public class WorkStaffCertificateService extends CrudService<WorkStaffCertificat
             return;
         }
         WorkStaffCertificate entity = new WorkStaffCertificate();
-        entity.setStaffId(workStaffBasicInfo.getAchiveId());
-//        entity.setStaffId(workStaffBasicInfo.getId());
+        entity.setStaffId(workStaffBasicInfo.getId());
         workStaffBasicInfo.setCertificateList(this.findList(entity));
     }
     private static Map<String,String> EDU_MAP = Maps.newHashMap();//教育经历

+ 3 - 10
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffEducationService.java

@@ -48,11 +48,8 @@ public class WorkStaffEducationService extends CrudService<WorkStaffEducationDao
     private WorkStaffAchivesLogService workStaffAchivesLogService;
     @Autowired
     private UserDao userDao;
-    @Autowired
-    private WorkStaffEducationDao workStaffEducationDao;
-
 
-    public WorkStaffEducation get(String id) {
+	public WorkStaffEducation get(String id) {
 		return super.get(id);
 	}
 	
@@ -141,7 +138,7 @@ public class WorkStaffEducationService extends CrudService<WorkStaffEducationDao
             }
             try {
                 OSSClientUtil ossUtil = new OSSClientUtil();
-                String path = Global.getStaffBasicFilePath()+ DateUtils.formatDate(new Date(), (Object) null)+"/";
+                String path = Global.getStaffBasicFilePath()+ DateUtils.formatDate(new Date(),null)+"/";
                 String newName = System.currentTimeMillis()+"-"+file.getOriginalFilename();
                 ossUtil.uploadFile2OSS(file.getInputStream(),path,newName);
                 return  Global.getAliDownloadUrl() + "/" + path + newName;
@@ -157,8 +154,7 @@ public class WorkStaffEducationService extends CrudService<WorkStaffEducationDao
             return;
         }
         WorkStaffEducation entity = new WorkStaffEducation();
-//        entity.setStaff(workStaffBasicInfo.getId());
-        entity.setStaff(workStaffBasicInfo.getAchiveId());
+        entity.setStaff(workStaffBasicInfo.getId());
         workStaffBasicInfo.setEducationList(this.findList(entity));
     }
 
@@ -502,7 +498,4 @@ public class WorkStaffEducationService extends CrudService<WorkStaffEducationDao
             }
         }
     }
-
-
-
 }

+ 1 - 2
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffExperienceService.java

@@ -102,8 +102,7 @@ public class WorkStaffExperienceService extends CrudService<WorkStaffExperienceD
             return;
         }
         WorkStaffExperience entity = new WorkStaffExperience();
-        entity.setStaffId(workStaffBasicInfo.getAchiveId());
-//        entity.setStaffId(workStaffBasicInfo.getId());
+        entity.setStaffId(workStaffBasicInfo.getId());
         workStaffBasicInfo.setExperienceList(this.findList(entity));
     }
     private static Map<String,String> EDU_MAP = Maps.newHashMap();//工作经历

+ 1 - 2
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffFamilyService.java

@@ -102,8 +102,7 @@ public class WorkStaffFamilyService extends CrudService<WorkStaffFamilyDao, Work
             return;
         }
         WorkStaffFamily entity = new WorkStaffFamily();
-//        entity.setStaff(workStaffBasicInfo.getId());
-        entity.setStaff(workStaffBasicInfo.getAchiveId());
+        entity.setStaff(workStaffBasicInfo.getId());
         workStaffBasicInfo.setFamilyList(this.findList(entity));
     }
     private static Map<String,String> EDU_MAP = Maps.newHashMap();//教育经历

+ 1 - 2
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffLanguagesService.java

@@ -149,8 +149,7 @@ public class WorkStaffLanguagesService extends CrudService<WorkStaffLanguagesDao
             return;
         }
         WorkStaffLanguages entity = new WorkStaffLanguages();
-//        entity.setStaffId(workStaffBasicInfo.getId());
-        entity.setStaffId(workStaffBasicInfo.getAchiveId());
+        entity.setStaffId(workStaffBasicInfo.getId());
         workStaffBasicInfo.setLanguageList(this.findList(entity));
     }
 

+ 1 - 2
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffRecordService.java

@@ -150,8 +150,7 @@ public class WorkStaffRecordService extends CrudService<WorkStaffRecordDao, Work
             return;
         }
         WorkStaffRecord entity = new WorkStaffRecord();
-//        entity.setStaff(workStaffBasicInfo.getId());
-        entity.setStaff(workStaffBasicInfo.getAchiveId());
+        entity.setStaff(workStaffBasicInfo.getId());
         workStaffBasicInfo.setRecordList(this.findList(entity));
     }
     private static Map<String,String> EDU_MAP = Maps.newHashMap();//教育经历

+ 1 - 2
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffRewardsService.java

@@ -102,8 +102,7 @@ public class WorkStaffRewardsService extends CrudService<WorkStaffRewardsDao, Wo
             return;
         }
         WorkStaffRewards entity = new WorkStaffRewards();
-//        entity.setStaff(workStaffBasicInfo.getId());
-        entity.setStaff(workStaffBasicInfo.getAchiveId());
+        entity.setStaff(workStaffBasicInfo.getId());
         workStaffBasicInfo.setRewardsList(this.findList(entity));
     }
     private static Map<String,String> EDU_MAP = Maps.newHashMap();//教育经历

+ 1 - 2
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffSocialPositionService.java

@@ -102,8 +102,7 @@ public class WorkStaffSocialPositionService extends CrudService<WorkStaffSocialP
             return;
         }
         WorkStaffSocialPosition entity = new WorkStaffSocialPosition();
-//        entity.setStaff(workStaffBasicInfo.getId());
-        entity.setStaff(workStaffBasicInfo.getAchiveId());
+        entity.setStaff(workStaffBasicInfo.getId());
         workStaffBasicInfo.setSocialPositionList(this.findList(entity));
     }
     private static Map<String,String> EDU_MAP = Maps.newHashMap();//教育经历

+ 1 - 2
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffTitleService.java

@@ -149,8 +149,7 @@ public class WorkStaffTitleService extends CrudService<WorkStaffTitleDao, WorkSt
             return;
         }
         WorkStaffTitle entity = new WorkStaffTitle();
-//        entity.setStaffId(workStaffBasicInfo.getId());
-        entity.setStaffId(workStaffBasicInfo.getAchiveId());
+        entity.setStaffId(workStaffBasicInfo.getId());
         workStaffBasicInfo.setTitleList(this.findList(entity));
     }
 

+ 1 - 2
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffTrainingService.java

@@ -149,8 +149,7 @@ public class WorkStaffTrainingService extends CrudService<WorkStaffTrainingDao,
             return;
         }
         WorkStaffTraining entity = new WorkStaffTraining();
-//        entity.setStaff(workStaffBasicInfo.getId());
-        entity.setStaff(workStaffBasicInfo.getAchiveId());
+        entity.setStaff(workStaffBasicInfo.getId());
         workStaffBasicInfo.setTrainingList(this.findList(entity));
     }
 

+ 6 - 0
src/main/resources/mappings/modules/sys/RoleDao.xml

@@ -596,4 +596,10 @@
 		on r.id = ur.role_id
 		where ur.user_id = #{userId}
 	</select>
+
+	<update id="updateRoleByUserId">
+		update sys_user_role
+		set role_id = #{roleId}
+		where user_id = #{userId}
+	</update>
 </mapper>