Browse Source

110举报投诉

master
laishajiang 2 years ago
parent
commit
f6bfbba180
  1. 57
      mailbox-lan/src/main/java/com/biutag/lan/controller/ReportController.java
  2. 111
      mailbox-lan/src/main/java/com/biutag/lan/domain/Report.java
  3. 23
      mailbox-lan/src/main/java/com/biutag/lan/domain/ReportAndMail.java
  4. 25
      mailbox-lan/src/main/java/com/biutag/lan/domain/ReportLog.java
  5. 20
      mailbox-lan/src/main/java/com/biutag/lan/domain/vo/ReportOptionsVO.java
  6. 10
      mailbox-lan/src/main/java/com/biutag/lan/mapper/ReportAndMailMapper.java
  7. 11
      mailbox-lan/src/main/java/com/biutag/lan/mapper/ReportLogMapper.java
  8. 10
      mailbox-lan/src/main/java/com/biutag/lan/mapper/ReportMapper.java
  9. 16
      mailbox-lan/src/main/java/com/biutag/lan/service/DataSyncScheduler.java
  10. 234
      mailbox-lan/src/main/java/com/biutag/lan/service/ReportService.java
  11. 39
      mailbox-lan/src/main/java/com/biutag/lan/validate/system/ReportSearchValidate.java
  12. 203
      mailbox-report/pom.xml
  13. 25
      mailbox-report/src/main/java/com/biutag/report/ReportApplication.java
  14. 30
      mailbox-report/src/main/java/com/biutag/report/controller/ReportController.java
  15. 107
      mailbox-report/src/main/java/com/biutag/report/domain/Report.java
  16. 113
      mailbox-report/src/main/java/com/biutag/report/domain/ReportVo.java
  17. 17
      mailbox-report/src/main/java/com/biutag/report/mapper/ReportMapper.java
  18. 62
      mailbox-report/src/main/java/com/biutag/report/service/ReportService.java
  19. 6
      mailbox-report/src/main/resources/application-dev.yml
  20. 7
      mailbox-report/src/main/resources/application-prod.yml
  21. 37
      mailbox-report/src/main/resources/application.yml
  22. 1
      mailbox-report/src/main/resources/license/license.dat
  23. 13
      mailbox-report/src/main/resources/license/words.license.xml
  24. 80
      mailbox-report/src/main/resources/log4j2-spring.xml
  25. 1
      pom.xml

57
mailbox-lan/src/main/java/com/biutag/lan/controller/ReportController.java

@ -0,0 +1,57 @@
package com.biutag.lan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.aop.NotPower;
import com.biutag.core.AjaxResult;
import com.biutag.lan.domain.Report;
import com.biutag.lan.domain.vo.ReportOptionsVO;
import com.biutag.lan.service.ReportService;
import com.biutag.lan.validate.system.DataSearchValidate;
import com.biutag.lan.validate.system.ReportSearchValidate;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@RequiredArgsConstructor
@RequestMapping("/api/report")
@RestController
public class ReportController {
private final ReportService reportService;
@NotPower
@GetMapping("list")
public AjaxResult<Page<Report>> list(Page page, ReportSearchValidate searchValidate) {
Page<Report> list = reportService.getlist(page, searchValidate);
return AjaxResult.success(list);
}
@NotPower
@PostMapping("addIntoMail")
public AjaxResult<Boolean> addIntoMail(@RequestBody Map<String,Object> report) {
return AjaxResult.success(reportService.addIntoMail(report.get("id")));
}
@NotPower
@PostMapping("addIntoBadMail")
public AjaxResult<Boolean> addIntoBadMail(@RequestBody Map<String,Object> report) {
return AjaxResult.success(reportService.addIntoBadMail(report.get("id"),report.get("reason")));
}
@NotPower
@GetMapping("detail")
public AjaxResult<Report> detail(String id) {
Report report = reportService.getdetail(id);
return AjaxResult.success(report);
}
@NotPower
@GetMapping("typelist")
public AjaxResult<List<ReportOptionsVO>> typelist() {
List<ReportOptionsVO> list = reportService.typelist();
return AjaxResult.success(list);
}
@NotPower
@GetMapping("naturelist")
public AjaxResult<List<ReportOptionsVO>> naturelist() {
List<ReportOptionsVO> list = reportService.naturelist();
return AjaxResult.success(list);
}
}

