Browse Source

消息通知

yuansh 1 tuần trước cách đây
mục cha
commit
c1d6c9bb92

+ 71 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/controller/IncidentTicketController.java

@@ -167,6 +167,7 @@ public class IncidentTicketController {
 		String informant = incidentTicket.getInformant();//填报人
 		String processor = incidentTicket.getProcessor();//处理人
 		String responsibilityPerson1 = incidentTicket.getResponsibilityPerson1();//责任人
+		Integer frequency = incidentTicket.getFrequency();//临时使用,查询是否超期
 
 		String handle = incidentTicket.getHandle();
 		incidentTicket.setAccidentDataEnd(null);
@@ -176,10 +177,26 @@ public class IncidentTicketController {
 		incidentTicket.setInformant(null);
 		incidentTicket.setHandle(null);
 		incidentTicket.setResponsibilityPerson1(null);
+		incidentTicket.setFrequency(null);
 
 		QueryWrapper<IncidentTicket> queryWrapper = QueryGenerator.initQueryWrapper(incidentTicket, req.getParameterMap());
 		queryWrapper.eq("1","1");
 
+		if(frequency != null){
+			if(frequency.equals(1)){
+//				queryWrapper.apply("frequency + frequency1 + frequency2 + frequency3 > 0");
+				queryWrapper.apply("frequency = 1");
+				queryWrapper.ne("state","6");
+
+			}else if(frequency.equals(2)){
+				queryWrapper.apply("frequency > 1");
+				queryWrapper.ne("state","6");
+
+			}else{
+				queryWrapper.apply("frequency < 1");
+			}
+
+		}
         if(StringUtils.isNotBlank(responsibilityPerson1)){
             queryWrapper.and(wrapper -> wrapper.like("responsibility_Person1",responsibilityPerson1)
                     .or().like("responsibility_Person2",responsibilityPerson1)
@@ -514,6 +531,13 @@ public class IncidentTicketController {
 			incidentTicket.setState("4");
 			incidentTicket.setPushFlag("1");
 			incidentTicket.setMsgTime(new Date());
+			incidentTicket.setFrequency(0);
+			incidentTicket.setMsgTime1(new Date());
+			incidentTicket.setFrequency1(0);
+			incidentTicket.setMsgTime2(new Date());
+			incidentTicket.setFrequency2(0);
+			incidentTicket.setMsgTime3(new Date());
+			incidentTicket.setFrequency3(0);
 			incidentTicketService.updateById(incidentTicket);
 			return Result.ok("执行成功(该单据无需推送U8,请直接执行下一步操作)");
 		}
@@ -604,6 +628,13 @@ public class IncidentTicketController {
 			if(fnl){
 				incidentTicket.setState("4");
 				incidentTicket.setMsgTime(new Date());
+                incidentTicket.setFrequency(0);
+				incidentTicket.setMsgTime1(new Date());
+				incidentTicket.setFrequency1(0);
+				incidentTicket.setMsgTime2(new Date());
+				incidentTicket.setFrequency2(0);
+				incidentTicket.setMsgTime3(new Date());
+				incidentTicket.setFrequency3(0);
 				incidentTicketService.updateById(incidentTicket);
 			}
 			return Result.ok("同步成功");
@@ -636,6 +667,13 @@ public class IncidentTicketController {
 			incidentTicket.setState("5");
 			incidentTicket.setStateText("已提交");
 			incidentTicket.setMsgTime(new Date());
+            incidentTicket.setFrequency(0);
+			incidentTicket.setMsgTime1(new Date());
+			incidentTicket.setFrequency1(0);
+			incidentTicket.setMsgTime2(new Date());
+			incidentTicket.setFrequency2(0);
+			incidentTicket.setMsgTime3(new Date());
+			incidentTicket.setFrequency3(0);
 //			LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 //			incidentTicket.setUpdateBy(sysUser.getUsername());
 //			incidentTicket.setUpdateTime(new Date());
@@ -673,6 +711,13 @@ public class IncidentTicketController {
 			incidentTicket.setState("6");
 			incidentTicket.setStateText("已完结");
 			incidentTicket.setMsgTime(new Date());
+            incidentTicket.setFrequency(0);
+			incidentTicket.setMsgTime1(new Date());
+			incidentTicket.setFrequency1(0);
+			incidentTicket.setMsgTime2(new Date());
+			incidentTicket.setFrequency2(0);
+			incidentTicket.setMsgTime3(new Date());
+			incidentTicket.setFrequency3(0);
 //			LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 //			incidentTicket.setUpdateBy(sysUser.getUsername());
 //			incidentTicket.setUpdateTime(new Date());
@@ -701,6 +746,7 @@ public class IncidentTicketController {
 		String responsibilityPerson1 = incidentTicket.getResponsibilityPerson1();//责任人
 		String accidentDataBegin = incidentTicket.getAccidentDataEnd();
 		String accidentDataEnd = incidentTicket.getAccidentDataBegin();
+		Integer frequency = incidentTicket.getFrequency();
 
 		String handle = incidentTicket.getHandle();
 		incidentTicket.setProcessor(null);
@@ -708,6 +754,7 @@ public class IncidentTicketController {
 		incidentTicket.setInformant(null);
 		incidentTicket.setHandle(null);
 		incidentTicket.setResponsibilityPerson1(null);
+		incidentTicket.setFrequency(null);
 
 		incidentTicket.setAccidentDataEnd(null);
 		incidentTicket.setAccidentDataBegin(null);
@@ -715,6 +762,30 @@ public class IncidentTicketController {
 		QueryWrapper<IncidentTicket> queryWrapper = QueryGenerator.initQueryWrapper(incidentTicket, request.getParameterMap());
 		queryWrapper.eq("1","1");
 
+		if(frequency != null){
+			if(frequency.equals(1)){
+//				queryWrapper.apply("frequency + frequency1 + frequency2 + frequency3 > 0");
+				queryWrapper.apply("frequency = 1");
+				queryWrapper.ne("state","6");
+
+			}else if(frequency.equals(2)){
+				queryWrapper.apply("frequency > 1");
+				queryWrapper.ne("state","6");
+
+			}else{
+				queryWrapper.apply("frequency < 1");
+			}
+
+		}
+//		if(frequency != null){
+//			if(frequency > 1 ){
+//				queryWrapper.apply("frequency + frequency1 + frequency2 + frequency3 > 0");
+//				queryWrapper.ne("state","6");
+//			}else{
+//				queryWrapper.apply("frequency + frequency1 + frequency2 + frequency3 <= 1");
+//			}
+//
+//		}
 		if(StringUtils.isNotBlank(accidentDataBegin) || StringUtils.isNotBlank(accidentDataEnd)){
 			queryWrapper.between("accident_data",accidentDataBegin,accidentDataEnd);
 		}

+ 20 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/entity/IncidentTicket.java

@@ -63,6 +63,26 @@ public class IncidentTicket implements Serializable {
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "提醒时间")
     private Date msgTime;
+    private Integer frequency;
+	/**提醒时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "提醒时间 扣款")
+    private Date msgTime1;
+    private Integer frequency1;
+	/**提醒时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "提醒时间 应补")
+    private Date msgTime2;
+    private Integer frequency2;
+	/**提醒时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "提醒时间 公司承担")
+    private Date msgTime3;
+    private Integer frequency3;
+
 	/**所属部门*/
 	@Excel(name = "所属部门", width = 15)
     @ApiModelProperty(value = "所属部门")

+ 7 - 3
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/mapper/IncidentTicketMapper.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.oa.mapper;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -41,8 +42,11 @@ public interface IncidentTicketMapper extends BaseMapper<IncidentTicket> {
      * @return
      */
     List<Map<String,Object>> selectConfigList();
-    List<String> selectTicketList(@Param("frequency")int frequency,@Param("stateText")String stateText,@Param("minute")int minute);
+    List<String> selectTicketList(@Param("frequency")int frequency,@Param("stateText")String stateText,@Param("minute")int minute
+            ,@Param("orderType")String orderType,@Param("createTime") Date create_time);
+
     int setMsgLog(@Param("order_status")String order_status,@Param("user_id")String user_id,@Param("user_name")String user_name,
-                  @Param("minute")int minute,@Param("frequency")int frequency,@Param("demo")String demo);
-    int updateIncidentInfo(@Param("id") List<String> id);
+                  @Param("minute")int minute,@Param("frequency")int frequency,@Param("demo")String demo,@Param("orderType")String orderType,@Param("code")String code);
+
+    int updateIncidentInfo(@Param("id") List<String> id,@Param("orderType") String orderType);
 }

+ 56 - 6
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/mapper/xml/IncidentTicketMapper.xml

@@ -5,9 +5,39 @@
     <select id="selectTicketList" resultType="String">
         select a.accident_number from incident_ticket a
         left join act_z_business b on a.id = b.table_id and b.table_name='incident_ticket'
-
-        where b.result = 2 and a.frequency &lt; ${frequency} and a.state_text = #{stateText}
-        and TIMESTAMPDIFF(MINUTE,IFNULL(a.msg_time,DATE_ADD(b.update_time, INTERVAL 8 HOUR)), NOW()) > ${minute}
+        <!-- left join (
+
+            select GROUP_CONCAT(accident_type SEPARATOR ',') accident_type,incident_ticket_id from incident_ticket_children
+            <if test="orderType!=null and orderType !=''">
+                where accident_type = #{orderType}
+            </if>
+            group by incident_ticket_id
+        ) c on c.incident_ticket_id = a.id
+        '2026-01-01 00:00:00'-->
+        where a.create_time > #{createTime}
+        and b.result = 2 and a.state = #{stateText}
+
+       <if test="orderType==null or orderType ==''">
+            and a.frequency &lt; ${frequency}
+            and TIMESTAMPDIFF(MINUTE,IFNULL(a.msg_time,DATE_ADD(b.update_time, INTERVAL 8 HOUR)), NOW()) > ${minute}
+        </if>
+        <!--
+                <if test="orderType=='扣款'">
+                    and c.incident_ticket_id is not null
+                    and a.frequency1 &lt; ${frequency}
+                    and TIMESTAMPDIFF(MINUTE,IFNULL(a.msg_time1,DATE_ADD(b.update_time, INTERVAL 8 HOUR)), NOW()) > ${minute}
+                </if>
+                <if test="orderType=='应补'">
+                    and c.incident_ticket_id is not null
+                    and a.frequency2 &lt; ${frequency}
+                    and TIMESTAMPDIFF(MINUTE,IFNULL(a.msg_time2,DATE_ADD(b.update_time, INTERVAL 8 HOUR)), NOW()) > ${minute}
+                </if>
+                <if test="orderType=='公司承担'">
+                    and c.incident_ticket_id is not null
+                    and a.frequency3 &lt; ${frequency}
+                    and TIMESTAMPDIFF(MINUTE,IFNULL(a.msg_time3,DATE_ADD(b.update_time, INTERVAL 8 HOUR)), NOW()) > ${minute}
+                </if>
+                -->
 
     </select>
 
@@ -24,7 +54,9 @@
                minute,
                frequency,
                demo,
-               msg_time
+               msg_time,
+               order_type,
+               code
            )
            VALUES(
                  #{order_status},
@@ -33,13 +65,31 @@
                  #{minute},
                  #{frequency},
                  #{demo},
-                  now()
+                  now(),
+                 #{orderType},
+                 #{code}
           )
 
     </insert>
 
     <update id="updateIncidentInfo">
-        update incident_ticket set frequency = frequency+1 ,msg_time = now() where accident_number in
+        update incident_ticket set
+
+        <if test="orderType==null or orderType ==''">
+            frequency = frequency+1 ,msg_time = now()
+        </if>
+
+        <if test="orderType=='扣款'">
+            frequency1 = frequency1+1 ,msg_time1 = now()
+        </if>
+        <if test="orderType=='应补'">
+            frequency2 = frequency2+1 ,msg_time2 = now()
+        </if>
+        <if test="orderType=='公司承担'">
+            frequency3 = frequency3+1 ,msg_time3 = now()
+        </if>
+
+         where accident_number in
         <foreach item="key" collection="id" open="(" separator="," close=")">
             #{key}
         </foreach>

+ 4 - 3
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/service/IIncidentTicketService.java

@@ -9,6 +9,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.io.Serializable;
 import java.util.Collection;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -51,7 +52,7 @@ public interface IIncidentTicketService extends IService<IncidentTicket> {
 	public Map<String,Object> propellingThree(IncidentTicket incidentTicket, IncidentTicketChildren children);
 
 	public List<Map<String,Object>> selectConfigList();
-	public List<String> selectTicketList(int frequency,String stateText,int minute);
-	public int setMsgLog(String order_status,String user_id,String user_name, int minute,int frequency,String demo);
-	public int updateIncidentInfo(List<String> id);
+	public List<String> selectTicketList(int frequency, String stateText, int minute, String order_type, Date create_time);
+	public int setMsgLog(String order_status,String user_id,String user_name, int minute,int frequency,String demo,String orderType,String code);
+	public int updateIncidentInfo(List<String> id,String orderType);
 }

+ 24 - 6
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/service/impl/IncidentTicketServiceImpl.java

@@ -769,7 +769,16 @@ public class IncidentTicketServiceImpl extends ServiceImpl<IncidentTicketMapper,
 		incidentTicketEntity.setState("2");//1未处理 2已通知 3通知已反馈 4已推送 5已完结
 		incidentTicketEntity.setUpdateBy(sysUser.getUsername());
 		incidentTicketEntity.setUpdateTime(new Date());
+
 		incidentTicketEntity.setMsgTime(new Date());
+		incidentTicketEntity.setFrequency(0);
+		incidentTicketEntity.setMsgTime1(new Date());
+		incidentTicketEntity.setFrequency1(0);
+		incidentTicketEntity.setMsgTime2(new Date());
+		incidentTicketEntity.setFrequency2(0);
+		incidentTicketEntity.setMsgTime3(new Date());
+		incidentTicketEntity.setFrequency3(0);
+
 		incidentTicketMapper.updateById(incidentTicketEntity);
 //		this.save(incidentTicketEntity);
 		return Result.ok("已通知");
@@ -841,7 +850,16 @@ public class IncidentTicketServiceImpl extends ServiceImpl<IncidentTicketMapper,
 			incidentTicketEntity.setState("3");//1未处理 2已通知 3通知已反馈 4已推送 5已完结
 			incidentTicketEntity.setUpdateBy(sysUser.getUsername());
 			incidentTicketEntity.setUpdateTime(new Date());
+
 			incidentTicketEntity.setMsgTime(new Date());
+			incidentTicketEntity.setFrequency(0);
+			incidentTicketEntity.setMsgTime1(new Date());
+			incidentTicketEntity.setFrequency1(0);
+			incidentTicketEntity.setMsgTime2(new Date());
+			incidentTicketEntity.setFrequency2(0);
+			incidentTicketEntity.setMsgTime3(new Date());
+			incidentTicketEntity.setFrequency3(0);
+
 			incidentTicketMapper.updateById(incidentTicketEntity);
 //			this.save(incidentTicketEntity);
 //		}
@@ -927,20 +945,20 @@ public class IncidentTicketServiceImpl extends ServiceImpl<IncidentTicketMapper,
 		return incidentTicketMapper.selectConfigList();
 	}
 	@Override
-	public List<String> selectTicketList(int frequency,String stateText,int minute){
-		return incidentTicketMapper.selectTicketList(frequency,stateText,minute);
+	public List<String> selectTicketList(int frequency,String stateText,int minute,String order_type,Date create_time){
+		return incidentTicketMapper.selectTicketList(frequency,stateText,minute,order_type,create_time);
 	}
 	@Override
 	@Transactional
 	public int setMsgLog(String order_status,String user_id,String user_name,
-						int minute,int frequency,String demo) {
+						int minute,int frequency,String demo,String orderType,String code) {
 		return incidentTicketMapper.setMsgLog(order_status,user_id,user_name,
-		minute,frequency,demo);
+		minute,frequency,demo,orderType,code);
 	}
 
 	@Override
 	@Transactional
-	public int updateIncidentInfo(@Param("id") List<String> id) {
-		return incidentTicketMapper.updateIncidentInfo(id);
+	public int updateIncidentInfo(List<String> id,String orderType) {
+		return incidentTicketMapper.updateIncidentInfo(id,orderType);
 	}
 }

+ 181 - 15
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/quartz/job/IncidentTicketJob.java

@@ -14,6 +14,10 @@ import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -47,6 +51,8 @@ public class IncidentTicketJob implements Job {
             }
             LoginUser loginUser = sysBaseAPI.getUserByName("admin");
 
+            SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");
+
             for(Map<String,Object> m:mapList){
 
                 if(m.get("order_status")==null||m.get("order_status")=="" ||
@@ -56,7 +62,18 @@ public class IncidentTicketJob implements Job {
                     continue;
                 }
 
+                String inputDate = m.get("create_time").toString();//
+                // 解析输入日期
+                Date date = inputFormat.parse(inputDate);
+                // 转换为LocalDateTime处理
+                LocalDateTime dateTime = LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
+                // 减去8小时
+                LocalDateTime newTime = dateTime.minusHours(8);
+                Date create_time = Date.from(newTime.atZone(ZoneId.systemDefault()).toInstant());
+
                 String order_status = m.get("order_status").toString();//订单状态 //1未处理 2已通知 3通知已反馈 4已推送 5已提交 6已完结
+                String order_statusText = m.get("order_status").toString();//订单状态 //1未处理 2已通知 3通知已反馈 4已推送 5已提交 6已完结
+                String order_type = m.get("order_type")==null || m.get("order_type") == "" ? "" : m.get("order_type").toString();//事故类型 //扣款 应补 公司承担
                 if(order_status.equals("未处理")){
                     order_status = "1";
                 }else if(order_status.equals("已通知")){
@@ -75,38 +92,187 @@ public class IncidentTicketJob implements Job {
 
                 String user_id = m.get("user_id").toString();//用户
                 int minute = (int) m.get("minute");//提醒时间(分钟)
-                int frequency = (int) m.get("frequency");//提醒次数
+                int frequency = 1;// (int) m.get("frequency");//提醒次数
+                minute = minute*1440; //客户要求改成天
+
+                //首次提醒
+                List<String> ticketList = incidentTicketService.selectTicketList(frequency,order_status,minute,order_type,create_time);
+
+                if(ticketList.size() > 0){
+
+                    String result = String.join(",", ticketList);
+
+                    for(String userId:user_id.split(",")){
+
+                        String msgContent = "<h3>您有"+ticketList.size()+"条("+order_statusText+")的事故单需要处理,请查看</h3><br> <h4><br>"+result+"</h4>";
+
+                        sysBaseAPI.sendSysAnnouncement(loginUser,"admin",userId,"事故处理单提醒",
+                                msgContent,
+                                CommonConstant.MSG_CATEGORY_2,new HashMap<>());
 
-                List<String> ticketList = incidentTicketService.selectTicketList(frequency,order_status,minute);
+                        incidentTicketService.setMsgLog(order_status,userId,null,minute,frequency,msgContent,order_statusText,result);
 
-                if(ticketList.size() == 0){
+                    }
+
+                    incidentTicketService.updateIncidentInfo(ticketList,order_type);
+                }
+
+                //次提醒
+                if(m.get("user_id2")==null||m.get("user_id2")=="" ||
+                        m.get("minute2")==null||m.get("minute2")=="" ||
+                        m.get("frequency2")==null||m.get("frequency2")==""){
                     continue;
                 }
 
-                String result = String.join(",", ticketList);
+                user_id = m.get("user_id2").toString();//用户
+                minute = (int) m.get("minute2");//提醒时间(分钟)
+                frequency = 2;// (int) m.get("frequency");//提醒次数
+                minute = minute*1440; //客户要求改成天
 
-                for(String userId:user_id.split(",")){
+                List<String> ticketList2 = incidentTicketService.selectTicketList(frequency,order_status,minute,order_type,create_time);
 
-                    String msgContent = "<h3>您有"+ticketList.size()+"条("+order_status+")的事故单需要处理,请查看</h3><br> <h4><br>"+result+"</h4>";
+                if(ticketList2.size() > 0){
 
-                    sysBaseAPI.sendSysAnnouncement(loginUser,"admin",userId,"事故处理单提醒",
-                            msgContent,
-                            CommonConstant.MSG_CATEGORY_2,new HashMap<>());
+                    String result = String.join(",", ticketList2);
 
-                    incidentTicketService.setMsgLog(order_status,userId,null,minute,frequency,msgContent);
+                    for(String userId:user_id.split(",")){
 
-                }
+                        String msgContent = "<h3>您有"+ticketList2.size()+"条("+order_statusText+")的事故单需要处理,请查看</h3><br> <h4><br>"+result+"</h4>";
 
-                incidentTicketService.updateIncidentInfo(ticketList);
+                        sysBaseAPI.sendSysAnnouncement(loginUser,"admin",userId,"事故处理单提醒",
+                                msgContent,
+                                CommonConstant.MSG_CATEGORY_2,new HashMap<>());
+
+                        incidentTicketService.setMsgLog(order_status,userId,null,minute,frequency,msgContent,order_type,result);
+
+                    }
+
+                    incidentTicketService.updateIncidentInfo(ticketList2,order_type);
+                }
             }
 
 
 		}catch (Exception e){
-            incidentTicketService.setMsgLog(null,null,null,99,99,"消息发送失败:"+e.getMessage());
-			System.out.println("消息发送失败:"+e.getMessage());
-			e.printStackTrace();
+            incidentTicketService.setMsgLog(null,null,null,0,0,"消息发送失败:"+e.getMessage(),null,null);
+//			System.out.println("消息发送失败:"+e.getMessage());
+//			e.printStackTrace();
 		}
 
     }
+//
+//    @Override
+//    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
+//
+//		try {
+//
+//		    //获取质量配置表
+//            //遍历配置表
+//                //查询 包含配置内数据 质量事故单:状态,发送次数<配置次数,上次发送时间(初始时间)与 当前时间 相差分钟数 > 配置分钟
+//                //根据配置人员 发送消息
+//                //更新发送时间,更新发送次数
+//                //记录日志
+//            //结束
+//
+//            List<Map<String,Object>> mapList = incidentTicketService.selectConfigList();
+//            if(mapList.size() == 0){
+//                return;
+//            }
+//            LoginUser loginUser = sysBaseAPI.getUserByName("admin");
+//
+//            for(Map<String,Object> m:mapList){
+//
+//                if(m.get("order_status")==null||m.get("order_status")=="" ||
+//                m.get("user_id")==null||m.get("user_id")=="" ||
+//                m.get("minute")==null||m.get("minute")=="" ||
+//                m.get("frequency")==null||m.get("frequency")==""){
+//                    continue;
+//                }
+//
+//                String order_status = m.get("order_status").toString();//订单状态 //1未处理 2已通知 3通知已反馈 4已推送 5已提交 6已完结
+//                String order_statusText = m.get("order_status").toString();//订单状态 //1未处理 2已通知 3通知已反馈 4已推送 5已提交 6已完结
+//                String order_type = m.get("order_type")==null || m.get("order_type") == "" ? "" : m.get("order_type").toString();//事故类型 //扣款 应补 公司承担
+//                if(order_status.equals("未处理")){
+//                    order_status = "1";
+//                }else if(order_status.equals("已通知")){
+//                    order_status = "2";
+//                }else if(order_status.equals("通知已反馈")){
+//                    order_status = "3";
+//                }else if(order_status.equals("已推送")){
+//                    order_status = "4";
+//                }else if(order_status.equals("已提交")){
+//                    order_status = "5";
+//                }else if(order_status.equals("已完结")){
+//                    order_status = "6";
+//                }else{
+//                    continue;
+//                }
+//
+//                String user_id = m.get("user_id").toString();//用户
+//                int minute = (int) m.get("minute");//提醒时间(分钟)
+//                int frequency = 1;// (int) m.get("frequency");//提醒次数
+//
+//                //首次提醒
+//                List<String> ticketList = incidentTicketService.selectTicketList(frequency,order_status,minute,order_type);
+//
+//                if(ticketList.size() > 0){
+//
+//                    String result = String.join(",", ticketList);
+//
+//                    for(String userId:user_id.split(",")){
+//
+//                        String msgContent = "<h3>您有"+ticketList.size()+"条("+order_statusText+")的事故单需要处理,请查看</h3><br> <h4><br>"+result+"</h4>";
+//
+//                        sysBaseAPI.sendSysAnnouncement(loginUser,"admin",userId,"事故处理单提醒",
+//                                msgContent,
+//                                CommonConstant.MSG_CATEGORY_2,new HashMap<>());
+//
+//                        incidentTicketService.setMsgLog(order_status,userId,null,minute,frequency,msgContent,order_statusText,result);
+//
+//                    }
+//
+//                    incidentTicketService.updateIncidentInfo(ticketList,order_type);
+//                }
+//
+//                //次提醒
+//                if(m.get("user_id2")==null||m.get("user_id2")=="" ||
+//                        m.get("minute2")==null||m.get("minute2")=="" ||
+//                        m.get("frequency2")==null||m.get("frequency2")==""){
+//                    continue;
+//                }
+//
+//                user_id = m.get("user_id2").toString();//用户
+//                minute = (int) m.get("minute2");//提醒时间(分钟)
+//                frequency = 2;// (int) m.get("frequency");//提醒次数
+//
+//                List<String> ticketList2 = incidentTicketService.selectTicketList(frequency,order_status,minute,order_type);
+//
+//                if(ticketList2.size() > 0){
+//
+//                    String result = String.join(",", ticketList2);
+//
+//                    for(String userId:user_id.split(",")){
+//
+//                        String msgContent = "<h3>您有"+ticketList2.size()+"条("+order_statusText+")的事故单需要处理,请查看</h3><br> <h4><br>"+result+"</h4>";
+//
+//                        sysBaseAPI.sendSysAnnouncement(loginUser,"admin",userId,"事故处理单提醒",
+//                                msgContent,
+//                                CommonConstant.MSG_CATEGORY_2,new HashMap<>());
+//
+//                        incidentTicketService.setMsgLog(order_status,userId,null,minute,frequency,msgContent,order_type,result);
+//
+//                    }
+//
+//                    incidentTicketService.updateIncidentInfo(ticketList2,order_type);
+//                }
+//            }
+//
+//
+//		}catch (Exception e){
+//            incidentTicketService.setMsgLog(null,null,null,0,0,"消息发送失败:"+e.getMessage(),null,null);
+////			System.out.println("消息发送失败:"+e.getMessage());
+////			e.printStackTrace();
+//		}
+//
+//    }
 
 }