|
@@ -3,12 +3,14 @@ package com.rongwei.trainingcommon.sys.service.impl;
|
|
|
import cn.hutool.core.thread.ExecutorBuilder;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.rongwei.rwcommon.base.BaseDo;
|
|
|
+import com.rongwei.rwcommon.base.R;
|
|
|
import com.rongwei.rwcommon.utils.StringUtils;
|
|
|
import com.rongwei.safecommon.utils.CXCommonUtils;
|
|
|
import com.rongwei.training.domain.EmpExamDo;
|
|
|
import com.rongwei.training.domain.PlanDo;
|
|
|
import com.rongwei.training.domain.PlanPaperDo;
|
|
|
import com.rongwei.training.domain.TrainingDemandSurveyBackupsDo;
|
|
|
+import com.rongwei.trainingcommon.sys.dao.DangerousDao;
|
|
|
import com.rongwei.trainingcommon.sys.service.EmpExamService;
|
|
|
import com.rongwei.trainingcommon.sys.service.PlanPaperService;
|
|
|
import com.rongwei.trainingcommon.sys.service.PlanService;
|
|
@@ -23,8 +25,7 @@ import java.util.concurrent.ThreadPoolExecutor;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
-import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.TRAINING;
|
|
|
-import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.TRAININGFORM;
|
|
|
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.*;
|
|
|
|
|
|
/**
|
|
|
* SendNotifyService class
|
|
@@ -44,6 +45,8 @@ public class SendNotifyServiceImpl implements SendNotifyService {
|
|
|
@Autowired
|
|
|
private PlanService planService;
|
|
|
@Autowired
|
|
|
+ private DangerousDao dangerousDao;
|
|
|
+ @Autowired
|
|
|
private PlanPaperService planPaperService;
|
|
|
@Autowired
|
|
|
private SendMailServiceImpl sendMailService;
|
|
@@ -57,8 +60,11 @@ public class SendNotifyServiceImpl implements SendNotifyService {
|
|
|
public static final String CANCEL_TRAIN_TITLE = "培训取消提醒";
|
|
|
public static final String CANCEL_TRAIN_CONTENT = "%s已取消";
|
|
|
|
|
|
- public static final String QUESTIONNAIRE_SURVEY_TITLE="培训需求调查提醒";
|
|
|
- public static final String QUESTIONNAIRE_SURVEY_CONTENT="%s年%s培训需求,已发布";
|
|
|
+ public static final String QUESTIONNAIRE_SURVEY_TITLE = "培训需求调查提醒";
|
|
|
+ public static final String QUESTIONNAIRE_SURVEY_CONTENT = "%s年%s培训需求,已发布";
|
|
|
+ public static final String DANGEROUS_TITLE = "危险作业处罚提醒";
|
|
|
+ public static final String DANGEROUS_CONTENT = "%s:%s-%s,处罚金额:%s,时间:%s";
|
|
|
+
|
|
|
|
|
|
// 培训计划已发布
|
|
|
private static final String TRAINING_PLAN_PUBLISH = "y";
|
|
@@ -161,4 +167,41 @@ public class SendNotifyServiceImpl implements SendNotifyService {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 危险作业每日处罚提醒
|
|
|
+ */
|
|
|
+ public void dangerousDailyNotify() {
|
|
|
+ List<Map<String, Object>> dangerous = dangerousDao.getDangerousDailyNotify();
|
|
|
+ if (dangerous != null) {
|
|
|
+ for (Map<String, Object> item : dangerous) {
|
|
|
+ String punishPersonnelId = (String) item.get("PUNISHPERSONNELID");
|
|
|
+ List<String> personnelIdList = new ArrayList<>();
|
|
|
+ personnelIdList.add(punishPersonnelId);
|
|
|
+ CXCommonUtils.sendNotify(DANGEROUS_TITLE, String.format(DANGEROUS_CONTENT,
|
|
|
+ item.get("JOBTYPE"), item.get("ASSIGNMENTTIMESTART"), item.get("ASSIGNMENTTIMEEND"),
|
|
|
+ item.get("PENALTYAMOUNT"), item.get("MODIFYDATE")),
|
|
|
+ "", personnelIdList, null, DANGEROUS);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 危险作业处罚提醒
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public R sendDangerousTimelyNotify(String id) {
|
|
|
+ Map<String, Object> dangerous = dangerousDao.getDangerousNotify(id);
|
|
|
+ if (dangerous != null) {
|
|
|
+ String punishPersonnelId = (String) dangerous.get("PUNISHPERSONNELID");
|
|
|
+ List<String> personnelIdList = new ArrayList<>();
|
|
|
+ personnelIdList.add(punishPersonnelId);
|
|
|
+ CXCommonUtils.sendNotify(DANGEROUS_TITLE, String.format(DANGEROUS_CONTENT,
|
|
|
+ dangerous.get("JOBTYPE"), dangerous.get("ASSIGNMENTTIMESTART"), dangerous.get("ASSIGNMENTTIMEEND"),
|
|
|
+ dangerous.get("PENALTYAMOUNT"), dangerous.get("MODIFYDATE")),
|
|
|
+ "", personnelIdList, null, DANGEROUS);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
}
|