Browse Source

修改人员筛选离职与否

lwx_dev
erdanergou 2 years ago
parent
commit
7176bede55
  1. 4
      src/main/java/com/dreamchaser/depository_manage/controller/CompanyController.java
  2. 38
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java
  3. 24
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java
  4. 32
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java
  5. 17
      src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java
  6. 8
      src/main/java/com/dreamchaser/depository_manage/service/impl/SplitUnitServiceImpl.java

4
src/main/java/com/dreamchaser/depository_manage/controller/CompanyController.java

@ -259,6 +259,10 @@ public class CompanyController {
Integer success = 0; Integer success = 0;
if (map.containsKey("depositoryId")) { if (map.containsKey("depositoryId")) {
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype();
if(emptype > 10){
continue;
}
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
param.put("userId", userByPort.getId()); param.put("userId", userByPort.getId());
param.put("depositoryId", map.get("depositoryId")); param.put("depositoryId", map.get("depositoryId"));

38
src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java

@ -994,19 +994,43 @@ public class DepositoryController {
token = (String) request.getSession().getAttribute("userToken"); token = (String) request.getSession().getAttribute("userToken");
userKey = (String) request.getSession().getAttribute("userKey"); userKey = (String) request.getSession().getAttribute("userKey");
} }
UserByPort userToken = AuthenticationTokenPool.getUserToken(token);
List<Integer> userIdByDid = roleService.findUserIdByDid(did); // 用于查询对应的管理员权限
List<UserByPortP> list = new ArrayList<>(); Map<String, Object> paramForUserManager = new HashMap<>();
for (Integer integer : userIdByDid) { paramForUserManager.put("depositoryId", did);
UserByPort userByPort = PublicConfig.FindUserById(integer, userKey, token); List<UserByPort> list = new ArrayList<>();
;
List<RoleAndDepository> roleAndDepositoryByCondition = roleService.findRoleAndDepositoryByCondition(paramForUserManager);
for (RoleAndDepository roleAndDepository : roleAndDepositoryByCondition) {
int classes = roleAndDepository.getClasses();
Integer userId = roleAndDepository.getUserId();
if (classes == 1) {
// 如果是对人设置的权限
UserByPort userByPort = PublicConfig.FindUserById(userId, userKey, token);
// 获取用户的用工关系
int emptype = userByPort.getEmptype();
if (emptype > 10) {
continue;
}
list.add(userByPort);
} else {
// 如果是对岗位
// 定义用于获取当前岗位下的人的参数map
Map<String, Object> paramForGetUserByPost = new HashMap<>();
paramForGetUserByPost.put("position", userId);
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token);
for (UserByPort userByPort : userByPortList) {
// 获取用户的用工关系 // 获取用户的用工关系
int emptype = userByPort.getEmptype(); int emptype = userByPort.getEmptype();
if (emptype > 10) { if (emptype > 10) {
continue; continue;
} }
UserByPortP user = new UserByPortP(userByPort); list.add(userByPort);
list.add(user);
} }
}
}
int size = list.size(); int size = list.size();
return new RestResponse(list, size, 200); return new RestResponse(list, size, 200);
} }

24
src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java

