liujie
9 天以前 9fecaec17392db458339040dacf63f40f6f5125d
分析统计修改   定时评价修改
3个文件已修改
29 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/AnalyticStatisticsController.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/scheduled/ComplaintTasks.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/AnalyticStatisticsController.java
@@ -61,10 +61,10 @@
        Integer id = loginUserInfoSanGeShenBian.getId();
        List<SystemUserLevel> listBySystemUsers = systemUserLevelService.getListBySystemUserId(id);
        if(listBySystemUsers.size()==0){
            // 没有权限
            return R.ok(new AnalyticStatisticsDataVo());
        }
        LambdaQueryWrapper<Complaint> wrapper = new LambdaQueryWrapper<Complaint>();
        LambdaQueryWrapper<Complaint> wrapper = new LambdaQueryWrapper<>();
        SystemUserLevel systemUserLevel = listBySystemUsers.stream().filter(e -> e.getLevel() == 1).findFirst().orElse(null);
        if(query.getCityCode()!=null){
            // 判断是否有市级权限
@@ -127,22 +127,28 @@
                List<Long> communityIds=new ArrayList<>();
                // 不是市级 查看是否是区县账号
                List<SystemUserLevel> systemUserLevels2 = listBySystemUsers.stream().filter(e -> e.getLevel() == 2).collect(Collectors.toList());
                if(systemUserLevels2.size()>0){
                if(!systemUserLevels2.isEmpty()){
                    // 区县账号 找出code
                    districtsCodes = systemUserLevels2.stream().map(SystemUserLevel::getDistrictsCode).collect(Collectors.toList());
                }else {
                    districtsCodes.add("0");
                }
                List<SystemUserLevel> systemUserLevels3 = listBySystemUsers.stream().filter(e -> e.getLevel() == 3).collect(Collectors.toList());
                if(systemUserLevels3.size()>0){
                    streetIds = systemUserLevels3.stream().filter(e -> !systemUserLevels2.contains(e.getDistrictsCode())).map(SystemUserLevel::getStreetId).collect(Collectors.toList());
                if(!systemUserLevels3.isEmpty()){
                    // 街道账号 找出id 且不在上面的区县下的街道
                    List<String> finalDistrictsCodes1 = districtsCodes;
                    streetIds = systemUserLevels3.stream().filter(e -> !finalDistrictsCodes1.contains(e.getDistrictsCode())).map(SystemUserLevel::getStreetId).collect(Collectors.toList());
                }else {
                    streetIds.add("0");
                }
                List<SystemUserLevel> systemUserLevels4 = listBySystemUsers.stream().filter(e -> e.getLevel() == 4).collect(Collectors.toList());
                if(systemUserLevels4.size()>0){
                    communityIds = systemUserLevels4.stream().filter(e -> !systemUserLevels3.contains(e.getStreetId()) && !systemUserLevels2.contains(e.getDistrictsCode())).map(SystemUserLevel::getCommunityId).collect(Collectors.toList());
                if(!systemUserLevels4.isEmpty()){
                    // community账号 找出id 且不在上面的街道下的社区
                    List<String> finalStreetIds1 = streetIds;
                    List<String> finalDistrictsCodes2 = districtsCodes;
                    communityIds = systemUserLevels4.stream().filter(e -> !finalStreetIds1.contains(e.getStreetId()) && !finalDistrictsCodes2.contains(e.getDistrictsCode())).map(SystemUserLevel::getCommunityId).collect(Collectors.toList());
                }else {
                    communityIds.add(0L);
                }
@@ -169,7 +175,6 @@
        // 第四部分数据
        AnalyticStatisticsFourVo analyticStatisticsFourVos =complaintService.analyticStatisticsFour(complaints);
        AnalyticStatisticsDataVo analyticStatisticsDataVo = new AnalyticStatisticsDataVo();
        analyticStatisticsDataVo.setAnalyticStatisticsOneVo(analyticStatisticsOneVo);
@@ -203,6 +208,7 @@
            analyticStatisticsRegionVo.setBcRegions(list);
            analyticStatisticsRegionVo.setComStreets(list1);
            analyticStatisticsRegionVo.setComActs(list2);
            return R.ok(analyticStatisticsRegionVo);
        }
@@ -215,13 +221,11 @@
        }
        // 找出这个区县的
        List<BcRegion> list = bcRegionService.list(new LambdaQueryWrapper<BcRegion>().eq(BcRegion::getParentId, 510400).in(BcRegion::getRegionCode, collect));
        // 区县街道
        List<ComStreet> list1 = comStreetService.list(new LambdaQueryWrapper<ComStreet>().in(ComStreet::getAreaCode, collect));
        // 区县社区
        List<ComAct> list2 = comActService.list(new LambdaQueryWrapper<ComAct>().in(ComAct::getAreaCode, collect).eq(ComAct::getState,0));
        // 有街道权限 排除上个查询出来的
        List<SystemUserLevel> systemUserLevels1 = listBySystemUsers.stream().filter(e -> e.getLevel() == 3 && !collect.contains(e.getDistrictsCode())).collect(Collectors.toList());
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/scheduled/ComplaintTasks.java
@@ -4,7 +4,6 @@
import com.panzhihua.common.exceptions.ServiceException;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.service.sangeshenbian.SystemUserService;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.common.utlis.DateUtils;
import com.panzhihua.sangeshenbian.dao.ComplaintAuditRecordMapper;
@@ -94,6 +93,8 @@
            complaintComment.setContent("满意");
            complaintComment.setDelFlag(0);
            complaintCommentService.save(complaintComment);
            complaint.setCommentRate(2);
            complaintService.updateById(complaint);
        }
    }
    
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java
@@ -1635,6 +1635,8 @@
    @Override
    public AnalyticStatisticsFourVo analyticStatisticsFour(List<Complaint> complaints) {
        // 只计算评分了的
        complaints = complaints.stream().filter(e ->e.getCommentRate() != null).collect(Collectors.toList());
        AnalyticStatisticsFourVo vo = new AnalyticStatisticsFourVo();
        // 0:不满意 1:一般 2:满意 3:非常满意
        long count = complaints.stream().filter(e -> e.getCommentRate() != null && e.getCommentRate() == 0).count();