111
mailbox-lan/src/main/java/com/biutag/lan/domain/Report.java

@ -0,0 +1,111 @@
package com.biutag.lan.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Setter
@Getter
public class Report {
private String id;
private String jjdbh;
/**
* 报警人姓名
*/
private String contactName;
/**
* 报警类型
*/
private String jjlxdmms;
/**
* 报警内容
*/
private String content;
/**
* 报警电话
*/
private String contactPhone;
/**
* 管辖单位
*/
private String gxdwmc;
/**
*接警性质
*/
private String ysjqxzmc;
/**
*接警员姓名
*/
private String jjyxm;
/**
*报警人联系电话
*/
private String bjrlxdh;
/**
*摘机时间
*/
private String bjsj;
/**
*话终时间
*/
private String hzsj;
/**
*处理类型
*/
private String cllxdmms;
/**
*警情级别
*/
private String jqjbms;
/**
*警情阶段
*/
private String jjdztms;
/**
*警区名称
*/
private String jqmc;
/**
*报警X坐标
*/
private String bjxzb;
/**
*报警Y坐标
*/
private String bjyzb;
/**
*反馈结警
*/
private String xchfnr;
/**
*创建时间
*/
private String cjsj;
/**
*是否被纳入无效类状态
*/
private String status;
/**
*报警坐标
*/
private String bjzb;
/**
*案发地址
*/
private String afdd;
/**
*性别
*/
private String bjrxbms;
/**
*身份
*/
private String bjrsfms;
}

23
mailbox-lan/src/main/java/com/biutag/lan/domain/ReportAndMail.java

@ -0,0 +1,23 @@
package com.biutag.lan.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Setter
@Getter
@TableName("mail_report_mapping")
public class ReportAndMail {
private String id;
private String mailid;
private String reportid;
private String jjdbh;
}

25
mailbox-lan/src/main/java/com/biutag/lan/domain/ReportLog.java

@ -0,0 +1,25 @@
package com.biutag.lan.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
@Accessors(chain = true)
@Setter
@Getter
@TableName("reportlog")
public class ReportLog {
private String id;
private String caseNos;
@TableField("update_time")
private String updateTime;
private String count;
}

20
mailbox-lan/src/main/java/com/biutag/lan/domain/vo/ReportOptionsVO.java

@ -0,0 +1,20 @@
package com.biutag.lan.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class ReportOptionsVO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private Integer id;
@ApiModelProperty(value = "名称")
private String labelName;
}

10
mailbox-lan/src/main/java/com/biutag/lan/mapper/ReportAndMailMapper.java

@ -0,0 +1,10 @@
package com.biutag.lan.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.lan.domain.ReportAndMail;
public interface ReportAndMailMapper extends BaseMapper<ReportAndMail> {
}

11
mailbox-lan/src/main/java/com/biutag/lan/mapper/ReportLogMapper.java

@ -0,0 +1,11 @@
package com.biutag.lan.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.lan.domain.Report;
import com.biutag.lan.domain.ReportLog;
public interface ReportLogMapper extends BaseMapper<ReportLog> {
}

10
mailbox-lan/src/main/java/com/biutag/lan/mapper/ReportMapper.java

@ -0,0 +1,10 @@
package com.biutag.lan.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.lan.domain.Report;
public interface ReportMapper extends BaseMapper<Report> {
}

16
mailbox-lan/src/main/java/com/biutag/lan/service/DataSyncScheduler.java

@ -0,0 +1,16 @@
package com.biutag.lan.service;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
public class DataSyncScheduler {
private final ReportService dataSourceService;
public DataSyncScheduler(ReportService dataSourceService) {
this.dataSourceService = dataSourceService;
}
@Scheduled(fixedRate = 120 * 60 * 1000) // 每5分钟执行一次
public void syncDataSourcesPeriodically() {
dataSourceService.syncData();
}
}

