Merge remote-tracking branch 'origin/huacheng_test' into huacheng_test
| | |
| | | public class AddShopFlowerGoodsAttrVO { |
| | | |
| | | @ApiModelProperty("商品规格Id:编辑必传") |
| | | private Long goodsAttrId; |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("商品规格") |
| | | private String goodsAttrName; |
| | |
| | | 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; |
| | |
| | | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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); |
| | |
| | | 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(); |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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(" "); |
| | | } |
| | |
| | | String categoryNames = convenientGoodsCategoryDAO.selectCategoryScopeByGoodsId(shopGoods.getId()); |
| | | shopGoods.setCategoryName(categoryNames); |
| | | shopGoods.setStock(stock); |
| | | shopGoods.setSale(sale); |
| | | }); |
| | | } |
| | | return R.ok(comShopStoreVOIPage); |
| | |
| | | } 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); |
| | |
| | | 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()); |
| | |
| | | <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> |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | <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> |