|
@@ -12,6 +12,7 @@ import com.huaxu.evaluation.vo.EvaluationItemValueVo;
|
|
|
import com.huaxu.evaluation.vo.EvaluationItemVo;
|
|
|
import com.huaxu.evaluation.vo.EvaluationResultTaskDetailsVo;
|
|
|
import com.huaxu.exception.ServiceException;
|
|
|
+import com.huaxu.model.AjaxMessage;
|
|
|
import com.huaxu.order.dao.WorkOrderManageMapper;
|
|
|
import com.huaxu.order.dto.WorkOrderManageDto;
|
|
|
import com.huaxu.task.entity.UserEntity;
|
|
@@ -71,7 +72,7 @@ public class EvaluationResultJob {
|
|
|
/**
|
|
|
* 运维类型
|
|
|
*/
|
|
|
- private static final String OPERATION_TYPE = "3";
|
|
|
+ private static final int OPERATION_TYPE = 3;
|
|
|
|
|
|
/**
|
|
|
* 保存考评项目设置
|
|
@@ -81,11 +82,11 @@ public class EvaluationResultJob {
|
|
|
/**
|
|
|
* 保存用户ID
|
|
|
*/
|
|
|
- static Map<String, List<Integer>> userIdsMap = new HashMap<>();
|
|
|
+ static Map<String, List<UserEntity>> userInfoMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
/***
|
|
|
- * @Scheduled(cron = "0/5 * * * * ?")
|
|
|
+ * @Scheduled(cron = "0/5 * * * * ?")
|
|
|
* 异步启动定时任务
|
|
|
* @Author lihui
|
|
|
* @Date 18:26 2021/5/17
|
|
@@ -142,17 +143,11 @@ public class EvaluationResultJob {
|
|
|
List<EvaluationItemVo> itemEntityList = null;
|
|
|
Integer cycle = evaluationCycleEntity.getType();
|
|
|
// 查询该租户公司下的所有用户
|
|
|
- List<Integer> userIds = getUserIds(evaluationCycleEntity.getTenantId(), evaluationCycleEntity.getCompanyOrgId());
|
|
|
- Map<Long, UserEntity> userEntityMap = toMap(userIds);
|
|
|
- if (userEntityMap == null) {
|
|
|
+ List<UserEntity> userEntityList = getUserInfo(evaluationCycleEntity.getTenantId(), evaluationCycleEntity.getCompanyOrgId());
|
|
|
+ if (userEntityList == null) {
|
|
|
return;
|
|
|
}
|
|
|
- for (Integer userId : userIds) {
|
|
|
- UserEntity userEntity = userEntityMap.get(Long.parseLong(userId.toString()));
|
|
|
- // 过滤掉不是运维的用户
|
|
|
- if (userEntity == null || !OPERATION_TYPE.equals(userEntity.getUserType())) {
|
|
|
- continue;
|
|
|
- }
|
|
|
+ for (UserEntity userEntity : userEntityList) {
|
|
|
itemEntityList = findItem(userEntity);
|
|
|
// 1.获取部门考评项设置,如果未设置直接过滤
|
|
|
// 2.判断部门考评项目设置里面有没有设置对应的考评周期,没有就直接过滤
|
|
@@ -176,12 +171,12 @@ public class EvaluationResultJob {
|
|
|
* @param companyOrgId : 公司id
|
|
|
* @return java.util.List<java.lang.Integer>
|
|
|
**/
|
|
|
- private List<Integer> getUserIds(String tenantId, Integer companyOrgId){
|
|
|
+ private List<UserEntity> getUserInfo(String tenantId, Integer companyOrgId){
|
|
|
String key = tenantId + "_" + companyOrgId;
|
|
|
- List<Integer> result = userIdsMap.get(key);
|
|
|
+ List<UserEntity> result = userInfoMap.get(key);
|
|
|
if (result == null){
|
|
|
- result = userCenterClient.findUserIdsByPermissonOrg(tenantId, companyOrgId, null);
|
|
|
- userIdsMap.put(key, result);
|
|
|
+ result = userCenterClient.findAllUserList(companyOrgId, tenantId, OPERATION_TYPE);
|
|
|
+ userInfoMap.put(key, result);
|
|
|
}
|
|
|
return result;
|
|
|
}
|