Browse Source

fit:值班表接口和大屏数据调整,定时任务完善

master
pengwei 5 months ago
parent
commit
8af7f3c929
  1. 7
      src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java
  2. 2
      src/main/java/com/biutag/supervision/controller/subdatav/SubOneRightsController.java
  3. 15
      src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java
  4. 25
      src/main/java/com/biutag/supervision/controller/supRota/SupRotaController.java
  5. 4
      src/main/java/com/biutag/supervision/job/Job.java
  6. 1
      src/main/java/com/biutag/supervision/mapper/DwdAsjZfbaWfrwfxxMapper.java
  7. 30
      src/main/java/com/biutag/supervision/mapper/SupRotaMapper.java
  8. 5
      src/main/java/com/biutag/supervision/mapper/ZhkshDutyScheduleDcMapper.java
  9. 17
      src/main/java/com/biutag/supervision/pojo/param/SupRotaQueryParam.java
  10. 23
      src/main/java/com/biutag/supervision/pojo/vo/SupRotaVo.java
  11. 2
      src/main/java/com/biutag/supervision/pojo/vo/SupervisionNotifyOverView.java
  12. 15
      src/main/java/com/biutag/supervision/service/DataMailService.java
  13. 38
      src/main/java/com/biutag/supervision/service/SupRotaService.java

7
src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java