234
mailbox-lan/src/main/java/com/biutag/lan/service/ReportService.java

@ -0,0 +1,234 @@
package com.biutag.lan.service;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.exception.BusinessException;
import com.biutag.lan.domain.*;
import com.biutag.lan.domain.bo.FlowAction;
import com.biutag.lan.domain.bo.MailOuter;
import com.biutag.lan.domain.vo.ReportOptionsVO;
import com.biutag.lan.mapper.ReportAndMailMapper;
import com.biutag.lan.mapper.ReportLogMapper;
import com.biutag.lan.mapper.ReportMapper;
import com.biutag.lan.validate.system.DataSearchValidate;
import com.biutag.lan.validate.system.ReportSearchValidate;
import com.google.gson.Gson;
import jakarta.annotation.Resource;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
@Slf4j
@RequiredArgsConstructor
@Service
public class ReportService extends ServiceImpl<ReportMapper, Report> {
@Resource
MailService mailService;
@Resource
MailSourceService mailSourceService;
@Resource
ReportMapper reportMapper;
@Resource
ReportLogMapper reportLogMapper;
@Resource
ReportAndMailMapper reportAndMailMapper;
public void syncData() {
List<Report> list = getReomteReport();
LambdaQueryWrapper<ReportLog> lambdaQueryWrapper = new LambdaQueryWrapper<ReportLog>().orderByDesc(ReportLog::getUpdateTime).last("LIMIT 1");
ReportLog reportLog = reportLogMapper.selectOne(lambdaQueryWrapper);
int count = 0 ;
StringBuilder sb = new StringBuilder();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
if (reportLog == null){
for (int i = 0; i < list.size(); i++){
String logTime = "2023-01-01 00:00:00";
LocalDateTime dateTime = LocalDateTime.parse(list.get(i).getCjsj(), formatter);
LocalDateTime lastdateTime = LocalDateTime.parse(logTime, formatter);
if (dateTime.isAfter(lastdateTime)){
reportMapper.insert(list.get(i));
sb.append(list.get(i).getJjdbh());
if (i < list.size() - 1) {
sb.append(",");
}
count++;
}
}
}else{
for (int i = 0; i < list.size(); i++){
String logTime = reportLog.getUpdateTime();
LocalDateTime dateTime = LocalDateTime.parse(list.get(i).getCjsj(), formatter);
LocalDateTime lastdateTime = LocalDateTime.parse(logTime, formatter);
if (dateTime.isAfter(lastdateTime)){
reportMapper.insert(list.get(i));
sb.append(list.get(i).getJjdbh());
if (i < list.size() - 1) {
sb.append(",");
}
count++;
}
}
}
if (count == 0){
return;
}
ReportLog updateLog = new ReportLog();
updateLog.setUpdateTime(LocalDateTime.now().format(formatter));
updateLog.setCount(String.valueOf(count));
updateLog.setCaseNos(sb.toString());
reportLogMapper.insert(updateLog);
}
public Page<Report> getlist(Page page, ReportSearchValidate searchValidate) {
QueryWrapper<Report> queryWrapper = new QueryWrapper<Report>()
.eq("status", "initial")
.ge(StrUtil.isNotBlank(searchValidate.getSearchStartTime()), "hzsj", searchValidate.getSearchStartTime())
.le(StrUtil.isNotBlank(searchValidate.getSearchEndTime()), "hzsj", searchValidate.getSearchEndTime())
.eq(StrUtil.isNotBlank(searchValidate.getContactName()), "contact_name", searchValidate.getContactName())
.eq(StrUtil.isNotBlank(searchValidate.getType()), "jjlxdmms", searchValidate.getType())
.eq(StrUtil.isNotBlank(searchValidate.getNature()), "ysjqxzmc", searchValidate.getNature())
.like(StrUtil.isNotBlank(searchValidate.getUnit()), "gxdwmc", searchValidate.getUnit())
.like(StrUtil.isNotBlank(searchValidate.getContactPhone()), "contact_phone", searchValidate.getContactPhone());
List<Report> list = reportMapper.selectList(page,queryWrapper);
Page<Report> dataVoPage = new Page<>();
dataVoPage.setRecords(list);
dataVoPage.setTotal(page.getTotal());
dataVoPage.setCurrent(page.getCurrent());
dataVoPage.setSize(page.getSize());
dataVoPage.setPages(page.getPages());
return dataVoPage;
}
public static List<Report> getReomteReport() {
String url = String.format("http://127.0.0.1:8083/api/server/report/list");
HttpResponse httpResponse = HttpUtil.createGet(url)
.execute();
JSONObject data = JSON.parseObject(httpResponse.body());
String report = data.getString("data");
Gson gson = new Gson();
Type contactListType = new TypeToken<List<Report>>() {}.getType();
List<Report> reports = gson.fromJson(report, contactListType);
if (StrUtil.isBlank(report)) {
log.error("response: {}", JSON.toJSONString(data));
throw new BusinessException("获取110数据异常,code: " + data.getInteger("errcode"));
}
return reports;
}
public Report getdetail(String id) {
LambdaQueryWrapper<Report> lambdaQueryWrapper = new LambdaQueryWrapper<Report>().eq(Report::getId,id);
Report report = baseMapper.selectOne(lambdaQueryWrapper);
return report;
}
public List<ReportOptionsVO> typelist() {
QueryWrapper<Report> queryWrapper = new QueryWrapper<>();
queryWrapper.select("DISTINCT jjlxdmms ").eq("status", "initial");
List<Report> list = baseMapper.selectList(queryWrapper);
List<ReportOptionsVO> listvo = new ArrayList<>();
int count = 1;
for (Report item :list){
if (item==null){
break;
}
ReportOptionsVO reportOptionsVO = new ReportOptionsVO();
reportOptionsVO.setId(count);
reportOptionsVO.setLabelName(item.getJjlxdmms());
count++;
listvo.add(reportOptionsVO);
}
return listvo;
}
public List<ReportOptionsVO> naturelist() {
QueryWrapper<Report> queryWrapper = new QueryWrapper<>();
queryWrapper.select("DISTINCT ysjqxzmc ").eq("status", "initial");
List<Report> list = baseMapper.selectList(queryWrapper);
List<ReportOptionsVO> listvo = new ArrayList<>();
int count = 1;
for (Report item :list){
if (item==null){
break;
}
ReportOptionsVO reportOptionsVO = new ReportOptionsVO();
reportOptionsVO.setId(count);
reportOptionsVO.setLabelName(item.getYsjqxzmc());
count++;
listvo.add(reportOptionsVO);
}
return listvo;
}
public Boolean addIntoMail(Object id) {
LambdaQueryWrapper<Report> lambdaQueryWrapper = new LambdaQueryWrapper<Report>().eq(Report::getId,id.toString());
Report report = baseMapper.selectOne(lambdaQueryWrapper);
MailOuter mail = new MailOuter();
mail.setSource(MailSource.Source.REPORT_COMPLAINTS.getValue());
mail.setContactName(report.getContactName());
mail.setContent(report.getContent());
mail.setContactPhone(report.getContactPhone());
LocalDateTime now = LocalDateTime.now();
mail.setId(mailService.generateMailId(mail.getSource()));
mail.setMailTime(now);
mail.setCreateTime(now);
ReportAndMail reportAndMail = new ReportAndMail();
reportAndMail.setReportid(id.toString());
reportAndMail.setMailid(mail.getId());
reportAndMail.setJjdbh(report.getJjdbh());
UpdateWrapper<Report> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("id", id.toString()).set("status", "INVALID");
baseMapper.update(updateWrapper);
reportAndMailMapper.insert(reportAndMail);
return mailSourceService.saveBatch(Collections.singletonList(mail));
}
public Boolean addIntoBadMail(Object id,Object reason) {
LambdaQueryWrapper<Report> lambdaQueryWrapper = new LambdaQueryWrapper<Report>().eq(Report::getId,id.toString());
Report report = baseMapper.selectOne(lambdaQueryWrapper);
MailOuter mail = new MailOuter();
mail.setSource(MailSource.Source.REPORT_COMPLAINTS.getValue());
mail.setContactName(report.getContactName());
mail.setContent(report.getContent());
mail.setContactPhone(report.getContactPhone());
mail.setContactPhone(report.getContactPhone());
LocalDateTime now = LocalDateTime.now();
mail.setId(mailService.generateMailId(mail.getSource()));
mail.setMailTime(now);
mail.setCreateTime(now);
ReportAndMail reportAndMail = new ReportAndMail();
reportAndMail.setReportid(id.toString());
reportAndMail.setMailid(mail.getId());
reportAndMail.setJjdbh(report.getJjdbh());
reportAndMailMapper.insert(reportAndMail);
UpdateWrapper<Report> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("id", id.toString()).set("status", "INVALID");
baseMapper.update(updateWrapper);
mailSourceService.saveBatch(Collections.singletonList(mail));
FlowAction flowAction = new FlowAction();
flowAction.setFlowKey("first_sign");
flowAction.setMailId(mail.getId());
String jsonString = "{\"mailFirstCategory\":\"无效类\",\"mailSecondCategory\":null,\"mailThreeCategory\":null,\"mailCategory\":\"无效类\",\"invalidationReason\":\""+reason.toString()+"\"}";
JSONObject jsonObject = JSONObject.parseObject(jsonString);
flowAction.setData(jsonObject);
flowAction.setNextActionKey("confirmedCompletion");
return mailService.next(flowAction);
}
}

