|
|
|
@ -12,21 +12,29 @@ import com.biutag.supervision.constants.enums.*; |
|
|
|
import com.biutag.supervision.mapper.DataPetition12337Mapper; |
|
|
|
import com.biutag.supervision.mapper.DataPetition12337Mapper; |
|
|
|
import com.biutag.supervision.mapper.DataPetitionComplaintMapper; |
|
|
|
import com.biutag.supervision.mapper.DataPetitionComplaintMapper; |
|
|
|
import com.biutag.supervision.mapper.NegativeMapper; |
|
|
|
import com.biutag.supervision.mapper.NegativeMapper; |
|
|
|
|
|
|
|
import com.biutag.supervision.mapper.SupDepartMapper; |
|
|
|
import com.biutag.supervision.pojo.dto.*; |
|
|
|
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.param.DataPetitionComplaintQueryParam; |
|
|
|
import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam; |
|
|
|
import com.biutag.supervision.pojo.vo.*; |
|
|
|
import com.biutag.supervision.pojo.vo.*; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.ZoneId; |
|
|
|
import java.time.ZoneId; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import static com.biutag.supervision.constants.enums.DepartGroupEnum.COUNTY_CITY_BUREAUS; |
|
|
|
|
|
|
|
import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.*; |
|
|
|
|
|
|
|
|
|
|
|
@RequiredArgsConstructor |
|
|
|
@RequiredArgsConstructor |
|
|
|
@Service |
|
|
|
@Service |
|
|
|
public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, DataPetitionComplaint> { |
|
|
|
public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, DataPetitionComplaint> { |
|
|
|
@ -36,8 +44,10 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da |
|
|
|
private final DataPetitionComplaintMapper dataPetitionComplaintMapper; |
|
|
|
private final DataPetitionComplaintMapper dataPetitionComplaintMapper; |
|
|
|
|
|
|
|
|
|
|
|
private final DataPetition12337Mapper dataPetition12337Mapper; |
|
|
|
private final DataPetition12337Mapper dataPetition12337Mapper; |
|
|
|
|
|
|
|
private final SupDepartMapper supDepartMapper; |
|
|
|
|
|
|
|
|
|
|
|
private final NegativeMapper negativeMapper; |
|
|
|
private final NegativeMapper negativeMapper; |
|
|
|
|
|
|
|
|
|
|
|
public Page<DataPetitionComplaint> page(DataPetitionComplaintQueryParam queryParam) { |
|
|
|
public Page<DataPetitionComplaint> page(DataPetitionComplaintQueryParam queryParam) { |
|
|
|
LambdaQueryWrapper<DataPetitionComplaint> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<DataPetitionComplaint> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapper.eq(DataPetitionComplaint::getProblemSourcesCode, queryParam.getProblemSourcesCode()) |
|
|
|
queryWrapper.eq(DataPetitionComplaint::getProblemSourcesCode, queryParam.getProblemSourcesCode()) |
|
|
|
@ -145,41 +155,11 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da |
|
|
|
Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper); |
|
|
|
Long policeMail = dataPetitionComplaintMapper.selectCount(policeQueryWrapper); |
|
|
|
System.out.println("公安部信访数量:" + policeMail); |
|
|
|
System.out.println("公安部信访数量:" + policeMail); |
|
|
|
// 12337信访
|
|
|
|
// 12337信访
|
|
|
|
QueryWrapper<DataPetition12337> queryWrapper12337 = new QueryWrapper<>(); |
|
|
|
QueryWrapper<DataPetition12337> queryWrapper12337 = new QueryWrapper<>(); |
|
|
|
Long numberMail = dataPetition12337Mapper.selectCount(queryWrapper12337); |
|
|
|
Long numberMail = dataPetition12337Mapper.selectCount(queryWrapper12337); |
|
|
|
System.out.println("12337信访数量:" + numberMail); |
|
|
|
System.out.println("12337信访数量:" + numberMail); |
|
|
|
// // 初访
|
|
|
|
|
|
|
|
// QueryWrapper<DataPetitionComplaint> firstQueryWrapper = new QueryWrapper<>();
|
|
|
|
|
|
|
|
// firstQueryWrapper.eq("initial_petition", 1);
|
|
|
|
|
|
|
|
// firstQueryWrapper.between("discovery_time", beginTime, endTime);
|
|
|
|
|
|
|
|
// Long firstMail = dataPetitionComplaintMapper.selectCount(firstQueryWrapper);
|
|
|
|
|
|
|
|
// // 重访
|
|
|
|
|
|
|
|
// QueryWrapper<DataPetitionComplaint> secondQueryWrapper = new QueryWrapper<>();
|
|
|
|
|
|
|
|
// secondQueryWrapper.eq("initial_petition", 2);
|
|
|
|
|
|
|
|
// secondQueryWrapper.between("discovery_time", beginTime, endTime);
|
|
|
|
|
|
|
|
// Long secondMail = dataPetitionComplaintMapper.selectCount(secondQueryWrapper);
|
|
|
|
|
|
|
|
// // 领导接访
|
|
|
|
|
|
|
|
// QueryWrapper<DataPetitionComplaint> leaderQueryWrapper = new QueryWrapper<>();
|
|
|
|
|
|
|
|
// leaderQueryWrapper.isNotNull("receiving_leader_name");
|
|
|
|
|
|
|
|
// leaderQueryWrapper.between("discovery_time", beginTime, endTime);
|
|
|
|
|
|
|
|
// Long leaderReceiveMail = dataPetitionComplaintMapper.selectCount(leaderQueryWrapper);
|
|
|
|
|
|
|
|
// // 领导督办
|
|
|
|
|
|
|
|
// QueryWrapper<DataPetitionComplaint> leaderViewQueryWrapper = new QueryWrapper<>();
|
|
|
|
|
|
|
|
// leaderViewQueryWrapper.isNotNull("receiving_leader_name");
|
|
|
|
|
|
|
|
// leaderViewQueryWrapper.between("discovery_time", beginTime, endTime);
|
|
|
|
|
|
|
|
// Long leaderViewMail = dataPetitionComplaintMapper.selectCount(leaderViewQueryWrapper);
|
|
|
|
|
|
|
|
// // 闹访 1:闹 0:不闹
|
|
|
|
|
|
|
|
// QueryWrapper<DataPetitionComplaint> tangleQueryWrapper = new QueryWrapper<>();
|
|
|
|
|
|
|
|
// tangleQueryWrapper.eq("entanglement_visits", 1);
|
|
|
|
|
|
|
|
// tangleQueryWrapper.between("discovery_time", beginTime, endTime);
|
|
|
|
|
|
|
|
// Long tangleMail = dataPetitionComplaintMapper.selectCount(tangleQueryWrapper);
|
|
|
|
|
|
|
|
// // 集访 1:集 0:不集
|
|
|
|
|
|
|
|
// QueryWrapper<DataPetitionComplaint> massQueryWrapper = new QueryWrapper<>();
|
|
|
|
|
|
|
|
// massQueryWrapper.eq("mass_visits", 1);
|
|
|
|
|
|
|
|
// massQueryWrapper.between("discovery_time", beginTime, endTime);
|
|
|
|
|
|
|
|
// Long massMail = dataPetitionComplaintMapper.selectCount(massQueryWrapper);
|
|
|
|
|
|
|
|
// 总数
|
|
|
|
// 总数
|
|
|
|
long totalMail = countryMail+policeMail+numberMail; |
|
|
|
long totalMail = countryMail + policeMail + numberMail; |
|
|
|
|
|
|
|
|
|
|
|
JSONObject overview = new JSONObject() |
|
|
|
JSONObject overview = new JSONObject() |
|
|
|
// 信访总数(起)
|
|
|
|
// 信访总数(起)
|
|
|
|
@ -204,7 +184,7 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<RecentMailTrendByDayVo> getRecentlyMailTrendByDay(Integer sourcesCode, Integer days, Date endTime) { |
|
|
|
public List<RecentMailTrendByDayVo> getRecentlyMailTrendByDay(Integer sourcesCode, Integer days, Date endTime) { |
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd"); |
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd"); |
|
|
|
// 将 endTime 转换为 LocalDate
|
|
|
|
// 将 endTime 转换为 LocalDate
|
|
|
|
LocalDate endLocalDate = endTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); |
|
|
|
LocalDate endLocalDate = endTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); |
|
|
|
@ -231,24 +211,23 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public MailOverviewVo getAllMailCount(Date beginTime, Date endTime) { |
|
|
|
public MailOverviewVo getAllMailCount(Date beginTime, Date endTime) { |
|
|
|
MailOverviewVo res = negativeMapper.getAllMailCount(beginTime, endTime); |
|
|
|
MailOverviewVo res = negativeMapper.getAllMailCount(beginTime, endTime); |
|
|
|
return res; |
|
|
|
return res; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<EchartsVo> getMailTrend(Integer year, Integer type) { |
|
|
|
public List<EchartsVo> getMailTrend(Integer year, Integer type) { |
|
|
|
List<EchartsVo> res = negativeMapper.getMailTrend(year, type); |
|
|
|
List<EchartsVo> res = negativeMapper.getMailTrend(year, type); |
|
|
|
return res; |
|
|
|
return res; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public MailFirstAndRepeatOverviewVo getFirstAndRepeatOverview(Date beginTime, Date endTime) { |
|
|
|
public MailFirstAndRepeatOverviewVo getFirstAndRepeatOverview(Date beginTime, Date endTime) { |
|
|
|
MailFirstAndRepeatOverviewVo res = dataPetitionComplaintMapper.getFirstAndRepeatOverview(beginTime, endTime); |
|
|
|
MailFirstAndRepeatOverviewVo res = dataPetitionComplaintMapper.getFirstAndRepeatOverview(beginTime, endTime); |
|
|
|
return res; |
|
|
|
return res; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<OrganizeProblemRankVo> getMailRank(Date beginTime, Date endTime, int groupId, Integer isRepeat) { |
|
|
|
public List<OrganizeProblemRankVo> getMailRank(Date beginTime, Date endTime, int groupId, Integer isRepeat) { |
|
|
|
List<OrganizeProblemRankVo> res = dataPetitionComplaintMapper.getMailRank(beginTime, endTime, groupId, isRepeat); |
|
|
|
List<OrganizeProblemRankVo> res = dataPetitionComplaintMapper.getMailRank(beginTime, endTime, groupId, isRepeat); |
|
|
|
return res; |
|
|
|
return res; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -263,7 +242,6 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<OrganizeProblemRankVo> getEntanglementMailRank(Date beginTime, Date endTime, int groupId) { |
|
|
|
public List<OrganizeProblemRankVo> getEntanglementMailRank(Date beginTime, Date endTime, int groupId) { |
|
|
|
List<OrganizeProblemRankVo> res = dataPetitionComplaintMapper.getEntanglementMailRank(beginTime, endTime, groupId); |
|
|
|
List<OrganizeProblemRankVo> res = dataPetitionComplaintMapper.getEntanglementMailRank(beginTime, endTime, groupId); |
|
|
|
return res; |
|
|
|
return res; |
|
|
|
@ -278,4 +256,31 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da |
|
|
|
List<EchartsVo> res = dataPetition12337Mapper.getMailTrend12337(year); |
|
|
|
List<EchartsVo> res = dataPetition12337Mapper.getMailTrend12337(year); |
|
|
|
return res; |
|
|
|
return res; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<MailMapIconVo> getMailMapIcon(Date beginTime, Date endTime) { |
|
|
|
|
|
|
|
List<MailMapIconVo> res = new ArrayList<>(); |
|
|
|
|
|
|
|
List<SupDepart> supDeparts = supDepartMapper.selectDepartsByGroupType(COUNTY_CITY_BUREAUS.getId()); |
|
|
|
|
|
|
|
for (SupDepart supDepart : supDeparts) { |
|
|
|
|
|
|
|
MailMapIconVo mapIconVo = new MailMapIconVo(); |
|
|
|
|
|
|
|
mapIconVo.setName(supDepart.getShortName()); |
|
|
|
|
|
|
|
mapIconVo.setDepartId(supDepart.getId()); |
|
|
|
|
|
|
|
res.add(mapIconVo); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for (MailMapIconVo re : res) { |
|
|
|
|
|
|
|
String departId = re.getDepartId(); |
|
|
|
|
|
|
|
Integer countryTotal = dataPetitionComplaintMapper.selectMailBySourceCode(beginTime, endTime, GJXFPT.getValue(), departId); |
|
|
|
|
|
|
|
Integer policeTotal = dataPetitionComplaintMapper.selectMailBySourceCode(beginTime, endTime, GABXF.getValue(), departId); |
|
|
|
|
|
|
|
// String commissionerTotal = dataPetitionComplaintMapper.selectMailBySourceCode(beginTime, endTime, JZXX.getValue(), departId);
|
|
|
|
|
|
|
|
Integer commissionerTotal = 0; |
|
|
|
|
|
|
|
Integer numTotal = dataPetition12337Mapper.select12337MailBySourceCode(beginTime, endTime, departId); |
|
|
|
|
|
|
|
Integer total = countryTotal + policeTotal + commissionerTotal + numTotal; |
|
|
|
|
|
|
|
// if (StringUtils.isAnyBlank(departId, total.toString() ))
|
|
|
|
|
|
|
|
re.setCountryTotal(countryTotal.toString()); |
|
|
|
|
|
|
|
re.setPoliceTotal(policeTotal.toString()); |
|
|
|
|
|
|
|
re.setCommissionerTotal(commissionerTotal.toString()); |
|
|
|
|
|
|
|
re.setNumTotal(numTotal.toString()); |
|
|
|
|
|
|
|
re.setTotal(total.toString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return res; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|