|
|
|
|
@ -1,17 +1,17 @@
|
|
|
|
|
package com.biutag.supervision.controller.subdatav; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.biutag.supervision.constants.enums.ProblemSourcesEnum; |
|
|
|
|
import com.biutag.supervision.mapper.MailMapper; |
|
|
|
|
import com.biutag.supervision.mapper.NegativeMapper; |
|
|
|
|
import com.biutag.supervision.mapper.SupExternalDepartMapper; |
|
|
|
|
import com.biutag.supervision.pojo.Result; |
|
|
|
|
import com.biutag.supervision.pojo.entity.Negative; |
|
|
|
|
import com.biutag.supervision.pojo.entity.mailbox.Mail; |
|
|
|
|
import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest; |
|
|
|
|
import com.biutag.supervision.pojo.vo.*; |
|
|
|
|
import com.biutag.supervision.pojo.vo.EchartsVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.GlobalMapIconVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.MailOverviewVo; |
|
|
|
|
import com.biutag.supervision.pojo.vo.StrongProblemRank; |
|
|
|
|
import com.biutag.supervision.service.CountyStreetDeptService; |
|
|
|
|
import com.biutag.supervision.service.DataMailService; |
|
|
|
|
import com.biutag.supervision.service.NegativeService; |
|
|
|
|
@ -39,15 +39,11 @@ import java.util.List;
|
|
|
|
|
@Slf4j |
|
|
|
|
public class SubOneGlobalController { |
|
|
|
|
|
|
|
|
|
private final String VALID_SIGN = "terminated"; // 有效标识
|
|
|
|
|
private final String EX_SOURCE = "局长信箱"; // 映射来源
|
|
|
|
|
|
|
|
|
|
private final NegativeMapper negativeMapper; |
|
|
|
|
private final CountyStreetDeptService countyStreetDeptService; |
|
|
|
|
private final DataMailService dataMailService; |
|
|
|
|
private final NegativeService negativeService; |
|
|
|
|
private final MailMapper mailMapper; |
|
|
|
|
private final SupExternalDepartMapper externalDepartMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
@ -63,14 +59,12 @@ public class SubOneGlobalController {
|
|
|
|
|
*/ |
|
|
|
|
@Operation(summary = "获取二级大屏地图JSON") |
|
|
|
|
@GetMapping("/getSubOneStreetMap") |
|
|
|
|
// @Cacheable(cacheNames = "subOneStreetMap", key = "'p_'+ #departId")
|
|
|
|
|
public Result<JSONObject> getSubOneStreetMap(@RequestParam Integer departId) { |
|
|
|
|
JSONObject res = countyStreetDeptService.getSubOneStreetMap(departId); |
|
|
|
|
return Result.success(res); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//region 左边
|
|
|
|
|
@Operation(summary = "机构问题排名") |
|
|
|
|
@PostMapping("/getSubOneOrganizationRank") |
|
|
|
|
public Result<JSONObject> getSubOneOrganizationRank(@RequestBody SubDataVRequest request) { |
|
|
|
|
@ -79,66 +73,17 @@ public class SubOneGlobalController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 业务类型占比 |
|
|
|
|
* |
|
|
|
|
* @param departId 2级单位的id |
|
|
|
|
* @param beginTime 开始时间 |
|
|
|
|
* @param endTime 结束时间 |
|
|
|
|
* @return Result<JSONObject> |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
@Operation(summary = "业务类型占比") |
|
|
|
|
@GetMapping("/getSubOneBusinessRate") |
|
|
|
|
public Result<JSONObject> getSubOneBusinessRate(@RequestParam Integer departId, |
|
|
|
|
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, |
|
|
|
|
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { |
|
|
|
|
// 业务类型占比
|
|
|
|
|
endTime = DateUtil.endOfDay(endTime); |
|
|
|
|
List<EchartsVo> ywzblist = negativeMapper.selectSubOneBusinessRate(departId, beginTime, endTime); |
|
|
|
|
JSONObject res = new JSONObject().fluentPut("ywzblist", ywzblist); |
|
|
|
|
return Result.success(res); |
|
|
|
|
} |
|
|
|
|
//endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//region 中间
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取首页大屏中央数据 |
|
|
|
|
* |
|
|
|
|
* @param departId 2级单位的id |
|
|
|
|
* @param beginTime 开始时间 |
|
|
|
|
* @param endTime 结束时间 |
|
|
|
|
* @return Result<JSONObject> |
|
|
|
|
*/ |
|
|
|
|
@Operation(summary = "大屏中央数据") |
|
|
|
|
@GetMapping("/getSubOneAllCount") |
|
|
|
|
public Result<JSONObject> getSubOneAllCount(@RequestParam Integer departId, |
|
|
|
|
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, |
|
|
|
|
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { |
|
|
|
|
// 获取数据大屏中央总数概览
|
|
|
|
|
GlobalOverViewVo overview = negativeMapper.getSuoOneAllGlobalCount(departId, beginTime, endTime); |
|
|
|
|
|
|
|
|
|
MailOverviewVo vo = dataMailService.mailCount(departId,beginTime, endTime); |
|
|
|
|
|
|
|
|
|
QueryWrapper<Mail> subOneMailQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
String exDepartId = externalDepartMapper.getExIdByInId(departId.toString(), "局长信箱"); |
|
|
|
|
subOneMailQueryWrapper.ne("mail_state", VALID_SIGN); |
|
|
|
|
subOneMailQueryWrapper.eq("second_dept_id", exDepartId); |
|
|
|
|
subOneMailQueryWrapper.between("mail_time", beginTime, endTime); |
|
|
|
|
Long mailboxNumber = mailMapper.selectCount(subOneMailQueryWrapper); |
|
|
|
|
// todo 局长信箱
|
|
|
|
|
// long mailboxNumber = negativeService.count(new LambdaQueryWrapper<Negative>()
|
|
|
|
|
// .between(Negative::getCrtTime, beginTime, endTime)
|
|
|
|
|
// .eq(Negative::getProblemSourcesCode, ProblemSourcesEnum.JZXX.getValue())
|
|
|
|
|
// .eq(Negative::getSecondInvolveDepartId,departId)
|
|
|
|
|
// );
|
|
|
|
|
overview.setMailboxNumber(mailboxNumber); |
|
|
|
|
overview.setComplaintPro(vo.getCountryMail() + vo.getPoliceMail() + vo.getNumberMail()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject data = new JSONObject().fluentPut("overview", overview); |
|
|
|
|
return Result.success(data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Operation(summary = "大屏中央数据") |
|
|
|
|
@PostMapping("/getSubOneAllCount") |
|
|
|
|
@ -146,17 +91,9 @@ public class SubOneGlobalController {
|
|
|
|
|
return subDatavService.getSubOneAllCount(request); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 地图数据 |
|
|
|
|
* |
|
|
|
|
* @param departId 2级单位的id |
|
|
|
|
* @param beginTime 开始时间 |
|
|
|
|
* @param endTime 结束时间 |
|
|
|
|
* @return Result<JSONObject> |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
@Operation(summary = "首页大屏地图数据") |
|
|
|
|
@GetMapping("/getSubOneGlobalMap") |
|
|
|
|
// @Cacheable(cacheNames = "Supervision:Screen:SubOneGlobalMap", key = "#departId+'_'+#beginTime.getTime()+'_'+#endTime.getTime()")
|
|
|
|
|
public Result<JSONObject> getSubOneMap(@RequestParam Integer departId, |
|
|
|
|
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, |
|
|
|
|
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { |
|
|
|
|
@ -179,38 +116,22 @@ public class SubOneGlobalController {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 数据大屏问题趋势统计 |
|
|
|
|
* |
|
|
|
|
* @param departId 2级单位的id |
|
|
|
|
* @param year 年份 |
|
|
|
|
* @return Result<JSONObject> |
|
|
|
|
*/ |
|
|
|
|
@Operation(summary = "数据大屏问题趋势统计") |
|
|
|
|
@GetMapping("/getSubOneGlobalTrend") |
|
|
|
|
public Result<JSONObject> getSubOneGlobalTrend(@RequestParam Integer departId, @RequestParam Integer year) { |
|
|
|
|
List<EchartsVo> GlobalRecentlyTrendList = negativeMapper.getSubOneTrend(departId.toString(), year.toString(), "2", "13", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "27", "28", "29", "30"); |
|
|
|
|
List<EchartsVo> GlobalRecentlyTrendList = negativeMapper.getSubOneTrend(departId.toString(), year.toString()); |
|
|
|
|
JSONObject jsonObject = new JSONObject().fluentPut("globalRecentlyTrendList", GlobalRecentlyTrendList); |
|
|
|
|
return Result.success(jsonObject); |
|
|
|
|
} |
|
|
|
|
//endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//region 右边
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 突出问题排名 |
|
|
|
|
* |
|
|
|
|
* @param departId 2级单位的id |
|
|
|
|
* @param beginTime 开始时间 |
|
|
|
|
* @param endTime 结束时间 |
|
|
|
|
* @return Result<JSONObject> |
|
|
|
|
*/ |
|
|
|
|
@Operation(summary = "突出问题排名") |
|
|
|
|
@GetMapping("/getSubOneStrongProblemRate") |
|
|
|
|
public Result<JSONObject> getSubOneStrongProblemRate(@RequestParam Integer departId, |
|
|
|
|
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, |
|
|
|
|
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { |
|
|
|
|
endTime = DateUtil.endOfDay(endTime); |
|
|
|
|
// 突出问题排名
|
|
|
|
|
List<StrongProblemRank> tcwtlist = negativeMapper.selectSubOneStrongProblemRank(departId, beginTime, endTime); |
|
|
|
|
for (int i = 1; i <= tcwtlist.size(); i++) { |
|
|
|
|
@ -221,25 +142,18 @@ public class SubOneGlobalController {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 问题类型占比 |
|
|
|
|
* |
|
|
|
|
* @param departId 2级单位的id |
|
|
|
|
* @param beginTime 开始时间 |
|
|
|
|
* @param endTime 结束时间 |
|
|
|
|
* @return Result<JSONObject> |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
@Operation(summary = "问题类型占比") |
|
|
|
|
@GetMapping("/getSubOneProblemBusinessRate") |
|
|
|
|
public Result<JSONObject> getSubOneProblemBusinessRate(@RequestParam Integer departId, |
|
|
|
|
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, |
|
|
|
|
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { |
|
|
|
|
// 问题类型占比
|
|
|
|
|
endTime = DateUtil.endOfDay(endTime); |
|
|
|
|
List<EchartsVo> wtlxlist = negativeMapper.selectSubOneProblemRate(departId, beginTime, endTime); |
|
|
|
|
JSONObject res = new JSONObject().fluentPut("wtlxlist", wtlxlist); |
|
|
|
|
return Result.success(res); |
|
|
|
|
} |
|
|
|
|
//endregion
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|