From 5ffbb5d2fc7991026ed898cc998fb442707ae792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E7=88=B1=E5=AD=A6=E4=B9=A0=E7=9A=84=E7=9F=B3?= =?UTF-8?q?=E5=90=8C=E5=AD=A6?= <2936013465@qq.com> Date: Wed, 15 Jan 2025 09:01:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constants/WorkDynamicConstants.java | 12 + .../data/VideoInspectionController.java | 1 + .../controller/datav/AuditController.java | 45 ++++ .../datav/DataMailViewController.java | 4 +- .../datav/DataVCaseVerifController.java | 2 +- .../datav/SupervisionNotifyController.java | 18 +- .../datav/VideoSuperviseController.java | 4 +- .../SubOneSupervisionNotifyController.java | 16 +- .../mapper/DataPetition12337Mapper.java | 4 +- .../mapper/DataPetitionComplaintMapper.java | 42 +-- .../biutag/supervision/mapper/MailMapper.java | 13 + .../mapper/SupExternalDepartMapper.java | 9 + .../biutag/supervision/pojo/entity/News.java | 4 +- .../biutag/supervision/pojo/vo/EchartsVo.java | 17 ++ .../supervision/pojo/vo/MailMapIconVo.java | 2 + .../biutag/supervision/pojo/vo/NewsVo.java | 36 +++ .../supervision/service/DataMailService.java | 245 ++++++++---------- .../DataSupervisionNotifyServiceImpl.java | 104 +------- .../supervision/service/NewsService.java | 29 +++ src/main/resources/application-dev.yml | 4 + 20 files changed, 322 insertions(+), 289 deletions(-) create mode 100644 src/main/java/com/biutag/supervision/constants/WorkDynamicConstants.java create mode 100644 src/main/java/com/biutag/supervision/controller/datav/AuditController.java create mode 100644 src/main/java/com/biutag/supervision/pojo/vo/NewsVo.java diff --git a/src/main/java/com/biutag/supervision/constants/WorkDynamicConstants.java b/src/main/java/com/biutag/supervision/constants/WorkDynamicConstants.java new file mode 100644 index 0000000..3af0fd3 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/WorkDynamicConstants.java @@ -0,0 +1,12 @@ +package com.biutag.supervision.constants; + +/** + * @Auther: sh + * @Date: 2025/1/14 10:27 + * @Description: 动作动态常量 + */ +public class WorkDynamicConstants { + public static final String DCGZDT = "督察工作动态"; + public static final String SJGZDT = "审计工作动态"; +} + diff --git a/src/main/java/com/biutag/supervision/controller/data/VideoInspectionController.java b/src/main/java/com/biutag/supervision/controller/data/VideoInspectionController.java index 2f64cfe..5a74ed0 100644 --- a/src/main/java/com/biutag/supervision/controller/data/VideoInspectionController.java +++ b/src/main/java/com/biutag/supervision/controller/data/VideoInspectionController.java @@ -43,6 +43,7 @@ public class VideoInspectionController { @Value("${videoInspection.url}") private String videoInspectionUrl; +// private static final String videoInspectionUrl = "http://65.47.26.33:8090/"; @GetMapping public Result> list(VideoInspectionQueryParam param) { diff --git a/src/main/java/com/biutag/supervision/controller/datav/AuditController.java b/src/main/java/com/biutag/supervision/controller/datav/AuditController.java new file mode 100644 index 0000000..6045492 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/datav/AuditController.java @@ -0,0 +1,45 @@ +package com.biutag.supervision.controller.datav; + +import com.alibaba.fastjson.JSONObject; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.vo.NewsVo; +import com.biutag.supervision.service.NewsService; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Date; +import java.util.List; + +import static com.biutag.supervision.constants.WorkDynamicConstants.SJGZDT; + + +/** + * @Auther: sh + * @Date: 2025/1/14 09:11 + * @Description: + */ +@Tag(name = "审计督察大屏相关") +@RequestMapping("datav/audit") +@RequiredArgsConstructor +@RestController +public class AuditController { + private final NewsService newsService; + + + + + @GetMapping("/getWorkDynamics") + public Result getWorkDynamics(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + List newsVoList = newsService.getWorkDynamics(beginTime, endTime, SJGZDT, null); + JSONObject data = new JSONObject().fluentPut("newsVoList", newsVoList); + return Result.success(data); + } + +} + diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java b/src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java index 44cedff..a0bb40e 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java @@ -136,11 +136,11 @@ public class DataMailViewController { public Result getMailTrend(@RequestParam Integer year) { List countryList = negativeMapper.getMailTrend(year, 21); List policeList = negativeMapper.getMailTrend(year, 22); - List manageList = negativeMapper.getMailTrend(year, 23); + List commissionerList = dataMailService.getCommissionerTrend(year); List numberList = dataPetition12337Mapper.getMailTrend12337(year); JSONObject data = new JSONObject().fluentPut("countryList", countryList) .fluentPut("policeList", policeList) - .fluentPut("manageList", manageList) + .fluentPut("commissionerList", commissionerList) .fluentPut("numberList", numberList); return Result.success(data); } diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java b/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java index e4a8810..bbd87f1 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java @@ -152,7 +152,7 @@ public class DataVCaseVerifController { * @return Result */ @GetMapping("/getConfinementAndPause") - public Result getConfinement(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + public Result getConfinementAndPause(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { List jbclList = negativeMapper.getConfinementAndPause(beginTime,endTime, 1); List tzclList = negativeMapper.getConfinementAndPause(beginTime, endTime, 2); // 停职 diff --git a/src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java b/src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java index 6e58975..62a12ab 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/SupervisionNotifyController.java @@ -5,6 +5,7 @@ import com.biutag.supervision.mapper.NegativeMapper; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.vo.*; import com.biutag.supervision.service.DataSupervisionNotifyServiceImpl; +import com.biutag.supervision.service.NewsService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; @@ -22,6 +23,7 @@ import java.util.Date; import java.util.List; import java.util.Map; +import static com.biutag.supervision.constants.WorkDynamicConstants.DCGZDT; import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.XCDC; import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.ZXDC; @@ -37,9 +39,9 @@ import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.ZXDC; @Tag(name = "现场督察相关") public class SupervisionNotifyController { - private final DataSupervisionNotifyServiceImpl dataSupervisionNotifyService; - private final NegativeMapper negativeMapper; + private final NewsService newsService; + // region 左边 /** @@ -95,7 +97,7 @@ public class SupervisionNotifyController { @Operation(summary = "获取现场督察大屏中央总览") @GetMapping("/getSupervisionNotifyCount") public Result getSupervisionNotifyCount(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { SupervisionNotifyOverView overview = negativeMapper.getAllSupervisionNotifyCount(beginTime, endTime); JSONObject data = new JSONObject().fluentPut("overview", overview); return Result.success(data); @@ -111,7 +113,7 @@ public class SupervisionNotifyController { @GetMapping("/getSupervisionNotifyMap") @Cacheable(cacheNames = "Supervision:Screen:SupervisionNotifyMap", key = "#beginTime.getTime()+'_'+#endTime.getTime()") public Result getSupervisionNotifyMap(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { //地图数据 List superviseTempMapVoList = negativeMapper.getSupervisionMapIconInfo(beginTime, endTime); JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", superviseTempMapVoList); @@ -237,6 +239,14 @@ public class SupervisionNotifyController { return Result.success(data); } + @GetMapping("/getWorkDynamics") + public Result getWorkDynamics(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + List newsVoList = newsService.getWorkDynamics(beginTime, endTime, DCGZDT, null); + JSONObject data = new JSONObject().fluentPut("newsVoList", newsVoList); + return Result.success(data); + } + // endregion diff --git a/src/main/java/com/biutag/supervision/controller/datav/VideoSuperviseController.java b/src/main/java/com/biutag/supervision/controller/datav/VideoSuperviseController.java index 37ff2f4..3f29ef4 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/VideoSuperviseController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/VideoSuperviseController.java @@ -98,7 +98,7 @@ public class VideoSuperviseController { } // 获取视频督察大屏中央问题趋势统计 - @Operation(summary = "数据大屏问题趋势统计") + @Operation(summary = "视频督察大屏问题趋势统计") @GetMapping("/getVideoSuperviseTrend") public Result getVideoSuperviseTrend(@RequestParam Integer year) { List videoSuperviseTrendList = negativeMapper.getTrend(year, SPDC.getValue()); @@ -111,7 +111,7 @@ public class VideoSuperviseController { // region 右边 // 问题类型占比 - @Operation(summary = "数据大屏问题类型占比") + @Operation(summary = "视频督察大屏问题类型占比") @GetMapping("/getVideoSuperviseProblemTypeRate") public Result getVideoSuperviseProblemTypeRate(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { diff --git a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java index d58fd96..92969ea 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; import com.biutag.supervision.mapper.NegativeMapper; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.vo.*; +import com.biutag.supervision.service.NewsService; import com.biutag.supervision.service.SubOneSupervisionNotifyService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; @@ -19,6 +20,9 @@ import org.springframework.web.bind.annotation.RestController; import java.util.Date; import java.util.List; +import static com.biutag.supervision.constants.WorkDynamicConstants.DCGZDT; + + /** * @Auther: sh * @Date: 2024/12/17 10:58 @@ -28,13 +32,14 @@ import java.util.List; @RestController @RequiredArgsConstructor @RequestMapping("datav/sub1/supervisonNotify") -@Tag(name = "现场督察相关") +@Tag(name = "二级现场督察相关") public class SubOneSupervisionNotifyController { private final SubOneSupervisionNotifyService subOneSupervisionNotifyService; private final NegativeMapper negativeMapper; + private final NewsService newsService; // region 左边 /** @@ -243,6 +248,15 @@ public class SubOneSupervisionNotifyController { return Result.success(data); } + @GetMapping("/getSubOneWorkDynamics") + public Result getSubOneWorkDynamics(@RequestParam Integer departId, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + List newsVoList = newsService.getWorkDynamics(beginTime, endTime, DCGZDT, departId.toString()); + JSONObject data = new JSONObject().fluentPut("newsVoList", newsVoList); + return Result.success(data); + } + // endregion diff --git a/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java b/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java index ec9995b..47a1bc7 100644 --- a/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java +++ b/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java @@ -30,7 +30,7 @@ public interface DataPetition12337Mapper extends BaseMapper { @Select("select count(*) from data_petition_12337 " + "where discover_time between #{beginTime} and #{endTime} " + "and second_depart_id=#{departId}") - Integer select12337MailBySourceCode(Date beginTime, Date endTime, String departId); + Long select12337MailBySourceCode(Date beginTime, Date endTime, String departId); @Select("SELECT " + @@ -50,7 +50,7 @@ public interface DataPetition12337Mapper extends BaseMapper { @Select("select count(*) from data_petition_12337 " + "where discover_time between #{beginTime} and #{endTime} " + "and third_depart_id=#{departId}") - Integer select12337PoliceMailBySourceCode(Date beginTime, Date endTime, Integer departId); + Long select12337PoliceMailBySourceCode(Date beginTime, Date endTime, Integer departId); } diff --git a/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java b/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java index 61c04a7..29ec4a8 100644 --- a/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java @@ -57,9 +57,9 @@ public interface DataPetitionComplaintMapper extends BaseMapper getMailRank(Date beginTime, Date endTime, Integer groupId, Integer isRepeat); - @Select("SELECT " + - "SUM( IF(dpc.problem_sources_code=21,1,0)) AS countryMail, " + - "SUM( IF(dpc.problem_sources_code=22,1,0)) AS policeMail " + - "FROM data_petition_complaint dpc " + - "WHERE dpc.discovery_time BETWEEN #{beginTime} AND #{endTime}" ) - MailOverviewVo selectMailOverviewVo(Date beginTime, Date endTime); - - - - @Select("SELECT " + "sd1.short_name AS label, " + "count(*) AS `value` FROM data_petition_complaint dpc " + @@ -106,9 +96,9 @@ public interface DataPetitionComplaintMapper extends BaseMapper getTeamMailLeaderRank(Date beginTime, Date endTime, Integer departId); - - @Select("SELECT " + - "SUM( IF(dpc.problem_sources_code=21,1,0)) AS countryMail, " + - "SUM( IF(dpc.problem_sources_code=22,1,0)) AS policeMail " + - "FROM data_petition_complaint dpc " + - "LEFT JOIN sup_depart sd ON dpc.third_depart_id=sd.id " + - "WHERE sd.pid=#{departId} " + - "AND dpc.discovery_time BETWEEN #{beginTime} AND #{endTime} ") - MailOverviewVo selectSubOneMailOverviewVo(Date beginTime, Date endTime, Integer departId); - - - @Select("SELECT " + "m.month_name AS `name`, " + "IFNULL(COUNT(sd.pid=#{departId}), 0) AS `value` " + @@ -260,8 +238,6 @@ public interface DataPetitionComplaintMapper extends BaseMapper getSubOneMailTrend(Integer year, Integer problemSourceCode, Integer departId); - - @Select("SELECT " + "COALESCE(SUM(IF(receiving_leader_name IS NOT NULL, 1, 0)), 0) AS leaderReview, " + "COALESCE(SUM(IF(entanglement_visits=1, 1, 0)), 0) AS entanglement, " + @@ -340,14 +316,12 @@ public interface DataPetitionComplaintMapper extends BaseMapper getTeamMassMailRank(Date beginTime, Date endTime, Integer departId); - - @Select("select count(*) " + "from data_petition_complaint dpc " + "where problem_sources_code=#{problemSourcesCode} " + "and dpc.third_depart_id=#{departId} " + "and discovery_time BETWEEN #{beginTime} AND #{endTime} ") - Integer selectPoliceMailBySourceCode(Date beginTime, Date endTime, String problemSourcesCode, String departId); + Long selectPoliceMailBySourceCode(Date beginTime, Date endTime, String problemSourcesCode, String departId); Page queryBooks(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); diff --git a/src/main/java/com/biutag/supervision/mapper/MailMapper.java b/src/main/java/com/biutag/supervision/mapper/MailMapper.java index 4ab5085..e8200c5 100644 --- a/src/main/java/com/biutag/supervision/mapper/MailMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/MailMapper.java @@ -3,6 +3,10 @@ package com.biutag.supervision.mapper; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.biutag.supervision.pojo.entity.mailbox.Mail; +import com.biutag.supervision.pojo.vo.EchartsVo; +import org.apache.ibatis.annotations.Select; + +import java.util.List; /** * @author wxc @@ -10,4 +14,13 @@ import com.biutag.supervision.pojo.entity.mailbox.Mail; */ @DS("mailbox") public interface MailMapper extends BaseMapper { + @Select("SELECT " + + "TO_CHAR(DATE_TRUNC('month', create_time), 'MM') AS name, " + + "COUNT(*) AS value " + + "FROM mailbox.mail " + + "WHERE EXTRACT(YEAR FROM create_time) = #{year} " + + "AND mail_state='terminated' " + + "GROUP BY TO_CHAR(DATE_TRUNC('month', create_time), 'MM') " + + "ORDER BY name;") + List selectTrendByYear(Integer year); } diff --git a/src/main/java/com/biutag/supervision/mapper/SupExternalDepartMapper.java b/src/main/java/com/biutag/supervision/mapper/SupExternalDepartMapper.java index e74a80e..975a672 100644 --- a/src/main/java/com/biutag/supervision/mapper/SupExternalDepartMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/SupExternalDepartMapper.java @@ -23,4 +23,13 @@ public interface SupExternalDepartMapper extends BaseMapper { @Select("select level from sup_external_depart where internal_id = #{internalDepartId}") SupExternalDepart selectLevelByDepartId(String internalDepartId); + + /** + * 根据内部单位ID和源头获取外部单位ID + * @param departId + * @param source + * @return + */ + @Select("SELECT external_id FROM sup_external_depart sed WHERE source=#{source} AND internal_id =#{departId}") + String getExIdByInId(String departId, String source); } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/News.java b/src/main/java/com/biutag/supervision/pojo/entity/News.java index 5a660eb..5e0e110 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/News.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/News.java @@ -42,8 +42,10 @@ public class News { @TableField("content_txt") private String contentTxt; - private String departId; private String departName; + @TableField("depart_id") + private String departId; + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/vo/EchartsVo.java b/src/main/java/com/biutag/supervision/pojo/vo/EchartsVo.java index 0934b3c..72705b4 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/EchartsVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/EchartsVo.java @@ -1,6 +1,11 @@ package com.biutag.supervision.pojo.vo; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.List; /** * @Auther: sh @@ -8,8 +13,20 @@ import lombok.Data; * @Description: */ @Data +@AllArgsConstructor +@NoArgsConstructor public class EchartsVo { private String name; private Integer value; + + public static List generateMonthlyData() { + List monthlyData = new ArrayList<>(); + String[] months = {"1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"}; + for (String month : months) { + monthlyData.add(new EchartsVo(month, 0)); + } + return monthlyData; + } + } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/MailMapIconVo.java b/src/main/java/com/biutag/supervision/pojo/vo/MailMapIconVo.java index c8508f5..1f6409b 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/MailMapIconVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/MailMapIconVo.java @@ -19,5 +19,7 @@ public class MailMapIconVo implements Serializable { private String policeTotal; private String commissionerTotal; private String numTotal; // 12337 + +// private String departPName; // 部门的父级名字 } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/NewsVo.java b/src/main/java/com/biutag/supervision/pojo/vo/NewsVo.java new file mode 100644 index 0000000..08ff3f5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/NewsVo.java @@ -0,0 +1,36 @@ +package com.biutag.supervision.pojo.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +/** + * @Auther: sh + * @Date: 2025/1/10 16:21 + * @Description: 工作动态VO + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class NewsVo implements java.io.Serializable { + // 动态来源 + private String source; + + // 动态分类 + private String workType; + + // 发布时间 + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime releaseTime; + + // 发布内容 + private String contentTxt; + +} + diff --git a/src/main/java/com/biutag/supervision/service/DataMailService.java b/src/main/java/com/biutag/supervision/service/DataMailService.java index 2e0517e..586a19e 100644 --- a/src/main/java/com/biutag/supervision/service/DataMailService.java +++ b/src/main/java/com/biutag/supervision/service/DataMailService.java @@ -1,36 +1,19 @@ package com.biutag.supervision.service; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.biutag.supervision.constants.enums.DataUpdateMethodEnum; -import com.biutag.supervision.constants.enums.DistributionStateEnum; -import com.biutag.supervision.constants.enums.HostLevelEnums; -import com.biutag.supervision.constants.enums.ProblemSourcesEnum; -import com.biutag.supervision.mapper.DataPetition12337Mapper; -import com.biutag.supervision.mapper.DataPetitionComplaintMapper; -import com.biutag.supervision.mapper.MailMapper; -import com.biutag.supervision.mapper.SupDepartMapper; -import com.biutag.supervision.pojo.dto.*; +import com.biutag.supervision.mapper.*; import com.biutag.supervision.pojo.entity.DataPetition12337; import com.biutag.supervision.pojo.entity.DataPetitionComplaint; import com.biutag.supervision.pojo.entity.SupDepart; import com.biutag.supervision.pojo.entity.mailbox.Mail; -import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam; +import com.biutag.supervision.pojo.vo.EchartsVo; import com.biutag.supervision.pojo.vo.MailMapIconVo; import com.biutag.supervision.pojo.vo.MailOverviewVo; import lombok.RequiredArgsConstructor; -import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; +import java.util.*; import static com.biutag.supervision.constants.enums.DepartGroupEnum.COUNTY_CITY_BUREAUS; import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.GABXF; @@ -40,131 +23,43 @@ import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.GJXFPT; @Service public class DataMailService extends ServiceImpl { - private final NegativeService negativeService; - + private final SupExternalDepartMapper supExternalDepartMapper; private final DataPetitionComplaintMapper dataPetitionComplaintMapper; private final DataPetition12337Mapper dataPetition12337Mapper; private final SupDepartMapper supDepartMapper; private final MailMapper mailMapper; + private final String VALID_SIGN = "terminated"; // 有效标识 + private final String EX_SOURCE = "局长信箱"; // 映射来源 - public Page page(DataPetitionComplaintQueryParam queryParam) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(DataPetitionComplaint::getProblemSourcesCode, queryParam.getProblemSourcesCode()) - .like(StrUtil.isNotBlank(queryParam.getOriginId()), DataPetitionComplaint::getOriginId, queryParam.getOriginId()) - .like(StrUtil.isNotBlank(queryParam.getThingDesc()), DataPetitionComplaint::getThingDesc, queryParam.getThingDesc()) - .orderByDesc(DataPetitionComplaint::getCreateTime); - if (queryParam.getDiscoveryTime().size() == 2) { - queryWrapper.between(DataPetitionComplaint::getDiscoveryTime, queryParam.getDiscoveryTime().get(0), queryParam.getDiscoveryTime().get(1)); - } - if (StrUtil.isNotBlank(queryParam.getResponderKey()) && StrUtil.isNotBlank(queryParam.getResponderValue())) { - switch (queryParam.getResponderKey()) { - case "name": - queryWrapper.like(DataPetitionComplaint::getResponderName, queryParam.getResponderValue()); - break; - case "phone": - queryWrapper.like(DataPetitionComplaint::getResponderPhone, queryParam.getResponderValue()); - break; - } - } - return page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); - } - - public boolean save(DataPetitionComplaintDto dto) { - DataPetitionComplaint dataPetitionComplaint = new DataPetitionComplaint(); - BeanUtil.copyProperties(dto, dataPetitionComplaint); - dataPetitionComplaint.setCreateTime(LocalDateTime.now()); - dataPetitionComplaint.setUpdateTime(LocalDateTime.now()); - return save(dataPetitionComplaint); - } - - public boolean save(DataPetitionComplaintAddDto body) { - LocalDateTime now = LocalDateTime.now(); - int index = 0; - for (DataPetitionComplaintImportDto dto : body.getData()) { - index++; - boolean exists = exists(new LambdaQueryWrapper().eq(DataPetitionComplaint::getOriginId, dto.getOriginId())); - // 增量更新 - if (DataUpdateMethodEnum.incremental.name().equals(body.getDataUpdateMethod()) && exists) { - throw new RuntimeException(String.format("第%s条数据的信件编号已存在,请核实", index)); - } - DataPetitionComplaint data = new DataPetitionComplaint(); - BeanUtils.copyProperties(dto, data); - - data.setCreateTime(now); - data.setUpdateTime(now); - data.setProblemSourcesCode(body.getProblemSourcesCode()); - data.setDistributionState(DistributionStateEnum.UNDISTRIBUTED.getValue()); - saveOrUpdate(data); - } - return true; - } - - public boolean distribution(DataDataPetitionComplainDistribute dataDistribute) { - dataDistribute.getData().forEach(item -> { - NegativeDto negativeDto = new NegativeDto(); - negativeDto.setOriginId(item.getOriginId()); - negativeDto.setDiscoveryTime(item.getDiscoveryTime()); - negativeDto.setProblemSourcesCode(item.getProblemSourcesCode()); - negativeDto.setProblemSources(ProblemSourcesEnum.get(item.getProblemSourcesCode()).getLabel()); -// negativeDto.setBusinessTypeCode(BusinessTypeEnum.ABWW); -// negativeDto.setBusinessTypeName(); - negativeDto.setResponderName(item.getResponderName()); - negativeDto.setContactPhone(item.getResponderPhone()); - negativeDto.setThingDesc(item.getThingDesc()); - String departId; - String departName; - if (StrUtil.isBlank(item.getThirdDepartId())) { - departId = item.getSecondDepartId(); - departName = item.getSecondDepartName(); - } else { - departId = item.getThirdDepartId(); - departName = item.getThirdDepartName(); - } - negativeDto.setInvolveDepartId(departId); - negativeDto.setInvolveDepartName(departName); - negativeDto.setHostLevel(HostLevelEnums.SECOND.getValue()); - - negativeDto.setApprovalFlow(dataDistribute.getApprovalFlow()); - negativeDto.setDepartId(departId); - negativeDto.setDepartName(departName); - negativeDto.setTimeLimit(dataDistribute.getTimeLimit()); - negativeDto.setMaxSignDuration(dataDistribute.getMaxSignDuration()); - negativeDto.setMaxHandleDuration(dataDistribute.getMaxHandleDuration()); - negativeDto.setMaxExtensionDuration(dataDistribute.getMaxExtensionDuration()); - negativeDto.setCaseNumber(item.getOriginId()); - negativeService.save(negativeDto); - update(new LambdaUpdateWrapper().eq(DataPetitionComplaint::getOriginId, item.getOriginId()) - .set(DataPetitionComplaint::getDistributionState, DistributionStateEnum.DISTRIBUTED.getValue())); - }); - return true; - } - - //所有分类数据总数 + // 一级信访大屏数据中央统计 public MailOverviewVo allMailCount(Date beginTime, Date endTime) { -// MailOverviewVo temp = dataPetitionComplaintMapper.selectMailOverviewVo(beginTime, endTime); MailOverviewVo temp = new MailOverviewVo(); + + // 国家信访 QueryWrapper countryQueryWrapper = new QueryWrapper<>(); countryQueryWrapper.eq("problem_sources_code", 21); countryQueryWrapper.between("discovery_time", beginTime, endTime); - Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper); // 国家信访 - System.out.println("国家信访数量:" + countryMail); + Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper); + // 公安部信访 QueryWrapper policeQueryWrapper = new QueryWrapper<>(); policeQueryWrapper.eq("problem_sources_code", 22); policeQueryWrapper.between("discovery_time", beginTime, endTime); - Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper); // 公安部信访 - System.out.println("公安部信访数量:" + policeMail); + Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper); + // 12337 QueryWrapper queryWrapper12337 = new QueryWrapper<>(); queryWrapper12337.between("discover_time", beginTime, endTime); Long numberMail = dataPetition12337Mapper.selectCount(queryWrapper12337); - temp.setNumberMail(numberMail); - System.out.println("12337信访数量:" + numberMail); + + // 局长信箱 QueryWrapper mailQueryWrapper = new QueryWrapper<>(); - mailQueryWrapper.ne("mail_state", "terminated"); + mailQueryWrapper.ne("mail_state", VALID_SIGN); + mailQueryWrapper.between("create_time", beginTime, endTime); Long manageMail = mailMapper.selectCount(mailQueryWrapper); + // 总数 Long totalMail = countryMail + policeMail + numberMail; temp.setCountryMail(countryMail); @@ -175,9 +70,10 @@ public class DataMailService extends ServiceImpl getMailMapIcon(Date beginTime, Date endTime) { List res = new ArrayList<>(); - // 查询所有区县局 + // 查询所有分县市局 List supDeparts = supDepartMapper.selectDepartsByGroupType(COUNTY_CITY_BUREAUS.getId()); for (SupDepart supDepart : supDeparts) { MailMapIconVo mapIconVo = new MailMapIconVo(); @@ -187,13 +83,11 @@ public class DataMailService extends ServiceImpl mailWrapper = new QueryWrapper<>(); + mailWrapper.between("create_time", beginTime, endTime); + mailWrapper.eq("mail_state", VALID_SIGN); + mailWrapper.eq("second_dept_id", exDepartId); + return mailMapper.selectCount(mailWrapper); + } + + + // 二级信访大屏中央数据统计 public MailOverviewVo getSubOneAllMailCount(Date beginTime, Date endTime, Integer departId) { -// MailOverviewVo temp = dataPetitionComplaintMapper.selectSubOneMailOverviewVo(beginTime, endTime, departId); MailOverviewVo temp = new MailOverviewVo(); + // 国家信访 QueryWrapper countryQueryWrapper = new QueryWrapper<>(); countryQueryWrapper.eq("problem_sources_code", 21); countryQueryWrapper.eq("second_depart_id", departId); countryQueryWrapper.between("discovery_time", beginTime, endTime); - Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper); // 国家信访 + Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper); + // 公安信访 QueryWrapper policeQueryWrapper = new QueryWrapper<>(); policeQueryWrapper.eq("problem_sources_code", 22); policeQueryWrapper.eq("second_depart_id", departId); policeQueryWrapper.between("discovery_time", beginTime, endTime); - Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper); // 公安部信访 + Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper); System.out.println("公安部信访数量:" + policeMail); // 12337信访 @@ -226,11 +135,15 @@ public class DataMailService extends ServiceImpl subOneMailQueryWrapper = new QueryWrapper<>(); - subOneMailQueryWrapper.ne("mail_state", "terminated"); - subOneMailQueryWrapper.eq("second_depart_id", departId); + String exDepartId = supExternalDepartMapper.getExIdByInId(departId.toString(), "局长信箱"); + subOneMailQueryWrapper.ne("mail_state", VALID_SIGN); + subOneMailQueryWrapper.eq("second_dept_id", exDepartId); + subOneMailQueryWrapper.between("create_time", beginTime, endTime); Long manageMail = mailMapper.selectCount(subOneMailQueryWrapper); + // 总数 Long totalMail = countryMail + policeMail + numberMail; temp.setCountryMail(countryMail); @@ -241,8 +154,11 @@ public class DataMailService extends ServiceImpl getSubOneMailMapIcon(Date beginTime, Date endTime, Integer departId) { List res = new ArrayList<>(); + // 查该区县局下属所有派出所 List policeDeparts = supDepartMapper.selectPoliceDeparts(departId); for (SupDepart supDepart : policeDeparts) { @@ -254,12 +170,12 @@ public class DataMailService extends ServiceImpl mailWrapper = new QueryWrapper<>(); + mailWrapper.between("create_time", beginTime, endTime); + mailWrapper.eq("mail_state", VALID_SIGN); + mailWrapper.eq("three_dept_id", exDepartId); + return mailMapper.selectCount(mailWrapper); + } + + // 一级信访大屏局长信箱趋势 + public List getCommissionerTrend(Integer year) { + List res = EchartsVo.generateMonthlyData(); + List temp = mailMapper.selectTrendByYear(year); + mappingMonth(res, temp); + return res; + } + + private static void mappingMonth(List res, List temp) { + Map monthMap = new HashMap<>(); + monthMap.put("01", "1月"); + monthMap.put("02", "2月"); + monthMap.put("03", "3月"); + monthMap.put("04", "4月"); + monthMap.put("05", "5月"); + monthMap.put("06", "6月"); + monthMap.put("07", "7月"); + monthMap.put("08", "8月"); + monthMap.put("09", "9月"); + monthMap.put("10", "10月"); + monthMap.put("11", "11月"); + monthMap.put("12", "12月"); + for (EchartsVo resVo : res) { + for (EchartsVo tempVo : temp) { + String month = monthMap.get(tempVo.getName()); + if (resVo.getName().equals(month)) { + resVo.setValue(tempVo.getValue()); + break; + } + } + } + } } diff --git a/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java b/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java index cbb6a63..30ab206 100644 --- a/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/DataSupervisionNotifyServiceImpl.java @@ -7,15 +7,9 @@ import com.biutag.supervision.constants.enums.DepartGroupEnum; import com.biutag.supervision.constants.enums.InspectCaseEnum; import com.biutag.supervision.constants.enums.ProblemSourcesEnum; import com.biutag.supervision.constants.enums.RepeatEnum; -import com.biutag.supervision.mapper.DataSupervisionNotifyMapper; -import com.biutag.supervision.mapper.NegativeBlameMapper; -import com.biutag.supervision.mapper.NegativeMapper; -import com.biutag.supervision.mapper.SupDepartMapper; +import com.biutag.supervision.mapper.*; import com.biutag.supervision.pojo.dto.CaseVerifDepart; -import com.biutag.supervision.pojo.entity.DataSupervisionNotify; -import com.biutag.supervision.pojo.entity.Negative; -import com.biutag.supervision.pojo.entity.NegativeBlame; -import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.pojo.entity.*; import com.biutag.supervision.pojo.vo.*; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -37,106 +31,16 @@ import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.XCDC; @Slf4j public class DataSupervisionNotifyServiceImpl extends ServiceImpl { - private final NegativeMapper negativeMapper; - -// region 左边 - - - - // 获取日常督察整改率排名 - public List getChangedRateRank(Integer groupType, Date beginTime, Date endTime) { - // Optional.ofNullable(rankVoRes).orElse(new ArrayList<>()); - List rankVoRes = negativeMapper.getChangedRateRank(beginTime, endTime, groupType); - return rankVoRes; - } - - //问题类型占比 - public List getProblemTypeRatio(Date beginTime, Date endTime) { - List echartsVos = negativeMapper.getProblemTypeRatio(beginTime, endTime); - return echartsVos; - } - -// endregion - -// region 中间 - - /** - * 获取所有 现场督察+专项督察 的数量 - * 现场督察代码: 13 专项督察代码: 15 - */ - public JSONObject getAllSupervisionNotifyCount(Date beginTime, Date endTime) { - - RankVoSupTwo res = negativeMapper.getTemp(beginTime, endTime); - if (res == null) { - return null; - } - // 通报问题数 - String supervisionNotifyTotal = res.getProblemNumber(); - log.info("通报问题数:{}", res.getProblemNumber()); - // 整改中 - String supervisionNotifyChangingTotal = res.getRectifingNumber(); - log.info("整改中:{}", res.getRectifingNumber()); - // 已整改 - String supervisionNotifyChangedTotal = res.getRectifedNumber(); - log.info("已整改:{}", res.getRectifedNumber()); - // 涉及单位数 - String supervisionNotifyOrgTotal = res.getDepartNumber(); - log.info("涉及单位数:{}", res.getDepartNumber()); - // 涉及人数 - String supervisionNotifyPreTotal = res.getPersonNumber(); - log.info("涉及人数:{}", res.getPersonNumber()); - String correctionRate = res.getRectifyRate(); - log.info("整改率:{}", res.getRectifyRate()); - - JSONObject jsonObject = new JSONObject(); - jsonObject.fluentPut("supervisionNotifyTotal", supervisionNotifyTotal) - .fluentPut("supervisionNotifyOrgTotal", supervisionNotifyOrgTotal) - .fluentPut("supervisionNotifyPreTotal", supervisionNotifyPreTotal) - .fluentPut("supervisionNotifyChangingTotal", supervisionNotifyChangingTotal) - .fluentPut("supervisionNotifyChangedTotal", supervisionNotifyChangedTotal) - .fluentPut("correctionRate", correctionRate); - return jsonObject; - } + private final NewsMapper newsMapper; - // 获取现场督察问题趋势 -// public List getSupervisionTrend(String year, String ...args) { -// List echartsVos = negativeMapper.getSupervisionTrend(year, args); -// return echartsVos; -// } - - - // 地图数据 - public List getSupervisionMapIconInfo(Date beginTime, Date endTime) { - List res = negativeMapper.getSupervisionMapIconInfo(beginTime, endTime); - return res; - } - -// endregion - -// region 右边 - - // 黄赌毒总览 但是这个查询可以公用 - public DayTimeSuperviseVo getYellowBetOverview(Date beginTime, Date endTime, Integer groupId, Integer queryType) { - DayTimeSuperviseVo res = negativeMapper.getYellowBetOverview(beginTime, endTime, groupId, queryType); - return res; - } - - // 黄赌毒排行 但是这个查询可以公用 - public List getYellowBetRankList(Date beginTime, Date endTime, Integer groupId, Integer queryType) { - List res = negativeMapper.getYellowBetRankList(beginTime, endTime, groupId, queryType); - return res; - } - +// region 左边 // endregion - - - } diff --git a/src/main/java/com/biutag/supervision/service/NewsService.java b/src/main/java/com/biutag/supervision/service/NewsService.java index b4ee73c..4c38167 100644 --- a/src/main/java/com/biutag/supervision/service/NewsService.java +++ b/src/main/java/com/biutag/supervision/service/NewsService.java @@ -1,11 +1,40 @@ package com.biutag.supervision.service; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.biutag.supervision.pojo.entity.News; import com.biutag.supervision.mapper.NewsMapper; +import com.biutag.supervision.pojo.vo.NewsVo; import org.springframework.stereotype.Service; +import java.util.Date; +import java.util.List; + @Service public class NewsService extends ServiceImpl { + + + public List getWorkDynamics(Date beginTime, Date endTime, String source, String departId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.select("source", "work_type", "release_time", "content_txt"); + queryWrapper.eq("source", source); + if ( departId != null && !departId.isEmpty() ) { + queryWrapper.eq("depart_id", departId); + } + queryWrapper.between("release_time", beginTime, endTime); + queryWrapper.orderByDesc("release_time"); + queryWrapper.last("limit 10"); + List newsList = this.list(queryWrapper); + List newsVos = newsList.stream().map(news -> new NewsVo( + news.getSource(), + news.getWorkType(), + news.getReleaseTime(), + news.getContentTxt() + )).toList(); + return newsVos; + } + + + } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 7143475..c994a95 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -82,3 +82,7 @@ springdoc: - '/api/plugin/**' - '/login' - '/**' +videoInspection: + url: http://65.47.26.33:8090/ +mailbox: + url: http://65.47.60.145/api/ \ No newline at end of file