parent
cdadc19726
commit
18bda31f1b
@ -1,15 +1,12 @@
|
|||||||
package com.ruoyi.pt.domain;
|
package com.ruoyi.pt.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.ruoyi.pt.domain;
|
package com.ruoyi.pt.entity;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
@ -0,0 +1,127 @@
|
|||||||
|
package com.ruoyi.pt.entity;
|
||||||
|
|
||||||
|
import cn.hutool.core.annotation.Alias;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.ruoyi.pt.entity.response.CasesEventExtImportResponse;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (CasesImport)表实体类
|
||||||
|
*
|
||||||
|
* @author wu
|
||||||
|
* @since 2023-12-26 10:40:44
|
||||||
|
*/
|
||||||
|
@ApiModel("CasesImport表实体类")
|
||||||
|
@TableName(value = "cases_import")
|
||||||
|
@Data
|
||||||
|
public class CasesImport implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 690827189481452659L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单编号
|
||||||
|
*/
|
||||||
|
@TableField(value = "innerEventId")
|
||||||
|
@Alias("innerEventIds")
|
||||||
|
private String innerEventId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单编号
|
||||||
|
*/
|
||||||
|
@TableField(value = "CASE_SERIAL")
|
||||||
|
@Alias("innerEventId")
|
||||||
|
private String caseSerial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 诉求类型
|
||||||
|
*/
|
||||||
|
@TableField(value = "CASE_TYPE")
|
||||||
|
@Alias("msgTypeName")
|
||||||
|
private String caseType;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@Alias("eventExt")
|
||||||
|
private String eventExt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件类型
|
||||||
|
*/
|
||||||
|
@TableField(value = "CASE_ACCORD")
|
||||||
|
@Alias("scenceTypeName")
|
||||||
|
private String caseAccord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单标题
|
||||||
|
*/
|
||||||
|
@TableField(value = "CASE_TITLE")
|
||||||
|
@Alias("title")
|
||||||
|
private String caseTitle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 制单时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@TableField(value = "CASE_DATE")
|
||||||
|
@Alias("eventTime")
|
||||||
|
private Date caseDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 诉求内容
|
||||||
|
*/
|
||||||
|
@TableField(value = "CASE_CONTENT")
|
||||||
|
@Alias("content")
|
||||||
|
private String caseContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 坐标
|
||||||
|
*/
|
||||||
|
@TableField(value = "CASE_LNGLAT")
|
||||||
|
@Alias("eventCoordinate")
|
||||||
|
private String caseLnglat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 位置描述
|
||||||
|
*/
|
||||||
|
@TableField(value = "CASE_ADDRESS")
|
||||||
|
@Alias("eventPlaceName")
|
||||||
|
private String caseAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否紧急
|
||||||
|
*/
|
||||||
|
@TableField(value = "IS_URGENT")
|
||||||
|
private Integer isUrgent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务对象姓名
|
||||||
|
*/
|
||||||
|
@TableField(value = "CREATOR_NAME")
|
||||||
|
@Alias("eventCreator")
|
||||||
|
private String creatorName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来电号码
|
||||||
|
*/
|
||||||
|
@TableField(value = "CREATOR_TEL")
|
||||||
|
@Alias("eventCreatorTel")
|
||||||
|
private String creatorTel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableField(value = "ID")
|
||||||
|
@Alias("id")
|
||||||
|
@TableId
|
||||||
|
private String id;
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,5 @@
|
|||||||
package com.ruoyi.pt.domain.dto;
|
package com.ruoyi.pt.entity.dto;
|
||||||
|
|
||||||
import cn.hutool.core.annotation.Alias;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.ruoyi.pt.entity.response;
|
||||||
|
|
||||||
|
import cn.hutool.core.annotation.Alias;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wu
|
||||||
|
* @since 2023/12/26 16:08
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CasesEventExtImportResponse implements Serializable {
|
||||||
|
private static final long serialVersionUID = -2836563404223704758L;
|
||||||
|
|
||||||
|
@Alias("eventCreator")
|
||||||
|
private String eventCreator;
|
||||||
|
|
||||||
|
@Alias("eventCreatorTel")
|
||||||
|
private String eventCreatorTel;
|
||||||
|
|
||||||
|
@Alias("scenceTypeName")
|
||||||
|
private String scenceTypeName;
|
||||||
|
|
||||||
|
@Alias("contentEncrypted")
|
||||||
|
private Boolean contentEncrypted;
|
||||||
|
|
||||||
|
@Alias("scenceType")
|
||||||
|
private String scenceType;
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package com.ruoyi.pt.entity.response;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 远程调用接口响应类
|
||||||
|
*
|
||||||
|
* @author wu
|
||||||
|
* @since 2023/12/15 23:49
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RemoteEventResponse implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1483725724309018586L;
|
||||||
|
|
||||||
|
private Boolean success;
|
||||||
|
|
||||||
|
private String errorCode;
|
||||||
|
|
||||||
|
private String errorMsg;
|
||||||
|
|
||||||
|
private Object data;
|
||||||
|
|
||||||
|
private String requestId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.ruoyi.pt.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.ruoyi.pt.entity.CasesImport;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (CasesImport)表数据库访问层
|
||||||
|
*
|
||||||
|
* @author wu
|
||||||
|
* @since 2023-12-26 10:40:44
|
||||||
|
*/
|
||||||
|
public interface CasesImportMapper extends BaseMapper<CasesImport> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询id最大的一条数据
|
||||||
|
*
|
||||||
|
* @return 数据
|
||||||
|
*/
|
||||||
|
Long findIdDesc();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有日期
|
||||||
|
*
|
||||||
|
* @return 日期集合
|
||||||
|
*/
|
||||||
|
List<String> findDate();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,43 @@
|
|||||||
|
package com.ruoyi.pt.quartz;
|
||||||
|
|
||||||
|
import com.ruoyi.pt.service.RemoteCallsService;
|
||||||
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送平台数据定时任务
|
||||||
|
*
|
||||||
|
* @author wu
|
||||||
|
* @since 2023/12/26 16:19
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@EnableAsync
|
||||||
|
public class PushQuartz {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RemoteCallsService remoteCallsService;
|
||||||
|
|
||||||
|
@Scheduled(cron = "0 0 1 * * * ?")
|
||||||
|
public void pushData() {
|
||||||
|
// 获取社会治理中心增量事件保存到events_import表
|
||||||
|
remoteCallsService.getEventDate();
|
||||||
|
// 获取昨天的数据
|
||||||
|
LocalDate localDate = LocalDate.now();
|
||||||
|
LocalDate yesterday = localDate.minusDays(1);
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
String yesterdayStr = yesterday.format(formatter);
|
||||||
|
// 紧急事件接口
|
||||||
|
remoteCallsService.urgentAlgorithm(yesterdayStr);
|
||||||
|
// 群体事件接口
|
||||||
|
remoteCallsService.groupAlgorithm();
|
||||||
|
// 同人事件接口
|
||||||
|
remoteCallsService.onepersonAlgorithm();
|
||||||
|
// 推送
|
||||||
|
remoteCallsService.imports();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.ruoyi.pt.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.ruoyi.pt.entity.CasesImport;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (CasesImport)表服务接口
|
||||||
|
*
|
||||||
|
* @author wu
|
||||||
|
* @since 2023-12-26 10:40:44
|
||||||
|
*/
|
||||||
|
public interface CasesImportService extends IService<CasesImport> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询id最大的一条数据
|
||||||
|
*
|
||||||
|
* @return 数据
|
||||||
|
*/
|
||||||
|
Long findIdDesc();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有日期
|
||||||
|
*
|
||||||
|
* @return 日期集合
|
||||||
|
*/
|
||||||
|
List<String> findDate();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.ruoyi.pt.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.ruoyi.pt.mapper.CasesImportMapper;
|
||||||
|
import com.ruoyi.pt.entity.CasesImport;
|
||||||
|
import com.ruoyi.pt.service.CasesImportService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (CasesImport)表服务实现类
|
||||||
|
*
|
||||||
|
* @author wu
|
||||||
|
* @since 2023-12-26 10:40:44
|
||||||
|
*/
|
||||||
|
@Service("casesImportService")
|
||||||
|
public class CasesImportServiceImpl extends ServiceImpl<CasesImportMapper, CasesImport> implements CasesImportService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询id最大的一条数据
|
||||||
|
*
|
||||||
|
* @return 数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Long findIdDesc() {
|
||||||
|
return baseMapper.findIdDesc();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有日期
|
||||||
|
*
|
||||||
|
* @return 日期集合
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<String> findDate() {
|
||||||
|
return baseMapper.findDate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
|||||||
|
<?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.ruoyi.pt.mapper.CasesImportMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="findIdDesc" resultType="java.lang.Long">
|
||||||
|
select id from cases_import
|
||||||
|
order by id desc limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findDate" resultType="java.lang.String">
|
||||||
|
SELECT DISTINCT
|
||||||
|
DATE_FORMAT( case_date, '%Y-%m-%d' ) AS formattedDate
|
||||||
|
FROM
|
||||||
|
cases_import
|
||||||
|
ORDER BY
|
||||||
|
formattedDate;
|
||||||
|
</select>
|
||||||
|
</mapper>
|
Loading…
Reference in new issue