lidongdong
2022-12-06 1433eb7ecf29b5dcb9b9403b8d616c0ff7d6483b
Merge remote-tracking branch 'origin/huacheng_test' into huacheng_test
6个文件已修改
91 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/shop/AddShopFlowerGoodsAttrVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActAcidRecordServiceImpl.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerGoodsServiceImpl.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActAcidRecordMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActEasyPhotoDOMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/shop/AddShopFlowerGoodsAttrVO.java
@@ -18,7 +18,7 @@
public class AddShopFlowerGoodsAttrVO {
    @ApiModelProperty("商品规格Id:编辑必传")
    private Long goodsAttrId;
    private Long id;
    @ApiModelProperty("商品规格")
    private String goodsAttrName;
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActAcidRecordServiceImpl.java
@@ -11,6 +11,7 @@
import com.panzhihua.common.model.dtos.community.acid.BatchCheckAcidRecordDTO;
import com.panzhihua.common.model.dtos.community.acid.ComActAcidRecordDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.StatisticsPhotoVO;
import com.panzhihua.common.model.vos.community.acid.*;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.common.utlis.DateUtils;
@@ -29,6 +30,7 @@
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -622,7 +624,7 @@
            if (0!=all){
                BigDecimal countNum = new BigDecimal(comActAcidColorChartsVO.getCountNum());
                BigDecimal allDecimal = new BigDecimal(all);
                BigDecimal percent = countNum.divide(allDecimal,2, BigDecimal.ROUND_HALF_DOWN);
                BigDecimal percent = countNum.divide(allDecimal,4, BigDecimal.ROUND_HALF_DOWN).multiply(new BigDecimal(100));
                comActAcidColorChartsVO.setPercent(percent);
            }
        }
@@ -646,16 +648,43 @@
                if (0L!=sum) {
                    BigDecimal countNum = new BigDecimal(comActAcidColorChartsVO.getCountNum());
                    BigDecimal sumDecimal = new BigDecimal(sum);
                    BigDecimal percent = countNum.divide(sumDecimal, 2, BigDecimal.ROUND_HALF_DOWN);
                    BigDecimal percent = countNum.divide(sumDecimal, 4, BigDecimal.ROUND_HALF_DOWN).multiply(new BigDecimal(100));
                    comActAcidColorChartsVO.setPercent(percent);
                }
            }
        }
        Map<String, Map<String, ComActAcidColorChartsVO>> chartMap = comActAcidColorChartsVOS1
        Map<String, Map<String, ComActAcidColorChartsVO>> colletMap = comActAcidColorChartsVOS1
                .stream()
                .collect(Collectors.groupingBy(ComActAcidColorChartsVO::getCountName,
                        Collectors.toMap(ComActAcidColorChartsVO::getColorMark, Function.identity())));
        String[] statusArr = {"红码","黄码","绿码"};
        List<String> latest5Month = DateUtils.getLatest12Month(LocalDate.now(), 5);
        for (String month : latest5Month) {
            Map<String, ComActAcidColorChartsVO> map1;
            if(colletMap.containsKey(month)){
                map1 = colletMap.get(month);
            }else {
                map1 = new HashMap<>();
            }
            for (String status : statusArr) {
                if (!map1.containsKey(status)){
                    ComActAcidColorChartsVO comActAcidColorChartsVO = new ComActAcidColorChartsVO();
                    comActAcidColorChartsVO.setCountNum(0);
                    comActAcidColorChartsVO.setCountName(month);
                    comActAcidColorChartsVO.setColorMark(status);
                    comActAcidColorChartsVOS1.add(comActAcidColorChartsVO);
                    map1.put(status,comActAcidColorChartsVO);
                }
            }
            colletMap.put(month,map1);
        }
        Map<String, List<ComActAcidColorChartsVO>> chartMap = comActAcidColorChartsVOS1
                .stream().sorted(Comparator.comparing(ComActAcidColorChartsVO::getCountName))
                .collect(Collectors.groupingBy(ComActAcidColorChartsVO::getColorMark));
        Map<String,Object> retMap = new HashMap<>();
        retMap.put("comActAcidColorChartsVOS",comActAcidColorChartsVOS);
        retMap.put("chartMap",chartMap);
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java
@@ -1104,13 +1104,14 @@
            if (0!=all){
                BigDecimal countNum = new BigDecimal(statisticsPhotoVO.getCountNum());
                BigDecimal allDecimal = new BigDecimal(all);
                BigDecimal percent = countNum.divide(allDecimal,2, BigDecimal.ROUND_HALF_DOWN);
                BigDecimal percent = countNum.divide(allDecimal,4, BigDecimal.ROUND_HALF_DOWN).multiply(new BigDecimal(100));
                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();
@@ -1128,15 +1129,18 @@
                if (0L!=sum) {
                    BigDecimal countNum = new BigDecimal(statisticsPhotoVO.getCountNum());
                    BigDecimal sumDecimal = new BigDecimal(sum);
                    BigDecimal percent = countNum.divide(sumDecimal, 2, BigDecimal.ROUND_HALF_DOWN);
                    BigDecimal percent = countNum.divide(sumDecimal, 4, BigDecimal.ROUND_HALF_DOWN).multiply(new BigDecimal(100));
                    statisticsPhotoVO.setPercent(percent);
                }
            }
        }
        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,13 +1155,23 @@
                    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()
                .sorted(Comparator.comparing(StatisticsPhotoVO::getStatisticsDate))
                .collect(Collectors.groupingBy(StatisticsPhotoVO::getCountName));
        return R.ok();
        Map<String,Object> retMap = new HashMap<>();
        retMap.put("statisticsPhotoVOS",statisticsPhotoVOS);
        retMap.put("monthMap",stringListMap);
        return R.ok(retMap);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerGoodsServiceImpl.java
