Commit 16dd71f0 authored by fangxinjiang's avatar fangxinjiang

优化消息

parent 54d887a6
...@@ -113,7 +113,7 @@ public class MsgInfoController { ...@@ -113,7 +113,7 @@ public class MsgInfoController {
* @Param * @Param
* @return * @return
**/ **/
@Operation(summary = "每5秒 处理订单待办提醒", description = "每5秒 处理订单待办提醒") @Operation(summary = "每10分钟 处理订单待办提醒", description = "每10分钟 处理订单待办提醒")
@Inner @Inner
@PostMapping("/inner/cancelHandledMsg") @PostMapping("/inner/cancelHandledMsg")
public void cancelHandledMsg() { public void cancelHandledMsg() {
......
...@@ -51,7 +51,9 @@ public interface MsgInfoMapper extends BaseMapper<MsgInfo> { ...@@ -51,7 +51,9 @@ public interface MsgInfoMapper extends BaseMapper<MsgInfo> {
List<MsgInfo> getMsgInfo(@Param("msgInfo") MsgInfo msgInfo); List<MsgInfo> getMsgInfo(@Param("msgInfo") MsgInfo msgInfo);
int deleteHandledMsg(); int deleteHandledMsg(@Param("nos")List<String> nos);
List<String> getOrderNos();
int insertMsg(@Param("vo") EkpInsertMsgVo vo); int insertMsg(@Param("vo") EkpInsertMsgVo vo);
} }
...@@ -210,7 +210,10 @@ public class MsgInfoServiceImpl extends ServiceImpl<MsgInfoMapper, MsgInfo> impl ...@@ -210,7 +210,10 @@ public class MsgInfoServiceImpl extends ServiceImpl<MsgInfoMapper, MsgInfo> impl
@Override @Override
public void cancelHandledMsg() { public void cancelHandledMsg() {
baseMapper.deleteHandledMsg(); List<String> orderNos = baseMapper.getOrderNos();
if (Common.isNotNull(orderNos)){
baseMapper.deleteHandledMsg(orderNos);
}
} }
@Override @Override
...@@ -223,5 +226,4 @@ public class MsgInfoServiceImpl extends ServiceImpl<MsgInfoMapper, MsgInfo> impl ...@@ -223,5 +226,4 @@ public class MsgInfoServiceImpl extends ServiceImpl<MsgInfoMapper, MsgInfo> impl
} }
} }
} }
...@@ -153,19 +153,26 @@ ...@@ -153,19 +153,26 @@
</select> </select>
<delete id="deleteHandledMsg"> <delete id="deleteHandledMsg">
DELETE FROM msg_info where ALERT_TYPE ='0' and ORDER_NO not in ( DELETE FROM msg_info where ALERT_TYPE ='0'
SELECT <if test="nos != null and nos.size > 0">
b1.fd_3ac901c5184274 ORDER_NO and ORDER_NO not in
FROM <foreach item="items" index="index" collection="nos" open="(" separator="," close=")">
lbpm_workitem a #{items}
LEFT JOIN lbpm_node e ON e.fd_id = a.fd_node_id </foreach>
LEFT JOIN lbpm_process p ON p.fd_id = e.fd_process_id </if>
LEFT JOIN ekp_ea33075576149bb8a4f5 b1 ON p.fd_model_id = b1.fd_id
WHERE
e.fd_fact_node_id = 'N5'
AND b1.fd_id IS NOT NULL
)
</delete> </delete>
<select id="getOrderNos" resultType="java.lang.String">
SELECT
b1.fd_3ac901c5184274 ORDER_NO
FROM
lbpm_workitem a
LEFT JOIN lbpm_node e ON e.fd_id = a.fd_node_id
LEFT JOIN lbpm_process p ON p.fd_id = e.fd_process_id
LEFT JOIN ekp_ea33075576149bb8a4f5 b1 ON p.fd_model_id = b1.fd_id
WHERE
e.fd_fact_node_id = 'N5'
AND b1.fd_id IS NOT NULL
</select>
<insert id="insertMsg"> <insert id="insertMsg">
insert into msg_info (ID,URL,ORDER_ID,ALERT_USER,DOMAIN_NAME,CREATE_TIME,ALERT_TYPE,ORDER_NO) insert into msg_info (ID,URL,ORDER_ID,ALERT_USER,DOMAIN_NAME,CREATE_TIME,ALERT_TYPE,ORDER_NO)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment