|
|
|
@ -1,36 +1,19 @@ |
|
|
|
package com.biutag.supervision.service; |
|
|
|
package com.biutag.supervision.service; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.biutag.supervision.constants.enums.DataUpdateMethodEnum; |
|
|
|
import com.biutag.supervision.mapper.*; |
|
|
|
import com.biutag.supervision.constants.enums.DistributionStateEnum; |
|
|
|
|
|
|
|
import com.biutag.supervision.constants.enums.HostLevelEnums; |
|
|
|
|
|
|
|
import com.biutag.supervision.constants.enums.ProblemSourcesEnum; |
|
|
|
|
|
|
|
import com.biutag.supervision.mapper.DataPetition12337Mapper; |
|
|
|
|
|
|
|
import com.biutag.supervision.mapper.DataPetitionComplaintMapper; |
|
|
|
|
|
|
|
import com.biutag.supervision.mapper.MailMapper; |
|
|
|
|
|
|
|
import com.biutag.supervision.mapper.SupDepartMapper; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.dto.*; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.entity.DataPetition12337; |
|
|
|
import com.biutag.supervision.pojo.entity.DataPetition12337; |
|
|
|
import com.biutag.supervision.pojo.entity.DataPetitionComplaint; |
|
|
|
import com.biutag.supervision.pojo.entity.DataPetitionComplaint; |
|
|
|
import com.biutag.supervision.pojo.entity.SupDepart; |
|
|
|
import com.biutag.supervision.pojo.entity.SupDepart; |
|
|
|
import com.biutag.supervision.pojo.entity.mailbox.Mail; |
|
|
|
import com.biutag.supervision.pojo.entity.mailbox.Mail; |
|
|
|
import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam; |
|
|
|
import com.biutag.supervision.pojo.vo.EchartsVo; |
|
|
|
import com.biutag.supervision.pojo.vo.MailMapIconVo; |
|
|
|
import com.biutag.supervision.pojo.vo.MailMapIconVo; |
|
|
|
import com.biutag.supervision.pojo.vo.MailOverviewVo; |
|
|
|
import com.biutag.supervision.pojo.vo.MailOverviewVo; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.*; |
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import static com.biutag.supervision.constants.enums.DepartGroupEnum.COUNTY_CITY_BUREAUS; |
|
|
|
import static com.biutag.supervision.constants.enums.DepartGroupEnum.COUNTY_CITY_BUREAUS; |
|
|
|
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.GABXF; |
|
|
|
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.GABXF; |
|
|
|
@ -40,131 +23,43 @@ import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.GJXFPT; |
|
|
|
@Service |
|
|
|
@Service |
|
|
|
public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, DataPetitionComplaint> { |
|
|
|
public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, DataPetitionComplaint> { |
|
|
|
|
|
|
|
|
|
|
|
private final NegativeService negativeService; |
|
|
|
private final SupExternalDepartMapper supExternalDepartMapper; |
|
|
|
|
|
|
|
|
|
|
|
private final DataPetitionComplaintMapper dataPetitionComplaintMapper; |
|
|
|
private final DataPetitionComplaintMapper dataPetitionComplaintMapper; |
|
|
|
|
|
|
|
|
|
|
|
private final DataPetition12337Mapper dataPetition12337Mapper; |
|
|
|
private final DataPetition12337Mapper dataPetition12337Mapper; |
|
|
|
private final SupDepartMapper supDepartMapper; |
|
|
|
private final SupDepartMapper supDepartMapper; |
|
|
|
private final MailMapper mailMapper; |
|
|
|
private final MailMapper mailMapper; |
|
|
|
|
|
|
|
private final String VALID_SIGN = "terminated"; // 有效标识
|
|
|
|
|
|
|
|
private final String EX_SOURCE = "局长信箱"; // 映射来源
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Page<DataPetitionComplaint> page(DataPetitionComplaintQueryParam queryParam) { |
|
|
|
// 一级信访大屏数据中央统计
|
|
|
|
LambdaQueryWrapper<DataPetitionComplaint> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
queryWrapper.eq(DataPetitionComplaint::getProblemSourcesCode, queryParam.getProblemSourcesCode()) |
|
|
|
|
|
|
|
.like(StrUtil.isNotBlank(queryParam.getOriginId()), DataPetitionComplaint::getOriginId, queryParam.getOriginId()) |
|
|
|
|
|
|
|
.like(StrUtil.isNotBlank(queryParam.getThingDesc()), DataPetitionComplaint::getThingDesc, queryParam.getThingDesc()) |
|
|
|
|
|
|
|
.orderByDesc(DataPetitionComplaint::getCreateTime); |
|
|
|
|
|
|
|
if (queryParam.getDiscoveryTime().size() == 2) { |
|
|
|
|
|
|
|
queryWrapper.between(DataPetitionComplaint::getDiscoveryTime, queryParam.getDiscoveryTime().get(0), queryParam.getDiscoveryTime().get(1)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(queryParam.getResponderKey()) && StrUtil.isNotBlank(queryParam.getResponderValue())) { |
|
|
|
|
|
|
|
switch (queryParam.getResponderKey()) { |
|
|
|
|
|
|
|
case "name": |
|
|
|
|
|
|
|
queryWrapper.like(DataPetitionComplaint::getResponderName, queryParam.getResponderValue()); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "phone": |
|
|
|
|
|
|
|
queryWrapper.like(DataPetitionComplaint::getResponderPhone, queryParam.getResponderValue()); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean save(DataPetitionComplaintDto dto) { |
|
|
|
|
|
|
|
DataPetitionComplaint dataPetitionComplaint = new DataPetitionComplaint(); |
|
|
|
|
|
|
|
BeanUtil.copyProperties(dto, dataPetitionComplaint); |
|
|
|
|
|
|
|
dataPetitionComplaint.setCreateTime(LocalDateTime.now()); |
|
|
|
|
|
|
|
dataPetitionComplaint.setUpdateTime(LocalDateTime.now()); |
|
|
|
|
|
|
|
return save(dataPetitionComplaint); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean save(DataPetitionComplaintAddDto body) { |
|
|
|
|
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
|
|
|
|
int index = 0; |
|
|
|
|
|
|
|
for (DataPetitionComplaintImportDto dto : body.getData()) { |
|
|
|
|
|
|
|
index++; |
|
|
|
|
|
|
|
boolean exists = exists(new LambdaQueryWrapper<DataPetitionComplaint>().eq(DataPetitionComplaint::getOriginId, dto.getOriginId())); |
|
|
|
|
|
|
|
// 增量更新
|
|
|
|
|
|
|
|
if (DataUpdateMethodEnum.incremental.name().equals(body.getDataUpdateMethod()) && exists) { |
|
|
|
|
|
|
|
throw new RuntimeException(String.format("第%s条数据的信件编号已存在,请核实", index)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
DataPetitionComplaint data = new DataPetitionComplaint(); |
|
|
|
|
|
|
|
BeanUtils.copyProperties(dto, data); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.setCreateTime(now); |
|
|
|
|
|
|
|
data.setUpdateTime(now); |
|
|
|
|
|
|
|
data.setProblemSourcesCode(body.getProblemSourcesCode()); |
|
|
|
|
|
|
|
data.setDistributionState(DistributionStateEnum.UNDISTRIBUTED.getValue()); |
|
|
|
|
|
|
|
saveOrUpdate(data); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean distribution(DataDataPetitionComplainDistribute dataDistribute) { |
|
|
|
|
|
|
|
dataDistribute.getData().forEach(item -> { |
|
|
|
|
|
|
|
NegativeDto negativeDto = new NegativeDto(); |
|
|
|
|
|
|
|
negativeDto.setOriginId(item.getOriginId()); |
|
|
|
|
|
|
|
negativeDto.setDiscoveryTime(item.getDiscoveryTime()); |
|
|
|
|
|
|
|
negativeDto.setProblemSourcesCode(item.getProblemSourcesCode()); |
|
|
|
|
|
|
|
negativeDto.setProblemSources(ProblemSourcesEnum.get(item.getProblemSourcesCode()).getLabel()); |
|
|
|
|
|
|
|
// negativeDto.setBusinessTypeCode(BusinessTypeEnum.ABWW);
|
|
|
|
|
|
|
|
// negativeDto.setBusinessTypeName();
|
|
|
|
|
|
|
|
negativeDto.setResponderName(item.getResponderName()); |
|
|
|
|
|
|
|
negativeDto.setContactPhone(item.getResponderPhone()); |
|
|
|
|
|
|
|
negativeDto.setThingDesc(item.getThingDesc()); |
|
|
|
|
|
|
|
String departId; |
|
|
|
|
|
|
|
String departName; |
|
|
|
|
|
|
|
if (StrUtil.isBlank(item.getThirdDepartId())) { |
|
|
|
|
|
|
|
departId = item.getSecondDepartId(); |
|
|
|
|
|
|
|
departName = item.getSecondDepartName(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
departId = item.getThirdDepartId(); |
|
|
|
|
|
|
|
departName = item.getThirdDepartName(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
negativeDto.setInvolveDepartId(departId); |
|
|
|
|
|
|
|
negativeDto.setInvolveDepartName(departName); |
|
|
|
|
|
|
|
negativeDto.setHostLevel(HostLevelEnums.SECOND.getValue()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
negativeDto.setApprovalFlow(dataDistribute.getApprovalFlow()); |
|
|
|
|
|
|
|
negativeDto.setDepartId(departId); |
|
|
|
|
|
|
|
negativeDto.setDepartName(departName); |
|
|
|
|
|
|
|
negativeDto.setTimeLimit(dataDistribute.getTimeLimit()); |
|
|
|
|
|
|
|
negativeDto.setMaxSignDuration(dataDistribute.getMaxSignDuration()); |
|
|
|
|
|
|
|
negativeDto.setMaxHandleDuration(dataDistribute.getMaxHandleDuration()); |
|
|
|
|
|
|
|
negativeDto.setMaxExtensionDuration(dataDistribute.getMaxExtensionDuration()); |
|
|
|
|
|
|
|
negativeDto.setCaseNumber(item.getOriginId()); |
|
|
|
|
|
|
|
negativeService.save(negativeDto); |
|
|
|
|
|
|
|
update(new LambdaUpdateWrapper<DataPetitionComplaint>().eq(DataPetitionComplaint::getOriginId, item.getOriginId()) |
|
|
|
|
|
|
|
.set(DataPetitionComplaint::getDistributionState, DistributionStateEnum.DISTRIBUTED.getValue())); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//所有分类数据总数
|
|
|
|
|
|
|
|
public MailOverviewVo allMailCount(Date beginTime, Date endTime) { |
|
|
|
public MailOverviewVo allMailCount(Date beginTime, Date endTime) { |
|
|
|
// MailOverviewVo temp = dataPetitionComplaintMapper.selectMailOverviewVo(beginTime, endTime);
|
|
|
|
|
|
|
|
MailOverviewVo temp = new MailOverviewVo(); |
|
|
|
MailOverviewVo temp = new MailOverviewVo(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 国家信访
|
|
|
|
QueryWrapper<DataPetitionComplaint> countryQueryWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<DataPetitionComplaint> countryQueryWrapper = new QueryWrapper<>(); |
|
|
|
countryQueryWrapper.eq("problem_sources_code", 21); |
|
|
|
countryQueryWrapper.eq("problem_sources_code", 21); |
|
|
|
countryQueryWrapper.between("discovery_time", beginTime, endTime); |
|
|
|
countryQueryWrapper.between("discovery_time", beginTime, endTime); |
|
|
|
Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper); // 国家信访
|
|
|
|
Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper); |
|
|
|
System.out.println("国家信访数量:" + countryMail); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 公安部信访
|
|
|
|
QueryWrapper<DataPetitionComplaint> policeQueryWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<DataPetitionComplaint> policeQueryWrapper = new QueryWrapper<>(); |
|
|
|
policeQueryWrapper.eq("problem_sources_code", 22); |
|
|
|
policeQueryWrapper.eq("problem_sources_code", 22); |
|
|
|
policeQueryWrapper.between("discovery_time", beginTime, endTime); |
|
|
|
policeQueryWrapper.between("discovery_time", beginTime, endTime); |
|
|
|
Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper); // 公安部信访
|
|
|
|
Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper); |
|
|
|
System.out.println("公安部信访数量:" + policeMail); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 12337
|
|
|
|
QueryWrapper<DataPetition12337> queryWrapper12337 = new QueryWrapper<>(); |
|
|
|
QueryWrapper<DataPetition12337> queryWrapper12337 = new QueryWrapper<>(); |
|
|
|
queryWrapper12337.between("discover_time", beginTime, endTime); |
|
|
|
queryWrapper12337.between("discover_time", beginTime, endTime); |
|
|
|
Long numberMail = dataPetition12337Mapper.selectCount(queryWrapper12337); |
|
|
|
Long numberMail = dataPetition12337Mapper.selectCount(queryWrapper12337); |
|
|
|
temp.setNumberMail(numberMail); |
|
|
|
|
|
|
|
System.out.println("12337信访数量:" + numberMail); |
|
|
|
// 局长信箱
|
|
|
|
QueryWrapper<Mail> mailQueryWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<Mail> mailQueryWrapper = new QueryWrapper<>(); |
|
|
|
mailQueryWrapper.ne("mail_state", "terminated"); |
|
|
|
mailQueryWrapper.ne("mail_state", VALID_SIGN); |
|
|
|
|
|
|
|
mailQueryWrapper.between("create_time", beginTime, endTime); |
|
|
|
Long manageMail = mailMapper.selectCount(mailQueryWrapper); |
|
|
|
Long manageMail = mailMapper.selectCount(mailQueryWrapper); |
|
|
|
|
|
|
|
|
|
|
|
// 总数
|
|
|
|
// 总数
|
|
|
|
Long totalMail = countryMail + policeMail + numberMail; |
|
|
|
Long totalMail = countryMail + policeMail + numberMail; |
|
|
|
temp.setCountryMail(countryMail); |
|
|
|
temp.setCountryMail(countryMail); |
|
|
|
@ -175,9 +70,10 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da |
|
|
|
return temp; |
|
|
|
return temp; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 一级信访大屏地图数据统计
|
|
|
|
public List<MailMapIconVo> getMailMapIcon(Date beginTime, Date endTime) { |
|
|
|
public List<MailMapIconVo> getMailMapIcon(Date beginTime, Date endTime) { |
|
|
|
List<MailMapIconVo> res = new ArrayList<>(); |
|
|
|
List<MailMapIconVo> res = new ArrayList<>(); |
|
|
|
// 查询所有区县局
|
|
|
|
// 查询所有分县市局
|
|
|
|
List<SupDepart> supDeparts = supDepartMapper.selectDepartsByGroupType(COUNTY_CITY_BUREAUS.getId()); |
|
|
|
List<SupDepart> supDeparts = supDepartMapper.selectDepartsByGroupType(COUNTY_CITY_BUREAUS.getId()); |
|
|
|
for (SupDepart supDepart : supDeparts) { |
|
|
|
for (SupDepart supDepart : supDeparts) { |
|
|
|
MailMapIconVo mapIconVo = new MailMapIconVo(); |
|
|
|
MailMapIconVo mapIconVo = new MailMapIconVo(); |
|
|
|
@ -187,13 +83,11 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da |
|
|
|
} |
|
|
|
} |
|
|
|
for (MailMapIconVo re : res) { |
|
|
|
for (MailMapIconVo re : res) { |
|
|
|
String departId = re.getDepartId(); |
|
|
|
String departId = re.getDepartId(); |
|
|
|
Integer countryTotal = dataPetitionComplaintMapper.selectMailBySourceCode(beginTime, endTime, GJXFPT.getValue(), departId); |
|
|
|
Long countryTotal = dataPetitionComplaintMapper.selectMailBySourceCode(beginTime, endTime, GJXFPT.getValue(), departId); |
|
|
|
Integer policeTotal = dataPetitionComplaintMapper.selectMailBySourceCode(beginTime, endTime, GABXF.getValue(), departId); |
|
|
|
Long policeTotal = dataPetitionComplaintMapper.selectMailBySourceCode(beginTime, endTime, GABXF.getValue(), departId); |
|
|
|
// String commissionerTotal = dataPetitionComplaintMapper.selectMailBySourceCode(beginTime, endTime, JZXX.getValue(), departId);
|
|
|
|
Long commissionerTotal = getCommissionerTotal(beginTime, endTime, re); |
|
|
|
Integer commissionerTotal = 0; |
|
|
|
Long numTotal = dataPetition12337Mapper.select12337MailBySourceCode(beginTime, endTime, departId); |
|
|
|
Integer numTotal = dataPetition12337Mapper.select12337MailBySourceCode(beginTime, endTime, departId); |
|
|
|
Long total = countryTotal + policeTotal + commissionerTotal + numTotal; |
|
|
|
Integer total = countryTotal + policeTotal + commissionerTotal + numTotal; |
|
|
|
|
|
|
|
// if (StringUtils.isAnyBlank(departId, total.toString() ))
|
|
|
|
|
|
|
|
re.setCountryTotal(countryTotal.toString()); |
|
|
|
re.setCountryTotal(countryTotal.toString()); |
|
|
|
re.setPoliceTotal(policeTotal.toString()); |
|
|
|
re.setPoliceTotal(policeTotal.toString()); |
|
|
|
re.setCommissionerTotal(commissionerTotal.toString()); |
|
|
|
re.setCommissionerTotal(commissionerTotal.toString()); |
|
|
|
@ -203,21 +97,36 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da |
|
|
|
return res; |
|
|
|
return res; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取一级信访大屏地图中的局长信箱数量
|
|
|
|
|
|
|
|
private Long getCommissionerTotal(Date beginTime, Date endTime, MailMapIconVo re) { |
|
|
|
|
|
|
|
// 1、查出这个VO里面的departID所对应的局长信箱的部门ID
|
|
|
|
|
|
|
|
String exDepartId = supExternalDepartMapper.getExIdByInId(re.getDepartId(), EX_SOURCE); |
|
|
|
|
|
|
|
// 2、按照时间来看看有多少条数据
|
|
|
|
|
|
|
|
QueryWrapper<Mail> mailWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
mailWrapper.between("create_time", beginTime, endTime); |
|
|
|
|
|
|
|
mailWrapper.eq("mail_state", VALID_SIGN); |
|
|
|
|
|
|
|
mailWrapper.eq("second_dept_id", exDepartId); |
|
|
|
|
|
|
|
return mailMapper.selectCount(mailWrapper); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 二级信访大屏中央数据统计
|
|
|
|
public MailOverviewVo getSubOneAllMailCount(Date beginTime, Date endTime, Integer departId) { |
|
|
|
public MailOverviewVo getSubOneAllMailCount(Date beginTime, Date endTime, Integer departId) { |
|
|
|
// MailOverviewVo temp = dataPetitionComplaintMapper.selectSubOneMailOverviewVo(beginTime, endTime, departId);
|
|
|
|
|
|
|
|
MailOverviewVo temp = new MailOverviewVo(); |
|
|
|
MailOverviewVo temp = new MailOverviewVo(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 国家信访
|
|
|
|
QueryWrapper<DataPetitionComplaint> countryQueryWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<DataPetitionComplaint> countryQueryWrapper = new QueryWrapper<>(); |
|
|
|
countryQueryWrapper.eq("problem_sources_code", 21); |
|
|
|
countryQueryWrapper.eq("problem_sources_code", 21); |
|
|
|
countryQueryWrapper.eq("second_depart_id", departId); |
|
|
|
countryQueryWrapper.eq("second_depart_id", departId); |
|
|
|
countryQueryWrapper.between("discovery_time", beginTime, endTime); |
|
|
|
countryQueryWrapper.between("discovery_time", beginTime, endTime); |
|
|
|
Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper); // 国家信访
|
|
|
|
Long countryMail = dataPetitionComplaintMapper.selectCount(countryQueryWrapper); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 公安信访
|
|
|
|
QueryWrapper<DataPetitionComplaint> policeQueryWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<DataPetitionComplaint> policeQueryWrapper = new QueryWrapper<>(); |
|
|
|
policeQueryWrapper.eq("problem_sources_code", 22); |
|
|
|
policeQueryWrapper.eq("problem_sources_code", 22); |
|
|
|
policeQueryWrapper.eq("second_depart_id", departId); |
|
|
|
policeQueryWrapper.eq("second_depart_id", departId); |
|
|
|
policeQueryWrapper.between("discovery_time", beginTime, endTime); |
|
|
|
policeQueryWrapper.between("discovery_time", beginTime, endTime); |
|
|
|
Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper); // 公安部信访
|
|
|
|
Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper); |
|
|
|
System.out.println("公安部信访数量:" + policeMail); |
|
|
|
System.out.println("公安部信访数量:" + policeMail); |
|
|
|
|
|
|
|
|
|
|
|
// 12337信访
|
|
|
|
// 12337信访
|
|
|
|
@ -226,11 +135,15 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da |
|
|
|
queryWrapper12337.between("discover_time", beginTime, endTime); |
|
|
|
queryWrapper12337.between("discover_time", beginTime, endTime); |
|
|
|
Long numberMail = dataPetition12337Mapper.selectCount(queryWrapper12337); |
|
|
|
Long numberMail = dataPetition12337Mapper.selectCount(queryWrapper12337); |
|
|
|
temp.setNumberMail(numberMail); |
|
|
|
temp.setNumberMail(numberMail); |
|
|
|
System.out.println("12337信访数量:" + numberMail); |
|
|
|
|
|
|
|
|
|
|
|
// 局长信箱
|
|
|
|
QueryWrapper<Mail> subOneMailQueryWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<Mail> subOneMailQueryWrapper = new QueryWrapper<>(); |
|
|
|
subOneMailQueryWrapper.ne("mail_state", "terminated"); |
|
|
|
String exDepartId = supExternalDepartMapper.getExIdByInId(departId.toString(), "局长信箱"); |
|
|
|
subOneMailQueryWrapper.eq("second_depart_id", departId); |
|
|
|
subOneMailQueryWrapper.ne("mail_state", VALID_SIGN); |
|
|
|
|
|
|
|
subOneMailQueryWrapper.eq("second_dept_id", exDepartId); |
|
|
|
|
|
|
|
subOneMailQueryWrapper.between("create_time", beginTime, endTime); |
|
|
|
Long manageMail = mailMapper.selectCount(subOneMailQueryWrapper); |
|
|
|
Long manageMail = mailMapper.selectCount(subOneMailQueryWrapper); |
|
|
|
|
|
|
|
|
|
|
|
// 总数
|
|
|
|
// 总数
|
|
|
|
Long totalMail = countryMail + policeMail + numberMail; |
|
|
|
Long totalMail = countryMail + policeMail + numberMail; |
|
|
|
temp.setCountryMail(countryMail); |
|
|
|
temp.setCountryMail(countryMail); |
|
|
|
@ -241,8 +154,11 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da |
|
|
|
return temp; |
|
|
|
return temp; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 二级信访大屏地图数据统计
|
|
|
|
public List<MailMapIconVo> getSubOneMailMapIcon(Date beginTime, Date endTime, Integer departId) { |
|
|
|
public List<MailMapIconVo> getSubOneMailMapIcon(Date beginTime, Date endTime, Integer departId) { |
|
|
|
List<MailMapIconVo> res = new ArrayList<>(); |
|
|
|
List<MailMapIconVo> res = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
// 查该区县局下属所有派出所
|
|
|
|
// 查该区县局下属所有派出所
|
|
|
|
List<SupDepart> policeDeparts = supDepartMapper.selectPoliceDeparts(departId); |
|
|
|
List<SupDepart> policeDeparts = supDepartMapper.selectPoliceDeparts(departId); |
|
|
|
for (SupDepart supDepart : policeDeparts) { |
|
|
|
for (SupDepart supDepart : policeDeparts) { |
|
|
|
@ -254,12 +170,12 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da |
|
|
|
// 查询国家信访和公安部信访数据
|
|
|
|
// 查询国家信访和公安部信访数据
|
|
|
|
for (MailMapIconVo re : res) { |
|
|
|
for (MailMapIconVo re : res) { |
|
|
|
String policeDepartId = re.getDepartId(); |
|
|
|
String policeDepartId = re.getDepartId(); |
|
|
|
Integer countryTotal = dataPetitionComplaintMapper.selectPoliceMailBySourceCode(beginTime, endTime, GJXFPT.getValue(), policeDepartId); |
|
|
|
Long countryTotal = dataPetitionComplaintMapper.selectPoliceMailBySourceCode(beginTime, endTime, GJXFPT.getValue(), policeDepartId); |
|
|
|
Integer policeTotal = dataPetitionComplaintMapper.selectPoliceMailBySourceCode(beginTime, endTime, GABXF.getValue(), policeDepartId); |
|
|
|
Long policeTotal = dataPetitionComplaintMapper.selectPoliceMailBySourceCode(beginTime, endTime, GABXF.getValue(), policeDepartId); |
|
|
|
Integer commissionerTotal = 0; // 局长信箱
|
|
|
|
Long commissionerTotal = getSubOneCommissionerTotal(beginTime, endTime, re); // 局长信箱
|
|
|
|
// 查询12337 数据
|
|
|
|
// 查询12337 数据
|
|
|
|
Integer numTotal = dataPetition12337Mapper.select12337PoliceMailBySourceCode(beginTime, endTime, departId); |
|
|
|
Long numTotal = dataPetition12337Mapper.select12337PoliceMailBySourceCode(beginTime, endTime, departId); |
|
|
|
Integer 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()); |
|
|
|
re.setCommissionerTotal(commissionerTotal.toString()); |
|
|
|
@ -268,4 +184,49 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da |
|
|
|
} |
|
|
|
} |
|
|
|
return res; |
|
|
|
return res; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 二级信访大屏地图中局长信箱数据统计
|
|
|
|
|
|
|
|
private Long getSubOneCommissionerTotal(Date beginTime, Date endTime, MailMapIconVo re) { |
|
|
|
|
|
|
|
// 1、查出这个VO里面的departID所对应的局长信箱的部门ID
|
|
|
|
|
|
|
|
String exDepartId = supExternalDepartMapper.getExIdByInId(re.getDepartId(), EX_SOURCE); |
|
|
|
|
|
|
|
// 2、按照时间来看看有多少条数据
|
|
|
|
|
|
|
|
QueryWrapper<Mail> mailWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
mailWrapper.between("create_time", beginTime, endTime); |
|
|
|
|
|
|
|
mailWrapper.eq("mail_state", VALID_SIGN); |
|
|
|
|
|
|
|
mailWrapper.eq("three_dept_id", exDepartId); |
|
|
|
|
|
|
|
return mailMapper.selectCount(mailWrapper); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 一级信访大屏局长信箱趋势
|
|
|
|
|
|
|
|
public List<EchartsVo> getCommissionerTrend(Integer year) { |
|
|
|
|
|
|
|
List<EchartsVo> res = EchartsVo.generateMonthlyData(); |
|
|
|
|
|
|
|
List<EchartsVo> temp = mailMapper.selectTrendByYear(year); |
|
|
|
|
|
|
|
mappingMonth(res, temp); |
|
|
|
|
|
|
|
return res; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void mappingMonth(List<EchartsVo> res, List<EchartsVo> temp) { |
|
|
|
|
|
|
|
Map<String, String> monthMap = new HashMap<>(); |
|
|
|
|
|
|
|
monthMap.put("01", "1月"); |
|
|
|
|
|
|
|
monthMap.put("02", "2月"); |
|
|
|
|
|
|
|
monthMap.put("03", "3月"); |
|
|
|
|
|
|
|
monthMap.put("04", "4月"); |
|
|
|
|
|
|
|
monthMap.put("05", "5月"); |
|
|
|
|
|
|
|
monthMap.put("06", "6月"); |
|
|
|
|
|
|
|
monthMap.put("07", "7月"); |
|
|
|
|
|
|
|
monthMap.put("08", "8月"); |
|
|
|
|
|
|
|
monthMap.put("09", "9月"); |
|
|
|
|
|
|
|
monthMap.put("10", "10月"); |
|
|
|
|
|
|
|
monthMap.put("11", "11月"); |
|
|
|
|
|
|
|
monthMap.put("12", "12月"); |
|
|
|
|
|
|
|
for (EchartsVo resVo : res) { |
|
|
|
|
|
|
|
for (EchartsVo tempVo : temp) { |
|
|
|
|
|
|
|
String month = monthMap.get(tempVo.getName()); |
|
|
|
|
|
|
|
if (resVo.getName().equals(month)) { |
|
|
|
|
|
|
|
resVo.setValue(tempVo.getValue()); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|