|
|
|
@ -1,6 +1,7 @@ |
|
|
|
package com.biutag.supervision.service.datav; |
|
|
|
package com.biutag.supervision.service.datav; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.util.NumberUtil; |
|
|
|
import cn.hutool.core.util.NumberUtil; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
@ -9,16 +10,16 @@ import com.biutag.supervision.constants.enums.DepartGroupEnum; |
|
|
|
import com.biutag.supervision.constants.enums.InspectCaseEnum; |
|
|
|
import com.biutag.supervision.constants.enums.InspectCaseEnum; |
|
|
|
import com.biutag.supervision.constants.enums.ProblemSourcesEnum; |
|
|
|
import com.biutag.supervision.constants.enums.ProblemSourcesEnum; |
|
|
|
import com.biutag.supervision.constants.enums.invest.DeleteStatusEnum; |
|
|
|
import com.biutag.supervision.constants.enums.invest.DeleteStatusEnum; |
|
|
|
|
|
|
|
import com.biutag.supervision.constants.enums.invest.ReportProjectNodeEnum; |
|
|
|
import com.biutag.supervision.pojo.Result; |
|
|
|
import com.biutag.supervision.pojo.Result; |
|
|
|
import com.biutag.supervision.pojo.dto.DepartAndSubDepartDto; |
|
|
|
import com.biutag.supervision.pojo.dto.DepartAndSubDepartDto; |
|
|
|
import com.biutag.supervision.pojo.entity.Negative; |
|
|
|
import com.biutag.supervision.pojo.entity.*; |
|
|
|
import com.biutag.supervision.pojo.entity.NegativeBlame; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.entity.SupExternalDepart; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.entity.SupPolice; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.entity.report.ReportProject; |
|
|
|
import com.biutag.supervision.pojo.entity.report.ReportProject; |
|
|
|
import com.biutag.supervision.pojo.param.*; |
|
|
|
import com.biutag.supervision.pojo.param.*; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.param.dataAudit.DataAuditQueryParam; |
|
|
|
import com.biutag.supervision.pojo.request.datav.DataVRequest; |
|
|
|
import com.biutag.supervision.pojo.request.datav.DataVRequest; |
|
|
|
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.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; |
|
|
|
@ -27,11 +28,15 @@ import com.biutag.supervision.repository.reportproject.ReportProjectResourceServ |
|
|
|
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.NegativeBlameService; |
|
|
|
import com.biutag.supervision.service.NegativeBlameService; |
|
|
|
|
|
|
|
import com.biutag.supervision.service.NegativeService; |
|
|
|
import com.biutag.supervision.service.SupPoliceService; |
|
|
|
import com.biutag.supervision.service.SupPoliceService; |
|
|
|
import jakarta.annotation.Resource; |
|
|
|
import jakarta.annotation.Resource; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
|
|
|
import java.math.RoundingMode; |
|
|
|
|
|
|
|
import java.time.ZoneId; |
|
|
|
import java.util.*; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
@ -74,6 +79,12 @@ public class DatavServiceImpl implements DatavService { |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private SupPoliceService supPoliceService; |
|
|
|
private SupPoliceService supPoliceService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private DataAuditResourceService dataAuditResourceService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private NegativeService negativeService; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Result<JSONObject> getAuditMap(DataVRequest request) { |
|
|
|
public Result<JSONObject> getAuditMap(DataVRequest request) { |
|
|
|
List<AuditSuperviseMapIconVo> auditSuperviseMapIconVoList = new ArrayList<>(); |
|
|
|
List<AuditSuperviseMapIconVo> auditSuperviseMapIconVoList = new ArrayList<>(); |
|
|
|
@ -97,7 +108,14 @@ public class DatavServiceImpl implements DatavService { |
|
|
|
reportProjectQueryParam.setAuditUnitIds(allDepartIds); |
|
|
|
reportProjectQueryParam.setAuditUnitIds(allDepartIds); |
|
|
|
reportProjectQueryParam.setDeleteFlag(DeleteStatusEnum.NO.getCode()); |
|
|
|
reportProjectQueryParam.setDeleteFlag(DeleteStatusEnum.NO.getCode()); |
|
|
|
List<ReportProject> reportProjectList = reportProjectResourceService.query(reportProjectQueryParam); |
|
|
|
List<ReportProject> reportProjectList = reportProjectResourceService.query(reportProjectQueryParam); |
|
|
|
auditSuperviseMapIconVo.setReportProjectNumber(reportProjectList.size()); |
|
|
|
// 其他审计项目
|
|
|
|
|
|
|
|
DataAuditQueryParam dataAuditQueryParam = new DataAuditQueryParam(); |
|
|
|
|
|
|
|
dataAuditQueryParam.setAuditTimeStart(request.getBeginTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); |
|
|
|
|
|
|
|
dataAuditQueryParam.setAuditTimeEnd(request.getEndTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); |
|
|
|
|
|
|
|
dataAuditQueryParam.setSecondLevelDeptId(Long.valueOf(entry.getKey())); |
|
|
|
|
|
|
|
List<DataAudit> dataAuditList = dataAuditResourceService.query(dataAuditQueryParam); |
|
|
|
|
|
|
|
Integer reportProjectNumber = reportProjectList.size() + dataAuditList.size(); |
|
|
|
|
|
|
|
auditSuperviseMapIconVo.setReportProjectNumber(reportProjectNumber); |
|
|
|
|
|
|
|
|
|
|
|
NegativeQueryParam negativeQueryParam = new NegativeQueryParam(); |
|
|
|
NegativeQueryParam negativeQueryParam = new NegativeQueryParam(); |
|
|
|
List<Date> dates = Arrays.asList(request.getBeginTime(), request.getEndTime()); |
|
|
|
List<Date> dates = Arrays.asList(request.getBeginTime(), request.getEndTime()); |
|
|
|
@ -410,4 +428,106 @@ public class DatavServiceImpl implements DatavService { |
|
|
|
JSONObject res = new JSONObject().fluentPut("overview", overview); |
|
|
|
JSONObject res = new JSONObject().fluentPut("overview", overview); |
|
|
|
return Result.success(res); |
|
|
|
return Result.success(res); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 审计大屏 审计项目类型 |
|
|
|
|
|
|
|
* @param request |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Result<JSONObject> getAuditType(DataVRequest request) { |
|
|
|
|
|
|
|
DataAuditQueryParam dataAuditQueryParam = new DataAuditQueryParam(); |
|
|
|
|
|
|
|
dataAuditQueryParam.setAuditTimeStart(request.getBeginTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); |
|
|
|
|
|
|
|
dataAuditQueryParam.setAuditTimeEnd(request.getEndTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); |
|
|
|
|
|
|
|
List<DataAudit> dataAuditList = dataAuditResourceService.query(dataAuditQueryParam); |
|
|
|
|
|
|
|
List<EchartsVo> barData = dataAuditList.stream() |
|
|
|
|
|
|
|
.collect(Collectors.groupingBy(DataAudit::getAuditTypeName, Collectors.counting())) |
|
|
|
|
|
|
|
.entrySet().stream() |
|
|
|
|
|
|
|
.map(entry -> new EchartsVo(entry.getKey(), entry.getValue().intValue())) |
|
|
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
ReportProjectQueryParam reportProjectQueryParam = new ReportProjectQueryParam(); |
|
|
|
|
|
|
|
reportProjectQueryParam.setArchivingStart(request.getBeginTime()); |
|
|
|
|
|
|
|
reportProjectQueryParam.setArchivingEnd(request.getEndTime()); |
|
|
|
|
|
|
|
List<ReportProject> reportProjects = reportProjectResourceService.query(reportProjectQueryParam); |
|
|
|
|
|
|
|
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); |
|
|
|
|
|
|
|
return Result.success(object); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Result<JSONObject> getAuditTrend(Integer year) { |
|
|
|
|
|
|
|
// 其他审计
|
|
|
|
|
|
|
|
List<EchartsVo> auditTrend = dataAuditResourceService.getAuditTrend(year); |
|
|
|
|
|
|
|
// 政府投资审计
|
|
|
|
|
|
|
|
List<EchartsVo> invertTrend = reportProjectResourceService.getReportProjectTrend(year); |
|
|
|
|
|
|
|
// 将两个列表转换为 Map,key 为月份名称,value 为数量
|
|
|
|
|
|
|
|
Map<String, Integer> auditMap = auditTrend.stream().collect(Collectors.toMap(EchartsVo::getName, EchartsVo::getValue)); |
|
|
|
|
|
|
|
Map<String, Integer> invertMap = invertTrend.stream().collect(Collectors.toMap(EchartsVo::getName, EchartsVo::getValue)); |
|
|
|
|
|
|
|
// 生成合并后的列表
|
|
|
|
|
|
|
|
List<EchartsVo> mergedList = new ArrayList<>(); |
|
|
|
|
|
|
|
for (int i = 1; i <= 12; i++) { |
|
|
|
|
|
|
|
String monthName = i + "月"; |
|
|
|
|
|
|
|
int auditValue = auditMap.getOrDefault(monthName, 0); |
|
|
|
|
|
|
|
int invertValue = invertMap.getOrDefault(monthName, 0); |
|
|
|
|
|
|
|
mergedList.add(new EchartsVo(monthName, auditValue + invertValue)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject object=new JSONObject(); |
|
|
|
|
|
|
|
object.fluentPut("auditTrend",mergedList); |
|
|
|
|
|
|
|
return Result.success(object); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Result<AuditOverview> aduitOverview(DataVRequest request) { |
|
|
|
|
|
|
|
Date beginTime = request.getBeginTime(); |
|
|
|
|
|
|
|
Date endTime = request.getEndTime(); |
|
|
|
|
|
|
|
List<Negative> negatives = negativeService.list(new LambdaQueryWrapper<Negative>().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)){ |
|
|
|
|
|
|
|
accountableNumber = negativeBlameService.count(new LambdaQueryWrapper<NegativeBlame>().in(NegativeBlame::getNegativeId, negatives.stream().map(Negative::getId).collect(Collectors.toSet())) |
|
|
|
|
|
|
|
.ne(NegativeBlame::getHandleResultName, "不予追责")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 政府投资数据
|
|
|
|
|
|
|
|
ReportProjectQueryParam reportProjectQueryParam = new ReportProjectQueryParam(); |
|
|
|
|
|
|
|
reportProjectQueryParam.setArchivingStart(beginTime); |
|
|
|
|
|
|
|
reportProjectQueryParam.setArchivingEnd(endTime); |
|
|
|
|
|
|
|
reportProjectQueryParam.setDeleteFlag(DeleteStatusEnum.NO.getCode()); |
|
|
|
|
|
|
|
reportProjectQueryParam.setNode(ReportProjectNodeEnum.END.getCode()); |
|
|
|
|
|
|
|
List<ReportProject> 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 zftzsjje = reportProjects.stream().map(ReportProject::getArchivingReduceMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP); |
|
|
|
|
|
|
|
// 其他审计数据
|
|
|
|
|
|
|
|
DataAuditQueryParam dataAuditQueryParam = new DataAuditQueryParam(); |
|
|
|
|
|
|
|
dataAuditQueryParam.setAuditTimeStart(request.getBeginTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); |
|
|
|
|
|
|
|
dataAuditQueryParam.setAuditTimeEnd(request.getEndTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); |
|
|
|
|
|
|
|
List<DataAudit> dataAuditList = dataAuditResourceService.query(dataAuditQueryParam); |
|
|
|
|
|
|
|
// 其他审计金额
|
|
|
|
|
|
|
|
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); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 最后得出的总的项目数量
|
|
|
|
|
|
|
|
int projectNumber = reportProjects.size() + dataAuditList.size(); |
|
|
|
|
|
|
|
// 审计总金额
|
|
|
|
|
|
|
|
BigDecimal auditAmount = zftzje.add(qtsjje); |
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
AuditOverview overview = new AuditOverview(); |
|
|
|
|
|
|
|
overview.setProjectNumber(new BigDecimal(projectNumber)); |
|
|
|
|
|
|
|
overview.setAuditAmount(auditAmount); |
|
|
|
|
|
|
|
overview.setAuditSjAmount(zftzsjje); |
|
|
|
|
|
|
|
overview.setAuditWtAmount(fxwtje); |
|
|
|
|
|
|
|
overview.setNegativeNumber(negatives.size()); |
|
|
|
|
|
|
|
overview.setAccountableNumber(accountableNumber); |
|
|
|
|
|
|
|
return Result.success(overview); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|