| | |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientElevatingPointVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientGoodsCategoryVO; |
| | | import com.panzhihua.common.utlis.MimeTypeUtils; |
| | | import io.swagger.annotations.*; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import static com.panzhihua.common.utlis.FileTypeUploadUtils.assertAllowed; |
| | |
| | | */ |
| | | @GetMapping("/merchant/selectOrderLineChart") |
| | | @ApiOperation(value = "统计时间区域的订单量 15天 30天 一年") |
| | | public R selectOrderLineChart(@RequestParam("storeId") Long storeId,@RequestParam("type") Integer type){ |
| | | return communityService.selectOrderLineChart(storeId,type); |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "storeId", value = "商家id"), |
| | | @ApiImplicitParam(name = "type", value = "类型 1.近15天 2.近30天 3.今年"), |
| | | @ApiImplicitParam(name = "tab", value = "tab 1.订单量 2.营业收入")}) |
| | | public R selectOrderLineChart(@RequestParam("storeId") Long storeId,@RequestParam("type") Integer type,@RequestParam("tab") Integer tab){ |
| | | return communityService.selectOrderLineChart(storeId,type,tab); |
| | | } |
| | | } |
| | |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @GetMapping("/shopFlower/selectOrderLineChart") R selectOrderLineChart(@RequestParam("storeId") Long storeId,@RequestParam("type") Integer type); |
| | | @GetMapping("/shopFlower/selectOrderLineChart") R selectOrderLineChart(@RequestParam("storeId") Long storeId,@RequestParam("type") Integer type,@RequestParam("tab") Integer tab); |
| | | } |
| | |
| | | */ |
| | | @GetMapping("selectOrderLineChart") |
| | | @ApiOperation(value = "商家后台-统计时间区域的订单量 15天 30天 一年") |
| | | public R selectOrderLineChart(@RequestParam("storeId") Long storeId,@RequestParam("type") Integer type){ |
| | | return communityService.selectOrderLineChart(storeId,type); |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "storeId", value = "商家id"), |
| | | @ApiImplicitParam(name = "type", value = "类型 1.近15天 2.近30天 3.今年"), |
| | | @ApiImplicitParam(name = "tab", value = "tab 1.订单量 2.营业收入")}) |
| | | public R selectOrderLineChart(@RequestParam("storeId") Long storeId,@RequestParam("type") Integer type,@RequestParam("tab") Integer tab){ |
| | | return communityService.selectOrderLineChart(storeId,type,tab); |
| | | } |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("selectOrderLineChart") |
| | | public R selectOrderLineChart(@RequestParam("storeId") Long storeId,@RequestParam("type") Integer type){ |
| | | return comShopFlowerOrderService.selectOrderLineChart(storeId,type); |
| | | public R selectOrderLineChart(@RequestParam("storeId") Long storeId,@RequestParam("type") Integer type,@RequestParam("tab") Integer tab){ |
| | | return comShopFlowerOrderService.selectOrderLineChart(storeId,type,tab); |
| | | } |
| | | |
| | | /** |
| | |
| | | List<ComShopOrderStoreIdCountVO> selectCountOrderMonthByStoreId(@Param("storeId") Long storeId); |
| | | |
| | | IPage<ComShopFlowerOrderStoreListVO> pageOrderByDeliveryNo(@Param("page") Page page, @Param("comOrderListDTO") PageComFlowerOrderListDTO comOrderListDTO); |
| | | |
| | | /** |
| | | * 查询近n天的营收 |
| | | * |
| | | * @param storeId |
| | | * @return |
| | | */ |
| | | List<ComShopOrderStoreIdNumVO> selectOrderSumPayDayByStoreId(@Param("storeId") Long storeId, @Param("days") Integer days); |
| | | |
| | | /** |
| | | * 查询当年月份的营收 |
| | | * |
| | | * @param storeId |
| | | * @return |
| | | */ |
| | | List<ComShopOrderStoreIdNumVO> selectOrderSumMonthByStoreId(@Param("storeId") Long storeId); |
| | | } |
| | |
| | | * 统计时间区域的订单量 15天 30天 一年 |
| | | * @param storeId |
| | | * @param type |
| | | * @param tab |
| | | * @return |
| | | */ |
| | | R selectOrderLineChart(Long storeId,Integer type); |
| | | R selectOrderLineChart(Long storeId,Integer type,Integer tab); |
| | | |
| | | /** |
| | | * 清点商品 确认送达详情 |
| | |
| | | return R.ok(retMap); |
| | | } |
| | | |
| | | public R selectOrderLineChart(Long storeId, Integer type) { |
| | | public R selectOrderLineChart(Long storeId, Integer type,Integer tab) { |
| | | if (tab == 1){ |
| | | if (1 == type) { |
| | | //近15天的订单量 |
| | | int days = 15; |
| | |
| | | } |
| | | return R.ok(retMap); |
| | | } |
| | | }else if (2==tab){ |
| | | if (1 == type) { |
| | | //近15天的营收 |
| | | int days = 15; |
| | | return getSumByStoreIdAndDays(storeId, days); |
| | | } else if (2 == type) { |
| | | //近30天的营收 |
| | | int days = 30; |
| | | return getSumByStoreIdAndDays(storeId, days); |
| | | } else { |
| | | //今年所有月份订单量 |
| | | List<ComShopOrderStoreIdNumVO> comShopOrderStoreIdCountVOS = this.baseMapper.selectOrderSumMonthByStoreId(storeId); |
| | | Map<String, BigDecimal> retMap = comShopOrderStoreIdCountVOS.stream().collect(Collectors.toMap(ComShopOrderStoreIdNumVO::getCountName, ComShopOrderStoreIdNumVO::getCountNum)); |
| | | List<String> yearMonths = DateUtils.getYearMonths(); |
| | | for (String yearMonth : yearMonths) { |
| | | if (!retMap.containsKey(yearMonth)) { |
| | | retMap.put(yearMonth, BigDecimal.ZERO); |
| | | } |
| | | } |
| | | return R.ok(retMap); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | private R getCountByStoreIdAndDays(Long storeId, int days) { |
| | |
| | | return R.ok(retMap); |
| | | } |
| | | |
| | | private R getSumByStoreIdAndDays(Long storeId, int days) { |
| | | List<ComShopOrderStoreIdNumVO> comShopOrderStoreIdNumVOS = this.baseMapper.selectOrderSumPayDayByStoreId(storeId, days); |
| | | Map<String, BigDecimal> retMap = comShopOrderStoreIdNumVOS.stream().collect(Collectors.toMap(ComShopOrderStoreIdNumVO::getCountName, ComShopOrderStoreIdNumVO::getCountNum)); |
| | | List<String> beforeDays = DateUtils.getBeforeDays(days); |
| | | for (String beforeDay : beforeDays) { |
| | | if (!retMap.containsKey(beforeDay)) { |
| | | retMap.put(beforeDay, BigDecimal.ZERO); |
| | | } |
| | | } |
| | | return R.ok(retMap); |
| | | } |
| | | |
| | | @Override |
| | | public R pageOrderByDeliveryNo(PageComFlowerOrderListDTO pageComFlowerOrderListDTO) { |
| | | Page page = new Page(pageComFlowerOrderListDTO.getPageNum(), pageComFlowerOrderListDTO.getPageSize()); |
| | |
| | | SELECT count(1) count_num, date_format(create_at,'%Y-%m') as count_name FROM com_shop_flower_order |
| | | WHERE date_format(create_at,'%Y-%m') >= date_format(now(),'%Y-01') and store_id = #{storeId} GROUP BY count_name |
| | | </select> |
| | | <select id="selectOrderSumPayDayByStoreId" |
| | | resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdNumVO"> |
| | | SELECT IFNULL(sum(pay_amount),0) count_num, date_format(create_at,'%Y-%m-%d') as count_name FROM com_shop_flower_order |
| | | WHERE date_format(create_at,'%Y-%m-%d') >= date_format(date_sub(now(), INTERVAL #{days} DAY),'%Y-%m-%d') |
| | | and store_id = #{storeId} and `status` not in (6,7) |
| | | GROUP BY count_name |
| | | </select> |
| | | <select id="selectOrderSumMonthByStoreId" |
| | | resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdNumVO"> |
| | | SELECT IFNULL(sum(pay_amount),0) count_num, date_format(create_at,'%Y-%m') as count_name FROM com_shop_flower_order |
| | | WHERE date_format(create_at,'%Y-%m') >= date_format(now(),'%Y-01') and store_id = #{storeId} and `status` not in (6,7) GROUP BY count_name |
| | | </select> |
| | | |
| | | |
| | | </mapper> |