Kaynağa Gözat

[task-1674]日常表单未填写时下午下班前提醒对应岗位的人/【后端】每天下午提醒未作保养的设备

szjbdgzl 2 yıl önce
ebeveyn
işleme
676579fd42

+ 1 - 1
ibps-provider-root/modules/provider-bpmn/src/main/java/com/lc/ibps/office/provider/BpmInitiatedProvider.java

@@ -1527,7 +1527,7 @@ public class BpmInitiatedProvider extends GenericProvider implements IBpmInitiat
 				List<Map<String,Object>> object3 =
 				List<Map<String,Object>> object3 =
 						(List<Map<String, Object>>) commonDao.query("SELECT COUNT(1) AS total" +
 						(List<Map<String, Object>>) commonDao.query("SELECT COUNT(1) AS total" +
 								"	FROM v_facs_summary_daily facs, ibps_party_employee emp" +
 								"	FROM v_facs_summary_daily facs, ibps_party_employee emp" +
-								"	WHERE FIND_IN_SET(bian_zhi_bu_men_,emp.positions_) AND emp.id_=#{p0}" , new String[]{currentUserId});
+								"	WHERE shi_fou_guo_shen_='待处理' and FIND_IN_SET(bian_zhi_bu_men_,emp.positions_) AND emp.id_=#{p0}" , new String[]{currentUserId});
 				infobox2.setDataText(object3.get(0).get("total").toString());
 				infobox2.setDataText(object3.get(0).get("total").toString());
 				list.add(infobox2);
 				list.add(infobox2);
 			} catch (Exception e) {
 			} catch (Exception e) {

+ 19 - 4
ibps-provider-root/modules/provider-platform/src/main/java/com/lc/ibps/platform/plan/job/DeviceToDoRemindJob.java

@@ -43,13 +43,30 @@ public class DeviceToDoRemindJob extends BaseJob2 {
                 long count = (long)total.get("total");
                 long count = (long)total.get("total");
                 if (count>0){
                 if (count>0){
                     // 发系统消息给对应的专业组组长
                     // 发系统消息给对应的专业组组长
-                    this.sendLeaders(deptId,count);
+                    this.sendLeaders(deptId,"设备维护保养提醒","您的专业组有"+count+"条待处理的设备维护保养记录,请通知相关人员及时处理!");
+                }
+            }
+        }
+
+        // 设施环境待处理推送
+        String sshjSql = "select facs_type,bian_zhi_bu_men_ from v_facs_summary_daily where shi_fou_guo_shen_ ='待处理' GROUP BY bian_zhi_bu_men_";
+        List<Map<String, Object>> bumen = (List<Map<String, Object>>)commonDao.query(sshjSql);
+        if (BeanUtils.isNotEmpty(bumen)){
+            for (Map<String,Object> map : bumen){
+                String deptId = map.get("bian_zhi_bu_men_").toString();
+                String taskName = map.get("facs_type").toString();
+                taskName = taskName.substring(3);
+                Map<String,Object> total = commonDao.queryOne("select count(1) total from v_facs_summary_daily where bian_zhi_bu_men_ ='"+deptId+"'");
+                long count = (long)total.get("total");
+                if (count>0){
+                    // 发系统消息给对应的专业组组长
+                    this.sendLeaders(deptId,taskName+"待处理提醒","您的专业组有"+count+"条待处理的"+taskName+"记录,请通知相关人员及时处理!");
                 }
                 }
             }
             }
         }
         }
     }
     }
 
 
-    private void sendLeaders(String deptId,long total){
+    private void sendLeaders(String deptId,String subject ,String content){
         String SQL2 = "select *from v_professional_leader where id_ in(select id_ from ibps_party_employee where positions_ like '%%%s%%')";
         String SQL2 = "select *from v_professional_leader where id_ in(select id_ from ibps_party_employee where positions_ like '%%%s%%')";
         SQL2 = String.format(SQL2,deptId);
         SQL2 = String.format(SQL2,deptId);
         List<Map<String, Object>> leads = (List<Map<String, Object>>)commonDao.query(SQL2);
         List<Map<String, Object>> leads = (List<Map<String, Object>>)commonDao.query(SQL2);
@@ -57,8 +74,6 @@ public class DeviceToDoRemindJob extends BaseJob2 {
             for (Map<String,Object> lead : leads){
             for (Map<String,Object> lead : leads){
                 List<String> receiver = new ArrayList<>();
                 List<String> receiver = new ArrayList<>();
                 receiver.add(lead.get("ID_").toString());
                 receiver.add(lead.get("ID_").toString());
-                String subject = "设备维护保养提醒";
-                String content = "您的专业组有"+total+"条待处理的设备维护保养记录,请通知相关人员及时处理!";
                 MessageQueueProductorUtil.send("DeviceToDoRemindJob", "DeviceToDoRemindJob" , "inner" , receiver,null , subject, content, null, null, null);
                 MessageQueueProductorUtil.send("DeviceToDoRemindJob", "DeviceToDoRemindJob" , "inner" , receiver,null , subject, content, null, null, null);
                 //TODO 消息模版
                 //TODO 消息模版
             }
             }