Kaynağa Gözat

Merge remote-tracking branch 'origin/matser' into matser

ZhuJiaHao 4 ay önce
ebeveyn
işleme
84db9cbea8

+ 18 - 7
ibps-provider-root/modules/provider-platform/src/main/java/com/lc/ibps/platform/plan/job/EquipmentMaintenancePlanJob.java

@@ -92,14 +92,16 @@ public class EquipmentMaintenancePlanJob  extends AbstractJob {
 
     private String getDeptRelatPusher(Map data,Map sbglxzfzrMap) {
         String sbDept = data.get("bian_zhi_bu_men_").toString();
-        String sbglyID = "";
-        String sbglxzfzrID = "";
+        String sbglyID = "sbglyID";           //设备管理员
+        String sbglxzfzrID = "sbglxzfzrID";   //设备管理组组长id
+        String zhsfzrID = "zhsfzrID";         //专业组组长id
+
         String Level3Sbglxzfzr ="";//三级部门推送要加上名下所有四级部门的设备管理组长角色
         Boolean deptLevel3 = false;
         Boolean deptLevel4 = true;//默认只存在四级部门
         String result = "";
         //1.0 获取设备管理员和设备管理组长角色ID
-        String roleIdsSql = "SELECT ROLE_ALIAS_,ID_ FROM ibps_party_role WHERE ROLE_ALIAS_ IN ('sbgly','sbglxzfzr')";
+        String roleIdsSql = "SELECT ROLE_ALIAS_,ID_ FROM ibps_party_role WHERE ROLE_ALIAS_ IN ('sbgly','sbglxzfzr','zhsfzr')";
 
 
         List<Map<String, Object>> equipList = (List<Map<String, Object>>) commonDao.query(roleIdsSql);
@@ -111,6 +113,9 @@ public class EquipmentMaintenancePlanJob  extends AbstractJob {
                 if("sbglxzfzr".equals(role.get("ROLE_ALIAS_"))){
                     sbglxzfzrID = (String) role.get("ID_");
                 }
+                if("zhsfzr".equals(role.get("ROLE_ALIAS_"))){
+                    zhsfzrID = (String) role.get("ID_");
+                }
             }
         }
 
@@ -141,17 +146,17 @@ public class EquipmentMaintenancePlanJob  extends AbstractJob {
         //3.0 查找不到指定推送人则推送所有人
         String pusherIdsSql = "select GROUP_CONCAT(ID_ SEPARATOR ',') as id_concat,\n" +
                 " GROUP_CONCAT(NAME_ SEPARATOR ',') as name_concat from ibps_party_employee where POSITIONS_ like '%"+sbDept+"%' " +
-                "and (JOB_ like '%"+sbglyID+"%' or JOB_ like '%"+sbglxzfzrID+"%')";//指定部门的推送人
+                "and (JOB_ like '%"+sbglyID+"%' or JOB_ like '%"+sbglxzfzrID+"%' or JOB_ like '%"+zhsfzrID+"%')";//指定部门的推送人
         Map<String, Object> pusherIds =  commonDao.queryOne(pusherIdsSql);
 
         if (BeanUtils.isEmpty(pusherIds) ||
                 BeanUtils.isEmpty(pusherIds.get("id_concat"))) {
             if(deptLevel4){
-                logger.warn("查询不到四级编制部门为:{},角色ID包含{},或者{}的账号数据", sbDept,sbglyID,sbglxzfzrID);
+                logger.warn("查询不到四级编制部门为:{},角色ID包含{},或者{},或者{}的账号数据", sbDept,sbglyID,sbglxzfzrID,zhsfzrID);
                 return "";
             }
             if(deptLevel3 && allSbglxzfzrMap.isEmpty()){
-                logger.warn("查询不到三级编制部门为:{},角色ID包含{},或者{}的账号数据", sbDept,sbglyID,sbglxzfzrID);
+                logger.warn("查询不到三级编制部门为:{},角色ID包含{},或者{},或者{}的账号数据,{}", sbDept,sbglyID,sbglxzfzrID,zhsfzrID);
                 return "";
             }
         }
@@ -167,7 +172,13 @@ public class EquipmentMaintenancePlanJob  extends AbstractJob {
                 .collect(Collectors.joining(","));
         return result;
     }
-
+    /**
+     * 获取所有四级部门 设备管理组组长
+     * @param sbDept 三级部门ID
+     * @param sbglxzfzrID 设备管理组组长id
+     * @param sbglxzfzrCacheMap 设备管理组组长缓存集合
+     * @return 设备管理组组长集合
+     */
     private Map<String, String> getAllSbglxzfzr(String sbDept, String sbglxzfzrID, Map sbglxzfzrCacheMap) {
         //获取三级部门下所有的部门
         Map<String, String> sbglxzfzrMap = new HashMap<>();

+ 44 - 0
ibps-provider-root/modules/provider-platform/src/main/java/com/lc/ibps/platform/plan/job/SmpStorAndDisposalNotifiJob.java

@@ -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>" +"<br>"+
+                "<p style=\"margin: 0 0 10px 32px;\">"+neiRong +
+                "<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-------------------");
+    }
+}