11 changed files with 431 additions and 32 deletions
@ -0,0 +1,28 @@ |
|||||||
|
package com.biutag.supervision.pojo.param; |
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
import java.util.Set; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName NegativeOrganizationRankQueryParam |
||||||
|
* @Description 机构问题排名查询参数实体 |
||||||
|
* @Author shihao |
||||||
|
* @Date 2025/12/19 16:51 |
||||||
|
*/ |
||||||
|
@Getter |
||||||
|
@Setter |
||||||
|
@Schema(description = "机构问题排名查询参数实体") |
||||||
|
public class NegativeOrganizationRankQueryParam { |
||||||
|
|
||||||
|
@Schema(description = "部门集合") |
||||||
|
private Set<String> involveDepartIds; |
||||||
|
|
||||||
|
@Schema(description = "时间集合") |
||||||
|
private List<Date> crtTime; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,57 @@ |
|||||||
|
package com.biutag.supervision.pojo.param; |
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.util.Set; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName SupDepartQueryParam |
||||||
|
* @Description 部门查询请求 |
||||||
|
* @Author shihao |
||||||
|
* @Date 2025/12/19 16:00 |
||||||
|
*/ |
||||||
|
@Getter |
||||||
|
@Setter |
||||||
|
@Schema(description = "部门查询请求") |
||||||
|
public class SupDepartQueryParam { |
||||||
|
|
||||||
|
@Schema(description = "部门ID") |
||||||
|
private String id; |
||||||
|
|
||||||
|
@Schema(description = "部门ID集合") |
||||||
|
private Set<String> ids; |
||||||
|
|
||||||
|
@Schema(description = "父部门ID") |
||||||
|
private String pid; |
||||||
|
|
||||||
|
@Schema(description = "父部门ID集合") |
||||||
|
private Set<String> pids; |
||||||
|
|
||||||
|
@Schema(description = "部门编码") |
||||||
|
private String code; |
||||||
|
|
||||||
|
@Schema(description = "部门编码集合") |
||||||
|
private Set<String> codes; |
||||||
|
|
||||||
|
@Schema(description = "部门层级") |
||||||
|
private String level; |
||||||
|
|
||||||
|
@Schema(description = "部门层级集合") |
||||||
|
private Set<String> levels; |
||||||
|
|
||||||
|
@Schema(description = "部门简称") |
||||||
|
private String shortName; |
||||||
|
|
||||||
|
@Schema(description = "部门名称") |
||||||
|
private String name; |
||||||
|
|
||||||
|
@Schema(description = "部门名称模糊查询") |
||||||
|
private String nameLike; |
||||||
|
|
||||||
|
@Schema(description = "单位统计分组ID") |
||||||
|
private Integer statisticsGroupId; |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,47 @@ |
|||||||
|
package com.biutag.supervision.pojo.request.subdatav; |
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil; |
||||||
|
import cn.hutool.core.util.StrUtil; |
||||||
|
import com.biutag.supervision.aop.ParamChecked; |
||||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||||
|
import jakarta.validation.ValidationException; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
import java.util.Objects; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName SubDataVRequest |
||||||
|
* @Description 二级数据大屏请求实体 |
||||||
|
* @Author shihao |
||||||
|
* @Date 2025/12/19 15:26 |
||||||
|
*/ |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
@Schema(description = "二级数据大屏请求实体") |
||||||
|
public class SubDataVRequest implements ParamChecked { |
||||||
|
|
||||||
|
@Schema(description = "开始时间") |
||||||
|
private Date beginTime; |
||||||
|
|
||||||
|
@Schema(description = "结束时间") |
||||||
|
private Date endTime; |
||||||
|
|
||||||
|
@Schema(description = "部门Id") |
||||||
|
private String departId; |
||||||
|
|
||||||
|
@Override |
||||||
|
public void check() { |
||||||
|
if (Objects.isNull(beginTime) || Objects.isNull(endTime)){ |
||||||
|
throw new ValidationException("必须选择时间"); |
||||||
|
} |
||||||
|
if (StrUtil.isBlank(departId)){ |
||||||
|
throw new ValidationException("必须传入部门ID"); |
||||||
|
} |
||||||
|
this.beginTime = DateUtil.beginOfDay(this.beginTime); |
||||||
|
this.endTime = DateUtil.endOfDay(this.endTime); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,28 @@ |
|||||||
|
package com.biutag.supervision.service.subDatav; |
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject; |
||||||
|
import com.biutag.supervision.pojo.Result; |
||||||
|
import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName SubDatavService |
||||||
|
* @Description 区县大屏服务层 |
||||||
|
* @Author shihao |
||||||
|
* @Date 2025/12/19 15:30 |
||||||
|
*/ |
||||||
|
public interface SubDatavService { |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取区县首页大屏的机构问题排名 |
||||||
|
* @param request |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
Result<JSONObject> getSubOneOrganizationRank(SubDataVRequest request); |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取区县首页大屏的中央总览数据 |
||||||
|
* @param request |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
Result<JSONObject> getSubOneAllCount(SubDataVRequest request); |
||||||
|
} |
||||||
@ -0,0 +1,173 @@ |
|||||||
|
package com.biutag.supervision.service.subDatav; |
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject; |
||||||
|
import com.biutag.supervision.constants.enums.DepartGroupEnum; |
||||||
|
import com.biutag.supervision.constants.enums.ProblemSourcesEnum; |
||||||
|
import com.biutag.supervision.pojo.Result; |
||||||
|
import com.biutag.supervision.pojo.dto.DepartAndSubDepartDto; |
||||||
|
import com.biutag.supervision.pojo.entity.SupDepart; |
||||||
|
import com.biutag.supervision.pojo.entity.SupExternalDepart; |
||||||
|
import com.biutag.supervision.pojo.param.*; |
||||||
|
import com.biutag.supervision.pojo.request.subdatav.SubDataVRequest; |
||||||
|
import com.biutag.supervision.pojo.vo.GlobalOverViewVo; |
||||||
|
import com.biutag.supervision.pojo.vo.OrganizeProblemRankVo; |
||||||
|
import com.biutag.supervision.repository.dataCaseVerif.DataCaseVerifResourceService; |
||||||
|
import com.biutag.supervision.repository.dataPetitionComplaint.DataPetitionComplaintResourceService; |
||||||
|
import com.biutag.supervision.repository.mail.MailResourceService; |
||||||
|
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 jakarta.annotation.Resource; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import java.util.*; |
||||||
|
import java.util.stream.Collectors; |
||||||
|
|
||||||
|
/** |
||||||
|
* @ClassName SubDatavServiceImpl |
||||||
|
* @Description 区县大屏服务层 |
||||||
|
* @Author shihao |
||||||
|
* @Date 2025/12/19 15:30 |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
public class SubDatavServiceImpl implements SubDatavService { |
||||||
|
|
||||||
|
@Resource |
||||||
|
private SupDepartResourceService supDepartResourceService; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private NegativeResourceService negativeResourceService; |
||||||
|
|
||||||
|
|
||||||
|
@Resource |
||||||
|
private ReportProjectResourceService reportProjectResourceService; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private NegativeBlameService negativeBlameService; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private DataPetitionComplaintResourceService dataPetitionComplaintResourceService; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private MailResourceService mailResourceService; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private SupExternalDepartResourceService supExternalDepartResourceService; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private DataCaseVerifResourceService dataCaseVerifResourceService; |
||||||
|
|
||||||
|
|
||||||
|
@Override |
||||||
|
public Result<JSONObject> getSubOneOrganizationRank(SubDataVRequest request) { |
||||||
|
SupDepartQueryParam supDepartQueryParam = new SupDepartQueryParam(); |
||||||
|
supDepartQueryParam.setPid(request.getDepartId()); |
||||||
|
List<SupDepart> query = supDepartResourceService.query(supDepartQueryParam); |
||||||
|
|
||||||
|
Set<String> pcsSet = query.stream().filter(one -> "10".equals(one.getStatisticsGroupId())).map(SupDepart::getId).collect(Collectors.toSet()); |
||||||
|
Set<String> ddSet = query.stream().filter(one -> !"10".equals(one.getStatisticsGroupId())).map(SupDepart::getId).collect(Collectors.toSet()); |
||||||
|
List<Date> dates = Arrays.asList(request.getBeginTime(), request.getEndTime()); |
||||||
|
NegativeOrganizationRankQueryParam pcsParam = new NegativeOrganizationRankQueryParam(); |
||||||
|
pcsParam.setCrtTime(dates); |
||||||
|
pcsParam.setInvolveDepartIds(pcsSet); |
||||||
|
List<OrganizeProblemRankVo> fxsjlist = negativeResourceService.getOrganizationRank(pcsParam); |
||||||
|
NegativeOrganizationRankQueryParam ddParam = new NegativeOrganizationRankQueryParam(); |
||||||
|
ddParam.setCrtTime(dates); |
||||||
|
ddParam.setInvolveDepartIds(ddSet); |
||||||
|
List<OrganizeProblemRankVo> jsdwlist = negativeResourceService.getOrganizationRank(ddParam); |
||||||
|
|
||||||
|
JSONObject res = new JSONObject() |
||||||
|
.fluentPut("fxsjlist", fxsjlist) |
||||||
|
.fluentPut("jsdwlist", jsdwlist); |
||||||
|
return Result.success(res); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
@Override |
||||||
|
public Result<JSONObject> getSubOneAllCount(SubDataVRequest request) { |
||||||
|
|
||||||
|
SupDepartGroupParam supDepartGroupParam = new SupDepartGroupParam(); |
||||||
|
supDepartGroupParam.setGroupId(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId()); |
||||||
|
supDepartGroupParam.setParentLevel(2); |
||||||
|
supDepartGroupParam.setChildLevel(3); |
||||||
|
Map<String, DepartAndSubDepartDto> departAndSubDepart = supDepartResourceService.getDepartAndSubDepart(supDepartGroupParam); |
||||||
|
DepartAndSubDepartDto departDto = departAndSubDepart.get(request.getDepartId()); |
||||||
|
Set<String> allDepartIds = departDto.getAllDepartIds(); |
||||||
|
|
||||||
|
|
||||||
|
GlobalOverViewVo overview = GlobalOverViewVo.of(); |
||||||
|
List<Date> dates = Arrays.asList(request.getBeginTime(), request.getEndTime()); |
||||||
|
// 现场督查
|
||||||
|
NegativeQueryParam xcdcQueryParam = new NegativeQueryParam(); |
||||||
|
xcdcQueryParam.setCrtTime(dates); |
||||||
|
xcdcQueryParam.setInvolveDepartIds(allDepartIds); |
||||||
|
xcdcQueryParam.setProblemSourcesCode(ProblemSourcesEnum.GROUP_13); |
||||||
|
long xcdcCount = negativeResourceService.count(xcdcQueryParam); |
||||||
|
// 数字督察
|
||||||
|
NegativeQueryParam szdcQueryParam = new NegativeQueryParam(); |
||||||
|
szdcQueryParam.setCrtTime(dates); |
||||||
|
szdcQueryParam.setInvolveDepartIds(allDepartIds); |
||||||
|
szdcQueryParam.setProblemSourcesCode(ProblemSourcesEnum.GROUP_14_15_16); |
||||||
|
long szdcCount = negativeResourceService.count(szdcQueryParam); |
||||||
|
// 案件核查
|
||||||
|
NegativeQueryParam ajhcQueryParam = new NegativeQueryParam(); |
||||||
|
ajhcQueryParam.setCrtTime(dates); |
||||||
|
ajhcQueryParam.setInvolveDepartIds(allDepartIds); |
||||||
|
ajhcQueryParam.setProblemSourcesCode(ProblemSourcesEnum.GROUP_17_18_19_20); |
||||||
|
long ajhcCount = negativeResourceService.count(ajhcQueryParam); |
||||||
|
|
||||||
|
// 局长信箱
|
||||||
|
SupExternalDepartQueryParam supExternalDepartQueryParam = new SupExternalDepartQueryParam(); |
||||||
|
supExternalDepartQueryParam.setInternalIds(allDepartIds); |
||||||
|
supExternalDepartQueryParam.setSource("局长信箱"); |
||||||
|
List<SupExternalDepart> supExternalDepartList = supExternalDepartResourceService.query(supExternalDepartQueryParam); |
||||||
|
Set<String> supExternalDepartIdSet = supExternalDepartList.stream().map(SupExternalDepart::getExternalId).collect(Collectors.toSet()); |
||||||
|
|
||||||
|
MailQueryParam mailQueryParam = new MailQueryParam(); |
||||||
|
mailQueryParam.setSecondDeptIds(supExternalDepartIdSet); |
||||||
|
mailQueryParam.setCreateTime(dates); |
||||||
|
long mailCount = mailResourceService.count(mailQueryParam); |
||||||
|
|
||||||
|
// 12337
|
||||||
|
NegativeQueryParam xf12337Param = new NegativeQueryParam(); |
||||||
|
xf12337Param.setCrtTime(dates); |
||||||
|
xf12337Param.setProblemSourcesCode(Collections.singletonList(ProblemSourcesEnum.XF12337.getValue())); |
||||||
|
xf12337Param.setInvolveDepartIds(allDepartIds); |
||||||
|
long xf12337Count = negativeResourceService.count(xf12337Param); |
||||||
|
// 国家信访
|
||||||
|
DataPetitionComplaintQueryParam countryParam = new DataPetitionComplaintQueryParam(); |
||||||
|
countryParam.setCreateTime(dates); |
||||||
|
countryParam.setSecondDepartIds(allDepartIds); |
||||||
|
countryParam.setProblemSourcesCode(ProblemSourcesEnum.GJXFPT.getValue()); |
||||||
|
long gjxfCount = dataPetitionComplaintResourceService.count(countryParam); |
||||||
|
// 公安部门信访
|
||||||
|
DataPetitionComplaintQueryParam policeParam = new DataPetitionComplaintQueryParam(); |
||||||
|
policeParam.setCreateTime(dates); |
||||||
|
policeParam.setSecondDepartIds(allDepartIds); |
||||||
|
policeParam.setProblemSourcesCode(ProblemSourcesEnum.GABXF.getValue()); |
||||||
|
long gabxfCount = dataPetitionComplaintResourceService.count(policeParam); |
||||||
|
|
||||||
|
// 审计项目数
|
||||||
|
ReportProjectQueryParam reportProjectQueryParam = new ReportProjectQueryParam(); |
||||||
|
reportProjectQueryParam.setArchivingStart(request.getBeginTime()); |
||||||
|
reportProjectQueryParam.setArchivingEnd(request.getEndTime()); |
||||||
|
reportProjectQueryParam.setAuditUnitIds(allDepartIds); |
||||||
|
long sjxmCount = reportProjectResourceService.count(reportProjectQueryParam); |
||||||
|
|
||||||
|
overview.setSupervisionPro(xcdcCount); |
||||||
|
overview.setNumSupervisionPro(szdcCount); |
||||||
|
overview.setCaseVerificationPro(ajhcCount); |
||||||
|
overview.setMailboxNumber(mailCount); |
||||||
|
overview.setComplaintPro(xf12337Count + gjxfCount + gabxfCount); |
||||||
|
overview.setAuditPro(sjxmCount); |
||||||
|
overview.calcTotal(); |
||||||
|
JSONObject data = new JSONObject().fluentPut("overview", overview); |
||||||
|
return Result.success(data); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
Loading…
Reference in new issue