39
mailbox-lan/src/main/java/com/biutag/lan/validate/system/ReportSearchValidate.java

@ -0,0 +1,39 @@
package com.biutag.lan.validate.system;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel("通知搜素参数")
public class ReportSearchValidate implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "报警电话")
private String contactPhone;
@ApiModelProperty(value = "话终时间")
private String searchTime;
@ApiModelProperty(value = "话终时间")
private String searchStartTime;
@ApiModelProperty(value = "话终时间")
private String searchEndTime;
@ApiModelProperty(value = "报警类型")
private String type;
@ApiModelProperty(value = "报警人名")
private String contactName;
@ApiModelProperty(value = "接警性质")
private String nature;
@ApiModelProperty(value = "管辖单位")
private String unit;
}

203
mailbox-report/pom.xml

@ -0,0 +1,203 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.biutag</groupId>
<artifactId>mailbox-boot</artifactId>
<version>1.0</version>
</parent>
<artifactId>mailbox-report</artifactId>
<description>局长信箱-110</description>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>com.tongweb.springboot</groupId>
<artifactId>tongweb-spring-boot-starter-3.x</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>Vastbase</groupId>
<artifactId>VastbaseG100_jdbc</artifactId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mailbox-common</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>com.github.penggle</groupId>
<artifactId>kaptcha</artifactId>
<version>2.3.2</version>
</dependency>
<!-- SaToken -->
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot3-starter</artifactId>
<version>1.37.0</version>
</dependency>
<!-- Quartz-Scheduler -->
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
</dependency>
<!-- 缓存 -->
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
</dependency>
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>15.8.0</version>
</dependency>
<dependency>
<groupId>jakarta.websocket</groupId>
<artifactId>jakarta.websocket-api</artifactId>
<version>2.2.0-M1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.websocket</groupId>
<artifactId>jakarta.websocket-client-api</artifactId>
<version>2.2.0-M1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>alibabacloud-dysmsapi20170525</artifactId>
<version>2.0.24</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>19.3.0.0</version>
</dependency>
<dependency>
<groupId>com.dameng</groupId>
<artifactId>DmJdbcDriver18</artifactId>
<version>8.1.3.140</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>9</source>
<target>9</target>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>application.yml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<finalName>mailbox-lan</finalName>
</build>
</project>