@@ -2,7 +2,6 @@
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.NumberUtil;
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.metadata.IPage;
@@ -17,7 +16,6 @@
import com.panzhihua.common.model.vos.shop.*;
import com.panzhihua.common.utlis.DifferentLongListUtil;
import com.panzhihua.common.utlis.Snowflake;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.dao.*;
import com.panzhihua.service_community.model.dos.*;
import com.panzhihua.service_community.service.ComShopFlowerGoodsAttrService;
@@ -141,13 +139,11 @@
                ArrayList<AddShopFlowerGoodsAttrVO> goodsAttrVOList = Lists.newArrayList();
                StringBuilder sbr = new StringBuilder();
                int stock = 0;
                int sale = 0;
                for (ComShopFlowerGoodsAttrDO oneGoodsAttrDO : goodsAttrDOs) {
                    AddShopFlowerGoodsAttrVO goodsAttrVO = new AddShopFlowerGoodsAttrVO();
                    BeanUtils.copyProperties(oneGoodsAttrDO, goodsAttrVO);
                    goodsAttrVO.setGoodsAttrId(oneGoodsAttrDO.getId());
                    goodsAttrVO.setId(oneGoodsAttrDO.getId());
                    goodsAttrVOList.add(goodsAttrVO);
                    sale = sale + oneGoodsAttrDO.getSale();
                    stock = stock +oneGoodsAttrDO.getStock();
                    sbr.append(oneGoodsAttrDO.getGoodsAttrName()).append(" ");
                }
@@ -161,7 +157,6 @@
                String categoryNames = convenientGoodsCategoryDAO.selectCategoryScopeByGoodsId(shopGoods.getId());
                shopGoods.setCategoryName(categoryNames);
                shopGoods.setStock(stock);
                shopGoods.setSale(sale);
            });
        }
        return R.ok(comShopStoreVOIPage);
@@ -286,7 +281,7 @@
        } else {
            List<Long> attrIds =
                    comShopFlowerGoodsAttrDOS.stream().map(ComShopFlowerGoodsAttrDO::getId).collect(Collectors.toList());
            List<Long> voAttrIds = addShopFlowerGoodsVO.getGoodsAttrVOList().stream().map(AddShopFlowerGoodsAttrVO::getGoodsAttrId)
            List<Long> voAttrIds = addShopFlowerGoodsVO.getGoodsAttrVOList().stream().map(AddShopFlowerGoodsAttrVO::getId)
                    .collect(Collectors.toList());
            // 需要删除的规格ID——针对编辑时删除了规格的情况
            List<Long> deleteIds = DifferentLongListUtil.getDiffrent(attrIds, voAttrIds);
@@ -294,7 +289,7 @@
                shopFlowerGoodsAttrDAO.deleteBatchIds(deleteIds);
            }
            addShopFlowerGoodsVO.getGoodsAttrVOList().forEach(goodsAttr -> {
                ComShopFlowerGoodsAttrDO comShopGoodsAttrDO = shopFlowerGoodsAttrDAO.selectById(goodsAttr.getGoodsAttrId());
                ComShopFlowerGoodsAttrDO comShopGoodsAttrDO = shopFlowerGoodsAttrDAO.selectById(goodsAttr.getId());
                if (comShopGoodsAttrDO != null) {
                    comShopGoodsAttrDO.setPrice(goodsAttr.getPrice());
                    comShopGoodsAttrDO.setCollatePrice(goodsAttr.getCollatePrice());
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActAcidRecordMapper.xml
@@ -441,7 +441,7 @@
    <select id="selectColorMarkGroupByMonth"
            resultType="com.panzhihua.common.model.vos.community.acid.ComActAcidColorChartsVO">
        SELECT COUNT(1) count_num,date_format(create_time,'%Y-%m')   as count_name,color_mark FROM `com_act_acid_record`
        WHERE date_format(create_time,'%Y-%m') >= date_format(date_sub(now(), INTERVAL 5 MONTH),'%Y-%m') GROUP BY  count_name,color_mark
        WHERE date_format(create_time,'%Y-%m') >= date_format(date_sub(now(), INTERVAL 4 MONTH),'%Y-%m') GROUP BY  count_name,color_mark
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActEasyPhotoDOMapper.xml
@@ -69,7 +69,8 @@
            p.examine_at,
            c.name  communityName,
            p.urban_status,
            p.transfer_reason
            p.transfer_reason,
        p.handle_status
        FROM
            com_act_easy_photo p
            LEFT JOIN sys_user u ON p.sponsor_id = u.user_id
@@ -518,7 +519,8 @@
        p.img_width,
        p.img_height,
        p.examine_at,
        f.id AS fid
        f.id AS fid,
        p.handle_status
        FROM
        com_act_easy_photo p
        JOIN sys_user u ON p.sponsor_id = u.user_id
@@ -610,13 +612,14 @@
    <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
        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 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 9 MONTH),'%Y-%m') and del_tag = 0 GROUP BY  statistics_date, `status`
    </select>
</mapper>