| | |
| | | package com.panzhihua.sangeshenbian.service.impl; |
| | | |
| | | import com.beust.jcommander.internal.Lists; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.sangeshenbian.dao.SystemUserMapper; |
| | | import com.panzhihua.sangeshenbian.model.entity.ComAct; |
| | | import com.panzhihua.sangeshenbian.model.entity.ComStreet; |
| | | import com.panzhihua.sangeshenbian.model.entity.Complaint; |
| | | import com.panzhihua.sangeshenbian.model.entity.PartyMember; |
| | | import com.panzhihua.sangeshenbian.model.entity.SystemUserLevel; |
| | | import com.panzhihua.sangeshenbian.model.query.AppStaticsQuery; |
| | | import com.panzhihua.sangeshenbian.model.vo.AnalyticStatisticsFourVo; |
| | | import com.panzhihua.sangeshenbian.model.vo.AnalyticStatisticsOneVo; |
| | | import com.panzhihua.sangeshenbian.model.vo.AnalyticStatisticsThreeVo; |
| | | import com.panzhihua.sangeshenbian.model.vo.AnalyticStatisticsTwoVo; |
| | | import com.panzhihua.sangeshenbian.model.vo.RegionVO; |
| | | import com.panzhihua.sangeshenbian.service.IBcRegionService; |
| | | import com.panzhihua.sangeshenbian.service.IComActService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @author mitao |
| | |
| | | List<Complaint> complaints = complaintService.queryCompliantList(query,loginUserInfo); |
| | | return complaintService.analyticStatisticsOne(null, complaints, simpleDateFormat); |
| | | } |
| | | |
| | | /** |
| | | *获取统计分析-第二部分(诉求单量统计柱状图) |
| | | * @param query |
| | | * @param loginUserInfo |
| | | * @return |
| | | */ |
| | | public List<AnalyticStatisticsTwoVo> queryStaticsPartTwo(AppStaticsQuery query, LoginUserInfoVO loginUserInfo) { |
| | | List<Complaint> complaints = complaintService.queryCompliantList(query,loginUserInfo); |
| | | //时间范围 |
| | | String time = ""; |
| | | if (Objects.nonNull(query.getTimeType())) { |
| | | Date now = new Date(); |
| | | Date start = null; |
| | | switch (query.getTimeType()) { |
| | | case 2: |
| | | start = DateUtils.addDay(now, -15); |
| | | break; |
| | | case 3: |
| | | start = DateUtils.addDay(now, -30); |
| | | break; |
| | | default: |
| | | start = DateUtils.addDay(now, -7); |
| | | break; |
| | | } |
| | | //格式化 |
| | | String startStr = DateUtils.format(start, DateUtils.yyyyMMdd_format); |
| | | String endStr = DateUtils.format(now, DateUtils.yyyyMMdd_format); |
| | | time = startStr + " - " + endStr; |
| | | } |
| | | return complaintService.analyticStatisticsTwo(time, complaints, simpleDateFormat); |
| | | } |
| | | |
| | | /** |
| | | *获取统计分析-第三部分(问题类型排名) |
| | | * @param query |
| | | * @param loginUserInfo |
| | | * @return |
| | | */ |
| | | public List<AnalyticStatisticsThreeVo> queryStaticsPartThree(AppStaticsQuery query, LoginUserInfoVO loginUserInfo) { |
| | | List<Complaint> complaints = complaintService.queryCompliantList(query,loginUserInfo); |
| | | return complaintService.analyticStatisticsThree(query.getRank(), complaints); |
| | | } |
| | | |
| | | /** |
| | | * 获取统计分析-第四部分(评价占比) |
| | | * @param query |
| | | * @param loginUserInfo |
| | | * @return |
| | | */ |
| | | public AnalyticStatisticsFourVo queryStaticsPartFour(AppStaticsQuery query, LoginUserInfoVO loginUserInfo) { |
| | | List<Complaint> complaints = complaintService.queryCompliantList(query,loginUserInfo); |
| | | return complaintService.analyticStatisticsFour(complaints); |
| | | } |
| | | } |