| | |
| | | @TableField("server_point") |
| | | private Integer serverPoint; |
| | | |
| | | @ApiModelProperty(value = "下级门店返佣积分") |
| | | @TableField("lower_level_rebate_points") |
| | | private Integer lowerLevelRebatePoints; |
| | | |
| | | @ApiModelProperty(value = "门店已用积分") |
| | | @TableField("use_point") |
| | | private Integer usePoint; |
| | |
| | | import com.ruoyi.account.api.model.UserCancellationLog; |
| | | import com.ruoyi.account.api.model.UserCoupon; |
| | | import com.ruoyi.account.api.model.UserSignRecord; |
| | | import com.ruoyi.account.mapper.AppUserMapper; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.UserCancellationLogService; |
| | | import com.ruoyi.account.service.UserCouponService; |
| | |
| | | private UserPointService userPointService; |
| | | @Resource |
| | | private VipSettingService vipSettingService; |
| | | @Resource |
| | | private AppUserMapper appUserMapper; |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | return R.ok(appUser); |
| | | } |
| | | |
| | | /** |
| | | * 用户统计 |
| | | */ |
| | | @GetMapping("/statistics") |
| | | @ApiOperation(value = "用户统计",tags = {"管理后台-首页统计-用户统计"}) |
| | | public R<UserStatistics> statistics() { |
| | | UserStatistics userStatistics = appUserMapper.getUserStatistics(); |
| | | return R.ok(userStatistics); |
| | | } |
| | | |
| | | /** |
| | | * 用户统计详情 |
| | | */ |
| | | @GetMapping("/statistics/detail") |
| | | @ApiOperation(value = "用户统计详情",tags = {"管理后台-首页统计-用户统计详情"}) |
| | | public R<UserStatisticsDetail> statisticsDetail(String userName) { |
| | | UserStatisticsDetail userStatisticsDetail = appUserMapper.getUserStatisticsDetail(userName); |
| | | return R.ok(userStatisticsDetail); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.vo.NearbyReferrer; |
| | | import com.ruoyi.account.vo.NearbyReferrerVo; |
| | | import com.ruoyi.account.vo.UserStatistics; |
| | | import com.ruoyi.account.vo.UserStatisticsDetail; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | IPage<AppUser> getAppuserPage(@Param("page") IPage<AppUser> page, @Param("appUser") AppUser appUser); |
| | | IPage<AppUser> getAppuserPage1(@Param("page") IPage<AppUser> page, @Param("appUser") AppUser appUser,@Param("objectId")Integer objectId,@Param("userIds")List<Long> userIds); |
| | | |
| | | UserStatistics getUserStatistics(); |
| | | |
| | | UserStatisticsDetail getUserStatisticsDetail(String userName); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | // 直推用户已成为代理数量 |
| | | List<AppUser> directAgentUserList = appUserService.list(new LambdaQueryWrapper<AppUser>() |
| | | .eq(AppUser::getInviteUserId, appUser.getId()) |
| | | .eq(AppUser::getUserType, 4)); |
| | | .eq(AppUser::getVipId, 4)); |
| | | agentApplication.setDirectAgentNum(directAgentUserList.size()); |
| | | |
| | | // 已绑定门店数量 |
New file |
| | |
| | | package com.ruoyi.account.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class UserStatistics { |
| | | /** |
| | | * 用户总数 |
| | | */ |
| | | private Integer totalUser; |
| | | |
| | | /** |
| | | * 拥有门店用户数 |
| | | */ |
| | | private Integer shopUser; |
| | | |
| | | /** |
| | | * 消费者用户数 |
| | | */ |
| | | private Integer consumerUser; |
| | | |
| | | /** |
| | | * 普通会员数 |
| | | */ |
| | | private Integer commonUser; |
| | | |
| | | /** |
| | | * 黄金会员数 |
| | | */ |
| | | private Integer goldUser; |
| | | |
| | | /** |
| | | * 钻石会员数 |
| | | */ |
| | | private Integer diamondUser; |
| | | |
| | | /** |
| | | * 创业者总数 |
| | | */ |
| | | private Integer entrepreneurUser; |
| | | |
| | | /** |
| | | * 准代理数 |
| | | */ |
| | | private Integer proxyUser; |
| | | |
| | | /** |
| | | * 代理数 |
| | | */ |
| | | private Integer agentUser; |
| | | |
| | | /** |
| | | * 总代数 |
| | | */ |
| | | private Integer totalAgentUser; |
| | | |
| | | /** |
| | | * 合伙人数 |
| | | */ |
| | | private Integer partnerUser; |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("用户统计详情") |
| | | public class UserStatisticsDetail { |
| | | |
| | | /** |
| | | * 用户获得总积分 |
| | | */ |
| | | @ApiModelProperty("用户获得总积分") |
| | | private Integer totalScore; |
| | | |
| | | /** |
| | | * 消费积分总数 |
| | | */ |
| | | @ApiModelProperty("消费积分总数") |
| | | private Integer consumeScore; |
| | | |
| | | /** |
| | | * 返佣积分总数 |
| | | */ |
| | | @ApiModelProperty("返佣积分总数") |
| | | private Integer rebateScore; |
| | | |
| | | /** |
| | | * 拉新人积分总数 |
| | | */ |
| | | @ApiModelProperty("拉新人积分总数") |
| | | private Integer inviteScore; |
| | | |
| | | /** |
| | | * 注册积分总数 |
| | | */ |
| | | @ApiModelProperty("注册积分总数") |
| | | private Integer registerScore; |
| | | |
| | | /** |
| | | * 做工积分总数 |
| | | */ |
| | | @ApiModelProperty("做工积分总数") |
| | | private Integer workScore; |
| | | |
| | | /** |
| | | * 技师业绩积分总数 |
| | | */ |
| | | @ApiModelProperty("技师业绩积分总数") |
| | | private Integer achievementScore; |
| | | |
| | | /** |
| | | * 用户获得分佣总金额 |
| | | */ |
| | | @ApiModelProperty("用户获得分佣总金额") |
| | | private Integer totalRebate; |
| | | |
| | | /** |
| | | * 充值金额 |
| | | */ |
| | | @ApiModelProperty("充值金额") |
| | | private Integer totalRecharge; |
| | | |
| | | /** |
| | | * 已提现金额 |
| | | */ |
| | | @ApiModelProperty("已提现金额") |
| | | private Integer totalWithdraw; |
| | | } |
| | |
| | | ) or ta.shop_id = #{objectId} ) |
| | | </where> |
| | | </select> |
| | | <select id="getUserStatistics" resultType="com.ruoyi.account.vo.UserStatistics"> |
| | | SELECT |
| | | COUNT(*) AS totalUser, |
| | | SUM(CASE WHEN tau.user_type = 2 THEN 1 ELSE 0 END) AS shopUser, |
| | | SUM(CASE WHEN tau.vip_id < 4 THEN 1 ELSE 0 END) AS consumerUser, |
| | | SUM(CASE WHEN tau.vip_id = 1 THEN 1 ELSE 0 END) AS commonUser, |
| | | SUM(CASE WHEN tau.vip_id = 2 THEN 1 ELSE 0 END) AS goldUser, |
| | | SUM(CASE WHEN tau.vip_id = 3 THEN 1 ELSE 0 END) AS diamondUser, |
| | | SUM(CASE WHEN tau.vip_id > 3 THEN 1 ELSE 0 END) AS entrepreneurUser, |
| | | SUM(CASE WHEN tau.vip_id = 4 THEN 1 ELSE 0 END) AS proxyUser, |
| | | SUM(CASE WHEN tau.vip_id = 5 THEN 1 ELSE 0 END) AS agentUser, |
| | | SUM(CASE WHEN tau.vip_id = 6 THEN 1 ELSE 0 END) AS totalAgentUser, |
| | | SUM(CASE WHEN tau.vip_id = 7 THEN 1 ELSE 0 END) AS partnerUser |
| | | FROM |
| | | t_app_user tau |
| | | </select> |
| | | <select id="getUserStatisticsDetail" resultType="com.ruoyi.account.vo.UserStatisticsDetail"> |
| | | SELECT |
| | | SUM(tau.total_point) totalScore, |
| | | SUM(tau.shop_point) consumeScore, |
| | | SUM(tau.share_point) rebateScore, |
| | | SUM(tau.total_invite_point) inviteScore, |
| | | SUM(tau.total_register_point) registerScore, |
| | | SUM(tau.total_share_point+tau.total_sign_point+tau.total_hour_point) workScore, |
| | | SUM(tau.total_performance_point) achievementScore, |
| | | SUM(tau.total_distribution_amount) totalRebate, |
| | | SUM(tau.total_recharge_amount) totalRecharge, |
| | | SUM(tau.withdrawn_amount) totalWithdraw |
| | | FROM |
| | | t_app_user tau |
| | | <where> |
| | | <if test="null != userName and '' != userName"> |
| | | and tau.name like CONCAT('%',#{userName},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.enums.OrderStatus; |
| | | import com.ruoyi.order.mapper.OrderMapper; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.order.service.CommissionService; |
| | | import com.ruoyi.order.service.OrderService; |
| | |
| | | private CommissionService commissionService; |
| | | @Resource |
| | | private BaseSettingClient baseSettingClient; |
| | | @Resource |
| | | private OrderMapper orderMapper; |
| | | |
| | | |
| | | /** |
| | |
| | | public R<PageInfo<OrderPageListVo>> getOrderPageList(OrderPageList orderPageList){ |
| | | return R.ok(orderService.getOrderPageList(orderPageList)); |
| | | } |
| | | |
| | | /** |
| | | * 订单统计 |
| | | */ |
| | | @GetMapping("/getOrderStatistics") |
| | | @ApiOperation(value = "订单统计", tags = {"管理后台-首页统计"}) |
| | | public R<OrderStatistics> getOrderStatistics(@RequestParam("startTime") String startTime, |
| | | @RequestParam("endTime") String endTime){ |
| | | OrderStatistics orderStatistics = orderMapper.getOrderStatistics(LocalDateTime.parse(startTime), LocalDateTime.parse(endTime)); |
| | | return R.ok(orderStatistics); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.order.vo.OrderPageList; |
| | | import com.ruoyi.order.vo.OrderPageListVo; |
| | | import com.ruoyi.order.vo.OrderStatistics; |
| | | import com.ruoyi.order.vo.OrderVO; |
| | | import com.ruoyi.order.model.Order; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | List<OrderPageListVo> getOrderPageList(PageInfo<OrderPageListVo> pageInfo, @Param("item") OrderPageList orderPageList); |
| | | |
| | | OrderStatistics getOrderStatistics(@Param("startTime")LocalDateTime startTime, |
| | | @Param("endTime") LocalDateTime endTime); |
| | | } |
| | |
| | | orderGoodsVO.setOriginalPrice(goods.getOriginalPrice()); |
| | | goodsList.add(orderGoodsVO); |
| | | } |
| | | |
| | | |
| | | |
| | | // 收货地址 |
| | | String addressJson = order.getAddressJson(); |
| | | UserAddress userAddress = new UserAddress(); |
| | |
| | | userAddress = JSONObject.parseObject(addressJson, UserAddress.class); |
| | | |
| | | } |
| | | |
| | | // 优惠券 |
| | | String couponJson = order.getCouponJson(); |
| | | CouponInfo couponInfo = new CouponInfo(); |
| | |
| | | if (StringUtils.isNotEmpty(activityJson)){ |
| | | orderActivityInfo = JSONObject.parseObject(activityJson, OrderActivityInfo.class); |
| | | } |
| | | |
| | | OrderDetailVO orderDetailVO = new OrderDetailVO(); |
| | | |
| | | if (CollectionUtil.isNotEmpty(orderGoods)){ |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("订单统计") |
| | | public class OrderStatistics { |
| | | /** |
| | | * 订单总数 |
| | | */ |
| | | @ApiModelProperty(value = "订单总数") |
| | | private Integer total; |
| | | |
| | | /** |
| | | * 服务类型订单数量 |
| | | */ |
| | | @ApiModelProperty(value = "服务类型订单数量") |
| | | private Integer serviceTotal; |
| | | |
| | | /** |
| | | * 单品类型订单数量 |
| | | */ |
| | | @ApiModelProperty(value = "单品类型订单数量") |
| | | private Integer singleTotal; |
| | | |
| | | /** |
| | | * 订单总金额 |
| | | */ |
| | | @ApiModelProperty(value = "订单总金额") |
| | | private Double totalMoney; |
| | | |
| | | /** |
| | | * 服务类型订单总金额 |
| | | */ |
| | | @ApiModelProperty(value = "服务类型订单总金额") |
| | | private Double serviceTotalMoney; |
| | | |
| | | /** |
| | | * 单品类型订单总金额 |
| | | */ |
| | | @ApiModelProperty(value = "单品类型订单总金额") |
| | | private Double singleTotalMoney; |
| | | } |
| | |
| | | </if> |
| | | order by create_time desc |
| | | </select> |
| | | <select id="getOrderStatistics" resultType="com.ruoyi.order.vo.OrderStatistics"> |
| | | SELECT |
| | | count(*), |
| | | SUM( CASE WHEN tor.order_type = 1 THEN 1 ELSE 0 END ) a, |
| | | SUM( CASE WHEN tor.order_type = 2 THEN 1 ELSE 0 END ) b, |
| | | SUM( tor.total_amount ) c, |
| | | SUM( CASE WHEN tor.order_type = 1 THEN tor.total_amount ELSE 0 END ), |
| | | SUM( CASE WHEN tor.order_type = 2 THEN tor.total_amount ELSE 0 END ) |
| | | FROM |
| | | t_order tor |
| | | <where> |
| | | <if test="startTime != null"> |
| | | and tor.create_time <![CDATA[>=]]> #{startTime} |
| | | </if> |
| | | <if test="endTime != null"> |
| | | and tor.create_time <![CDATA[<=]]> #{endTime} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | @PostMapping("/save") |
| | | @ApiOperation(value = "积分配置", tags = {"后台"}) |
| | | public R<PointSetting> save(@RequestBody PointSettingDto pointSettingDto) { |
| | | pointSettingService.remove(Wrappers.lambdaQuery()); |
| | | pointSettingService.saveBatch(pointSettingDto.getPointSettings()); |
| | | pointSettingService.saveOrUpdateBatch(pointSettingDto.getPointSettings()); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.domain.ShopScore; |
| | | import com.ruoyi.other.mapper.ShopMapper; |
| | | import com.ruoyi.other.service.ShopScoreService; |
| | | import com.ruoyi.other.service.ShopService; |
| | | import com.ruoyi.other.vo.NearbyShopVO; |
| | | import com.ruoyi.other.vo.ShopDetailVO; |
| | | import com.ruoyi.other.vo.ShopStatistics; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | @Resource |
| | | private ShopMapper shopMapper; |
| | | |
| | | |
| | | |
| | |
| | | shop.setShopPoint(0); |
| | | shop.setSharePoint(0); |
| | | shop.setServerPoint(0); |
| | | shop.setLowerLevelRebatePoints(0); |
| | | shop.setUsePoint(0); |
| | | shop.setGiveawayAllMoney(BigDecimal.ZERO); |
| | | shop.setGiveawayMoney(BigDecimal.ZERO); |
| | |
| | | return R.ok(list.stream().map(Shop::getId).collect(Collectors.toSet())); |
| | | } |
| | | |
| | | /** |
| | | * 门店统计 |
| | | */ |
| | | @GetMapping("/shopStatistics") |
| | | @ApiOperation(value = "门店统计", tags = {"管理后台-首页统计"}) |
| | | public R<ShopStatistics> shopStatistics(@ApiParam("门店名称") String shopName) { |
| | | ShopStatistics shopStatistics = shopMapper.getShopStatistics(shopName); |
| | | return R.ok(shopStatistics); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.vo.NearbyShopVO; |
| | | import com.ruoyi.other.vo.ShopDetailVO; |
| | | import com.ruoyi.other.vo.ShopStatistics; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | |
| | | ShopDetailVO selectShopDetail(Integer shopId); |
| | | |
| | | ShopStatistics getShopStatistics(String shopName); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.other.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ShopStatistics { |
| | | |
| | | /** |
| | | * 门店积分总数 |
| | | */ |
| | | private Integer totalPoint; |
| | | |
| | | /** |
| | | * 门店返佣积分总数 |
| | | */ |
| | | private Integer commissionPoint; |
| | | |
| | | /** |
| | | * 门店服务积分总数 |
| | | */ |
| | | private Integer servicePoint; |
| | | |
| | | /** |
| | | * 绑定下级门店返佣积分总数 |
| | | */ |
| | | private Integer bindCommissionPoint; |
| | | |
| | | /** |
| | | * 门店分佣总金额 |
| | | */ |
| | | private Double totalCommissionMoney; |
| | | |
| | | /** |
| | | * 门店分佣金额 |
| | | */ |
| | | private Double commissionMoney; |
| | | |
| | | /** |
| | | * 绑定下级分佣金额 |
| | | */ |
| | | private Double bindCommissionMoney; |
| | | |
| | | /** |
| | | * 门店服务分佣金额 |
| | | */ |
| | | private Double serviceCommissionMoney; |
| | | |
| | | /** |
| | | * 门店订单总数 |
| | | */ |
| | | private Integer totalOrder; |
| | | |
| | | /** |
| | | * 服务订单数 |
| | | */ |
| | | private Integer serviceOrder; |
| | | |
| | | /** |
| | | * 单品-上门自提订单数 |
| | | */ |
| | | private Integer goodsOrder; |
| | | |
| | | /** |
| | | * 可提现金额 |
| | | */ |
| | | private Double canWithdrawMoney; |
| | | |
| | | /** |
| | | * 已提现金额 |
| | | */ |
| | | private Double alreadyWithdrawMoney; |
| | | |
| | | } |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getShopStatistics" resultType="com.ruoyi.other.vo.ShopStatistics"> |
| | | SELECT |
| | | SUM(ts.shop_all_point) totalPoint, |
| | | SUM(ts.share_point) commissionPoint, |
| | | SUM(ts.server_point) servicePoint, |
| | | SUM(ts.lower_level_giveaway_money) bindCommissionPoint, |
| | | SUM(ts.giveaway_all_money) totalCommissionMoney, |
| | | SUM(ts.giveaway_money) commissionMoney, |
| | | SUM(ts.lower_level_giveaway_money) bindCommissionMoney, |
| | | SUM(ts.server_giveaway_money) serviceCommissionMoney, |
| | | SUM(ts.order_number) totalOrder, |
| | | SUM(ts.server_order_number) serviceOrder, |
| | | SUM(ts.custom_order_number) goodsOrder, |
| | | SUM(ts.can_withdraw_money) canWithdrawMoney, |
| | | SUM(ts.withdraw_money) alreadyWithdrawMoney |
| | | FROM |
| | | t_shop ts |
| | | </select> |
| | | </mapper> |