@ -12,9 +12,11 @@ import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.NegativeBlame;
import com.biutag.supervision.pojo.entity.News;
import com.biutag.supervision.pojo.entity.SuperviseReport;
import com.biutag.supervision.pojo.vo.*;
import com.biutag.supervision.service.NegativeBlameService;
import com.biutag.supervision.service.NewsService;
import com.biutag.supervision.service.SuperviseReportService;
import com.biutag.supervision.util.CompletableUtils.CompletableFutureUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@ -48,6 +50,7 @@ public class DataVSupervisionNotifyController {
private final NegativeMapper negativeMapper;
private final NewsService newsService;
private final NegativeBlameService negativeBlameService;
private final SuperviseReportService superviseReportService;
// region 左边
@ -113,6 +116,10 @@ public class DataVSupervisionNotifyController {
List<String> negativeIds = negatives.stream().filter(item -> InspectCaseEnum.isItTure(item.getCheckStatus())).map(Negative::getId).toList();
overView.setProblemNumber(negatives.size());
overView.setCompletedNumber(negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).count());
//问题期数
Long problemQuarter = superviseReportService.count(new LambdaQueryWrapper<SuperviseReport>().between(SuperviseReport::getCrtTime,beginTime,endTime));
overView.setProblemQuarter(problemQuarter);
overView.setProcessingNumber(negatives.size() - overView.getCompletedNumber());
// 办结率
overView.setCompletedRate(overView.getProblemNumber() == 0 ? 0: NumberUtil.roundHalfEven(NumberUtil.mul(NumberUtil.div(overView.getCompletedNumber(), overView.getProblemNumber()), 100), 0).doubleValue());

2
src/main/java/com/biutag/supervision/controller/subdatav/SubOneRightsController.java

@ -165,7 +165,7 @@ public class SubOneRightsController {
List<RpcApply> list = rpcApplyService.list(new LambdaQueryWrapper<RpcApply>()
.between(RpcApply::getCrtTime, beginTime, finalEndTime)
.eq(RpcApply::getSecondDepartId,departId)
.eq(RpcApply::getSecondDepartId,deptId)
.eq(RpcApply::getType, RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue()));
Set<String> caseNumbers = list.stream().map(RpcApply::getCaseNumber).collect(Collectors.toSet());

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

@ -10,14 +10,12 @@ import com.biutag.supervision.constants.enums.ProcessingStatusEnum;
import com.biutag.supervision.mapper.CountyStreetDeptMapper;
import com.biutag.supervision.mapper.NegativeMapper;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.CountyStreetDept;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.NegativeBlame;
import com.biutag.supervision.pojo.entity.News;
import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.pojo.vo.*;
import com.biutag.supervision.service.NegativeBlameService;
import com.biutag.supervision.service.NewsService;
import com.biutag.supervision.service.SubOneSupervisionNotifyService;
import com.biutag.supervision.service.SuperviseReportService;
import com.biutag.supervision.util.CompletableUtils.CompletableFutureUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@ -56,6 +54,7 @@ public class SubOneSupervisionNotifyController {
private final NewsService newsService;
private final NegativeBlameService negativeBlameService;
private final CountyStreetDeptMapper countyStreetDeptMapper;
private final SuperviseReportService superviseReportService;
// region 左边
/**
@ -133,6 +132,14 @@ public class SubOneSupervisionNotifyController {
overView.setCompletedNumber(negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).count());
//办理中
overView.setProcessingNumber(negatives.size() - overView.getCompletedNumber());
//问题期数
Long problemQuarter = superviseReportService.count(new LambdaQueryWrapper<SuperviseReport>()
.eq(SuperviseReport::getCrtDepartId,departId)
.between(SuperviseReport::getCrtTime,beginTime,endTime));
overView.setProblemQuarter(problemQuarter);
// 办结率
// overView.setCompletedRate(overView.getProblemNumber() == 0 ? 0: NumberUtil.roundHalfEven(NumberUtil.mul(NumberUtil.div(overView.getCompletedNumber(), overView.getProblemNumber()), 100), 0).doubleValue());
CompletableFuture.allOf(

25
src/main/java/com/biutag/supervision/controller/supRota/SupRotaController.java

@ -0,0 +1,25 @@
package com.biutag.supervision.controller.supRota;
import com.alibaba.fastjson.JSONObject;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.param.SupRotaQueryParam;
import com.biutag.supervision.service.SupRotaService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RequestMapping("supRota")
@RequiredArgsConstructor
@RestController
public class SupRotaController {
private final SupRotaService service;
@GetMapping
public Result<JSONObject> getSupRota(SupRotaQueryParam queryParam){
JSONObject jsonObject = service.getSupRotaTable(queryParam);
return Result.success(jsonObject);
}
}

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

@ -256,8 +256,8 @@ public class Job {
}
private ZhkshDutyScheduleDcMapper zhkshDutyScheduleDcMapper;
private SupRotaMapper supRotaMapper;
private final ZhkshDutyScheduleDcMapper zhkshDutyScheduleDcMapper;
private final SupRotaMapper supRotaMapper;
//每天一次 00:20:00
//值班人员
@Scheduled(cron = "0 20 00 * * ?")

1
src/main/java/com/biutag/supervision/mapper/DwdAsjZfbaWfrwfxxMapper.java

@ -7,5 +7,4 @@ import com.biutag.supervision.pojo.entity.DwdAsjZfbaWfrwfxx;
@DS("slave2")
public interface DwdAsjZfbaWfrwfxxMapper extends BaseMapper<DwdAsjZfbaWfrwfxx> {
}

30
src/main/java/com/biutag/supervision/mapper/SupRotaMapper.java

@ -2,6 +2,36 @@ package com.biutag.supervision.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.supervision.pojo.entity.SupRota;
import com.biutag.supervision.pojo.vo.SupRotaVo;
import org.apache.ibatis.annotations.Select;
import java.util.Date;
import java.util.List;
public interface SupRotaMapper extends BaseMapper<SupRota> {
@Select("SELECT " +
"a.id as departId, " +
"a.short_name as departName, " +
"b.rota_person_name as rotaPersonName, " +
"b.police_code as policeCode, " +
"b.id_code as idCode, " +
"b.rota_station as rotaStation, " +
"b.phone as phone " +
" from sup_depart a " +
"LEFT JOIN sup_rota b on a.id = b.dept_code and b.rota_time = #{dateTime} " +
"where statistics_group_id = #{groupId} ")
List<SupRotaVo> getSubofficeData(Date dateTime,String groupId);
@Select("SELECT " +
"a.id as departId, " +
"a.short_name as departName, " +
"b.rota_person_name as rotaPersonName, " +
"b.police_code as policeCode, " +
"b.id_code as idCode, " +
"b.rota_station as rotaStation, " +
"b.phone as phone " +
" from sup_depart a " +
"LEFT JOIN sup_rota b on a.id = b.dept_code and b.rota_time = #{dateTime} " +
"where a.pid =#{departId} ")
List<SupRotaVo> getSupRotaList(Date dateTime,String departId);
}

5
src/main/java/com/biutag/supervision/mapper/ZhkshDutyScheduleDcMapper.java

@ -10,7 +10,8 @@ import java.util.List;
@DS("zbdm")
public interface ZhkshDutyScheduleDcMapper extends BaseMapper<ZhkshDutyScheduleDc> {
@Select(" SELECT * FROM 'CSGA110'.'V_ZHKSH_DUTY_SCHEDULE DC' " +
" where start_time between #{startTime} and #{endTime} ")
@Select(" SELECT * FROM V_ZHKSH_DUTY_SCHEDULE_DC " +
" where start_time between #{startTime} and #{endTime} " +
" and PARENT_POST_CODE = 'zb' ")
List<ZhkshDutyScheduleDc> selectList(LocalDate startTime,LocalDate endTime);
}

17
src/main/java/com/biutag/supervision/pojo/param/SupRotaQueryParam.java

@ -0,0 +1,17 @@
package com.biutag.supervision.pojo.param;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
import java.util.Date;
@Getter
@Setter
public class SupRotaQueryParam {
private String deptId;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date date;
}

23
src/main/java/com/biutag/supervision/pojo/vo/SupRotaVo.java

@ -0,0 +1,23 @@
package com.biutag.supervision.pojo.vo;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class SupRotaVo {
//部门id
private String departId;
//部门名称
private String departName;
//值班人员名称
private String rotaPersonName;
//值班人员警号
private String policeCode;
//身份证
private String idCode;
//值班岗位
private String rotaStation;
//电话
private String phone;
}

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

@ -11,6 +11,8 @@ import lombok.Data;
public class SupervisionNotifyOverView {
// 问题数
private Integer problemNumber;
//问题期数
private Long problemQuarter;
// 办理中
private Long processingNumber;
// 已办结

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

@ -139,7 +139,18 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da
// 12337
Long numTotal = negativeService.count(new LambdaQueryWrapper<Negative>().between(Negative::getCrtTime, beginTime, endTime).eq(Negative::getHandleSecondDepartId,departId).eq(Negative::getProblemSourcesCode, ProblemSourcesEnum.XF12337.getValue()));
// 局长信箱
Long commissionerTotal = negativeService.count(new LambdaQueryWrapper<Negative>().between(Negative::getCrtTime, beginTime, endTime).eq(Negative::getHandleSecondDepartId,departId).eq(Negative::getProblemSourcesCode, ProblemSourcesEnum.JZXX.getValue()));
// Long commissionerTotal = negativeService.count(new LambdaQueryWrapper<Negative>().between(Negative::getCrtTime, beginTime, endTime).eq(Negative::getHandleSecondDepartId,departId).eq(Negative::getProblemSourcesCode, ProblemSourcesEnum.JZXX.getValue()));
// 局长信箱
QueryWrapper<Mail> subOneMailQueryWrapper = new QueryWrapper<>();
String exDepartId = supExternalDepartMapper.getExIdByInId(departId.toString(), "局长信箱");
subOneMailQueryWrapper.ne("mail_state", VALID_SIGN);
subOneMailQueryWrapper.eq("second_dept_id", exDepartId);
subOneMailQueryWrapper.between("create_time", beginTime, endTime);
Long commissionerTotal = mailMapper.selectCount(subOneMailQueryWrapper);
Long total = countryTotal + policeTotal + commissionerTotal + numTotal;
//国家信访
@ -214,7 +225,7 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da
Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper);
// 总数
Long totalMail = countryMail + policeMail + numberMail;
Long totalMail = countryMail + policeMail + numberMail + manageMail;
temp.setCountryMail(countryMail);
temp.setPoliceMail(policeMail);
temp.setNumberMail(numberMail);

38
src/main/java/com/biutag/supervision/service/SupRotaService.java

@ -1,8 +1,46 @@
package com.biutag.supervision.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.mapper.SupRotaMapper;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.entity.SupRota;
import com.biutag.supervision.pojo.param.SupRotaQueryParam;
import com.biutag.supervision.pojo.vo.SupRotaVo;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
@RequiredArgsConstructor
@Service
public class SupRotaService extends ServiceImpl<SupRotaMapper, SupRota> {
private SupDepartService departService;
//展示数据的接口
public JSONObject getSupRotaTable(SupRotaQueryParam queryParam){
//判断传入的id是市局、还是分局
SupDepart supDepart = departService.getById(queryParam.getDeptId());
JSONObject jsonObject=new JSONObject();
if(supDepart.getLevel() == 0){
//市局的数据进行分类
//市局本身
List<SupRota> supRota = baseMapper.selectList(new LambdaQueryWrapper<SupRota>().eq(SupRota::getDeptCode,supDepart.getId()).eq(SupRota::getRotaTime,queryParam.getDate()));
jsonObject.fluentPut("cityBureau",supRota);
//分局
List<SupRotaVo> suboffice =baseMapper.getSubofficeData(queryParam.getDate(),"3");
jsonObject.fluentPut("suboffice",suboffice);
//局属单位
List<SupRotaVo> departmental =baseMapper.getSubofficeData(queryParam.getDate(),"4");
jsonObject.fluentPut("departmental",departmental);
}else{
List<SupRotaVo> supRotaList = baseMapper.getSupRotaList(queryParam.getDate(),queryParam.getDeptId());
jsonObject.fluentPut("supRotaList",supRotaList);
}
return jsonObject;
}
}

Loading…
Cancel
Save