4 changed files with 201 additions and 6 deletions
@ -0,0 +1,18 @@ |
|||||||
|
package com.biutag.supervision.constants.enums; |
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.Getter; |
||||||
|
|
||||||
|
@AllArgsConstructor |
||||||
|
@Getter |
||||||
|
public enum RepeatEnum { |
||||||
|
|
||||||
|
FIRST_MAIL(1, "初访信件"), |
||||||
|
REPEAT_MAIL(2, "重访信件"); |
||||||
|
|
||||||
|
private Integer id; |
||||||
|
|
||||||
|
private String label; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,71 @@ |
|||||||
|
package com.biutag.supervision.controller.datav; |
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.NumberUtil; |
||||||
|
import com.alibaba.fastjson.JSONObject; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.biutag.supervision.constants.enums.DepartGroupEnum; |
||||||
|
import com.biutag.supervision.constants.enums.RepeatEnum; |
||||||
|
import com.biutag.supervision.mapper.DataCaseVerifMapper; |
||||||
|
import com.biutag.supervision.mapper.DataPetitionComplaintMapper; |
||||||
|
import com.biutag.supervision.pojo.Result; |
||||||
|
import com.biutag.supervision.pojo.dto.CaseVerifDepart; |
||||||
|
import com.biutag.supervision.pojo.entity.DataPetitionComplaint; |
||||||
|
import com.biutag.supervision.service.DataPetitionComplaintService; |
||||||
|
import lombok.RequiredArgsConstructor; |
||||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* @author: sh |
||||||
|
* @date: 2024/10/31 |
||||||
|
*/ |
||||||
|
@RequestMapping("datav/mailVisits") |
||||||
|
@RequiredArgsConstructor |
||||||
|
@RestController |
||||||
|
public class DataPetitionComplaintViewController { |
||||||
|
|
||||||
|
private final DataPetitionComplaintService dataPetitionComplaintService; |
||||||
|
private final DataPetitionComplaintMapper dataPetitionComplaintMapper; |
||||||
|
|
||||||
|
/** |
||||||
|
* 信访数据大屏统计 |
||||||
|
* |
||||||
|
* @param beginTime |
||||||
|
* @param endTime |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@GetMapping |
||||||
|
public Result<JSONObject> mailVisits(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { |
||||||
|
// 信访数据总数概览
|
||||||
|
JSONObject overview = dataPetitionComplaintService.allMailCount(beginTime, endTime); |
||||||
|
// 分县市局信初重访领导访排名
|
||||||
|
List<CaseVerifDepart> fxsjFirstMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), RepeatEnum.FIRST_MAIL.getId(), beginTime, endTime); |
||||||
|
List<CaseVerifDepart> fxsjRepeatMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), RepeatEnum.REPEAT_MAIL.getId(), beginTime, endTime); |
||||||
|
List<CaseVerifDepart> fxsjLeaderViewMailList = dataPetitionComplaintMapper.selectLeaderViewMail(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), beginTime, endTime); |
||||||
|
// 部委支队初重领导访排名
|
||||||
|
List<CaseVerifDepart> bwzdFirstMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.BUREAU_AFFILIATED.getId(), RepeatEnum.FIRST_MAIL.getId(), beginTime, endTime); |
||||||
|
List<CaseVerifDepart> bwzdRepeatMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.BUREAU_AFFILIATED.getId(), RepeatEnum.REPEAT_MAIL.getId(), beginTime, endTime); |
||||||
|
List<CaseVerifDepart> bwzdLeaderViewMailList = dataPetitionComplaintMapper.selectLeaderViewMail(DepartGroupEnum.BUREAU_AFFILIATED.getId(), beginTime, endTime); |
||||||
|
//
|
||||||
|
|
||||||
|
JSONObject data = new JSONObject().fluentPut("overview", overview) |
||||||
|
.fluentPut("fxsjFirstMailList", fxsjFirstMailList) |
||||||
|
.fluentPut("fxsjRepeatMailList", fxsjRepeatMailList) |
||||||
|
.fluentPut("fxsjLeaderViewMailList", fxsjLeaderViewMailList) |
||||||
|
.fluentPut("bwzdFirstMailList", bwzdFirstMailList) |
||||||
|
.fluentPut("bwzdRepeatMailList", bwzdRepeatMailList) |
||||||
|
.fluentPut("bwzdLeaderViewMailList", bwzdLeaderViewMailList); |
||||||
|
return Result.success(data); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -1,8 +1,30 @@ |
|||||||
package com.biutag.supervision.mapper; |
package com.biutag.supervision.mapper; |
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.biutag.supervision.pojo.dto.CaseVerifDepart; |
||||||
import com.biutag.supervision.pojo.entity.DataPetitionComplaint; |
import com.biutag.supervision.pojo.entity.DataPetitionComplaint; |
||||||
|
import org.apache.ibatis.annotations.Select; |
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
public interface DataPetitionComplaintMapper extends BaseMapper<DataPetitionComplaint> { |
public interface DataPetitionComplaintMapper extends BaseMapper<DataPetitionComplaint> { |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Select("SELECT sd.id, sd.short_name label,count(*) value " + |
||||||
|
"FROM (SELECT * FROM data_petition_complaint dpc " + |
||||||
|
"WHERE dpc.create_time BETWEEN #{beginTime} AND #{endTime}) as temp " + |
||||||
|
"INNER JOIN sup_depart sd on sd.id=temp.second_depart_id " + |
||||||
|
"WHERE sd.statistics_group_id=#{departId} and temp.initial_petition=#{Repeat} " + |
||||||
|
"GROUP BY temp.second_depart_id") |
||||||
|
List<CaseVerifDepart> selectDepartStatistic(Integer departId, Integer Repeat, Date beginTime, Date endTime); |
||||||
|
|
||||||
|
@Select("SELECT sd.id, sd.short_name label,count(*) value " + |
||||||
|
"FROM (SELECT * FROM data_petition_complaint dpc " + |
||||||
|
"WHERE dpc.create_time BETWEEN #{beginTime} AND #{endTime}) as temp " + |
||||||
|
"INNER JOIN sup_depart sd on sd.id=temp.second_depart_id " + |
||||||
|
"WHERE sd.statistics_group_id=#{departId} and temp.receiving_leader_name is not null " + |
||||||
|
"GROUP BY temp.second_depart_id") |
||||||
|
List<CaseVerifDepart> selectLeaderViewMail(Integer departId, Date beginTime, Date endTime); |
||||||
} |
} |
||||||
|
|||||||
Loading…
Reference in new issue