|
@@ -2,6 +2,10 @@ package com.rongwei.trainingcommon.sys.service.impl;
|
|
|
|
|
|
import cn.hutool.core.thread.ExecutorBuilder;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.rongwei.rwadmincommon.system.domain.SysUserDo;
|
|
|
+import com.rongwei.rwadmincommon.system.service.SysUserOrgService;
|
|
|
+import com.rongwei.rwadmincommon.system.vo.SysUserVo;
|
|
|
import com.rongwei.rwcommon.base.BaseDo;
|
|
|
import com.rongwei.rwcommon.utils.StringUtils;
|
|
|
import com.rongwei.safecommon.utils.CXCommonUtils;
|
|
@@ -23,10 +27,10 @@ import java.util.concurrent.ThreadPoolExecutor;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
-import static com.rongwei.safecommon.utils.SaveConstans.DEFAULT_SEPARATOR;
|
|
|
import static com.rongwei.safecommon.utils.SaveConstans.NotifyContent.*;
|
|
|
import static com.rongwei.safecommon.utils.SaveConstans.NotifyTitle.*;
|
|
|
-import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.*;
|
|
|
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.TRAINING;
|
|
|
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.TRAININGFORM;
|
|
|
|
|
|
/**
|
|
|
* SendNotifyService class
|
|
@@ -51,6 +55,12 @@ public class TrainingSendNotifyServiceImpl implements TrainingSendNotifyService
|
|
|
private SendMailServiceImpl sendMailService;
|
|
|
@Autowired
|
|
|
private EmpExamService empExamService;
|
|
|
+ @Autowired
|
|
|
+ private SysUserOrgService userOrgService;
|
|
|
+ @Autowired
|
|
|
+ private TrainingSendNotifyServiceImpl sendNotifyService;
|
|
|
+ @Autowired
|
|
|
+ private TrainingDemandSurveyBackupsServiceImpl demandSurveyBackupsService;
|
|
|
|
|
|
|
|
|
// 培训计划已发布
|
|
@@ -103,14 +113,65 @@ public class TrainingSendNotifyServiceImpl implements TrainingSendNotifyService
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 定时提醒为产于培训人员产于培训
|
|
|
+ *
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ * @date 2023/12/19 17:58
|
|
|
+ * @author shangmi
|
|
|
+ *
|
|
|
+ */
|
|
|
+
|
|
|
@Override
|
|
|
public void trainingPlan() {
|
|
|
-
|
|
|
+ List<PlanDo> planDos = planService.list(new QueryWrapper<PlanDo>().lambda().eq(BaseDo::getDeleted, "0"));
|
|
|
+ Map<PlanDo, Set<String>> planDoSetHashMap = new HashMap<>();
|
|
|
+ planDos.forEach(planDo -> {
|
|
|
+ // 参与部门
|
|
|
+ String orgIds = planDo.getIncludingorgids();
|
|
|
+ // 参与员工
|
|
|
+ String empids = planDo.getTrainingempids();
|
|
|
+ // 排除员工
|
|
|
+ String excludeempids = planDo.getExcludeempids();
|
|
|
+ Set<String> empIdSet = new HashSet<>();
|
|
|
+ if (StringUtils.isNotBlank(orgIds)) {
|
|
|
+ // 根据组织机构获取 该机构下的所有员工信息
|
|
|
+ List<SysUserVo> deptUsersByDeptIds = userOrgService.getDeptUsersByDeptIds(Arrays.asList(orgIds.split(",")));
|
|
|
+ // 取出员工id
|
|
|
+ empIdSet = deptUsersByDeptIds.stream().map(SysUserDo::getId).collect(Collectors.toSet());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(empids)) {
|
|
|
+ // 将参与员工的组织机构加入
|
|
|
+ empIdSet.addAll(Arrays.asList(empids.split(",")));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(excludeempids)) {
|
|
|
+ empIdSet.removeAll(Arrays.asList(excludeempids.split(",")));
|
|
|
+ }
|
|
|
+ planDoSetHashMap.put(planDo, empIdSet);
|
|
|
+ });
|
|
|
+ /**
|
|
|
+ * 发送提醒通知
|
|
|
+ */
|
|
|
+ sendTrainingPlanNotify(planDoSetHashMap);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 提示产于问卷调查
|
|
|
+ *
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ * @date 2023/12/19 17:58
|
|
|
+ * @author shangmi
|
|
|
+ *
|
|
|
+ */
|
|
|
+
|
|
|
@Override
|
|
|
public void questionnaireSurvey() {
|
|
|
-
|
|
|
+ List<TrainingDemandSurveyBackupsDo> list = demandSurveyBackupsService.list(new LambdaQueryWrapper<TrainingDemandSurveyBackupsDo>()
|
|
|
+ .eq(BaseDo::getDeleted, 0)
|
|
|
+ .isNotNull(TrainingDemandSurveyBackupsDo::getNoparticipatinguserid));
|
|
|
+ sendQuestionnaireSurveyNotify(list);
|
|
|
}
|
|
|
|
|
|
/**
|