diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataVRightsComfortController.java b/src/main/java/com/biutag/supervision/controller/datav/DataVRightsComfortController.java index 781f390..5e60f6e 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVRightsComfortController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVRightsComfortController.java @@ -16,12 +16,15 @@ import com.biutag.supervision.pojo.entity.RpcInfringerResult; import com.biutag.supervision.pojo.entity.SupDepart; import com.biutag.supervision.pojo.entity.SupDictData; import com.biutag.supervision.pojo.model.DataRightsComfortModel; +import com.biutag.supervision.pojo.request.datav.DataVRequest; import com.biutag.supervision.pojo.vo.ComfortMapIconVo; import com.biutag.supervision.pojo.vo.EchartsVo; import com.biutag.supervision.service.DataRightsComfortService; import com.biutag.supervision.service.RpcApplyService; import com.biutag.supervision.service.SupDictDataService; +import com.biutag.supervision.service.datav.DatavService; import com.biutag.supervision.util.CompletableUtils.CompletableFutureUtil; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import org.springframework.format.annotation.DateTimeFormat; @@ -53,6 +56,33 @@ public class DataVRightsComfortController { private final SupDictDataService supDictDataService; private final SupDepartMapper supDepartMapper; + private final DatavService datavService; + + + /** + * 机构问题排名 + * @return Result + */ + @Operation(summary = "维权案件情况") + @PostMapping("/getRightsBarList") + public Result getRightsBarList(@RequestBody DataVRequest request) { + return datavService.getRightsBarList(request); + } + + + + /** + * 机构问题排名 + * @return Result + */ + @Operation(summary = "抚慰金额情况") + @PostMapping("/getComfortMoneyBarList") + public Result getComfortMoneyBarList(@RequestBody DataVRequest request) { + return datavService.getComfortMoneyBarList(request); + } + + + @GetMapping public Result rightsComfort(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @@ -67,7 +97,7 @@ public class DataVRightsComfortController { .between(RpcApply::getCrtTime, beginTime, finalEndTime) .eq(RpcApply::getType, RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue())); //获取案件编号 - Set caseNumbers = list.stream().map(RpcApply::getCaseNumber).collect(Collectors.toSet()); + Set caseNumbers = list.stream().filter(one->StrUtil.isNotBlank(one.getDepartId())).map(RpcApply::getCaseNumber).collect(Collectors.toSet()); // 维权案件总数 result.setRightsNumber(caseNumbers.size()); // 受侵害人数 @@ -127,25 +157,25 @@ public class DataVRightsComfortController { // 抚慰金额(万元) result.setComfortMoney(dataRightsComfortService.countComfortMoney(beginTime, finalEndTime)); }), - CompletableFutureUtil.runSyncObject(() -> { - // 抚慰金额情况 - 分县市局 - result.setCountyComfortMoneyBarList(rpcApplyMapper.selectComfortMoneyBarList(beginTime, finalEndTime, 3)); - }), - - CompletableFutureUtil.runSyncObject(() -> { - // 抚慰金额情况 - 局属单位 - result.setBureauComfortMoneyBarList(rpcApplyMapper.selectComfortMoneyBarList(beginTime, finalEndTime, 4)); - }), - CompletableFutureUtil.runSyncObject(()->{ - // 维权案件情况 - 分县市局 - result.setCountyRightsBarList(rpcApplyMapper.selectProtectRightsBarList(beginTime, finalEndTime, 3)); - - }), - - CompletableFutureUtil.runSyncObject(()->{ - // 维权案件情况 - 局属单位 - result.setBureauRightsBarList(rpcApplyMapper.selectProtectRightsBarList(beginTime, finalEndTime, 4)); - }), +// CompletableFutureUtil.runSyncObject(() -> { +// // 抚慰金额情况 - 分县市局 +// result.setCountyComfortMoneyBarList(rpcApplyMapper.selectComfortMoneyBarList(beginTime, finalEndTime, 3)); +// }), +// +// CompletableFutureUtil.runSyncObject(() -> { +// // 抚慰金额情况 - 局属单位 +// result.setBureauComfortMoneyBarList(rpcApplyMapper.selectComfortMoneyBarList(beginTime, finalEndTime, 4)); +// }), +// CompletableFutureUtil.runSyncObject(()->{ +// // 维权案件情况 - 分县市局 +// result.setCountyRightsBarList(rpcApplyMapper.selectProtectRightsBarList(beginTime, finalEndTime, 3)); +// +// }), + +// CompletableFutureUtil.runSyncObject(()->{ +// // 维权案件情况 - 局属单位 +// result.setBureauRightsBarList(rpcApplyMapper.selectProtectRightsBarList(beginTime, finalEndTime, 4)); +// }), CompletableFutureUtil.runSyncObject(()->{ //案件类别 - 刑事 result.setCrownCaseBarList(rpcApplyMapper.selectCaseData(beginTime, finalEndTime,"1")); @@ -210,11 +240,12 @@ public class DataVRightsComfortController { List list = rpcApplyService.list(new LambdaQueryWrapper() .between(RpcApply::getCrtTime, beginTime, finalEndTime) - .eq(RpcApply::getSecondDepartId,departId) - .eq(RpcApply::getVerified,"2") + .eq(RpcApply::getDepartId,departId) + .eq(RpcApply::getVerified,"0") .eq(RpcApply::getType, RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue())); Set caseNumbers = list.stream() + .filter(one->StrUtil.isNotBlank(one.getDepartId())) .map(RpcApply::getCaseNumber) .collect(Collectors.toSet()); @@ -238,14 +269,15 @@ public class DataVRightsComfortController { re.setHitPersonNumber(initialListSize + nums - hitPersonNumber); } //抚慰金额 - CompletableFutureUtil.runSyncObject(() -> { - - re.setComfortMoney(rpcApplyMapper.selectComfortMoneyBarByOrg(beginTime, finalEndTime, departId)); - }); + re.setComfortMoney(rpcApplyMapper.selectComfortMoneyBar(beginTime, finalEndTime, departId)); +// CompletableFutureUtil.runSyncObject(() -> { +// +// re.setComfortMoney(rpcApplyMapper.selectComfortMoneyBarByOrg(beginTime, finalEndTime, departId)); +// }).join(); CompletableFutureUtil.runSyncObject(() -> { // 抚慰人数 re.setComfortPersonNumber(rpcApplyService.orgCount(beginTime, finalEndTime, RpcApplyTypeEnum.COMFORT.getValue(), departId)); - }); + }).join(); } diff --git a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneRightsController.java b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneRightsController.java index f7e8263..7d89b77 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneRightsController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneRightsController.java @@ -165,10 +165,10 @@ public class SubOneRightsController { List list = rpcApplyService.list(new LambdaQueryWrapper() .between(RpcApply::getCrtTime, beginTime, finalEndTime) - .eq(RpcApply::getSecondDepartId,deptId) + .eq(RpcApply::getDepartId,deptId) .eq(RpcApply::getType, RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue())); - Set caseNumbers = list.stream().map(RpcApply::getCaseNumber).collect(Collectors.toSet()); + Set caseNumbers = list.stream().filter(one->StrUtil.isNotBlank(one.getDepartId())).map(RpcApply::getCaseNumber).collect(Collectors.toSet()); // 维权案件总数 re.setRightsNumber(caseNumbers.size()); @@ -190,14 +190,17 @@ public class SubOneRightsController { re.setHitPersonNumber(initialListSize + nums - hitPersonNumber); } //抚慰金额 - CompletableFutureUtil.runSyncObject(() -> { - - re.setComfortMoney(rpcApplyMapper.selectComfortMoneyBarByOrg(beginTime, finalEndTime, deptId)); - }); - CompletableFutureUtil.runSyncObject(() -> { - // 抚慰人数 - re.setComfortPersonNumber(rpcApplyService.orgCount(beginTime, finalEndTime, RpcApplyTypeEnum.COMFORT.getValue(), deptId)); - }); + re.setComfortMoney(rpcApplyMapper.selectComfortMoneyBar(beginTime, finalEndTime, deptId)); + // 抚慰人数 + re.setComfortPersonNumber(rpcApplyService.orgCount(beginTime, finalEndTime, RpcApplyTypeEnum.COMFORT.getValue(), deptId)); +// CompletableFutureUtil.runSyncObject(() -> { +// +// re.setComfortMoney(rpcApplyMapper.selectComfortMoneyBarByOrg(beginTime, finalEndTime, deptId)); +// }); +// CompletableFutureUtil.runSyncObject(() -> { +// // 抚慰人数 +// re.setComfortPersonNumber(rpcApplyService.orgCount(beginTime, finalEndTime, RpcApplyTypeEnum.COMFORT.getValue(), deptId)); +// }); } diff --git a/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java index 7f09a8a..694707b 100644 --- a/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java @@ -19,7 +19,7 @@ import java.util.List; public interface RpcApplyMapper extends BaseMapper { @Select("SELECT COALESCE(SUM(a.provide_relief), 0.0) FROM rpc_apply_person a LEFT JOIN rpc_apply b ON a.rpc_id = b.rpc_id " + - "WHERE b.crt_time BETWEEN #{beginTime} AND #{endTime} AND b.type = 2") + "WHERE b.apply_date BETWEEN #{beginTime} AND #{endTime} AND b.type = 2") Double countComfortMoney(Date beginTime, Date endTime); @Select("SELECT c.job name, COUNT(c.job) value FROM sup_police c JOIN " + @@ -62,7 +62,7 @@ public interface RpcApplyMapper extends BaseMapper { * */ @Select(" SELECT COUNT(*) from rpc_apply_person a LEFT JOIN rpc_apply b " + " on a.rpc_id = b.rpc_id and b.type =1 " + - " WHERE b.rpc_id is not null and b.verified ='2' " + + " WHERE b.rpc_id is not null and b.verified ='0' " + " and b.crt_time BETWEEN #{beginTime} and #{endTime} ") int selectVictimNumber(Date beginTime, Date endTime); @@ -71,7 +71,7 @@ public interface RpcApplyMapper extends BaseMapper { * */ @Select(" SELECT COUNT(*) from rpc_apply_person a LEFT JOIN rpc_apply b " + " on a.rpc_id = b.rpc_id and b.type =1 " + - " WHERE b.rpc_id is not null and b.verified ='2' " + + " WHERE b.rpc_id is not null and b.verified ='0' " + " and b.crt_time BETWEEN #{beginTime} and #{endTime} " + " and b.second_depart_id = #{deptId} ") int selectVictimNumberByOrg(Date beginTime, Date endTime,String deptId); @@ -104,7 +104,7 @@ public interface RpcApplyMapper extends BaseMapper { "Incident_link_name AS `name`, " + "count(*) AS `value` " + "FROM rpc_apply ra " + - "WHERE ra.crt_time BETWEEN #{beginTime} AND #{endTime} and ra.type = 1 and ra.verified= '2' " + + "WHERE ra.crt_time BETWEEN #{beginTime} AND #{endTime} and ra.type = 1 and ra.verified= '0' " + "GROUP BY Incident_link_name ") List getIncidentLink(Date beginTime, Date endTime); @@ -239,6 +239,21 @@ public interface RpcApplyMapper extends BaseMapper { " r.crt_time between #{beginTime} " + " and #{endTime} and r.type = 2 ") BigDecimal selectComfortMoneyBarByOrg(Date beginTime, Date endTime, String orgId); + + @Select("SELECT \n" + + "round( sum(p.provide_relief)/10000, 2)\n" + + "FROM rpc_apply r\n" + + "LEFT JOIN rpc_apply_person p on r.rpc_id = p.rpc_id\n" + + "LEFT JOIN sup_depart sd ON r.depart_id = sd.id\n" + + "LEFT JOIN sup_depart sdd ON sd.pid = sdd.id\n" + + "LEFT JOIN sup_depart sddd ON sdd.pid = sddd.id\n" + + "WHERE r.type=2\n" + + "AND r.rpc_status = 'completed'\n" + + "AND r.apply_date > #{beginTime} and r.apply_date<= #{finalEndTime}" + + "AND (sd.id = #{departId} OR sdd.id = #{departId} OR sddd.id = #{departId})") + BigDecimal selectComfortMoneyBar(Date beginTime, Date finalEndTime, String departId); + + /** * 按事发时间进行筛选 * 维权案件情况 @@ -321,4 +336,14 @@ public interface RpcApplyMapper extends BaseMapper { @Select("select p.injury_severity_name name, count(r.rpc_id) value from rpc_apply r left join rpc_apply_person p on r.rpc_id = p.rpc_id where r.crt_time between #{beginTime} and #{endTime} and r.type = 2 GROUP BY p.injury_severity_name") List selectComfortInjuryCategory(Date beginTime, Date endTime); + + @Select("SELECT r.* " + + "FROM rpc_apply r " + + "INNER JOIN sup_depart d ON r.depart_id = d.id " + + " LEFT JOIN sup_depart d_parent ON d.pid = d_parent.id " + + "WHERE r.type = 1 " + + " AND r.crt_time BETWEEN #{beginTime} AND #{endTime} " + + " AND (d.id = #{id} OR d.pid = #{id} OR d_parent.pid = #{id} )") + List selectRightsList(String id, Date beginTime, Date endTime); + } diff --git a/src/main/java/com/biutag/supervision/mapper/RpcComfortPacksMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcComfortPacksMapper.java index eec36df..b585094 100644 --- a/src/main/java/com/biutag/supervision/mapper/RpcComfortPacksMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/RpcComfortPacksMapper.java @@ -1,8 +1,34 @@ package com.biutag.supervision.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.dto.common.BarItem; import com.biutag.supervision.pojo.entity.RpcComfortPacks; +import com.biutag.supervision.pojo.request.datav.DataVRequest; +import org.apache.ibatis.annotations.Select; + +import java.util.Date; +import java.util.List; public interface RpcComfortPacksMapper extends BaseMapper { + + @Select("SELECT rpc.rpc_id FROM rpc_comfort_packs rcp " + + "LEFT JOIN rpc_packs_comfort rpc ON rcp.id =rpc.packs_id " + + "WHERE report_time > #{beginTime} AND report_time <=#{endTime}") + List selectRpcIds(Date beginTime, Date endTime); + + @Select(" SELECT " + + "sdd.short_name AS label, " + + "ROUND(sum(p.provide_relief) / 10000, 2) value " + + "FROM rpc_apply r " + + "LEFT JOIN rpc_apply_person p ON r.rpc_id = p.rpc_id " + + "LEFT JOIN sup_depart sd on r.depart_id = sd.id " + + "LEFT JOIN sup_depart sdd ON sd.pid = sdd.id " + + "WHERE r.type=2 " + + "AND r.rpc_status ='completed' " + + "AND r.apply_date > #{beginTime} AND r.apply_date <=#{endTime} " + + "AND sdd.statistics_group_id =#{i} " + + "GROUP BY sdd.`name` " + + "ORDER BY value desc") + List getComfortMoneyBarList(Date beginTime, Date endTime, int i); } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/RpcInfringerResultMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcInfringerResultMapper.java index 82a3bb8..0c1fd48 100644 --- a/src/main/java/com/biutag/supervision/mapper/RpcInfringerResultMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/RpcInfringerResultMapper.java @@ -12,7 +12,7 @@ public interface RpcInfringerResultMapper extends BaseMapper @Select(" SELECT rir.tort_name from rpc_infringer_result rir LEFT JOIN rpc_apply as rpa" + " on rpa.rpc_id = rir.rpc_id" + " WHERE rpa.crt_time between #{beginTime} and #{endTime} " + - " and rpa.type = 1 and rpa.verified ='2'") + " and rpa.type = 1 and rpa.verified ='0'") List selectNamesByTime(Date beginTime, Date endTime); @@ -24,13 +24,13 @@ public interface RpcInfringerResultMapper extends BaseMapper @Select(" SELECT rir.* from rpc_infringer_result rir LEFT JOIN rpc_apply as rpa" + " on rpa.rpc_id = rir.rpc_id" + " WHERE rpa.crt_time between #{beginTime} and #{endTime} " + - " and rpa.type = 1 and rpa.verified= '2'") + " and rpa.type = 1 and rpa.verified= '0'") List selectDataByTime(Date beginTime, Date endTime); @Select(" SELECT rir.tort_name from rpc_infringer_result rir LEFT JOIN rpc_apply as rpa" + " on rpa.rpc_id = rir.rpc_id " + " WHERE rpa.crt_time between #{beginTime} and #{endTime} " + - " and rpa.type = 1 and rpa.verified ='2' and rpa.second_depart_id = #{orgId} ") + " and rpa.type = 1 and rpa.verified ='0' and rpa.depart_id = #{orgId} ") List selectNamesByOrgTime(Date beginTime, Date endTime,String orgId); } diff --git a/src/main/java/com/biutag/supervision/service/RpcApplyService.java b/src/main/java/com/biutag/supervision/service/RpcApplyService.java index c12c7f9..6e129ce 100644 --- a/src/main/java/com/biutag/supervision/service/RpcApplyService.java +++ b/src/main/java/com/biutag/supervision/service/RpcApplyService.java @@ -231,7 +231,7 @@ public class RpcApplyService extends ServiceImpl { // 抚慰人数 public Long orgCount(Date beginTime, Date endTime, String type, String orgId) { - return count(new LambdaQueryWrapper().between(RpcApply::getCrtTime, beginTime, endTime).eq(RpcApply::getSecondDepartId,orgId).eq(RpcApply::getType, type)); + return count(new LambdaQueryWrapper().between(RpcApply::getCrtTime, beginTime, endTime).eq(RpcApply::getDepartId,orgId).eq(RpcApply::getType, type)); } public Result getPoliceInfo(ComfortApplyRequest request) { diff --git a/src/main/java/com/biutag/supervision/service/datav/DatavService.java b/src/main/java/com/biutag/supervision/service/datav/DatavService.java index 2d7f756..4f9df8c 100644 --- a/src/main/java/com/biutag/supervision/service/datav/DatavService.java +++ b/src/main/java/com/biutag/supervision/service/datav/DatavService.java @@ -69,4 +69,19 @@ public interface DatavService { * @return */ Result aduitOverview(DataVRequest request); + + /** + * 维权抚慰 维权案件情况 + * @param request + * @return + */ + Result getRightsBarList(DataVRequest request); + + /** + * 维权抚慰 抚慰金额情况 + * @param request + * @return + */ + Result getComfortMoneyBarList(DataVRequest request); + } diff --git a/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java b/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java index cddc810..b9c71ce 100644 --- a/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java @@ -5,14 +5,15 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.NumberUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.biutag.supervision.constants.enums.BlameType; -import com.biutag.supervision.constants.enums.DepartGroupEnum; -import com.biutag.supervision.constants.enums.InspectCaseEnum; -import com.biutag.supervision.constants.enums.ProblemSourcesEnum; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.biutag.supervision.constants.enums.*; import com.biutag.supervision.constants.enums.invest.DeleteStatusEnum; import com.biutag.supervision.constants.enums.invest.ReportProjectNodeEnum; +import com.biutag.supervision.mapper.RpcApplyMapper; +import com.biutag.supervision.mapper.RpcComfortPacksMapper; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.dto.DepartAndSubDepartDto; +import com.biutag.supervision.pojo.dto.common.BarItem; import com.biutag.supervision.pojo.entity.*; import com.biutag.supervision.pojo.entity.report.ReportProject; import com.biutag.supervision.pojo.param.*; @@ -27,11 +28,10 @@ import com.biutag.supervision.repository.negative.NegativeResourceService; import com.biutag.supervision.repository.reportproject.ReportProjectResourceService; import com.biutag.supervision.repository.supExternalDepart.SupExternalDepartResourceService; import com.biutag.supervision.repository.supdepart.SupDepartResourceService; -import com.biutag.supervision.service.NegativeBlameService; -import com.biutag.supervision.service.NegativeService; -import com.biutag.supervision.service.SupPoliceService; +import com.biutag.supervision.service.*; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; +import org.ehcache.sizeof.SizeOf; import org.springframework.stereotype.Service; import java.math.BigDecimal; @@ -85,6 +85,25 @@ public class DatavServiceImpl implements DatavService { @Resource private NegativeService negativeService; + @Resource + private RpcApplyService rpcApplyService; + + @Resource + private SupDepartService supDepartService; + + @Resource + private RpcApplyMapper rpcApplyMapper; + + @Resource + private RpcPacksComfortService rpcPacksComfortService; + @Resource + private RpcComfortPacksService rpcComfortPacksService; + + @Resource + private RpcComfortPacksMapper rpcComfortPacksMapper; + + @Resource + private RpcApplyPersonService rpcApplyPersonService; @Override public Result getAuditMap(DataVRequest request) { List auditSuperviseMapIconVoList = new ArrayList<>(); @@ -432,6 +451,7 @@ public class DatavServiceImpl implements DatavService { /** * 审计大屏 审计项目类型 + * * @param request * @return */ @@ -451,23 +471,23 @@ public class DatavServiceImpl implements DatavService { reportProjectQueryParam.setArchivingEnd(request.getEndTime()); reportProjectQueryParam.setNode(ReportProjectNodeEnum.END.getCode()); List reportProjects = reportProjectResourceService.query(reportProjectQueryParam); - if (CollectionUtil.isNotEmpty(reportProjects)){ + if (CollectionUtil.isNotEmpty(reportProjects)) { EchartsVo echartsVo = new EchartsVo(); echartsVo.setName("政府投资审计"); echartsVo.setValue(reportProjects.size()); barData.add(echartsVo); } - JSONObject object=new JSONObject(); - object.fluentPut("barData",barData); + JSONObject object = new JSONObject(); + object.fluentPut("barData", barData); return Result.success(object); } @Override public Result getAuditTrend(Integer year) { // 其他审计 - List auditTrend = dataAuditResourceService.getAuditTrend(year); + List auditTrend = dataAuditResourceService.getAuditTrend(year); // 政府投资审计 - List invertTrend = reportProjectResourceService.getReportProjectTrend(year); + List invertTrend = reportProjectResourceService.getReportProjectTrend(year); // 将两个列表转换为 Map,key 为月份名称,value 为数量 Map auditMap = auditTrend.stream().collect(Collectors.toMap(EchartsVo::getName, EchartsVo::getValue)); Map invertMap = invertTrend.stream().collect(Collectors.toMap(EchartsVo::getName, EchartsVo::getValue)); @@ -480,8 +500,8 @@ public class DatavServiceImpl implements DatavService { mergedList.add(new EchartsVo(monthName, auditValue + invertValue)); } - JSONObject object=new JSONObject(); - object.fluentPut("auditTrend",mergedList); + JSONObject object = new JSONObject(); + object.fluentPut("auditTrend", mergedList); return Result.success(object); } @@ -492,7 +512,7 @@ public class DatavServiceImpl implements DatavService { List negatives = negativeService.list(new LambdaQueryWrapper().between(Negative::getCrtTime, beginTime, DateUtil.endOfDay(endTime)) .in(Negative::getProblemSourcesCode, List.of(ProblemSourcesEnum.ZFTZSJ.getValue(), ProblemSourcesEnum.ZFSACFSS.getValue(), ProblemSourcesEnum.JJZRSJ.getValue(), ProblemSourcesEnum.ZXSJ.getValue()))); long accountableNumber = 0; - if (CollectionUtil.isNotEmpty(negatives)){ + if (CollectionUtil.isNotEmpty(negatives)) { accountableNumber = negativeBlameService.count(new LambdaQueryWrapper().in(NegativeBlame::getNegativeId, negatives.stream().map(Negative::getId).collect(Collectors.toSet())) .ne(NegativeBlame::getHandleResultName, "不予追责")); } @@ -504,7 +524,7 @@ public class DatavServiceImpl implements DatavService { reportProjectQueryParam.setNode(ReportProjectNodeEnum.END.getCode()); List reportProjects = reportProjectResourceService.query(reportProjectQueryParam); // 政府投资审计金额 - BigDecimal zftzje = reportProjects.stream().map(ReportProject::getReportMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP); ; + BigDecimal zftzje = reportProjects.stream().map(ReportProject::getReportMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP); // 政府投资审减金额 BigDecimal zftzsjje = reportProjects.stream().map(ReportProject::getArchivingReduceMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP); // 其他审计数据 @@ -515,7 +535,7 @@ public class DatavServiceImpl implements DatavService { // 其他审计金额 BigDecimal qtsjje = dataAuditList.stream().map(DataAudit::getAuditAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); // 发现问题金额 - BigDecimal fxwtje = dataAuditList.stream().map(DataAudit::getIssueAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal fxwtje = dataAuditList.stream().map(DataAudit::getIssueAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); // 最后得出的总的项目数量 @@ -532,4 +552,54 @@ public class DatavServiceImpl implements DatavService { overview.setAccountableNumber(accountableNumber); return Result.success(overview); } + + @Override + public Result getRightsBarList(DataVRequest request) { + List countyRightsBarList = new ArrayList<>(); + List bureauRightsBarList = new ArrayList<>(); + SupDepartQueryParam supDepartQueryParam = new SupDepartQueryParam(); + supDepartQueryParam.setStatisticsGroupId(3); + List fxsjDw = supDepartResourceService.query(supDepartQueryParam); + supDepartQueryParam.setStatisticsGroupId(4); + List bwzdDw = supDepartResourceService.query(supDepartQueryParam); + for (SupDepart supDepart : fxsjDw) { + List rpcApplyList = rpcApplyMapper.selectRightsList(supDepart.getId(), request.getBeginTime(), request.getEndTime()); + if (CollectionUtil.isNotEmpty(rpcApplyList)){ + BarItem barItem = new BarItem(supDepart.getShortName(), new BigDecimal(rpcApplyList.size())); + countyRightsBarList.add(barItem); + } + } + + for (SupDepart supDepart : bwzdDw) { + List rpcApplyList = rpcApplyMapper.selectRightsList(supDepart.getId(), request.getBeginTime(), request.getEndTime()); + if (CollectionUtil.isNotEmpty(rpcApplyList)){ + BarItem barItem = new BarItem(supDepart.getShortName(), new BigDecimal(rpcApplyList.size())); + bureauRightsBarList.add(barItem); + } + } + JSONObject object = new JSONObject(); + countyRightsBarList.sort((o1, o2) -> o2.getValue().compareTo(o1.getValue())); + bureauRightsBarList.sort((o1, o2) -> o2.getValue().compareTo(o1.getValue())); + object.fluentPut("countyRightsBarList", countyRightsBarList); + object.fluentPut("bureauRightsBarList", bureauRightsBarList); + return Result.success(object); + } + + @Override + public Result getComfortMoneyBarList(DataVRequest request) { + // 找到rpcId +// List rpcIds = rpcComfortPacksMapper.selectRpcIds(request.getBeginTime(), request.getEndTime()); + // 找人找单位 +// LambdaQueryWrapper rpcApplyPersonLambdaQueryWrapper = new LambdaQueryWrapper<>(); +// rpcApplyPersonLambdaQueryWrapper.in(RpcApplyPerson::getRpcId, rpcIds); +// rpcApplyPersonLambdaQueryWrapper.between(RpcApplyPerson::getCreatTime, request.getBeginTime(), request.getEndTime()); +// List rpcApplyPersonList = rpcApplyPersonService.list(rpcApplyPersonLambdaQueryWrapper); + List countyComfortMoneyBarList = rpcComfortPacksMapper.getComfortMoneyBarList(request.getBeginTime(), request.getEndTime(), 3); + List bureauComfortMoneyBarList = rpcComfortPacksMapper.getComfortMoneyBarList(request.getBeginTime(), request.getEndTime(), 4); + + JSONObject object = new JSONObject(); + object.fluentPut("countyComfortMoneyBarList", countyComfortMoneyBarList); + object.fluentPut("bureauComfortMoneyBarList", bureauComfortMoneyBarList); + return Result.success(object); + } }