Commit 88edc9d1 authored by fangxinjiang's avatar fangxinjiang

消息提醒

parent ab726e04
package com.yifu.cloud.plus.v1.yifu.common.dapr.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
/**
* @Author fxj
* @Date 2022/7/4
* @Description
* @Version 1.0
*/
@Data
@Component
@PropertySource("classpath:daprConfig.properties")
@ConfigurationProperties(value = "dapr.msg", ignoreInvalidFields = false)
public class DaprMsgProperties {
/*
* @author fxj
* @date 14:34
* @Description dapr sidercar url 如:http://localhost:3005/v1.0/invoke/
**/
String appUrl;
/*
* @author fxj
* @date 14:35
* @decription app_id 如:"yifu_upms_sider"
**/
String appId;
String appPort;
String httpPort;
String grpcPort;
String metricsPort;
}
package com.yifu.cloud.plus.v1.job.compont;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprMsgProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @Author fxj
* @Description 定時任務--定时生成 超时提醒
* @Date 19:57 2023/5/30
* @Param
* @return
**/
@Component(value = "msgTask")
@Slf4j
@EnableConfigurationProperties(DaprMsgProperties.class)
public class MsgTask {
@Autowired
private DaprMsgProperties daprMsgProperties;
/**
* @Author fxj
* @Description 每29分钟刷新 超时待办提醒
* @Date 20:01 2023/5/30
* @Param
* @return
**/
public void createOderOverTimeMsg() {
log.info("-------------每29分钟刷新 超时待办提醒-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprMsgProperties.getAppUrl(), daprMsgProperties.getAppId(),
"/msg/inner/updateOverTimeMsg", "", Object.class,
SecurityConstants.FROM_IN);
log.info("-------------每29分钟刷新 超时待办提醒定时任务结束------------");
}
}
\ No newline at end of file
......@@ -86,7 +86,7 @@ public class MsgInfoController {
@Operation(summary = "每29分钟刷新 超时待办提醒", description = "每29分钟刷新 超时待办提醒")
@Inner
@PostMapping("/inner/updateOverTimeMsg")
public void everyMonthUpdateSalaryStatus() {
public void updateOverTimeMsg() {
msgInfoService.updateOverTimeMsg();
}
}
......@@ -84,7 +84,7 @@ public class MsgInfoServiceImpl extends ServiceImpl<MsgInfoMapper, MsgInfo> impl
if (Common.isNotNull(save)){
save.setCreateTime(LocalDateTime.now());
save.setUrl(MesConstants.orderUrl+vo.getOrderId());
save.setAlertUser(vo.getAlertUser());
save.setAlertUser(vo.getAlertUser().replace("\"",""));
baseMapper.insert(save);
log.error(JSON.toJSONString(save));
}
......@@ -96,7 +96,7 @@ public class MsgInfoServiceImpl extends ServiceImpl<MsgInfoMapper, MsgInfo> impl
save.setCreateTime(LocalDateTime.now());
save.setUrl(MesConstants.orderUrl+save.getOrderId());
save.setAlertType(CommonConstants.TWO_STRING);
save.setAlertUser(vo.getAlertUser());
save.setAlertUser(vo.getAlertUser().replace("\"",""));
baseMapper.insert(save);
log.error(JSON.toJSONString(save));
}
......
......@@ -103,21 +103,26 @@
WHERE
a.fd_id = #{orderId} limit 1
</select>
<!-- 加急(2-3小时)|1 紧急(3-5小时)|4 常规(5-8小时)|7 -->
<select id="getMsgByTask" resultMap="msgInfoMap">
select
<!-- 加急(2-3小时)|1 紧急(3-5小时)|4 常规(5-8小时)|7 -->
o.fd_name alertUser,
b1.fd_3ac901c5184274 orderNo,
b1.fd_id orderId,
'1' as alertType
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
LEFT JOIN sys_org_element o on o.fd_id=fd_expected_id
where
e.fd_fact_node_id='N5' and b1.fd_id is not null;
and DATE_ADD(NOW(),INTERVAL 30 MINUTE) > IF(b1.fd_3b779ba2168eea=1,DATE_ADD(a.fd_start_date,INTERVAL 3 HOUR),IF(b1.fd_3b779ba2168eea=4,DATE_ADD(a.fd_start_date,INTERVAL 5 HOUR),DATE_ADD(a.fd_start_date,INTERVAL 8 HOUR)))
SELECT * from (
SELECT
o.fd_no ALERT_USER,
b1.fd_3ac901c5184274 ORDER_NO,
b1.fd_id ORDER_ID,
'1' AS ALERT_TYPE,
DATE_ADD(NOW(), INTERVAL 30 MINUTE) as 'date1',
IF(b1.fd_3b779ba2168eea = 1,DATE_ADD(a.fd_start_date,INTERVAL 3 HOUR),IF(b1.fd_3b779ba2168eea = 4,DATE_ADD(a.fd_start_date,INTERVAL 5 HOUR),DATE_ADD(a.fd_start_date,INTERVAL 8 HOUR))) as 'date2'
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
LEFT JOIN sys_org_element o ON o.fd_id = fd_expected_id
WHERE
e.fd_fact_node_id = 'N5'
AND b1.fd_id IS NOT NULL
) x
where x.date1 > date2
</select>
</mapper>
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