Browse Source

fiex:优化定时任务 与 二级大屏

master
pengwei 3 months ago
parent
commit
bea8febfa3
  1. 1
      src/main/java/com/biutag/supervision/controller/rightsComfort/SuperviseController.java
  2. 6
      src/main/java/com/biutag/supervision/controller/subdatav/SubOneCaseVerifController.java
  3. 30
      src/main/java/com/biutag/supervision/controller/subdatav/SubOneGlobalController.java
  4. 20
      src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java
  5. 2
      src/main/java/com/biutag/supervision/job/Job.java
  6. 16
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  7. 2
      src/main/java/com/biutag/supervision/mapper/RpcApplyPersonMapper.java
  8. 4
      src/main/java/com/biutag/supervision/mapper/RpcApplySuperviseMapper.java
  9. 2
      src/main/java/com/biutag/supervision/pojo/vo/DayTimeSuperviseVo.java
  10. 15
      src/main/java/com/biutag/supervision/service/DataMailService.java
  11. 10
      src/main/java/com/biutag/supervision/service/RpcApplySuperviseService.java
  12. 3
      src/main/resources/mapper/RpcApplySuperviseMapper.xml

1
src/main/java/com/biutag/supervision/controller/rightsComfort/SuperviseController.java

@ -33,6 +33,7 @@ public class SuperviseController {
* */ * */
@GetMapping("/{id}") @GetMapping("/{id}")
public Result<RpcSuperviseVo> getDetail(@PathVariable String id){ public Result<RpcSuperviseVo> getDetail(@PathVariable String id){
log.info("传入id:{}",id);
RpcSuperviseVo superviseVo = rpcApplySuperviseService.getDetail(id); RpcSuperviseVo superviseVo = rpcApplySuperviseService.getDetail(id);
if(ObjectUtil.isNotEmpty(superviseVo)){ if(ObjectUtil.isNotEmpty(superviseVo)){
return Result.success(superviseVo); return Result.success(superviseVo);

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

@ -111,7 +111,11 @@ public class SubOneCaseVerifController {
); );
overview.setTotal((int) total); overview.setTotal((int) total);
int confirmed = overview.getConfirmed() != null?overview.getConfirmed():0; int confirmed = overview.getConfirmed() != null?overview.getConfirmed():0;
overview.setRate(NumberUtil.div((Number) (confirmed * 100),total ).doubleValue()); if(total != 0 && confirmed != 0) {
overview.setRate(NumberUtil.div((Number) (confirmed * 100),total ).doubleValue());
}else{
overview.setRate(0.00);
}
JSONObject res = new JSONObject().fluentPut("overview", overview); JSONObject res = new JSONObject().fluentPut("overview", overview);
return Result.success(res); return Result.success(res);
} }

30
src/main/java/com/biutag/supervision/controller/subdatav/SubOneGlobalController.java

@ -2,10 +2,16 @@ package com.biutag.supervision.controller.subdatav;
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;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.supervision.constants.enums.ProblemSourcesEnum; import com.biutag.supervision.constants.enums.ProblemSourcesEnum;
import com.biutag.supervision.mapper.MailMapper;
import com.biutag.supervision.mapper.NegativeMapper; import com.biutag.supervision.mapper.NegativeMapper;
import com.biutag.supervision.mapper.SupExternalDepartMapper;
import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.Negative; import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.SupExternalDepart;
import com.biutag.supervision.pojo.entity.mailbox.Mail;
import com.biutag.supervision.pojo.vo.*; import com.biutag.supervision.pojo.vo.*;
import com.biutag.supervision.service.*; import com.biutag.supervision.service.*;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
@ -36,6 +42,8 @@ public class SubOneGlobalController {
private final CountyStreetDeptService countyStreetDeptService; private final CountyStreetDeptService countyStreetDeptService;
private final DataMailService dataMailService; private final DataMailService dataMailService;
private final NegativeService negativeService; private final NegativeService negativeService;
private final MailMapper mailMapper;
private final SupExternalDepartMapper externalDepartMapper;
/** /**
* 获取地图数据, 所有二级地图的json数据 * 获取地图数据, 所有二级地图的json数据
* *
@ -99,7 +107,8 @@ public class SubOneGlobalController {
//region 中间 //region 中间
private final String VALID_SIGN = "terminated"; // 有效标识
private final String EX_SOURCE = "局长信箱"; // 映射来源
/** /**
* 获取首页大屏中央数据 * 获取首页大屏中央数据
* *
@ -117,12 +126,19 @@ public class SubOneGlobalController {
GlobalOverViewVo overview = negativeMapper.getSuoOneAllGlobalCount(departId, beginTime, endTime); GlobalOverViewVo overview = negativeMapper.getSuoOneAllGlobalCount(departId, beginTime, endTime);
MailOverviewVo vo = dataMailService.mailCount(departId,beginTime, endTime); MailOverviewVo vo = dataMailService.mailCount(departId,beginTime, endTime);
// 局长信箱
long mailboxNumber = negativeService.count(new LambdaQueryWrapper<Negative>() QueryWrapper<Mail> subOneMailQueryWrapper = new QueryWrapper<>();
.between(Negative::getCrtTime, beginTime, endTime) String exDepartId = externalDepartMapper.getExIdByInId(departId.toString(), "局长信箱");
.eq(Negative::getProblemSourcesCode, ProblemSourcesEnum.JZXX.getValue()) subOneMailQueryWrapper.ne("mail_state", VALID_SIGN);
.eq(Negative::getSecondInvolveDepartId,departId) subOneMailQueryWrapper.eq("second_dept_id", exDepartId);
); subOneMailQueryWrapper.between("create_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.setMailboxNumber(mailboxNumber);
overview.setComplaintPro(vo.getCountryMail() + vo.getPoliceMail() + vo.getNumberMail()); overview.setComplaintPro(vo.getCountryMail() + vo.getPoliceMail() + vo.getNumberMail());

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

@ -25,6 +25,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -71,11 +73,22 @@ public class SubOneSupervisionNotifyController {
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
DayTimeSuperviseVo policeRankOverview = negativeMapper.getPoliceRankOverview(departId, beginTime, endTime); DayTimeSuperviseVo policeRankOverview = negativeMapper.getPoliceRankOverview(departId, beginTime, endTime);
DayTimeSuperviseVo teamRankOverview = negativeMapper.getTeamRankOverview(departId, beginTime, endTime); DayTimeSuperviseVo teamRankOverview = negativeMapper.getTeamRankOverview(departId, beginTime, endTime);
List<RankVo> policeChangedRankList = negativeMapper.getPoliceChangedRankList(departId, beginTime, endTime); List<RankVo> policeChangedRankList = negativeMapper.getPoliceChangedRankList(departId, beginTime, endTime);
List<RankVo> teamChangedRankList = negativeMapper.getTeamChangedRankList(departId, beginTime, endTime); List<RankVo> teamChangedRankList = negativeMapper.getTeamChangedRankList(departId, beginTime, endTime);
DayTimeSuperviseVo overview = new DayTimeSuperviseVo().addVO(policeRankOverview,teamRankOverview);
DayTimeSuperviseVo vo = negativeMapper.selectRankOverview(departId,beginTime,endTime);
if(vo.getProTotal() == null || vo.getProTotal() == 0 || vo.getChanged() == 0){
vo.setCorrectionRate(0.0);
}else{
BigDecimal result = new BigDecimal(vo.getChanged() * 100)
.divide(new BigDecimal(vo.getProTotal()), 1, RoundingMode.HALF_UP);
vo.setCorrectionRate(result.doubleValue());
}
JSONObject data = new JSONObject() JSONObject data = new JSONObject()
.fluentPut("overview",overview) .fluentPut("overview",vo)
.fluentPut("fxsjRankOverview", policeRankOverview) .fluentPut("fxsjRankOverview", policeRankOverview)
.fluentPut("jsdwRankOverview", teamRankOverview) .fluentPut("jsdwRankOverview", teamRankOverview)
.fluentPut("fxsjChangedRankList", policeChangedRankList) .fluentPut("fxsjChangedRankList", policeChangedRankList)
@ -83,6 +96,9 @@ public class SubOneSupervisionNotifyController {
return Result.success(data); return Result.success(data);
} }
public Long isZero(Long val){
return val != null?val:0L;
}
/** /**
* 问题类型占比 * 问题类型占比
* *

2
src/main/java/com/biutag/supervision/job/Job.java

@ -290,6 +290,7 @@ public class Job {
rpcApply.setSource("gbase"); rpcApply.setSource("gbase");
rpcApplySuperviseService.saveOrUpdate(rpcApply); rpcApplySuperviseService.saveOrUpdate(rpcApply);
//受害人列表 //受害人列表
rpcApplyPersonService.remove(new LambdaQueryWrapper<RpcApplyPerson>().eq(RpcApplyPerson::getRpcId,item.getZj()));
RpcApplyPerson rpcApplyPerson= new RpcApplyPerson(); RpcApplyPerson rpcApplyPerson= new RpcApplyPerson();
rpcApplyPerson.setRpcId(item.getZj()); rpcApplyPerson.setRpcId(item.getZj());
rpcApplyPerson.setType(RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue()); rpcApplyPerson.setType(RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue());
@ -344,6 +345,7 @@ public class Job {
apply.setInfringerName(result); apply.setInfringerName(result);
apply.setInfringerHandle(clfss); apply.setInfringerHandle(clfss);
wfrwfxxes.forEach(x->{ wfrwfxxes.forEach(x->{
rpcInfringerResultService.remove(new LambdaQueryWrapper<RpcInfringerResult>().eq(RpcInfringerResult::getRpcId,item.getZj()));
RpcInfringerResult rpcInfringerResult =new RpcInfringerResult(); RpcInfringerResult rpcInfringerResult =new RpcInfringerResult();
rpcInfringerResult.setId(IdUtil.fastSimpleUUID()); rpcInfringerResult.setId(IdUtil.fastSimpleUUID());
rpcInfringerResult.setRpcId(item.getZj()); rpcInfringerResult.setRpcId(item.getZj());

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

@ -643,6 +643,18 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"AND sd.statistics_group_id=10 " + "AND sd.statistics_group_id=10 " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} ") "AND crtTime BETWEEN #{beginTime} AND #{endTime} ")
DayTimeSuperviseVo getPoliceRankOverview(Integer departId, Date beginTime, Date endTime); DayTimeSuperviseVo getPoliceRankOverview(Integer departId, Date beginTime, Date endTime);
@Select("SELECT " +
"COUNT(DISTINCT ng.id) AS proTotal, " +
"COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS changing, " +
"COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS changed, " +
"IFNULL(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS correctionRate " +
"FROM negative ng " +
"LEFT JOIN sup_depart sd ON ng.involveDepartId=sd.id " +
"WHERE ng.problemSourcesCode IN (13) " +
"AND ng.second_involve_depart_id=#{departId} " +
"AND crtTime BETWEEN #{beginTime} AND #{endTime} ")
DayTimeSuperviseVo selectRankOverview(Integer departId, Date beginTime, Date endTime);
//分县级 - 现场督察 //分县级 - 现场督察
@Select("SELECT " + @Select("SELECT " +
"COUNT(DISTINCT ng.id) AS proTotal, " + "COUNT(DISTINCT ng.id) AS proTotal, " +
@ -689,6 +701,10 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"ORDER BY denominator DESC;") "ORDER BY denominator DESC;")
List<RankVo> getTeamChangedRankList(Integer departId, Date beginTime, Date endTime); List<RankVo> getTeamChangedRankList(Integer departId, Date beginTime, Date endTime);
@Select("SELECT sd.short_name as label, " + @Select("SELECT sd.short_name as label, " +
"sd.id AS departId, " + "sd.id AS departId, " +
"count( DISTINCT ng.id) AS denominator, " + "count( DISTINCT ng.id) AS denominator, " +

2
src/main/java/com/biutag/supervision/mapper/RpcApplyPersonMapper.java

@ -18,7 +18,7 @@ public interface RpcApplyPersonMapper extends BaseMapper<RpcApplyPerson> {
Page<RpcApplyVo> queryPage(@Param("page") Page<RpcApplySupervise> page, @Param(Constants.WRAPPER) QueryWrapper<RpcApplySupervise> queryWrapper); Page<RpcApplyVo> queryPage(@Param("page") Page<RpcApplySupervise> page, @Param(Constants.WRAPPER) QueryWrapper<RpcApplySupervise> queryWrapper);
@Select(" SELECT a.*,sup.job_type as empType,sup.name as empName from rpc_apply_person as a " + @Select(" SELECT distinct a.emp_no, a.id, a.rpc_id, a.provide_relief,a.injury_severity, a.injury_severity_name,a.handle_result,a.id_code, a.forms_of_tort, a.emp_type, a.gender ,sup.job_type as empType,sup.name as empName from rpc_apply_person as a " +
" left join sup_police as sup " + " left join sup_police as sup " +
" on a.emp_no = sup.emp_no where a.rpc_id = #{id} " ) " on a.emp_no = sup.emp_no where a.rpc_id = #{id} " )
List<RpcApplyPerson> selectPerson(String id); List<RpcApplyPerson> selectPerson(String id);

4
src/main/java/com/biutag/supervision/mapper/RpcApplySuperviseMapper.java

@ -11,6 +11,8 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
import java.util.List;
@Mapper @Mapper
public interface RpcApplySuperviseMapper extends BaseMapper<RpcApplySupervise> { public interface RpcApplySuperviseMapper extends BaseMapper<RpcApplySupervise> {
@ -29,7 +31,7 @@ public interface RpcApplySuperviseMapper extends BaseMapper<RpcApplySupervise>
" LEFT JOIN sup_police sup ON a.input_emp_no = sup.emp_no " + " LEFT JOIN sup_police sup ON a.input_emp_no = sup.emp_no " +
" WHERE a.rpc_id = #{id} " " WHERE a.rpc_id = #{id} "
) )
RpcApplyVo selectDataById(String id); List<RpcApplyVo> selectDataById(String id);
@Update(" UPDATE rpc_apply_supervise set " + @Update(" UPDATE rpc_apply_supervise set " +
" Incident_link_name = #{rpcApplyVo.incidentLinkName}, " + " Incident_link_name = #{rpcApplyVo.incidentLinkName}, " +

2
src/main/java/com/biutag/supervision/pojo/vo/DayTimeSuperviseVo.java

@ -32,7 +32,7 @@ public class DayTimeSuperviseVo {
public DayTimeSuperviseVo addVO(DayTimeSuperviseVo one,DayTimeSuperviseVo two){ public DayTimeSuperviseVo addVO(DayTimeSuperviseVo one,DayTimeSuperviseVo two){
DayTimeSuperviseVo vo =new DayTimeSuperviseVo(); DayTimeSuperviseVo vo =new DayTimeSuperviseVo();
//问题总数 //问题总数
vo.setProTotal(one.getProTotal() + two.proTotal); vo.setProTotal(one.getProTotal() + two.getProTotal());
//办理中 //办理中
vo.setProcessingNumber(isZero(one.getProcessingNumber()) + isZero(two.getProcessingNumber())); vo.setProcessingNumber(isZero(one.getProcessingNumber()) + isZero(two.getProcessingNumber()));
//已办结 //已办结

15
src/main/java/com/biutag/supervision/service/DataMailService.java

@ -250,6 +250,10 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da
// 查询国家信访和公安部信访数据 // 查询国家信访和公安部信访数据
for (MailMapIconVo re : res) { for (MailMapIconVo re : res) {
String policeDepartId = re.getDepartId(); String policeDepartId = re.getDepartId();
Long countryTotal = dataPetitionComplaintMapper.selectPoliceMailBySourceCode(beginTime, endTime, GJXFPT.getValue(), policeDepartId); Long countryTotal = dataPetitionComplaintMapper.selectPoliceMailBySourceCode(beginTime, endTime, GJXFPT.getValue(), policeDepartId);
Long policeTotal = dataPetitionComplaintMapper.selectPoliceMailBySourceCode(beginTime, endTime, GABXF.getValue(), policeDepartId); Long policeTotal = dataPetitionComplaintMapper.selectPoliceMailBySourceCode(beginTime, endTime, GABXF.getValue(), policeDepartId);
Long commissionerTotal = getSubOneCommissionerTotal(beginTime, endTime, re); // 局长信箱 Long commissionerTotal = getSubOneCommissionerTotal(beginTime, endTime, re); // 局长信箱
@ -259,7 +263,16 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da
Long total = countryTotal + policeTotal + commissionerTotal + numTotal; Long total = countryTotal + policeTotal + commissionerTotal + numTotal;
re.setCountryTotal(countryTotal.toString()); re.setCountryTotal(countryTotal.toString());
re.setPoliceTotal(policeTotal.toString()); re.setPoliceTotal(policeTotal.toString());
re.setCommissionerTotal(commissionerTotal.toString());
// 局长信箱
QueryWrapper<Mail> subOneMailQueryWrapper = new QueryWrapper<>();
String exDepartId = supExternalDepartMapper.getExIdByInId(policeDepartId, "局长信箱");
subOneMailQueryWrapper.ne("mail_state", VALID_SIGN);
subOneMailQueryWrapper.eq("second_dept_id", exDepartId);
subOneMailQueryWrapper.between("create_time", beginTime, endTime);
Long manageMail = mailMapper.selectCount(subOneMailQueryWrapper);
re.setCommissionerTotal(manageMail.toString());
re.setNumTotal(numTotal.toString()); re.setNumTotal(numTotal.toString());
re.setTotal(total.toString()); re.setTotal(total.toString());
} }

10
src/main/java/com/biutag/supervision/service/RpcApplySuperviseService.java

@ -87,7 +87,7 @@ public class RpcApplySuperviseService extends ServiceImpl<RpcApplySuperviseMappe
if (queryParam.getHappenTime() != null && queryParam.getHappenTime().size() == 2) { if (queryParam.getHappenTime() != null && queryParam.getHappenTime().size() == 2) {
queryWrapper.between("a.happen_time", queryParam.getHappenTime().get(0), queryParam.getHappenTime().get(1)); queryWrapper.between("a.happen_time", queryParam.getHappenTime().get(0), queryParam.getHappenTime().get(1));
} }
queryWrapper.orderByDesc("a.happen_time");
return baseMapper.queryPage(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); return baseMapper.queryPage(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper);
} }
@ -97,12 +97,16 @@ public class RpcApplySuperviseService extends ServiceImpl<RpcApplySuperviseMappe
RpcSuperviseVo superviseVo=new RpcSuperviseVo(); RpcSuperviseVo superviseVo=new RpcSuperviseVo();
//根据id获取数据 //根据id获取数据
RpcApplyVo rpcApplyVo = baseMapper.selectDataById(id); List<RpcApplyVo> rpcApplyVoList = baseMapper.selectDataById(id);
if(CollectionUtil.isEmpty(rpcApplyVoList)){
return null;
}
RpcApplyVo rpcApplyVo = rpcApplyVoList.get(0);
if(ObjectUtil.isNotEmpty(rpcApplyVo)){ if(ObjectUtil.isNotEmpty(rpcApplyVo)){
//获取数据 //获取数据
superviseVo.setRpcApplyVo(rpcApplyVo); superviseVo.setRpcApplyVo(rpcApplyVo);
//获取侵权人信息 //获取侵权人信息
List<RpcInfringerResult> rpcInfringerResults = rpcInfringerResultService.list(new LambdaQueryWrapper<RpcInfringerResult>().eq(RpcInfringerResult::getRpcId,id)); List<RpcInfringerResult> rpcInfringerResults = rpcInfringerResultService.list(new LambdaQueryWrapper<RpcInfringerResult>().select(RpcInfringerResult::getIdCode).eq(RpcInfringerResult::getRpcId,id));
if (ArrayUtil.isNotEmpty(rpcInfringerResults)){ if (ArrayUtil.isNotEmpty(rpcInfringerResults)){
superviseVo.setRpcInfringerResults(rpcInfringerResults); superviseVo.setRpcInfringerResults(rpcInfringerResults);
} }

3
src/main/resources/mapper/RpcApplySuperviseMapper.xml

@ -6,7 +6,8 @@
<select id="queryPage" resultType="com.biutag.supervision.pojo.vo.RpcApplyVo"> <select id="queryPage" resultType="com.biutag.supervision.pojo.vo.RpcApplyVo">
SELECT SELECT
a.*, p.*, ap.injury_severity as injuryServerity, ap.injury_severity_name as injuryServerityName, sup.job as policeJob distinct a.rpc_id,
a.number,a.apply_date,a.happen_time,a.applicant_emp_name,a.applicant_emp_no,p.id, p.emp_no, p.name, p.sex, p.birthday, p.level_education, p.politic_countenance, p.id_code, p.mobile, p.depart_id, p.depart_name, p.job, p.police_types, p.police_rank, p.bank_card, p.bank_branch, p.bank_card_account, ap.injury_severity as injuryServerity, ap.injury_severity_name as injuryServerityName, sup.job as policeJob
FROM FROM
rpc_apply_supervise a rpc_apply_supervise a
LEFT JOIN rpc_person p ON a.rpc_id = p.rpc_id LEFT JOIN rpc_person p ON a.rpc_id = p.rpc_id

Loading…
Cancel
Save