25
mailbox-report/src/main/java/com/biutag/report/ReportApplication.java

@ -0,0 +1,25 @@
package com.biutag.report;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
//@EnableScheduling
//@Configuration
//@ComponentScan(basePackages = {"com.biutag.*"})
//@EnableTransactionManagement
@MapperScan(basePackages = {"com.biutag.report.mapper"})
@SpringBootApplication(exclude = {RedisAutoConfiguration.class,RedisRepositoriesAutoConfiguration.class})
public class ReportApplication {
public static void main(String[] args) {
SpringApplication.run(ReportApplication.class, args);
}
}

30
mailbox-report/src/main/java/com/biutag/report/controller/ReportController.java

@ -0,0 +1,30 @@
package com.biutag.report.controller;
import com.biutag.aop.NotLogin;
import com.biutag.aop.NotPower;
import com.biutag.core.AjaxResult;
import com.biutag.report.domain.Report;
import com.biutag.report.domain.ReportVo;
import com.biutag.report.service.ReportService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RequiredArgsConstructor
@RequestMapping("/api/server/report")
@RestController
public class ReportController {
private final ReportService reportService;
@NotPower
@NotLogin
@GetMapping("list")
public AjaxResult<List<ReportVo>> list() {
List<ReportVo> list = reportService.syncData();
return AjaxResult.success(list);
}
}