@ -480,6 +480,10 @@ public class DepositoryRecordController {
paramForGetUserByPost.put("position", uid); paramForGetUserByPost.put("position", uid);
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, null, null); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, null, null);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype();
if(emptype > 10){
continue;
}
String workwechat = userByPort.getWorkwechat(); String workwechat = userByPort.getWorkwechat();
if (workwechat == null || "".equals(workwechat)) { if (workwechat == null || "".equals(workwechat)) {
workwechat = userByPort.getWechat(); workwechat = userByPort.getWechat();
@ -537,6 +541,10 @@ public class DepositoryRecordController {
paramForGetUserByPost.put("position", uid); paramForGetUserByPost.put("position", uid);
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, finalUserKey, finalToken); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, finalUserKey, finalToken);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype();
if(emptype > 10){
continue;
}
String workwechat = userByPort.getWorkwechat(); String workwechat = userByPort.getWorkwechat();
if (workwechat == null || "".equals(workwechat)) { if (workwechat == null || "".equals(workwechat)) {
workwechat = userByPort.getWechat(); workwechat = userByPort.getWechat();
@ -1766,6 +1774,10 @@ public class DepositoryRecordController {
paramForGetUserByPost.put("position", uid); paramForGetUserByPost.put("position", uid);
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, finalUserkey, finalUsertoken); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, finalUserkey, finalUsertoken);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype();
if(emptype > 10){
continue;
}
String workwechat = userByPort.getWorkwechat(); String workwechat = userByPort.getWorkwechat();
if (workwechat == null || "".equals(workwechat)) { if (workwechat == null || "".equals(workwechat)) {
workwechat = userByPort.getWechat(); workwechat = userByPort.getWechat();
@ -1826,6 +1838,10 @@ public class DepositoryRecordController {
paramForGetUserByPost.put("position", uid); paramForGetUserByPost.put("position", uid);
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, finalUserkey, finalUsertoken); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, finalUserkey, finalUsertoken);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype();
if(emptype > 10){
continue;
}
String workwechat = userByPort.getWorkwechat(); String workwechat = userByPort.getWorkwechat();
if (workwechat == null || "".equals(workwechat)) { if (workwechat == null || "".equals(workwechat)) {
workwechat = userByPort.getWechat(); workwechat = userByPort.getWechat();
@ -2057,6 +2073,10 @@ public class DepositoryRecordController {
paramForGetUserByPost.put("position", uid); paramForGetUserByPost.put("position", uid);
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, finalUserkey, finalUsertoken); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, finalUserkey, finalUsertoken);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype();
if(emptype > 10){
continue;
}
String workwechat = userByPort.getWorkwechat(); String workwechat = userByPort.getWorkwechat();
if (workwechat == null || "".equals(workwechat)) { if (workwechat == null || "".equals(workwechat)) {
workwechat = userByPort.getWechat(); workwechat = userByPort.getWechat();
@ -2112,6 +2132,10 @@ public class DepositoryRecordController {
paramForGetUserByPost.put("position", uid); paramForGetUserByPost.put("position", uid);
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, finalUserkey, finalUsertoken); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, finalUserkey, finalUsertoken);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype();
if(emptype > 10){
continue;
}
String workwechat = userByPort.getWorkwechat(); String workwechat = userByPort.getWorkwechat();
if (workwechat == null || "".equals(workwechat)) { if (workwechat == null || "".equals(workwechat)) {
workwechat = userByPort.getWechat(); workwechat = userByPort.getWechat();

32
src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java

@ -750,6 +750,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
paramForGetUserByPost.put("position", roleAndDepository.getUserId()); paramForGetUserByPost.put("position", roleAndDepository.getUserId());
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, null, null); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, null, null);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype();
if(emptype > 10){
continue;
}
approverId.append(userByPort.getId()).append(","); approverId.append(userByPort.getId()).append(",");
} }
} }
@ -785,6 +789,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
paramForGetUserByPost.put("position", uid); paramForGetUserByPost.put("position", uid);
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, null, null); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, null, null);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype();
if(emptype > 10){
continue;
}
approverId.append(userByPort.getId()).append(","); approverId.append(userByPort.getId()).append(",");
} }
} }
@ -2513,6 +2521,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 获取当前岗位对应的人员 // 获取当前岗位对应的人员
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token);
for (UserByPort userByPort1 : userByPortList) { for (UserByPort userByPort1 : userByPortList) {
int emptype = userByPort1.getEmptype();
if(emptype > 10){
continue;
}
Integer userId1 = userByPort1.getId(); Integer userId1 = userByPort1.getId();
// 修改redis中用户的数据 // 修改redis中用户的数据
updateRedisDataForUserManager(userId1, minRecordKey); updateRedisDataForUserManager(userId1, minRecordKey);
@ -2587,6 +2599,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
paramForGetUserByPost.put("position", roleAndDepository.getUserId()); paramForGetUserByPost.put("position", roleAndDepository.getUserId());
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token);
for (UserByPort userByPort1 : userByPortList) { for (UserByPort userByPort1 : userByPortList) {
int emptype = userByPort1.getEmptype();
if(emptype > 10){
continue;
}
Integer userId1 = userByPort1.getId(); Integer userId1 = userByPort1.getId();
// 修改redis中用户的数据 // 修改redis中用户的数据
updateRedisDataForUserManager(userId1, minRecordKey); updateRedisDataForUserManager(userId1, minRecordKey);
@ -3588,6 +3604,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
paramForGetUserByPost.put("position", roleAndMaterialType.getUid()); paramForGetUserByPost.put("position", roleAndMaterialType.getUid());
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype();
if(emptype > 10){
continue;
}
Integer userId = userByPort.getId(); Integer userId = userByPort.getId();
// 修改redis中用户的数据 // 修改redis中用户的数据
updateRedisDataForUserManager(userId, minRecordKey); updateRedisDataForUserManager(userId, minRecordKey);
@ -3671,6 +3691,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
paramForGetUserByPost.put("position", roleAndDepository.getUserId()); paramForGetUserByPost.put("position", roleAndDepository.getUserId());
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype();
if(emptype > 10){
continue;
}
Integer userId = userByPort.getId(); Integer userId = userByPort.getId();
// 修改redis中用户的数据 // 修改redis中用户的数据
updateRedisDataForUserManager(userId, minRecordKey); updateRedisDataForUserManager(userId, minRecordKey);
@ -4091,6 +4115,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
paramForGetUserByPost.put("position", roleAndMaterialType.getUid()); paramForGetUserByPost.put("position", roleAndMaterialType.getUid());
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token);
for (UserByPort userByPort1 : userByPortList) { for (UserByPort userByPort1 : userByPortList) {
int emptype = userByPort1.getEmptype();
if(emptype > 10){
continue;
}
Integer userId = userByPort1.getId(); Integer userId = userByPort1.getId();
// 修改redis中用户的数据 // 修改redis中用户的数据
updateRedisDataForUserManager(userId, minRecordKey); updateRedisDataForUserManager(userId, minRecordKey);
@ -4173,6 +4201,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
paramForGetUserByPost.put("position", roleAndDepository.getUserId()); paramForGetUserByPost.put("position", roleAndDepository.getUserId());
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token);
for (UserByPort userByPort1 : userByPortList) { for (UserByPort userByPort1 : userByPortList) {
int emptype = userByPort1.getEmptype();
if(emptype > 10){
continue;
}
Integer userId = userByPort1.getId(); Integer userId = userByPort1.getId();
// 修改redis中用户的数据 // 修改redis中用户的数据
updateRedisDataForUserManager(userId, minRecordKey); updateRedisDataForUserManager(userId, minRecordKey);

17
src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java

@ -1974,6 +1974,10 @@ public class QyWxOperationService {
paramForGetUserByPost.put("position", userId); paramForGetUserByPost.put("position", userId);
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype();
if(emptype > 10){
continue;
}
// 获取企业微信id或微信id // 获取企业微信id或微信id
String userByPortWorkwechat = userByPort.getWorkwechat(); String userByPortWorkwechat = userByPort.getWorkwechat();
if (userByPortWorkwechat == null || "".equals(userByPortWorkwechat)) { if (userByPortWorkwechat == null || "".equals(userByPortWorkwechat)) {
@ -2029,7 +2033,10 @@ public class QyWxOperationService {
paramForGetUserByPost.put("position", userId); paramForGetUserByPost.put("position", userId);
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype();
if(emptype > 10){
continue;
}
// 获取企业微信id或微信id // 获取企业微信id或微信id
String userByPortWorkwechat = userByPort.getWorkwechat(); String userByPortWorkwechat = userByPort.getWorkwechat();
if (userByPortWorkwechat == null || "".equals(userByPortWorkwechat)) { if (userByPortWorkwechat == null || "".equals(userByPortWorkwechat)) {
@ -2494,6 +2501,10 @@ public class QyWxOperationService {
paramForGetUserByPost.put("position", roleAndMaterialType.getUid()); paramForGetUserByPost.put("position", roleAndMaterialType.getUid());
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype();
if(emptype > 10){
continue;
}
String userByPortWorkwechat = userByPort.getWorkwechat(); String userByPortWorkwechat = userByPort.getWorkwechat();
if (userByPortWorkwechat == null || "".equals(userByPortWorkwechat)) { if (userByPortWorkwechat == null || "".equals(userByPortWorkwechat)) {
userByPortWorkwechat = userByPort.getWechat(); userByPortWorkwechat = userByPort.getWechat();
@ -2557,6 +2568,10 @@ public class QyWxOperationService {
paramForGetUserByPost.put("position", roleAndDepository.getUserId()); paramForGetUserByPost.put("position", roleAndDepository.getUserId());
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, userKey, token);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype();
if(emptype > 10){
continue;
}
String userByPortWorkwechat = userByPort.getWorkwechat(); String userByPortWorkwechat = userByPort.getWorkwechat();
if (userByPortWorkwechat == null || "".equals(userByPortWorkwechat)) { if (userByPortWorkwechat == null || "".equals(userByPortWorkwechat)) {
userByPortWorkwechat = userByPort.getWechat(); userByPortWorkwechat = userByPort.getWechat();

8
src/main/java/com/dreamchaser/depository_manage/service/impl/SplitUnitServiceImpl.java

@ -137,6 +137,10 @@ public class SplitUnitServiceImpl implements SplitUnitService {
paramForGetUserByPost.put("position", roleAndDepository.getUserId()); paramForGetUserByPost.put("position", roleAndDepository.getUserId());
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, null, null); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, null, null);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype();
if(emptype > 10){
continue;
}
approverId.append(userByPort.getId()).append(","); approverId.append(userByPort.getId()).append(",");
} }
} }
@ -169,6 +173,10 @@ public class SplitUnitServiceImpl implements SplitUnitService {
paramForGetUserByPost.put("position", uid); paramForGetUserByPost.put("position", uid);
List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, null, null); List<UserByPort> userByPortList = PublicConfig.FindUserByMap(paramForGetUserByPost, null, null);
for (UserByPort userByPort : userByPortList) { for (UserByPort userByPort : userByPortList) {
int emptype = userByPort.getEmptype();
if(emptype > 10){
continue;
}
approverId.append(userByPort.getId()).append(","); approverId.append(userByPort.getId()).append(",");
} }
} }

Loading…
Cancel
Save