|
|
@@ -0,0 +1,44 @@
|
|
|
+package com.lc.ibps.platform.plan.job;
|
|
|
+
|
|
|
+import com.lc.ibps.base.core.util.AppUtil;
|
|
|
+import com.lc.ibps.base.framework.table.ICommonDao;
|
|
|
+import com.lc.ibps.cloud.message.util.MessageQueueProductorUtil;
|
|
|
+import com.lc.ibps.components.quartz.BaseJob2;
|
|
|
+import org.quartz.JobExecutionContext;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+public class SmpStorAndDisposalNotifiJob extends BaseJob2 {
|
|
|
+ private static final Logger logger = LoggerFactory.getLogger(EquipmentMaintenancePlanJob.class);
|
|
|
+ private ICommonDao<?> commonDao = AppUtil.getBean(ICommonDao.class);
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void executeJob(JobExecutionContext context) throws Exception {
|
|
|
+ logger.warn("-------------------SmpStorAndDisposalNotifiJob.start-------------------");
|
|
|
+ List<Map<String, Object>> employeeInfoList = (List<Map<String, Object>>)commonDao.query(
|
|
|
+ "select ID_,NAME_ from ibps_party_employee where STATUS_ ='actived' and (POSITIONS_ is not null and POSITIONS_ !='')");
|
|
|
+ //转换接收人ID
|
|
|
+ List<String> receiver = employeeInfoList.stream()
|
|
|
+ .map(map -> (String) map.get("ID_"))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ //转换接收人姓名
|
|
|
+ List<String> receiverNames = employeeInfoList.stream()
|
|
|
+ .map(map -> (String) map.get("NAME_"))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ String title = "标本保存和弃置消息提醒";
|
|
|
+ String neiRong = "请确认今日是否有待处理的标本需要进行保存或者弃置";
|
|
|
+ String biaoBenDiDian ="检验过程管理/样品保存和弃置";
|
|
|
+ String content = "<p style=\"font-weight: 600; font-size: 24px; text-align: center; margin-bottom: 20px;\"></p>" +
|
|
|
+ "<p><strong>一、通知主题</strong></p><p style=\"margin: 0 0 10px 32px;\">"+neiRong +
|
|
|
+ "<p><strong>二、标本处理菜单地址</strong></p><p style=\"margin: 0 0 10px 32px\">"+biaoBenDiDian+"</p>";
|
|
|
+
|
|
|
+ MessageQueueProductorUtil.send("SmpStorAndDisposalNotifiJob", "system" , "inner", receiver,null , title, content, null, null, null);
|
|
|
+ logger.warn("SmpStorAndDisposalNotifiJob.receiver{}已发送消息提醒",receiverNames);
|
|
|
+ logger.warn("-------------------SmpStorAndDisposalNotifiJob.end-------------------");
|
|
|
+ }
|
|
|
+}
|