| | |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.convenient.PageConvenientServiceCategoryDTO; |
| | | import com.panzhihua.common.model.dtos.shop.*; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientElevatingPointVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientServiceCategoryVO; |
| | | import com.panzhihua.common.model.vos.shop.*; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | |
| | | */ |
| | | @ApiOperation(value = "查询我的店铺各类统计数据") |
| | | @GetMapping("/selectCountByStoreId") |
| | | public R selectCountByStoreId(Long storeId){ |
| | | return communityService.selectCountByStoreId(storeId); |
| | | public R selectCountByUserId(Long storeId){ |
| | | return communityService.selectCountByUserId(storeId); |
| | | } |
| | | |
| | | |
| | |
| | | return communityService.selectCountGroupStatus(storeId); |
| | | } |
| | | |
| | | @ApiOperation(value = "商品分类") |
| | | @GetMapping("/goodsCategory/getAllGoodsCategories") |
| | | public R getAllGoodsCategories() { |
| | | return communityService.getAllGoodsCategories(); |
| | | } |
| | | @ApiOperation(value = "分页查询便民服务分类", response = ConvenientServiceCategoryVO.class) |
| | | @PostMapping("/service-category/page") |
| | | public R pageServiceCategory(@RequestBody PageConvenientServiceCategoryDTO pageConvenientServiceCategoryDTO) { |
| | | pageConvenientServiceCategoryDTO.setAreaCode(this.getAreaCode()); |
| | | return communityService.pageServiceCategory(pageConvenientServiceCategoryDTO); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("服务范围") |
| | | private Integer serviceRange; |
| | | |
| | | @ApiModelProperty("微信手机号") |
| | | private String mobilePhone; |
| | | |
| | | @ApiModelProperty("详细地址") |
| | | private String detailedAddress; |
| | | |
| | | public String getPeriod() { |
| | | return period.name(); |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "购物车记录id集合(当提交类型为2时,此字段必填)") |
| | | private List<Long> cartIds; |
| | | /** |
| | | * 配送方式(1.自提 2.快递) |
| | | */ |
| | | @ApiModelProperty(value = "配送方式(1.自提 2.快递)") |
| | | private Integer deliveryType; |
| | | |
| | | /** |
| | | * 提交类型(1.商品详情提交 2.购物车提交) |
| | |
| | | @ApiModelProperty("店铺销售额") |
| | | private BigDecimal saleVolume; |
| | | |
| | | @ApiModelProperty("详细地址") |
| | | private String detailedAddress; |
| | | |
| | | @ApiModelProperty("商家评分") |
| | | private BigDecimal score; |
| | | |
| | | public void setPeriod(String period) { |
| | | this.period = MerchantBusinessPeriod.valueOf(period); |
| | | } |
| | |
| | | * 配送方式(1.商家配送 2.快递物流) |
| | | */ |
| | | @ApiModelProperty(value = "配送方式(1.自提 2.快递)") |
| | | private Integer deliveryType; |
| | | private String deliveryType; |
| | | |
| | | @ApiModelProperty("商品规格") |
| | | @Valid |
| | |
| | | * 配送方式(1.商家配送 2.快递物流) |
| | | */ |
| | | @ApiModelProperty("配送方式(1.商家配送 2.快递物流)") |
| | | private Integer deliveryType; |
| | | private String deliveryType; |
| | | |
| | | /** |
| | | * 商品规格列表 |
| | |
| | | /** |
| | | * 统计查询订单数量 |
| | | * @param deliveryType |
| | | * @param storeId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/shopFlower/selectCountByDeliveryType") |
| | | R selectCountByDeliveryType(@RequestParam("deliveryType") Integer deliveryType,@RequestParam("storeId") Long storeId); |
| | | R selectCountByDeliveryType(@RequestParam("deliveryType") Integer deliveryType,@RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 查询我的店铺各类统计数据 |
| | | * @param storeId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/shopFlower/selectCountByStoreId") |
| | | R selectCountByStoreId(Long storeId); |
| | | @GetMapping("/shopFlower/selectCountByUserId") |
| | | R selectCountByUserId(@RequestParam("userId") Long userId); |
| | | |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "统计查询订单数量") |
| | | @GetMapping("/order/selectCountByDeliveryType") |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "deliveryType", value = "1.自提 2.快递"), |
| | | @ApiImplicitParam(name = "storeId", value = "商店id")}) |
| | | public R selectCountByDeliveryType(Integer deliveryType,Long storeId){ |
| | | return communityService.selectCountByDeliveryType(deliveryType,storeId); |
| | | @ApiImplicitParam(name = "userId", value = "商店用户id")}) |
| | | public R selectCountByDeliveryType(Integer deliveryType,Long userId){ |
| | | return communityService.selectCountByDeliveryType(deliveryType,userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "商家查询 订单_分页列表", response = ComShopOrderSearchVO.class) |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/selectCountByDeliveryType") |
| | | public R selectCountByDeliveryType(@RequestParam("deliveryType") Integer deliveryType,@RequestParam("storeId") Long storeId){ |
| | | return comShopFlowerOrderService.selectCountByDeliveryType(deliveryType,storeId); |
| | | public R selectCountByDeliveryType(@RequestParam("deliveryType") Integer deliveryType,@RequestParam("userId") Long userId){ |
| | | return comShopFlowerOrderService.selectCountByDeliveryType(deliveryType,userId); |
| | | } |
| | | |
| | | /** |
| | | * 查询我的店铺各类统计数据 |
| | | * @param storeId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/selectCountByStoreId") |
| | | public R selectCountByStoreId(Long storeId){ |
| | | return comShopFlowerOrderService.selectCountByStoreId(storeId); |
| | | @GetMapping("/selectCountByUserId") |
| | | public R selectCountByUserId(@RequestParam("userId") Long userId){ |
| | | return comShopFlowerOrderService.selectCountByUserId(userId); |
| | | } |
| | | |
| | | /** |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | ComShopFlowerEvaluateVO selectByOrderNo(@Param("orderNo") String orderNo); |
| | | |
| | | |
| | | /** |
| | | * 统计商家评分 |
| | | * @param storeId |
| | | * @return |
| | | */ |
| | | BigDecimal statisticsScore(@Param("storeId") Long storeId); |
| | | } |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.panzhihua.service_community.model.dos.ComShopFlowerOrderPayDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | |
| | | @Mapper |
| | | public interface ComShopFlowerOrderPayDAO extends BaseMapper<ComShopFlowerOrderPayDO> { |
| | | |
| | | |
| | | } |
| | |
| | | /** |
| | | * 配送方式(1.自提 2.快递) |
| | | */ |
| | | private Integer deliveryType; |
| | | private String deliveryType; |
| | | |
| | | /** |
| | | * 删除状态(1.未删除 2.已删除) |
| | |
| | | * 商家地址 |
| | | */ |
| | | private String address; |
| | | |
| | | /** |
| | | * 详细地址 |
| | | */ |
| | | private String detailedAddress; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | |
| | | * @param deliveryType |
| | | * @return |
| | | */ |
| | | R selectCountByDeliveryType(Integer deliveryType,Long storeId); |
| | | R selectCountByDeliveryType(Integer deliveryType,Long userId); |
| | | |
| | | /** |
| | | * 查询我的店铺各类统计数据 |
| | | * @param storeId |
| | | * @return |
| | | */ |
| | | R selectCountByStoreId(Long storeId); |
| | | R selectCountByUserId(Long storeId); |
| | | } |
| | |
| | | // 生成订单号 |
| | | String orderNo = OrderNoUtils.NextOrderNo(userId); |
| | | // 配送方式 |
| | | Integer deliveryType = 0; |
| | | Integer deliveryType = 1; |
| | | // 订单总金额 |
| | | BigDecimal orderTotal = BigDecimal.ZERO; |
| | | // 创建订单商品信息 |
| | |
| | | continue; |
| | | } |
| | | storeId = goodsDO.getStoreId(); |
| | | deliveryType = goodsDO.getDeliveryType(); |
| | | deliveryType = orderCreateDTO.getDeliveryType(); |
| | | ComShopFlowerOrderGoodsDO orderGoodsDO = new ComShopFlowerOrderGoodsDO(); |
| | | orderGoodsDO.setGoodsId(goodsDO.getId()); |
| | | orderGoodsDO.setGoodsName(goodsDO.getName()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R selectCountByDeliveryType(Integer deliveryType,Long storeId) { |
| | | public R selectCountByDeliveryType(Integer deliveryType,Long userId) { |
| | | //1.等待配送 2.配送中 3.待收货 4.待评价 5.已完成 6.已取消 7.已退款 8.总订单 |
| | | String[] statusStr = {"ddps","psz","dsh","dpj","ywc","yqx","ytk"}; |
| | | List<ComShopOrderCountVO> comShopOrderCountVOS = this.baseMapper.selectCountByDeliveryType(deliveryType,storeId); |
| | | ConvenientMerchantVO convenientMerchantVO = convenientMerchantDAO.selectMerchantByUserId(userId); |
| | | List<ComShopOrderCountVO> comShopOrderCountVOS = this.baseMapper.selectCountByDeliveryType(deliveryType,convenientMerchantVO.getId()); |
| | | Map<Integer, Integer> collect = comShopOrderCountVOS.stream().collect(Collectors.toMap(ComShopOrderCountVO::getStatus, ComShopOrderCountVO::getAmount)); |
| | | Map<String,Integer> retMap = new HashMap<>(); |
| | | int amountTotal = 0; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R selectCountByStoreId(Long storeId){ |
| | | public R selectCountByUserId(Long userId){ |
| | | ConvenientMerchantVO convenientMerchantVO = convenientMerchantDAO.selectMerchantByUserId(userId); |
| | | Long storeId = convenientMerchantVO.getId(); |
| | | Map<String,Object> retMap = new HashMap<>(); |
| | | //查询我的店铺订单量 |
| | | List<ComShopOrderStoreIdCountVO> comShopOrderStoreIdCountVOS = this.baseMapper.selectCountByStoreId(storeId, null); |
| | |
| | | retMap.put("kddd",kdddMap); |
| | | |
| | | //拼单订单各状态 |
| | | R r = this.selectCountByDeliveryType(ComShopFlowerOrderDO.deliveryType.store,storeId); |
| | | R r = this.selectCountByDeliveryType(ComShopFlowerOrderDO.deliveryType.store,userId); |
| | | retMap.put("pdddStatus",r.getData()); |
| | | |
| | | //快递订单各状态 |
| | | R r1 = this.selectCountByDeliveryType(ComShopFlowerOrderDO.deliveryType.express,storeId); |
| | | R r1 = this.selectCountByDeliveryType(ComShopFlowerOrderDO.deliveryType.express,userId); |
| | | retMap.put("kdddStatus",r1.getData()); |
| | | //营业额 |
| | | List<ComShopOrderStoreIdCountVO> comShopOrderStoreIdCountVOS3 = this.baseMapper.selectSumAmountByStoreId(storeId); |
| | |
| | | // orderPayDO.setWxTradeNo(wxPayNotifyOrderDTO.getWxTradeNo()); |
| | | orderPayDO.setPayStatus(ComShopFlowerOrderPayDO.payStatus.yes); |
| | | orderPayDO.setRefundStatus(ComShopFlowerOrderPayDO.refundStatus.tkcg); |
| | | //更新订单状态 |
| | | comShopFlowerOrderDO.setStatus(ComShopFlowerOrderDO.status.ytk); |
| | | comShopFlowerOrderDAO.updateById(comShopFlowerOrderDO); |
| | | }else { |
| | | //退款失败 |
| | | comShopFlowerRefundOrderDO.setStatus(ComShopFlowerRefundOrderDO.status.tksb); |
| | |
| | | import static java.util.Objects.nonNull; |
| | | import static org.apache.commons.lang3.StringUtils.isNotBlank; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.hutool.core.util.NumberUtil; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientViewStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.convenient.ExportMerchantVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | | import com.panzhihua.service_community.dao.ConvenientConsultationStatisticsDAO; |
| | | import com.panzhihua.service_community.dao.ConvenientMerchantDAO; |
| | | import com.panzhihua.service_community.dao.ConvenientProductDAO; |
| | | import com.panzhihua.service_community.dao.ConvenientServiceCategoryDAO; |
| | | import com.panzhihua.service_community.dao.ConvenientViewStatisticsDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActDO; |
| | | import com.panzhihua.service_community.model.dos.ConvenientConsultationStatisticsDO; |
| | | import com.panzhihua.service_community.model.dos.ConvenientMerchantDO; |
| | |
| | | private ConvenientConsultationStatisticsDAO convenientConsultationStatisticsDAO; |
| | | @Resource |
| | | private ConvenientViewStatisticsDAO convenientViewStatisticsDAO; |
| | | @Resource |
| | | private ComShopFlowerEvaluateDAO comShopFlowerEvaluateDAO; |
| | | |
| | | private static final String DQ="510402"; |
| | | private static final String RHQ="510411"; |
| | |
| | | List<Long> serviceIds = convenientServiceCategoryDAO.selectServiceIdsForMerchant(convenientMerchantVO.getId()); |
| | | convenientMerchantVO.setServiceIds(serviceIds); |
| | | } |
| | | BigDecimal score = comShopFlowerEvaluateDAO.statisticsScore(convenientMerchantVO.getId()); |
| | | convenientMerchantVO.setScore(null==score ?BigDecimal.ZERO: NumberUtil.round(score, 1)); |
| | | return R.ok(convenientMerchantVO); |
| | | } |
| | | } |
| | |
| | | <select id="selectByOrderNo" resultType="com.panzhihua.common.model.vos.shop.ComShopFlowerEvaluateVO"> |
| | | SELECT * FROM com_shop_flower_evaluate WHERE order_no = #{orderNo} |
| | | </select> |
| | | <select id="statisticsScore" resultType="java.math.BigDecimal"> |
| | | SELECT (sum(e.evaluate_type)/count(1)) AS pf FROM `com_shop_flower_evaluate` e LEFT JOIN com_shop_flower_goods g ON e.goods_id = g.id WHERE g.store_id = #{storeId} GROUP BY g.store_id |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <if test='comShopFlowerGoodsDTO.status != null '>AND csg.`status` = #{comShopFlowerGoodsDTO.status}</if> |
| | | <if test='comShopFlowerGoodsDTO.storeId != null '>AND csg.store_id = #{comShopFlowerGoodsDTO.storeId}</if> |
| | | <if test='comShopFlowerGoodsDTO.status != null '>AND csg.status = #{comShopFlowerGoodsDTO.status}</if> |
| | | <if test='comShopFlowerGoodsDTO.deliveryType != null '>AND csg.delivery_type = #{comShopFlowerGoodsDTO.deliveryType}</if> |
| | | <if test='comShopFlowerGoodsDTO.deliveryType != null '>AND csg.delivery_type like concat('%',#{comShopFlowerGoodsDTO.deliveryType},'%' </if> |
| | | <if test='comShopFlowerGoodsDTO.categoriesId != null '>AND cgs.goods_category_id = #{comShopFlowerGoodsDTO.categoriesId}</if> |
| | | order by sale desc,create_at desc |
| | | </select> |
| | |
| | | id, order_no, pay_no, wx_trade_no, pay_status, order_amount, pay_amount, pay_time, |
| | | create_at, update_at |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | <id column="id_card" property="idCard" /> |
| | | <id column="phone" property="phone" /> |
| | | <id column="address" property="address" /> |
| | | <id column="address" property="address" /> |
| | | <id column="detailed_address" property="detailedAddress" /> |
| | | <id column="lat" property="lat" /> |
| | | <id column="lon" property="lon" /> |
| | | <id column="begin_at" property="beginAt" /> |
| | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id,`name`,community_id,community_name,logo,contacts,id_card,phone,address,lat,lon,begin_at,end_at,period,introduction, |
| | | business_status,user_id,consultation_volume,is_del,created_at,created_by,updated_at,updated_by,area_code,service_range,mobile_phone |
| | | business_status,user_id,consultation_volume,is_del,created_at,created_by,updated_at,updated_by,area_code,service_range,mobile_phone,detailed_address |
| | | </sql> |
| | | <select id="pageMerchant" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO"> |
| | | SELECT ccm.*, su.account, su.status AS accountStatus, GROUP_CONCAT(ccss.service_name) AS serviceScope |
| | |
| | | </select> |
| | | <select id="getMerchantDetail" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO"> |
| | | SELECT |
| | | temp.id, temp.name, temp.introduction, temp.logo, temp.phone, temp.begin_at, temp.end_at, temp.period, |
| | | temp.id, temp.name, temp.introduction, temp.logo, temp.phone, temp.begin_at, temp.end_at, temp.period,temp.detailed_address, |
| | | temp.address, temp.lat, temp.lon, temp.serviceScope, IF(SUM(temp.consultation_volume) is null,0,SUM(temp.consultation_volume)) as monthConsultationVolume |
| | | FROM ( |
| | | SELECT |
| | | ccm.id, ccm.name, ccm.introduction, ccm.logo, ccm.phone, ccm.begin_at, ccm.end_at, ccm.period, |
| | | ccm.id, ccm.name, ccm.introduction, ccm.logo, ccm.phone, ccm.begin_at, ccm.end_at, ccm.period,ccm.detailed_address, |
| | | ccm.address, ccm.lat, ccm.lon, cccs.consultation_volume,GROUP_CONCAT(ccss.service_name) AS serviceScope |
| | | FROM com_convenient_merchants ccm |
| | | LEFT JOIN (SELECT * FROM com_convenient_consultation_statistics WHERE statistic_date LIKE #{currentMon}) cccs ON ccm.id = cccs.merchant_id |
| | |
| | | </select> |
| | | <select id="pageSearchMerchant" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO"> |
| | | SELECT |
| | | temp.id, temp.name, temp.introduction, temp.logo, |
| | | temp.id, temp.name, temp.introduction, temp.logo,temp.detailed_address, |
| | | temp.serviceScope, IF(SUM(temp.consultation_volume) is null,0,SUM(temp.consultation_volume)) as monthConsultationVolume |
| | | FROM ( |
| | | SELECT |
| | | ccm.id, ccm.name, ccm.introduction, ccm.logo, |
| | | ccm.id, ccm.name, ccm.introduction, ccm.logo,ccm.detailed_address, |
| | | cccs.consultation_volume,GROUP_CONCAT(ccss.service_name) AS serviceScope |
| | | FROM com_convenient_merchants ccm |
| | | LEFT JOIN (SELECT * FROM com_convenient_consultation_statistics WHERE statistic_date LIKE #{currentMon}) cccs ON ccm.id = cccs.merchant_id |
| | |
| | | ccm.name LIKE CONCAT('%', #{exportMerchantDTO.keyword}, '%') |
| | | OR ccm.address LIKE CONCAT('%', #{exportMerchantDTO.keyword}, '%') |
| | | OR ccm.phone LIKE CONCAT('%', #{exportMerchantDTO.keyword}, '%') |
| | | OR ccm.detailed_address LIKE CONCAT('%', #{exportMerchantDTO.keyword}, '%') |
| | | ) |
| | | </if> |
| | | GROUP BY ccm.id |