
10 changed files with 187 additions and 2 deletions
@ -0,0 +1,22 @@ |
|||
package com.yxt.messagecenter.api.messageurgeList; |
|||
|
|||
import com.yxt.common.core.dto.Dto; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/9/10 |
|||
**/ |
|||
@Data |
|||
public class MessageListDto implements Dto { |
|||
private static final long serialVersionUID = -1667937381274036191L; |
|||
|
|||
private String proInstId; |
|||
|
|||
private int type; |
|||
|
|||
private String urgeName; |
|||
|
|||
private String nodeName; |
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.yxt.messagecenter.api.messageurgeList; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/9/9 |
|||
**/ |
|||
@TableName("message_urgeList") |
|||
public class MessageUrgeList extends BaseEntity { |
|||
private static final long serialVersionUID = 7667726702154027285L; |
|||
@ApiModelProperty("消息sid") |
|||
private String msgSid; |
|||
@ApiModelProperty("流程实例id") |
|||
private String proInstId; |
|||
@ApiModelProperty("催办类别:1系统,2人工") |
|||
private String urgeType; |
|||
@ApiModelProperty("被催办人") |
|||
private String urgeName; |
|||
@ApiModelProperty("审批环节") |
|||
private String nodeName; |
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.yxt.messagecenter.api.messageurgeList; |
|||
|
|||
import com.yxt.messagecenter.api.message.MessageFeignFallback; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/9/9 |
|||
**/ |
|||
@FeignClient( |
|||
contextId = "message-center-MessageUrgeList", |
|||
name = "message-center", |
|||
path = "v1/MessageUrgeList", |
|||
fallback = MessageUrgeListFeignFallback.class) |
|||
public interface MessageUrgeListFeign { |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.yxt.messagecenter.api.messageurgeList; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/9/9 |
|||
**/ |
|||
public class MessageUrgeListFeignFallback { |
|||
} |
@ -0,0 +1,15 @@ |
|||
package com.yxt.messagecenter.biz.messageurgeList; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.yxt.messagecenter.api.messagetype.MessageType; |
|||
import com.yxt.messagecenter.api.messageurgeList.MessageUrgeList; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/9/11 |
|||
**/ |
|||
@Mapper |
|||
public interface MessageUrgeListMapper extends BaseMapper<MessageUrgeList> { |
|||
} |
@ -0,0 +1,4 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.yxt.messagecenter.biz.messageurgeList.MessageUrgeListMapper"> |
|||
</mapper> |
@ -0,0 +1,9 @@ |
|||
package com.yxt.messagecenter.biz.messageurgeList; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/9/9 |
|||
**/ |
|||
public class MessageUrgeListRest { |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.yxt.messagecenter.biz.messageurgeList; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.messagecenter.api.messagetype.MessageType; |
|||
import com.yxt.messagecenter.api.messageurgeList.MessageListDto; |
|||
import com.yxt.messagecenter.api.messageurgeList.MessageUrgeList; |
|||
import com.yxt.messagecenter.biz.messagetype.MessageTypeMapper; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/9/9 |
|||
**/ |
|||
@Service |
|||
public class MessageUrgeListService extends MybatisBaseService<MessageUrgeListMapper, MessageUrgeList> { |
|||
|
|||
|
|||
ResultBean saveMessage(MessageListDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
MessageUrgeList messageUrgeList = new MessageUrgeList(); |
|||
BeanUtil.copyProperties(dto, messageUrgeList); |
|||
baseMapper.insert(messageUrgeList); |
|||
return rb.success(); |
|||
} |
|||
} |
@ -0,0 +1,55 @@ |
|||
package com.yxt.messagecenter.biz.messageurgeList; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.yxt.anrui.flowable.api.flow2.FlowFeign; |
|||
import com.yxt.anrui.flowable.api.flow2.FlowableMessageVo; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.messagecenter.api.message.OrderListMessageDto; |
|||
import com.yxt.messagecenter.api.message.OrderMesageDto; |
|||
import com.yxt.messagecenter.api.messageurgeList.MessageListDto; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.scheduling.annotation.Scheduled; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.text.SimpleDateFormat; |
|||
import java.util.*; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/9/9 |
|||
**/ |
|||
@Component |
|||
public class ScheduledMessageService { |
|||
|
|||
@Autowired |
|||
private FlowFeign flowFeign; |
|||
@Autowired |
|||
private MessageUrgeListService messageUrgeListService; |
|||
|
|||
|
|||
// @Scheduled(cron = "0 0 0 * * ?")
|
|||
// @Scheduled(cron = "0 0/5 16 * * ?")
|
|||
public void remindVehicle() { |
|||
Date now = new Date(); |
|||
//获取当前时间
|
|||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|||
//查询规则
|
|||
int minutes = 5; |
|||
//查询所有的待办工作时间超过5分钟的
|
|||
ResultBean<List<FlowableMessageVo>> resultBean = flowFeign.getMessageList(minutes); |
|||
List<FlowableMessageVo> list = resultBean.getData(); |
|||
list.removeAll(Collections.singleton(null)); |
|||
if (!list.isEmpty()) { |
|||
for (int i = 0; i < list.size(); i++) { |
|||
FlowableMessageVo flowableMessageVo = list.get(i); |
|||
MessageListDto messageListDto = new MessageListDto(); |
|||
BeanUtil.copyProperties(flowableMessageVo, messageListDto); |
|||
messageUrgeListService.saveMessage(messageListDto); |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
Loading…
Reference in new issue