107
mailbox-report/src/main/java/com/biutag/report/domain/Report.java

@ -0,0 +1,107 @@
package com.biutag.report.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
@Accessors(chain = true)
@Setter
@Getter
@TableName("V_T_JCJ_JJD")
//@TableName("V_DCZD_JJD")
public class Report {
private String jjdbh;
/**
* 报警人姓名
*/
private String bjrxm;
/**
* 报警类型
*/
private String jjlxdmms;
/**
* 报警内容
*/
private String bjnr;
/**
* 报警电话
*/
private String bjdh;
/**
* 管辖单位
*/
private String gxdwmc;
/**
*接警性质
*/
private String ysjqxzmc;
/**
*接警员姓名
*/
private String jjyxm;
/**
*报警人联系电话
*/
private String bjrlxdh;
/**
*摘机时间
*/
private String bjsj;
/**
*话终时间
*/
private String hzsj;
/**
*处理类型
*/
private String cllxdmms;
/**
*警情级别
*/
private String jqjbms;
/**
*警情阶段
*/
private String jjdztms;
/**
*警区名称
*/
private String jqmc;
/**
*报警X坐标
*/
private String bjxzb;
/**
*报警Y坐标
*/
private String bjyzb;
/**
*反馈结警
*/
private String xchfnr;
/**
*创建时间
*/
private String cjsj;
/**
*案发地址
*/
private String afdd;
/**
*性别
*/
private String bjrxbms;
/**
*身份
*/
private String bjrsfms;
}

113
mailbox-report/src/main/java/com/biutag/report/domain/ReportVo.java

@ -0,0 +1,113 @@
package com.biutag.report.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@Setter
@Getter
public class ReportVo {
private String jjdbh;
/**
* 报警人姓名
*/
private String contactName;
/**
* 报警类型
*/
private String jjlxdmms;
/**
* 报警内容
*/
private String content;
/**
* 报警电话
*/
private String contactPhone;
/**
* 管辖单位
*/
private String gxdwmc;
/**
*接警性质
*/
private String ysjqxzmc;
/**
*接警员姓名
*/
private String jjyxm;
/**
*报警人联系电话
*/
private String bjrlxdh;
/**
*摘机时间
*/
private String bjsj;
/**
*话终时间
*/
private String hzsj;
/**
*处理类型
*/
private String cllxdmms;
/**
*警情级别
*/
private String jqjbms;
/**
*警情阶段
*/
private String jjdztms;
/**
*警区名称
*/
private String jqmc;
/**
*报警X坐标
*/
private String bjxzb;
/**
*报警Y坐标
*/
private String bjyzb;
/**
*反馈结警
*/
private String xchfnr;
/**
*创建时间
*/
private String cjsj;
/**
*是否被纳入无效类状态
*/
private String status;
/**
*报警坐标
*/
private String bjzb;
/**
*案发地址
*/
private String afdd;
/**
*性别
*/
private String bjrxbms;
/**
*身份
*/
private String bjrsfms;
}

