Browse Source

feat--现场专项父子屏幕核对对齐

master
parent
commit
7b6cdc5221
  1. 6
      src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java
  2. 39
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  3. 4
      src/main/java/com/biutag/supervision/pojo/vo/SuperviseMapIconVo.java
  4. 61
      src/main/java/com/biutag/supervision/service/SubOneSupervisionNotifyService.java
  5. 80
      src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java
  6. 150
      src/main/java/com/biutag/supervision/service/subDatav/SubDatavServiceImpl.java

6
src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java

@ -1,5 +1,6 @@
package com.biutag.supervision.controller.subdatav; package com.biutag.supervision.controller.subdatav;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.biutag.supervision.mapper.NegativeMapper; import com.biutag.supervision.mapper.NegativeMapper;
import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.Result;
@ -7,7 +8,6 @@ import com.biutag.supervision.pojo.entity.News;
import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest; import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest;
import com.biutag.supervision.pojo.vo.EchartsVo; import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.service.NewsService; import com.biutag.supervision.service.NewsService;
import com.biutag.supervision.service.SubOneSupervisionNotifyService;
import com.biutag.supervision.service.subDatav.SubDatavService; import com.biutag.supervision.service.subDatav.SubDatavService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@ -32,7 +32,6 @@ import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*;
@Tag(name = "现场专项二级大屏", description = "现场专项二级大屏") @Tag(name = "现场专项二级大屏", description = "现场专项二级大屏")
public class SubOneSupervisionNotifyController { public class SubOneSupervisionNotifyController {
private final SubOneSupervisionNotifyService subOneSupervisionNotifyService;
private final NewsService newsService; private final NewsService newsService;
private final SubDatavService subDatavService; private final SubDatavService subDatavService;
private final NegativeMapper negativeMapper; private final NegativeMapper negativeMapper;
@ -48,7 +47,7 @@ public class SubOneSupervisionNotifyController {
public Result<JSONObject> getSubOneProblemTypeRate(@RequestParam Integer departId, public Result<JSONObject> getSubOneProblemTypeRate(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @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<EchartsVo> wtlxList = subOneSupervisionNotifyService.getSubOneProblemTypeRatio(departId, beginTime, endTime); List<EchartsVo> wtlxList = negativeMapper.getSubOneProblemTypeRatio(departId, beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("wtlxList", wtlxList); JSONObject data = new JSONObject().fluentPut("wtlxList", wtlxList);
return Result.success(data); return Result.success(data);
} }
@ -86,6 +85,7 @@ public class SubOneSupervisionNotifyController {
public Result<List<News>> getSubOneWorkDynamics(@RequestParam Integer departId, public Result<List<News>> getSubOneWorkDynamics(@RequestParam Integer departId,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
endTime = DateUtil.endOfDay(endTime);
List<News> newsList = newsService.getWorkDynamics(beginTime, endTime, DCGZDT, departId.toString()); List<News> newsList = newsService.getWorkDynamics(beginTime, endTime, DCGZDT, departId.toString());
return Result.success(newsList); return Result.success(newsList);
} }

39
src/main/java/com/biutag/supervision/mapper/NegativeMapper.java

@ -100,13 +100,16 @@ public interface NegativeMapper extends BaseMapper<Negative> {
@Select("SELECT npr.oneLevelContent as name, count(*) value FROM negative ng, negative_problem_relation npr " + @Select("SELECT " +
"WHERE ng.id = npr.negativeId " + "npr.oneLevelContent as `name`, " +
"AND ng.problemSourcesCode in (13,14, 15) " + "count(*) as `value` " +
"and ng.check_status_code in (1, 2, 3) " + "FROM negative ng " +
"AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} " + "LEFT JOIN negative_problem_relation npr on ng.id = npr.negativeId " +
"AND oneLevelContent is NOT NULL " + "WHERE ng.problemSourcesCode IN (13, 14, 15) " +
"GROUP BY oneLevelContent ") "AND ng.check_status_code IN (1, 2, 3) " +
"AND ng.crtTime >= #{beginTime} AND ng.crtTime < #{endTime} " +
"AND npr.oneLevelContent is not NULL " +
"GROUP BY npr.oneLevelContent; ")
List<EchartsVo> getProblemTypeRatio(Date beginTime, Date endTime); List<EchartsVo> getProblemTypeRatio(Date beginTime, Date endTime);
@ -489,16 +492,20 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"order by rate desc;") "order by rate desc;")
List<RankVo> getSubOneTeamChangedRateRank(Integer departId, Date beginTime, Date endTime); List<RankVo> getSubOneTeamChangedRateRank(Integer departId, Date beginTime, Date endTime);
@Select("SELECT npr.oneLevelContent as name, " + @Select("SELECT " +
"count(*) value " + "npr.oneLevelContent as `name`, " +
"count(*) as `value` " +
"FROM negative ng " + "FROM negative ng " +
"INNER JOIN negative_problem_relation npr ON ng.id = npr.negativeId " + "LEFT JOIN negative_problem_relation npr on ng.id = npr.negativeId " +
"INNER JOIN sup_depart sd ON ng.involveDepartId=sd.id AND sd.pid=#{departId} " + "LEFT JOIN sup_depart sd on ng.involveDepartId = sd.id " +
"WHERE ng.problemSourcesCode in (13, 15) " + "LEFT JOIN sup_depart sdd on sd.pid = sdd.id " +
"and ng.checkStatus<>3 " + "LEFT JOIN sup_depart sddd on sdd.pid = sddd.id " +
"AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} " + "WHERE ng.problemSourcesCode IN (13, 14, 15) " +
"AND oneLevelContent is NOT NULL " + "AND ng.check_status_code IN (1, 2, 3) " +
"GROUP BY oneLevelContent ") "AND ng.crtTime >= #{beginTime} AND ng.crtTime < #{endTime} " +
"AND npr.oneLevelContent is not NULL " +
"AND (sd.id = #{departId} or sdd.id= #{departId} or sddd.id = #{departId} ) " +
"GROUP BY npr.oneLevelContent; ")
List<EchartsVo> getSubOneProblemTypeRatio(Integer departId, Date beginTime, Date endTime); List<EchartsVo> getSubOneProblemTypeRatio(Integer departId, Date beginTime, Date endTime);
@Select("SELECT " + @Select("SELECT " +

4
src/main/java/com/biutag/supervision/pojo/vo/SuperviseMapIconVo.java

@ -1,5 +1,6 @@
package com.biutag.supervision.pojo.vo; package com.biutag.supervision.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@ -19,5 +20,8 @@ public class SuperviseMapIconVo implements Serializable {
private String relationOrg; private String relationOrg;
private String personNum; private String personNum;
private String completedRate; private String completedRate;
@Schema(description = "通报期数")
private String reportNumber;
} }

61
src/main/java/com/biutag/supervision/service/SubOneSupervisionNotifyService.java

@ -1,61 +0,0 @@
package com.biutag.supervision.service;
import com.biutag.supervision.mapper.NegativeMapper;
import com.biutag.supervision.pojo.vo.EchartsVo;
import com.biutag.supervision.pojo.vo.RankVo;
import com.biutag.supervision.pojo.vo.SupervisionNotifyOverView;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* @Auther: sh
* @Date: 2024/12/17 16:27
* @Description: 现场督察二级大屏服务
*/
@RequiredArgsConstructor
@Service
public class SubOneSupervisionNotifyService {
private final NegativeMapper negativeMapper;
// public DayTimeSuperviseVo getChangedRankOverView(Integer groupId, Integer departId, Date beginTime, Date endTime) {
// DayTimeSuperviseVo res;
// if (groupId != null && groupId == 10) {
// res = negativeMapper.getPoliceChangedRankOverView(departId, beginTime, endTime);
// } else {
// res = negativeMapper.getTeamChangedRankOverView(departId, beginTime, endTime);
// }
// return res;
// }
public List<RankVo> getSubOneChangedRateRank(Integer groupId, Integer departId, Date beginTime, Date endTime) {
List<RankVo> res;
if (groupId != null && groupId == 10) {
res = negativeMapper.getSubOnePoliceChangedRateRank(departId, beginTime, endTime);
} else {
res = negativeMapper.getSubOneTeamChangedRateRank(departId, beginTime, endTime);
}
return res;
}
public List<EchartsVo> getSubOneProblemTypeRatio(Integer departId, Date beginTime, Date endTime) {
List<EchartsVo> res = negativeMapper.getSubOneProblemTypeRatio(departId, beginTime, endTime);
return res;
}
public SupervisionNotifyOverView getAllSubOneSupervisionNotifyCount(Integer departId, Date beginTime, Date endTime) {
SupervisionNotifyOverView res = negativeMapper.getAllSubOneSupervisionNotifyCount(departId, beginTime, endTime);
return res;
}
public List<EchartsVo> getSubOneSupervisionTrend(Integer departId, String year) {
List<EchartsVo> res = negativeMapper.getSubOneSupervisionTrend(departId, year);
return res;
}
}

80
src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java

@ -37,6 +37,7 @@ import com.biutag.supervision.service.*;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.logstash.logback.encoder.org.apache.commons.lang.StringUtils; import net.logstash.logback.encoder.org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -131,6 +132,9 @@ public class DatavServiceImpl implements DatavService {
@Resource @Resource
private DataCaseVerifMapper dataCaseVerifMapper; private DataCaseVerifMapper dataCaseVerifMapper;
@Resource
private SupDepartService supDepartService;
private static final String NO_BLAME = "不予追责"; private static final String NO_BLAME = "不予追责";
private static final BigDecimal WAN = new BigDecimal("10000"); private static final BigDecimal WAN = new BigDecimal("10000");
@ -709,53 +713,36 @@ public class DatavServiceImpl implements DatavService {
List<SupDepart> fxsjDw = supDepartResourceService.query(supDepartQueryParam); List<SupDepart> fxsjDw = supDepartResourceService.query(supDepartQueryParam);
List<String> proCode = List.of(XCDC.getValue(), LMGZ.getValue(), ZXDC.getValue()); List<String> proCode = List.of(XCDC.getValue(), LMGZ.getValue(), ZXDC.getValue());
SupDepartGroupParam supDepartGroupParam = new SupDepartGroupParam();
supDepartGroupParam.setGroupId(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId());
supDepartGroupParam.setParentLevel(2);
supDepartGroupParam.setChildLevel(3);
Map<String, DepartAndSubDepartDto> departAndSubDepart = supDepartResourceService.getDepartAndSubDepart(supDepartGroupParam);
for (SupDepart fxsj : fxsjDw) { for (SupDepart fxsj : fxsjDw) {
SuperviseMapIconVo superviseMapIconVo = new SuperviseMapIconVo(); SuperviseMapIconVo superviseMapIconVo = new SuperviseMapIconVo();
List<Negative> negatives = negativeMapper.getNegativeListData(fxsj.getId(), request.getBeginTime(), request.getEndTime(), proCode); List<Negative> negatives = negativeMapper.getNegativeListData(fxsj.getId(), request.getBeginTime(), request.getEndTime(), proCode);
List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList(); List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList();
List<Negative> processingList = negatives.stream().filter(item -> ProcessingStatusEnum.processing.name().equals(item.getProcessingStatus())).toList(); List<Negative> processingList = negatives.stream().filter(item -> ProcessingStatusEnum.processing.name().equals(item.getProcessingStatus())).toList();
// 暂不用通报期数 // 通报期数
// LambdaQueryWrapper<SuperviseReport> superviseReportLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SuperviseReport> superviseReportLambdaQueryWrapper = new LambdaQueryWrapper<>();
// superviseReportLambdaQueryWrapper.between(SuperviseReport::getCrtTime, request.getBeginTime(), request.getEndTime()); superviseReportLambdaQueryWrapper.between(SuperviseReport::getCrtTime, request.getBeginTime(), request.getEndTime());
// superviseReportLambdaQueryWrapper.eq(SuperviseReport::getType, "1"); superviseReportLambdaQueryWrapper.eq(SuperviseReport::getType, "1");
// List<SuperviseReport> superviseReportList = superviseReportService.list(superviseReportLambdaQueryWrapper); Set<String> allDepartIds = Optional.ofNullable(departAndSubDepart.get(fxsj.getId()))
List<String> negativeIds = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).map(Negative::getId).toList(); .map(DepartAndSubDepartDto::getAllDepartIds)
.orElse(Collections.emptySet());
superviseReportLambdaQueryWrapper.in(CollectionUtil.isNotEmpty(allDepartIds), SuperviseReport::getCrtDepartId, allDepartIds);
NegativeBlameQueryParam negativeBlameQueryParam = new NegativeBlameQueryParam(); List<SuperviseReport> superviseReportList = superviseReportService.list(superviseReportLambdaQueryWrapper);
negativeBlameQueryParam.setNegativeIds(negativeIds); BlameResult blameResult = this.buildBlameResult(negatives);
List<NegativeBlame> negativeBlames = negativeBlameResourceService.query(negativeBlameQueryParam);
// 3. 个人问责
List<NegativeBlame> personalBlames = negativeBlames.stream()
.filter(one -> BlameType.personal.name().equals(one.getType()))
.filter(one -> StrUtil.isNotBlank(one.getHandleResultName()))
.filter(one -> !"不予追责".equals(one.getHandleResultName()))
.toList();
// 4. 领导问责(按 negativeId + 领导姓名 + 领导处理结果 去重)
Set<String> seenLead = new HashSet<>();
List<NegativeBlame> leadBlames = negativeBlames.stream()
.filter(one -> BlameType.personal.name().equals(one.getType()))
.filter(one -> StrUtil.isNotBlank(one.getLeadHandleResultName()))
.filter(one -> !"不予追责".equals(one.getLeadHandleResultName()))
.filter(one -> seenLead.add(
one.getNegativeId() + "_" + one.getLeadHandleResultName() + "_" + one.getLeadName()
))
.toList();
// 5. 单位问责
List<NegativeBlame> unitBlames = negativeBlames.stream()
.filter(one -> BlameType.department.name().equals(one.getType()))
.filter(one -> StrUtil.isNotBlank(one.getHandleResultName()))
.filter(one -> !"不予追责".equals(one.getHandleResultName()))
.toList();
superviseMapIconVo.setDepartId(fxsj.getId()); superviseMapIconVo.setDepartId(fxsj.getId());
superviseMapIconVo.setName(fxsj.getShortName()); superviseMapIconVo.setName(fxsj.getShortName());
superviseMapIconVo.setTotalPro(negatives.size()); superviseMapIconVo.setTotalPro(negatives.size());
superviseMapIconVo.setProcessingNumber(processingList.size()); superviseMapIconVo.setProcessingNumber(processingList.size());
superviseMapIconVo.setCompletedNumber(completedList.size()); superviseMapIconVo.setCompletedNumber(completedList.size());
superviseMapIconVo.setRelationOrg(String.valueOf(unitBlames.size())); superviseMapIconVo.setRelationOrg(String.valueOf(blameResult.unitBlames().size()));
superviseMapIconVo.setPersonNum(String.valueOf(personalBlames.size() + leadBlames.size())); superviseMapIconVo.setPersonNum(String.valueOf(blameResult.personalBlames().size() + blameResult.leadBlames().size()));
superviseMapIconVo.setReportNumber(String.valueOf(superviseReportList.size()));
superviseTempMapVoList.add(superviseMapIconVo); superviseTempMapVoList.add(superviseMapIconVo);
} }
JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", superviseTempMapVoList); JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", superviseTempMapVoList);
@ -1511,7 +1498,6 @@ public class DatavServiceImpl implements DatavService {
// endregion // endregion
// region 辅助方法 // region 辅助方法
private List<EchartsVo> filterZero(List<EchartsVo> list) { private List<EchartsVo> filterZero(List<EchartsVo> list) {
return list.stream() return list.stream()
@ -1522,13 +1508,14 @@ public class DatavServiceImpl implements DatavService {
public record BlameResult( public record BlameResult(
List<NegativeBlame> personalBlames, List<NegativeBlame> personalBlames,
List<NegativeBlame> leadBlames List<NegativeBlame> leadBlames,
List<NegativeBlame> unitBlames
) { ) {
} }
public BlameResult buildBlameResult(List<Negative> negativeListData) { public BlameResult buildBlameResult(List<Negative> negativeListData) {
if (CollUtil.isEmpty(negativeListData)) { if (CollUtil.isEmpty(negativeListData)) {
return new BlameResult(List.of(), List.of()); return new BlameResult(List.of(), List.of(), List.of());
} }
// 1. 筛选有效 negative // 1. 筛选有效 negative
List<Negative> validNegatives = negativeListData.stream() List<Negative> validNegatives = negativeListData.stream()
@ -1536,7 +1523,7 @@ public class DatavServiceImpl implements DatavService {
|| CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode()))
.toList(); .toList();
if (CollUtil.isEmpty(validNegatives)) { if (CollUtil.isEmpty(validNegatives)) {
return new BlameResult(List.of(), List.of()); return new BlameResult(List.of(), List.of(), List.of());
} }
// 2. 查询问责数据 // 2. 查询问责数据
NegativeBlameQueryParam param = new NegativeBlameQueryParam(); NegativeBlameQueryParam param = new NegativeBlameQueryParam();
@ -1545,7 +1532,7 @@ public class DatavServiceImpl implements DatavService {
.toList()); .toList());
List<NegativeBlame> negativeBlames = negativeBlameResourceService.query(param); List<NegativeBlame> negativeBlames = negativeBlameResourceService.query(param);
if (CollUtil.isEmpty(negativeBlames)) { if (CollUtil.isEmpty(negativeBlames)) {
return new BlameResult(List.of(), List.of()); return new BlameResult(List.of(), List.of(), List.of());
} }
// 3. 个人问责 // 3. 个人问责
List<NegativeBlame> personalBlames = negativeBlames.stream() List<NegativeBlame> personalBlames = negativeBlames.stream()
@ -1562,7 +1549,13 @@ public class DatavServiceImpl implements DatavService {
one.getNegativeId() + "_" + one.getLeadHandleResultName() + "_" + one.getLeadName() one.getNegativeId() + "_" + one.getLeadHandleResultName() + "_" + one.getLeadName()
)) ))
.toList(); .toList();
return new BlameResult(personalBlames, leadBlames); // 5. 单位问责
List<NegativeBlame> unitBlames = negativeBlames.stream()
.filter(one -> BlameType.department.name().equals(one.getType()))
.filter(one -> StrUtil.isNotBlank(one.getHandleResultName()))
.filter(one -> !"不予追责".equals(one.getHandleResultName()))
.toList();
return new BlameResult(personalBlames, leadBlames, unitBlames);
} }
private LocalDateTime toLocalDateTime(Date date) { private LocalDateTime toLocalDateTime(Date date) {
@ -1649,9 +1642,6 @@ public class DatavServiceImpl implements DatavService {
// endregion // endregion
public Result<JSONObject> getSubOneMailMapIcon() { public Result<JSONObject> getSubOneMailMapIcon() {
// ✅ 注意:这里的 name 必须和地图 geojson 区域名一致(一般是“xx街道/园区”) // ✅ 注意:这里的 name 必须和地图 geojson 区域名一致(一般是“xx街道/园区”)

150
src/main/java/com/biutag/supervision/service/subDatav/SubDatavServiceImpl.java

@ -1,4 +1,4 @@
package com.biutag.supervision.service.subDatav; package com.biutag.supervision.service.subDatav;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
@ -19,8 +19,6 @@ import com.biutag.supervision.pojo.param.negativeBlame.NegativeBlameQueryParam;
import com.biutag.supervision.pojo.request.datav.DataVRequest; import com.biutag.supervision.pojo.request.datav.DataVRequest;
import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest; import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest;
import com.biutag.supervision.pojo.vo.*; import com.biutag.supervision.pojo.vo.*;
import com.biutag.supervision.repository.dataAudit.DataAuditResourceService;
import com.biutag.supervision.repository.dataCaseVerif.DataCaseVerifResourceService;
import com.biutag.supervision.repository.dataPetitionComplaint.DataPetitionComplaintResourceService; import com.biutag.supervision.repository.dataPetitionComplaint.DataPetitionComplaintResourceService;
import com.biutag.supervision.repository.mail.MailResourceService; import com.biutag.supervision.repository.mail.MailResourceService;
import com.biutag.supervision.repository.negative.NegativeResourceService; import com.biutag.supervision.repository.negative.NegativeResourceService;
@ -28,7 +26,10 @@ import com.biutag.supervision.repository.negativeBlame.NegativeBlameResourceServ
import com.biutag.supervision.repository.reportproject.ReportProjectResourceService; import com.biutag.supervision.repository.reportproject.ReportProjectResourceService;
import com.biutag.supervision.repository.supExternalDepart.SupExternalDepartResourceService; import com.biutag.supervision.repository.supExternalDepart.SupExternalDepartResourceService;
import com.biutag.supervision.repository.supdepart.SupDepartResourceService; import com.biutag.supervision.repository.supdepart.SupDepartResourceService;
import com.biutag.supervision.service.*; import com.biutag.supervision.service.DataMailService;
import com.biutag.supervision.service.DataPetition12337Service;
import com.biutag.supervision.service.NegativeBlameService;
import com.biutag.supervision.service.SuperviseReportService;
import com.biutag.supervision.service.datav.DatavServiceImpl; import com.biutag.supervision.service.datav.DatavServiceImpl;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -107,6 +108,9 @@ public class SubDatavServiceImpl implements SubDatavService {
@Resource @Resource
private DataCaseVerifMapper dataCaseVerifMapper; private DataCaseVerifMapper dataCaseVerifMapper;
@Resource
private SuperviseReportService superviseReportService;
private static final String NO_BLAME = "不予追责"; private static final String NO_BLAME = "不予追责";
private static final BigDecimal WAN = new BigDecimal("10000"); private static final BigDecimal WAN = new BigDecimal("10000");
@ -557,35 +561,24 @@ public class SubDatavServiceImpl implements SubDatavService {
if (negatives.isEmpty()) { if (negatives.isEmpty()) {
continue; continue;
} }
List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList(); List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList();
List<Negative> processingList = negatives.stream().filter(item -> ProcessingStatusEnum.processing.name().equals(item.getProcessingStatus())).toList(); List<Negative> processingList = negatives.stream().filter(item -> ProcessingStatusEnum.processing.name().equals(item.getProcessingStatus())).toList();
List<String> negativeIds = negatives.stream() // 通报期数
.filter(item -> InspectCaseEnum.isItTure(item.getCheckStatus())) LambdaQueryWrapper<SuperviseReport> superviseReportLambdaQueryWrapper = new LambdaQueryWrapper<>();
.map(Negative::getId) superviseReportLambdaQueryWrapper.between(SuperviseReport::getCrtTime, request.getBeginTime(), request.getEndTime());
.toList(); superviseReportLambdaQueryWrapper.eq(SuperviseReport::getType, "1");
superviseReportLambdaQueryWrapper.eq(SuperviseReport::getCrtDepartId, request.getDepartId());
long personNumber = negativeIds.isEmpty() ? 0 : negativeBlameService.count(new LambdaQueryWrapper<NegativeBlame>() List<SuperviseReport> superviseReportList = superviseReportService.list(superviseReportLambdaQueryWrapper);
.in(NegativeBlame::getNegativeId, negativeIds) DatavServiceImpl.BlameResult blameResult = this.buildBlameResult(negatives);
.eq(NegativeBlame::getType, "personal")
.ne(NegativeBlame::getHandleResultName, "涓嶄簣杩借矗")
.isNotNull(NegativeBlame::getHandleResultName)
.ne(NegativeBlame::getHandleResultName, ""));
long departNumber = negativeIds.isEmpty() ? 0 : negativeBlameService.count(new LambdaQueryWrapper<NegativeBlame>()
.in(NegativeBlame::getNegativeId, negativeIds)
.eq(NegativeBlame::getType, "department")
.ne(NegativeBlame::getHandleResultName, "涓嶄簣杩借矗")
.isNotNull(NegativeBlame::getHandleResultName)
.ne(NegativeBlame::getHandleResultName, ""));
SuperviseMapIconVo superviseMapIconVo = new SuperviseMapIconVo(); SuperviseMapIconVo superviseMapIconVo = new SuperviseMapIconVo();
superviseMapIconVo.setName(supDepart.getShortName()); superviseMapIconVo.setName(supDepart.getShortName());
superviseMapIconVo.setDepartId(supDepart.getId()); superviseMapIconVo.setDepartId(supDepart.getId());
superviseMapIconVo.setTotalPro(negatives.size()); superviseMapIconVo.setTotalPro(negatives.size());
superviseMapIconVo.setCompletedNumber(completedList.size()); superviseMapIconVo.setCompletedNumber(completedList.size());
superviseMapIconVo.setProcessingNumber(processingList.size()); superviseMapIconVo.setProcessingNumber(processingList.size());
superviseMapIconVo.setPersonNum(String.valueOf(personNumber)); superviseMapIconVo.setPersonNum(String.valueOf(blameResult.personalBlames().size() + blameResult.leadBlames().size()));
superviseMapIconVo.setRelationOrg(String.valueOf(departNumber)); superviseMapIconVo.setRelationOrg(String.valueOf(blameResult.unitBlames().size()));
superviseMapIconVo.setReportNumber(String.valueOf(superviseReportList.size()));
superviseTempMapVoList.add(superviseMapIconVo); superviseTempMapVoList.add(superviseMapIconVo);
} }
@ -596,77 +589,30 @@ public class SubDatavServiceImpl implements SubDatavService {
@Override @Override
public Result<JSONObject> getAllSubOneSupervisionNotifyCount(SubDataVRequest request) { public Result<JSONObject> getAllSubOneSupervisionNotifyCount(SubDataVRequest request) {
SupervisionNotifyOverView overView = new SupervisionNotifyOverView(); SupervisionNotifyOverView overView = new SupervisionNotifyOverView();
List<SupDepart> policeDeparts = supDepartMapper.selectPoliceDeparts(Integer.valueOf(request.getDepartId()));
List<String> proCode = List.of(XCDC.getValue(), LMGZ.getValue(), ZXDC.getValue()); List<String> proCode = List.of(XCDC.getValue(), LMGZ.getValue(), ZXDC.getValue());
List<Negative> negatives = negativeMapper.getNegativeListData(request.getDepartId(), request.getBeginTime(), request.getEndTime(), proCode);
long problemNumber = 0L; List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList();
long processingNumber = 0L; List<Negative> processingList = negatives.stream().filter(item -> ProcessingStatusEnum.processing.name().equals(item.getProcessingStatus())).toList();
long completedNumber = 0L; SupDepartGroupParam supDepartGroupParam = new SupDepartGroupParam();
long reportNumber = 0L; supDepartGroupParam.setGroupId(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId());
long departNumber = 0L; supDepartGroupParam.setParentLevel(2);
long personNumber = 0L; supDepartGroupParam.setChildLevel(3);
Map<String, DepartAndSubDepartDto> departAndSubDepart = supDepartResourceService.getDepartAndSubDepart(supDepartGroupParam);
for (SupDepart supDepart : policeDeparts) { Set<String> allDepartIds = Optional.ofNullable(departAndSubDepart.get(request.getDepartId()))
List<Negative> negatives = negativeMapper.getNegativeListData(supDepart.getId(), request.getBeginTime(), request.getEndTime(), proCode); .map(DepartAndSubDepartDto::getAllDepartIds)
if (CollectionUtil.isEmpty(negatives)) { .orElse(Collections.emptySet());
continue; LambdaQueryWrapper<SuperviseReport> superviseReportLambdaQueryWrapper = new LambdaQueryWrapper<>();
} superviseReportLambdaQueryWrapper.between(SuperviseReport::getCrtTime, request.getBeginTime(), request.getEndTime());
superviseReportLambdaQueryWrapper.eq(SuperviseReport::getType, "1");
List<Negative> completedList = negatives.stream() superviseReportLambdaQueryWrapper.in(CollectionUtil.isNotEmpty(allDepartIds), SuperviseReport::getCrtDepartId, allDepartIds);
.filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())) List<SuperviseReport> superviseReportList = superviseReportService.list(superviseReportLambdaQueryWrapper);
.toList(); DatavServiceImpl.BlameResult blameResult = this.buildBlameResult(negatives);
List<Negative> processingList = negatives.stream() overView.setProblemNumber(negatives.size());
.filter(item -> ProcessingStatusEnum.processing.name().equals(item.getProcessingStatus())) overView.setProcessingNumber((long) processingList.size());
.toList(); overView.setCompletedNumber((long) completedList.size());
List<String> negativeIds = negatives.stream() overView.setReportNumber((long) superviseReportList.size());
.filter(item -> CheckStatusEnum.TRUE_SET.contains(item.getCheckStatusCode()) overView.setDepartNumber((long) blameResult.unitBlames().size());
|| CheckStatusEnum.PART_TRUE_SET.contains(item.getCheckStatusCode())) overView.setPersonNumber((long) (blameResult.leadBlames().size() + blameResult.personalBlames().size()));
.map(Negative::getId)
.toList();
List<NegativeBlame> negativeBlames = Collections.emptyList();
if (!negativeIds.isEmpty()) {
NegativeBlameQueryParam negativeBlameQueryParam = new NegativeBlameQueryParam();
negativeBlameQueryParam.setNegativeIds(negativeIds);
negativeBlames = negativeBlameResourceService.query(negativeBlameQueryParam);
}
List<NegativeBlame> personalBlames = negativeBlames.stream()
.filter(one -> BlameType.personal.name().equals(one.getType()))
.filter(one -> StrUtil.isNotBlank(one.getHandleResultName()))
.filter(one -> !"不予追责".equals(one.getHandleResultName()))
.toList();
Set<String> seenLead = new HashSet<>();
List<NegativeBlame> leadBlames = negativeBlames.stream()
.filter(one -> BlameType.personal.name().equals(one.getType()))
.filter(one -> StrUtil.isNotBlank(one.getLeadHandleResultName()))
.filter(one -> !"不予追责".equals(one.getLeadHandleResultName()))
.filter(one -> seenLead.add(
one.getNegativeId() + "_" + one.getLeadHandleResultName() + "_" + one.getLeadName()
))
.toList();
List<NegativeBlame> unitBlames = negativeBlames.stream()
.filter(one -> BlameType.department.name().equals(one.getType()))
.filter(one -> StrUtil.isNotBlank(one.getHandleResultName()))
.filter(one -> !"不予追责".equals(one.getHandleResultName()))
.toList();
problemNumber += negatives.size();
processingNumber += processingList.size();
completedNumber += completedList.size();
reportNumber += 0L;
departNumber += unitBlames.size();
personNumber += personalBlames.size() + leadBlames.size();
}
overView.setProblemNumber(Math.toIntExact(problemNumber));
overView.setProcessingNumber(processingNumber);
overView.setCompletedNumber(completedNumber);
overView.setReportNumber(reportNumber);
overView.setDepartNumber(departNumber);
overView.setPersonNumber(personNumber);
return Result.success(new JSONObject().fluentPut("overview", overView)); return Result.success(new JSONObject().fluentPut("overview", overView));
} }
@ -1318,7 +1264,7 @@ public class SubDatavServiceImpl implements SubDatavService {
public DatavServiceImpl.BlameResult buildBlameResult(List<Negative> negativeListData) { public DatavServiceImpl.BlameResult buildBlameResult(List<Negative> negativeListData) {
if (CollUtil.isEmpty(negativeListData)) { if (CollUtil.isEmpty(negativeListData)) {
return new DatavServiceImpl.BlameResult(List.of(), List.of()); return new DatavServiceImpl.BlameResult(List.of(), List.of(), List.of());
} }
// 1. 筛选有效 negative // 1. 筛选有效 negative
List<Negative> validNegatives = negativeListData.stream() List<Negative> validNegatives = negativeListData.stream()
@ -1326,7 +1272,7 @@ public class SubDatavServiceImpl implements SubDatavService {
|| CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode()))
.toList(); .toList();
if (CollUtil.isEmpty(validNegatives)) { if (CollUtil.isEmpty(validNegatives)) {
return new DatavServiceImpl.BlameResult(List.of(), List.of()); return new DatavServiceImpl.BlameResult(List.of(), List.of(), List.of());
} }
// 2. 查询问责数据 // 2. 查询问责数据
NegativeBlameQueryParam param = new NegativeBlameQueryParam(); NegativeBlameQueryParam param = new NegativeBlameQueryParam();
@ -1335,7 +1281,7 @@ public class SubDatavServiceImpl implements SubDatavService {
.toList()); .toList());
List<NegativeBlame> negativeBlames = negativeBlameResourceService.query(param); List<NegativeBlame> negativeBlames = negativeBlameResourceService.query(param);
if (CollUtil.isEmpty(negativeBlames)) { if (CollUtil.isEmpty(negativeBlames)) {
return new DatavServiceImpl.BlameResult(List.of(), List.of()); return new DatavServiceImpl.BlameResult(List.of(), List.of(), List.of());
} }
// 3. 个人问责 // 3. 个人问责
List<NegativeBlame> personalBlames = negativeBlames.stream() List<NegativeBlame> personalBlames = negativeBlames.stream()
@ -1352,7 +1298,13 @@ public class SubDatavServiceImpl implements SubDatavService {
one.getNegativeId() + "_" + one.getLeadHandleResultName() + "_" + one.getLeadName() one.getNegativeId() + "_" + one.getLeadHandleResultName() + "_" + one.getLeadName()
)) ))
.toList(); .toList();
return new DatavServiceImpl.BlameResult(personalBlames, leadBlames); // 5. 单位问责
List<NegativeBlame> unitBlames = negativeBlames.stream()
.filter(one -> BlameType.department.name().equals(one.getType()))
.filter(one -> StrUtil.isNotBlank(one.getHandleResultName()))
.filter(one -> !"不予追责".equals(one.getHandleResultName()))
.toList();
return new DatavServiceImpl.BlameResult(personalBlames, leadBlames, unitBlames);
} }
private LocalDateTime toLocalDateTime(Date date) { private LocalDateTime toLocalDateTime(Date date) {

Loading…
Cancel
Save