From c1b67dd00934b110c8563fd8ad13267a43f18c1f Mon Sep 17 00:00:00 2001 From: yanghui <2536613402@qq.com> Date: 星期二, 06 十二月 2022 14:03:44 +0800 Subject: [PATCH] #feat ,, --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActEasyPhotoDOMapper.xml | 5 +++-- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java | 19 +++++++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java index ce4b094..637855c 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java @@ -1108,9 +1108,10 @@ statisticsPhotoVO.setPercent(percent); } } - Map<String, StatisticsPhotoVO> circleMap = statisticsPhotoVOS - .stream() - .collect(Collectors.toMap(StatisticsPhotoVO::getCountName, Function.identity())); +// Map<String, StatisticsPhotoVO> circleMap = statisticsPhotoVOS +// .stream() +// .collect(Collectors.toMap(StatisticsPhotoVO::getCountName, Function.identity())); + //按月份查询 List<StatisticsPhotoVO> statisticsPhotoVOS1 = this.baseMapper.selectPhotoByMonth(); @@ -1135,8 +1136,11 @@ } Map<String, Map<String, StatisticsPhotoVO>> chartMap = statisticsPhotoVOS1.stream().collect(Collectors.groupingBy(StatisticsPhotoVO::getStatisticsDate, Collectors.toMap(StatisticsPhotoVO::getCountName, Function.identity()))); + + + // 状态 1待处理 2进行中 3已驳回 4待评价 5.已完成 - String[] statusArr = {"dcl","jxz","ybh","dpj","ywc"}; + String[] statusArr = {"待处理","进行中","已驳回","待评价","已完成"}; List<String> latest12Month = DateUtils.getLatest12Month(LocalDate.now(), 10); for (String month : latest12Month) { Map<String, StatisticsPhotoVO> map1; @@ -1151,11 +1155,18 @@ statisticsPhotoVO.setCountNum(0); statisticsPhotoVO.setStatisticsDate(month); statisticsPhotoVO.setCountName(status); + statisticsPhotoVOS1.add(statisticsPhotoVO); map1.put(status,statisticsPhotoVO); } } chartMap.put(month,map1); } + Map<String, List<StatisticsPhotoVO>> stringListMap = statisticsPhotoVOS1.stream().collect(Collectors.groupingBy(StatisticsPhotoVO::getCountName)); + + + Map<String,Object> retMap = new HashMap<>(); + retMap.put("statisticsPhotoVOS",statisticsPhotoVOS); + retMap.put("monthMap",stringListMap); return R.ok(); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActEasyPhotoDOMapper.xml b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActEasyPhotoDOMapper.xml index c3c88a5..42b3cfd 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActEasyPhotoDOMapper.xml +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActEasyPhotoDOMapper.xml @@ -610,12 +610,13 @@ <select id="getBanner" resultType="com.panzhihua.common.model.vos.community.easyPhoto.BannerVO"> select * from com_act_dyn where type=1 AND on_top=1 </select> + <select id="selectPhotoAll" resultType="com.panzhihua.common.model.vos.community.StatisticsPhotoVO"> - SELECT count(1) count_num,(case `status` when 1 THEN 'dcl' WHEN 2 THEN 'jxz' WHEN 3 THEN 'ybh' WHEN 4 THEN 'dpj' WHEN 5 THEN 'ywc' ELSE 'qt' END) count_name + SELECT count(1) count_num,(case `status` when 1 THEN '待处理' WHEN 2 THEN '进行中' WHEN 3 THEN '已驳回' WHEN 4 THEN '待评价' WHEN 5 THEN '已完成' ELSE '其他' END) count_name FROM `com_act_easy_photo` where del_tag = 0 GROUP BY `status` </select> <select id="selectPhotoByMonth" resultType="com.panzhihua.common.model.vos.community.StatisticsPhotoVO"> - SELECT count(1) count_num,(case `status` when 1 THEN 'dcl' WHEN 2 THEN 'jxz' WHEN 3 THEN 'ybh' WHEN 4 THEN 'dpj' WHEN 5 THEN 'ywc' ELSE 'qt' END) count_name,date_format(create_at,'%Y-%m') as statistics_date + SELECT count(1) count_num,(case `status` when 1 THEN '待处理' WHEN 2 THEN '进行中' WHEN 3 THEN '已驳回' WHEN 4 THEN '待评价' WHEN 5 THEN '已完成' ELSE '其他' END) count_name,date_format(create_at,'%Y-%m') as statistics_date FROM `com_act_easy_photo` WHERE date_format(create_at,'%Y-%m') >= date_format(date_sub(now(), INTERVAL 10 MONTH),'%Y-%m') and del_tag = 0 GROUP BY statistics_date, `status` </select> -- Gitblit v1.7.1