17
mailbox-report/src/main/java/com/biutag/report/mapper/ReportMapper.java

@ -0,0 +1,17 @@
package com.biutag.report.mapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.biutag.report.domain.Report;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface ReportMapper extends BaseMapper<Report> {
}

62
mailbox-report/src/main/java/com/biutag/report/service/ReportService.java

@ -0,0 +1,62 @@
package com.biutag.report.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.report.domain.Report;
import com.biutag.report.domain.ReportVo;
import com.biutag.report.mapper.ReportMapper;
import jakarta.annotation.Resource;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@RequiredArgsConstructor
@Service
public class ReportService extends ServiceImpl<ReportMapper, Report> {
public List<ReportVo> syncData() {
QueryWrapper<Report> queryWrapper = new QueryWrapper<>();
queryWrapper.select("DISTINCT * ");
// queryWrapper.select("DISTINCT BJDH,BJRXM,afdd,bjrxbms,bjrsfms,JJLXDMMS," +
// "GXDWMC,YSJQXZMC,JQXZMC,BJNR,hzsj,bjrlxdh,jqjbms,jjdztms,bjxzb,bjyzb,XCHFNR ");
List<Report> list = baseMapper.selectList(queryWrapper);
List<ReportVo> listVo = new ArrayList<>();
for (Report report : list){
ReportVo reportVo = new ReportVo();
BeanUtils.copyProperties(report, reportVo);
if (report.getBjrxm()!=null){
reportVo.setContactName(report.getBjrxm().trim());
}else {
reportVo.setContactName(report.getBjrxm());
}
if (report.getBjdh()!=null){
reportVo.setContactPhone(report.getBjdh().trim());
}else {
reportVo.setContactPhone(report.getBjdh());
}
if (report.getJjlxdmms()!=null){
reportVo.setJjlxdmms(report.getJjlxdmms().trim());
}else {
reportVo.setJjlxdmms(report.getJjlxdmms());
}
if (report.getBjxzb()!=null&&report.getBjyzb()!=null){
reportVo.setBjzb(report.getBjxzb()+","+report.getBjyzb());
}
reportVo.setContent(report.getBjnr());
reportVo.setStatus("initial");
listVo.add(reportVo);
}
return listVo;
}
}

6
mailbox-report/src/main/resources/application-dev.yml

@ -0,0 +1,6 @@
spring:
datasource:
url: jdbc:oracle:thin:@127.0.0.1:1521:orcl
username: scott
password: a

7
mailbox-report/src/main/resources/application-prod.yml

@ -0,0 +1,7 @@
spring:
datasource:
url: jdbc:dm://65.32.34.9:5237?SCHEMA=CSGA110
username: dczd_cx
password: dczd#110110

37
mailbox-report/src/main/resources/application.yml

@ -0,0 +1,37 @@
server:
port: 8083
tongweb:
license:
path: classpath:license/license.dat
spring:
profiles:
active: @profiles.active@
datasource:
driver-class-name: oracle.jdbc.OracleDriver
#driver-class-name: dm.jdbc.driver.DmDriver
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
mybatis-plus:
# 对应的 XML 文件位置
mapper-locations: classpath*:mapper/*Mapper.xml
# Sa-token配置
sa-token:
token-name: admin # token的名称
timeout: 86400 # token有效期单位s 默认24小时(24 * 60 * 60)
active-timeout: -1 # token临时有效期(指定时间无操作掉线)
is-concurrent: false # 是否允许同一账号并发登录
is-share: false # 多人同登账号共用token
token-style: random-64 # token生成的风格
is-print: false # 打印版本字符画
is-log: false # 是否输出操作日志
logging:
level:
root: INFO
com.biutag: debug

1
mailbox-report/src/main/resources/license/license.dat

@ -0,0 +1 @@
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NrN

13
mailbox-report/src/main/resources/license/words.license.xml

@ -0,0 +1,13 @@
<License>
<Data>
<Products>
<Product>Aspose.Total for Java</Product>
<Product>Aspose.Words for Java</Product>
</Products>
<EditionType>Enterprise</EditionType>
<SubscriptionExpiry>20991231</SubscriptionExpiry>
<LicenseExpiry>20991231</LicenseExpiry>
<SerialNumber>8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7</SerialNumber>
</Data>
<Signature>sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU=</Signature>
</License>

80
mailbox-report/src/main/resources/log4j2-spring.xml

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 日志级别排序: OFF > FATAL > ERROR > WARN > INFO > DEBUG > TRACE > ALL -->
<configuration monitorInterval="5">
<!-- 变量配置 -->
<Properties>
<property name="LOG_PATTERN" value="%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n" />
<property name="FILE_PATH" value="./logs/admin" />
<property name="FILE_NAME" value="admin-log4j2" />
</Properties>
<appenders>
<!-- 控制台输出 -->
<console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="${LOG_PATTERN}"/>
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
</console>
<!-- 临时测试日志 -->
<File name="Filelog" fileName="${FILE_PATH}/test.log" append="false">
<PatternLayout pattern="${LOG_PATTERN}"/>
</File>
<!-- Info日志分割压缩 -->
<RollingFile name="RollingFileInfo" fileName="${FILE_PATH}/info.log" filePattern="${FILE_PATH}/${FILE_NAME}-INFO-%d{yyyy-MM-dd}_%i.log.gz">
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="${LOG_PATTERN}"/>
<Policies>
<TimeBasedTriggeringPolicy interval="1"/>
<SizeBasedTriggeringPolicy size="10MB"/>
</Policies>
<DefaultRolloverStrategy max="15"/>
</RollingFile>
<!-- warn日志分割压缩 -->
<RollingFile name="RollingFileWarn" fileName="${FILE_PATH}/warn.log" filePattern="${FILE_PATH}/${FILE_NAME}-WARN-%d{yyyy-MM-dd}_%i.log.gz">
<ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="${LOG_PATTERN}"/>
<Policies>
<TimeBasedTriggeringPolicy interval="1"/>
<SizeBasedTriggeringPolicy size="10MB"/>
</Policies>
<DefaultRolloverStrategy max="15"/>
</RollingFile>
<!-- error日志分割压缩 -->
<RollingFile name="RollingFileError" fileName="${FILE_PATH}/error.log" filePattern="${FILE_PATH}/${FILE_NAME}-ERROR-%d{yyyy-MM-dd}_%i.log.gz">
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="${LOG_PATTERN}"/>
<Policies>
<TimeBasedTriggeringPolicy interval="1"/>
<SizeBasedTriggeringPolicy size="10MB"/>
</Policies>
<DefaultRolloverStrategy max="15"/>
</RollingFile>
</appenders>
<loggers>
<!-- 过滤指定DEBUG信息 -->
<logger name="org.mybatis" level="info" additivity="false">
<AppenderRef ref="Console"/>
</logger>
<!-- 监控系统信息 -->
<Logger name="org.springframework" level="info" additivity="false">
<AppenderRef ref="Console"/>
</Logger>
<!-- 初始化日志 -->
<root level="DEBUG">
<appender-ref ref="Console"/>
<appender-ref ref="Filelog"/>
<appender-ref ref="RollingFileInfo"/>
<appender-ref ref="RollingFileWarn"/>
<appender-ref ref="RollingFileError"/>
</root>
</loggers>
</configuration>

1
pom.xml

@ -97,6 +97,7 @@
<module>mailbox-outer</module> <module>mailbox-outer</module>
<module>mailbox-lan</module> <module>mailbox-lan</module>
<module>mailbox-outer-admin</module> <module>mailbox-outer-admin</module>
<module>mailbox-report</module>
</modules> </modules>
<packaging>pom</packaging> <packaging>pom</packaging>

Loading…
Cancel
Save