分成逻辑修改、新增运营统计接口
This commit is contained in:
parent
e722f2004e
commit
027ef83a0d
|
@ -1,14 +1,21 @@
|
|||
package com.ruoyi.bst.area.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AreaQuery extends AreaVO {
|
||||
|
||||
@ApiModelProperty("创建日期范围")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private List<LocalDate> createDateRange;
|
||||
|
||||
@ApiModelProperty("运营区ID列表")
|
||||
private List<Long> ids;
|
||||
|
||||
|
|
|
@ -99,6 +99,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
or su.nick_name like concat('%', #{query.keyword}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="query.createDateRange != null and query.createDateRange.size() >= 2">
|
||||
and date(ba.create_time) >= #{query.createDateRange[0]}
|
||||
and date(ba.create_time) <= #{query.createDateRange[1]}
|
||||
</if>
|
||||
<if test="query.radius != null and query.center != null and query.center.size() >= 2">
|
||||
and (
|
||||
ST_Contains(ba.boundary, point(#{query.center[0]}, #{query.center[1]}))
|
||||
|
|
|
@ -22,5 +22,12 @@ public interface AreaDashboard {
|
|||
*/
|
||||
List<LongIntegerVO> selectMaxOfDeviceCountAreaId(AreaQuery query);
|
||||
|
||||
/**
|
||||
* 查询运营区数量
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
Integer selectCount(AreaQuery query);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public class AreaDashboardImpl implements AreaDashboard {
|
|||
public AreaStatVO selectStat(AreaQuery query, List<String> keys) {
|
||||
AreaStatVO vo = new AreaStatVO();
|
||||
if (keys.contains(StatKeys.AREA_COUNT)) {
|
||||
vo.setCount(MathUtils.dv(areaMapper.selectCount(query)));
|
||||
vo.setCount(this.selectCount(query));
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
@ -34,5 +34,10 @@ public class AreaDashboardImpl implements AreaDashboard {
|
|||
PageHelper.orderBy("value desc");
|
||||
return areaMapper.selectDeviceCountGroupByAreaId(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer selectCount(AreaQuery query) {
|
||||
return MathUtils.dv(areaMapper.selectCount(query));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package com.ruoyi.bst.areaJoin.domain;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
@ -20,4 +23,8 @@ public class AreaJoinQuery extends AreaJoinVO {
|
|||
@ApiModelProperty("排除ID")
|
||||
private Long excludeId;
|
||||
|
||||
@ApiModelProperty("创建日期范围")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private List<LocalDate> createDateRange;
|
||||
|
||||
}
|
||||
|
|
|
@ -47,6 +47,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="query.userPhone != null and query.userPhone != ''">and su.user_name like concat('%', #{query.userPhone}, '%')</if>
|
||||
<if test="query.mchId != null">and ba.user_id = #{query.mchId}</if>
|
||||
<if test="query.excludeId != null">and baj.id != #{query.excludeId}</if>
|
||||
<if test="query.createDateRange != null and query.createDateRange.size() >= 2">
|
||||
and date(baj.create_time) >= #{query.createDateRange[0]}
|
||||
and date(baj.create_time) <= #{query.createDateRange[1]}
|
||||
</if>
|
||||
<if test="query.types != null and query.types.size() > 0">
|
||||
and baj.type in
|
||||
<foreach item="item" collection="query.types" open="(" separator="," close=")">
|
||||
|
|
|
@ -47,5 +47,35 @@ public interface AreaJoinDashboard {
|
|||
* @return
|
||||
*/
|
||||
BigDecimal selectMaxOfAreaPoint(Long areaId);
|
||||
|
||||
/**
|
||||
* 查询运营区加盟商数量
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
Integer selectCount(AreaJoinQuery query);
|
||||
|
||||
/**
|
||||
* 查询运营区加盟商数量
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
Integer selectJoinCount(AreaJoinQuery query);
|
||||
|
||||
/**
|
||||
* 查询运营区合伙人数量
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
Integer selectPartnerCount(AreaJoinQuery query);
|
||||
|
||||
/**
|
||||
* 查询运营区运维数量
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
Integer selectOperationCount(AreaJoinQuery query);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ import com.ruoyi.dashboard.constants.StatKeys;
|
|||
|
||||
@Service
|
||||
public class AreaJoinDashboardImpl implements AreaJoinDashboard {
|
||||
|
||||
|
||||
@Autowired
|
||||
private AreaJoinMapper areaJoinMapper;
|
||||
|
||||
|
@ -39,19 +39,21 @@ public class AreaJoinDashboardImpl implements AreaJoinDashboard {
|
|||
}
|
||||
|
||||
// 加盟商数量
|
||||
private int selectJoinCount(AreaJoinQuery query) {
|
||||
@Override
|
||||
public Integer selectJoinCount(AreaJoinQuery query) {
|
||||
AreaJoinQuery joinQuery = new AreaJoinQuery();
|
||||
BeanUtils.copyProperties(query, joinQuery);
|
||||
joinQuery.setType(AreaJoinType.JOIN.getCode());
|
||||
return MathUtils.dv(areaJoinMapper.selectCount(joinQuery));
|
||||
return selectCount(query);
|
||||
}
|
||||
|
||||
// 合伙人数量
|
||||
private int selectPartnerCount(AreaJoinQuery query) {
|
||||
@Override
|
||||
public Integer selectPartnerCount(AreaJoinQuery query) {
|
||||
AreaJoinQuery partnerQuery = new AreaJoinQuery();
|
||||
BeanUtils.copyProperties(query, partnerQuery);
|
||||
partnerQuery.setType(AreaJoinType.PARTNER.getCode());
|
||||
return MathUtils.dv(areaJoinMapper.selectCount(partnerQuery));
|
||||
return selectCount(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -101,5 +103,18 @@ public class AreaJoinDashboardImpl implements AreaJoinDashboard {
|
|||
// 合伙人加算,加盟商取最大值
|
||||
return MathUtils.max(partnerPoint, joinPoint);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Integer selectCount(AreaJoinQuery query) {
|
||||
return MathUtils.dv(areaJoinMapper.selectCount(query));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer selectOperationCount(AreaJoinQuery query) {
|
||||
AreaJoinQuery operationQuery = new AreaJoinQuery();
|
||||
BeanUtils.copyProperties(query, operationQuery);
|
||||
operationQuery.setType(AreaJoinType.OPERATION.getCode());
|
||||
return selectCount(query);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -51,6 +51,13 @@ public interface BonusDashboard {
|
|||
* @param query 查询条件
|
||||
* @return 分成数量
|
||||
*/
|
||||
Integer selectCount(BonusQuery query);
|
||||
Integer selectCount(BonusQuery query);
|
||||
|
||||
/**
|
||||
* 查询分成待分金额
|
||||
* @param query 查询条件
|
||||
* @return 分成待分金额
|
||||
*/
|
||||
BigDecimal selectSumOfWaitAmount(BonusQuery query);
|
||||
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public class BonusDashboardImpl implements BonusDashboard {
|
|||
vo.setAmount(this.selectSumOfAmount(query));
|
||||
}
|
||||
if (keys.contains(StatKeys.BONUS_WAIT_DIVIDE_AMOUNT)) {
|
||||
vo.setWaitDivideAmount(MathUtils.dv(bonusMapper.selectSumOfWaitAmount(query)));
|
||||
vo.setWaitDivideAmount(this.selectSumOfWaitAmount(query));
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
@ -67,5 +67,10 @@ public class BonusDashboardImpl implements BonusDashboard {
|
|||
public Integer selectCount(BonusQuery query) {
|
||||
return MathUtils.dv(bonusMapper.selectCount(query));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal selectSumOfWaitAmount(BonusQuery query) {
|
||||
return MathUtils.dv(bonusMapper.selectSumOfWaitAmount(query));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.bst.device.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -59,4 +60,8 @@ public class DeviceQuery extends DeviceVO {
|
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime lastTimeStart;
|
||||
|
||||
@ApiModelProperty("创建日期范围")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private List<LocalDate> createDateRange;
|
||||
|
||||
}
|
||||
|
|
|
@ -160,6 +160,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and bd.remaining_power >= #{query.powerRange[0]}
|
||||
and bd.remaining_power <= #{query.powerRange[1]}
|
||||
</if>
|
||||
<if test="query.createDateRange != null and query.createDateRange.size() == 2">
|
||||
and date(bd.create_time) >= #{query.createDateRange[0]}
|
||||
and date(bd.create_time) <= #{query.createDateRange[1]}
|
||||
</if>
|
||||
<if test="query.nonOrOrderDeviceStatusList != null and query.nonOrOrderDeviceStatusList.size() > 0">
|
||||
and (
|
||||
bd.order_device_id is null
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.bst.device.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ruoyi.bst.device.domain.DeviceQuery;
|
||||
import com.ruoyi.bst.device.domain.vo.DeviceStatVO;
|
||||
|
@ -12,4 +13,18 @@ public interface DeviceDashboard {
|
|||
*/
|
||||
DeviceStatVO selectStat(DeviceQuery query, List<String> keys);
|
||||
|
||||
/**
|
||||
* 查询设备数量
|
||||
*/
|
||||
Integer selectCount(DeviceQuery query);
|
||||
|
||||
/**
|
||||
* 查询设备状态数量
|
||||
*/
|
||||
Map<String, Integer> selectStatusCount(DeviceQuery query);
|
||||
|
||||
/**
|
||||
* 查询设备在线状态数量
|
||||
*/
|
||||
Map<String, Integer> selectOnlineStatusCount(DeviceQuery query);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ public class DeviceDashboardImpl implements DeviceDashboard {
|
|||
public DeviceStatVO selectStat(DeviceQuery query, List<String> keys) {
|
||||
DeviceStatVO vo = new DeviceStatVO();
|
||||
if (keys.contains(StatKeys.DEVICE_COUNT)) {
|
||||
vo.setCount(MathUtils.dv(deviceMapper.selectCount(query)));
|
||||
vo.setCount(this.selectCount(query));
|
||||
}
|
||||
if (keys.contains(StatKeys.DEVICE_STATUS_COUNT)) {
|
||||
vo.setStatusCount(this.selectStatusCount(query));
|
||||
|
@ -37,14 +37,22 @@ public class DeviceDashboardImpl implements DeviceDashboard {
|
|||
}
|
||||
|
||||
// 获取设备状态数量
|
||||
private Map<String, Integer> selectStatusCount(DeviceQuery query) {
|
||||
@Override
|
||||
public Map<String, Integer> selectStatusCount(DeviceQuery query) {
|
||||
List<StringIntegerVO> list = deviceMapper.selectStatusCount(query);
|
||||
return list.stream().collect(Collectors.toMap(StringIntegerVO::getKey, StringIntegerVO::getValue));
|
||||
}
|
||||
|
||||
// 获取设备在线状态数量
|
||||
private Map<String, Integer> selectOnlineStatusCount(DeviceQuery query) {
|
||||
@Override
|
||||
public Map<String, Integer> selectOnlineStatusCount(DeviceQuery query) {
|
||||
List<StringIntegerVO> list = deviceMapper.selectOnlineStatusCount(query);
|
||||
return list.stream().collect(Collectors.toMap(StringIntegerVO::getKey, StringIntegerVO::getValue));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer selectCount(DeviceQuery query) {
|
||||
return MathUtils.dv(deviceMapper.selectCount(query));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,5 +8,12 @@ import com.ruoyi.bst.fault.domain.vo.FaultStatVO;
|
|||
public interface FaultDashboard {
|
||||
|
||||
FaultStatVO selectStat(FaultQuery query, List<String> keys);
|
||||
|
||||
/**
|
||||
* 查询待处理的故障数量
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
Integer selectPendingCount(FaultQuery query);
|
||||
|
||||
}
|
||||
|
|
|
@ -28,7 +28,8 @@ public class FaultDashboardImpl implements FaultDashboard {
|
|||
return vo;
|
||||
}
|
||||
|
||||
private int selectPendingCount(FaultQuery query) {
|
||||
@Override
|
||||
public Integer selectPendingCount(FaultQuery query) {
|
||||
FaultQuery pendingQuery = new FaultQuery();
|
||||
BeanUtils.copyProperties(query, pendingQuery);
|
||||
pendingQuery.setAppealStatus(FaultStatus.PENDING.getCode());
|
||||
|
|
|
@ -8,5 +8,11 @@ import com.ruoyi.bst.mchApply.domain.vo.MchApplyStatVO;
|
|||
public interface MchApplyDashboard {
|
||||
|
||||
MchApplyStatVO selectStat(MchApplyQuery query, List<String> keys);
|
||||
|
||||
|
||||
/**
|
||||
* 查询待审核的加盟商申请数量
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
Integer selectApprovingCount(MchApplyQuery query);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,8 @@ public class MchApplyDashboardImpl implements MchApplyDashboard {
|
|||
return vo;
|
||||
}
|
||||
|
||||
private int selectApprovingCount(MchApplyQuery query) {
|
||||
@Override
|
||||
public Integer selectApprovingCount(MchApplyQuery query) {
|
||||
MchApplyQuery approvingQuery = new MchApplyQuery();
|
||||
BeanUtils.copyProperties(query, approvingQuery);
|
||||
approvingQuery.setStatus(MchApplyStatus.APPROVING.getStatus());
|
||||
|
|
|
@ -217,9 +217,10 @@ public class RealNameServiceImpl implements RealNameService
|
|||
ServiceUtil.assertion(user.getIsReal() != null && user.getIsReal(),"用户已实名认证");
|
||||
|
||||
IDResponse idRes = TwoEleUtil.verifyIdentity(dto.getIdCard(), dto.getUserName());
|
||||
ServiceUtil.assertion(idRes == null, "二要素实名认证返回为空,请联系管理员续费");
|
||||
|
||||
boolean isSuccess = IDResponse.isSuccess(idRes);
|
||||
|
||||
|
||||
// 保存实名信息
|
||||
RealName realName = new RealName();
|
||||
realName.setUserId(dto.getUserId());
|
||||
|
|
|
@ -21,4 +21,11 @@ public interface WithdrawDashboard {
|
|||
* @return
|
||||
*/
|
||||
BigDecimal selectSuccessAmount(WithdrawQuery query);
|
||||
|
||||
/**
|
||||
* 查询待审核的提现数量
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
Integer selectWaitVerifyCount(WithdrawQuery query);
|
||||
}
|
||||
|
|
|
@ -41,7 +41,8 @@ public class WithdrawDashboardImpl implements WithdrawDashboard {
|
|||
return MathUtils.dv(withdrawMapper.selectSumOfAmount(successQuery));
|
||||
}
|
||||
|
||||
private int selectWaitVerifyCount(WithdrawQuery query) {
|
||||
@Override
|
||||
public Integer selectWaitVerifyCount(WithdrawQuery query) {
|
||||
WithdrawQuery waitVerifyQuery = new WithdrawQuery();
|
||||
BeanUtils.copyProperties(query, waitVerifyQuery);
|
||||
waitVerifyQuery.setStatus(WithdrawStatus.WAIT_VERIFY.getCode());
|
||||
|
|
|
@ -61,6 +61,8 @@ public class StatKeys {
|
|||
public static final String AREA_JOIN_COUNT = "area_join_count";
|
||||
// 合伙人数量
|
||||
public static final String AREA_JOIN_PARTNER_COUNT = "area_join_partner_count";
|
||||
// 运维数量
|
||||
public static final String AREA_JOIN_OPERATION_COUNT = "area_join_operation_count";
|
||||
|
||||
// 成功提现金额
|
||||
public static final String WITHDRAW_SUCCESS_AMOUNT = "withdraw_success_amount";
|
||||
|
|
|
@ -3,68 +3,40 @@ package com.ruoyi.dashboard.domain.platformStat;
|
|||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ruoyi.common.utils.MathUtils;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PlatformStatVO {
|
||||
@ApiModelProperty("订单支付金额")
|
||||
private BigDecimal orderPayAmount;
|
||||
|
||||
@ApiModelProperty("订单退款金额")
|
||||
private BigDecimal orderRefundAmount;
|
||||
|
||||
@ApiModelProperty("订单数量")
|
||||
@ApiModelProperty("订单总数")
|
||||
private Integer orderCount;
|
||||
@ApiModelProperty("订单实收总金额")
|
||||
private BigDecimal orderActualAmount;
|
||||
@ApiModelProperty("订单状态数量")
|
||||
private Map<String, Integer> orderStatusCount;
|
||||
@ApiModelProperty("进行中的订单预存金额")
|
||||
private BigDecimal orderDepositAmount;
|
||||
|
||||
@ApiModelProperty("今日订单支付金额")
|
||||
private BigDecimal todayOrderPayAmount;
|
||||
@ApiModelProperty("支付总金额")
|
||||
private BigDecimal payAmount;
|
||||
@ApiModelProperty("退款总金额")
|
||||
private BigDecimal refundAmount;
|
||||
|
||||
@ApiModelProperty("今日订单退款金额")
|
||||
private BigDecimal todayOrderRefundAmount;
|
||||
|
||||
@ApiModelProperty("今日订单数量")
|
||||
private Integer todayOrderCount;
|
||||
|
||||
@ApiModelProperty("车辆总数")
|
||||
private Integer deviceCount;
|
||||
|
||||
@ApiModelProperty("车型总数")
|
||||
private Integer modelCount;
|
||||
@ApiModelProperty("平台分成总金额")
|
||||
private BigDecimal platformBonusAmount;
|
||||
@ApiModelProperty("平台分成退款总金额")
|
||||
private BigDecimal platformBonusRefundAmount;
|
||||
@ApiModelProperty("平台分成实收")
|
||||
public BigDecimal platformBonusActualAmount() {
|
||||
return MathUtils.subtractDecimal(platformBonusAmount, platformBonusRefundAmount);
|
||||
}
|
||||
|
||||
@ApiModelProperty("运营区数量")
|
||||
private Integer areaCount;
|
||||
|
||||
@ApiModelProperty("加盟商数量")
|
||||
private Integer areaJoinJoinCount;
|
||||
@ApiModelProperty("设备数量")
|
||||
private Integer deviceCount;
|
||||
|
||||
@ApiModelProperty("合伙人数量")
|
||||
private Integer areaJoinPartnerCount;
|
||||
|
||||
@ApiModelProperty("用户总数")
|
||||
private Integer userCount;
|
||||
|
||||
@ApiModelProperty("今日新增用户数")
|
||||
private Integer todayUserCount;
|
||||
|
||||
@ApiModelProperty("运营商数量")
|
||||
private Integer userMchCount;
|
||||
|
||||
@ApiModelProperty("代理商数量")
|
||||
private Integer userAgentCount;
|
||||
|
||||
@ApiModelProperty("商户余额")
|
||||
private BigDecimal userBalance;
|
||||
|
||||
@ApiModelProperty("累计提现金额")
|
||||
private BigDecimal withdrawSuccessAmount;
|
||||
|
||||
@ApiModelProperty("设备状态")
|
||||
private Map<String, Integer> deviceStatusCount;
|
||||
|
||||
@ApiModelProperty("设备在线状态")
|
||||
private Map<String, Integer> deviceOnlineStatusCount;
|
||||
|
||||
@ApiModelProperty("订单状态")
|
||||
private Map<String, Integer> orderStatusCount;
|
||||
}
|
||||
|
|
|
@ -5,11 +5,17 @@ import java.util.List;
|
|||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import com.ruoyi.bst.area.domain.AreaQuery;
|
||||
import com.ruoyi.bst.areaJoin.domain.AreaJoinQuery;
|
||||
import com.ruoyi.bst.bonus.domain.BonusQuery;
|
||||
import com.ruoyi.bst.bonus.domain.enums.BonusStatus;
|
||||
import com.ruoyi.bst.bonusRefund.domain.BonusRefundQuery;
|
||||
import com.ruoyi.bst.device.domain.DeviceQuery;
|
||||
import com.ruoyi.bst.fault.domain.FaultQuery;
|
||||
import com.ruoyi.bst.mchApply.domain.MchApplyQuery;
|
||||
import com.ruoyi.bst.order.domain.OrderQuery;
|
||||
import com.ruoyi.bst.order.domain.enums.OrderStatus;
|
||||
import com.ruoyi.bst.withdraw.domain.WithdrawQuery;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
@ -83,4 +89,56 @@ public class RevenueStatQuery {
|
|||
query.setCreateDateRange(dateRange);
|
||||
return query;
|
||||
}
|
||||
|
||||
public AreaQuery toAreaQuery() {
|
||||
AreaQuery query = new AreaQuery();
|
||||
query.setCreateDateRange(dateRange);
|
||||
query.setId(areaId);
|
||||
query.setUserId(userId);
|
||||
query.setScope(scope);
|
||||
return query;
|
||||
}
|
||||
|
||||
public AreaJoinQuery toAreaJoinQuery() {
|
||||
AreaJoinQuery query = new AreaJoinQuery();
|
||||
query.setCreateDateRange(dateRange);
|
||||
query.setAreaId(areaId);
|
||||
query.setUserId(userId);
|
||||
query.setScope(scope);
|
||||
return query;
|
||||
}
|
||||
|
||||
public DeviceQuery toDeviceQuery() {
|
||||
DeviceQuery query = new DeviceQuery();
|
||||
query.setCreateDateRange(dateRange);
|
||||
query.setAreaId(areaId);
|
||||
query.setMchId(userId);
|
||||
query.setScope(scope);
|
||||
return query;
|
||||
}
|
||||
|
||||
public WithdrawQuery toWithdrawQuery() {
|
||||
WithdrawQuery query = new WithdrawQuery();
|
||||
query.setCreateDateRange(dateRange);
|
||||
query.setUserId(userId);
|
||||
query.setScope(scope);
|
||||
return query;
|
||||
}
|
||||
|
||||
public MchApplyQuery toMchApplyQuery() {
|
||||
MchApplyQuery query = new MchApplyQuery();
|
||||
query.setCreateDateRange(dateRange);
|
||||
query.setUserId(userId);
|
||||
query.setScope(scope);
|
||||
return query;
|
||||
}
|
||||
|
||||
public FaultQuery toFaultQuery() {
|
||||
FaultQuery query = new FaultQuery();
|
||||
query.setCreateDateRange(dateRange);
|
||||
query.setStoreId(userId);
|
||||
query.setAreaId(areaId);
|
||||
query.setScope(scope);
|
||||
return query;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,6 +24,8 @@ public class RevenueStatVO {
|
|||
private BigDecimal bonusAmount;
|
||||
@ApiModelProperty("分成退款金额")
|
||||
private BigDecimal bonusRefundAmount;
|
||||
@ApiModelProperty("分成待分金额")
|
||||
private BigDecimal bonusWaitDivideAmount;
|
||||
@ApiModelProperty("分成数量")
|
||||
private Integer bonusCount;
|
||||
@ApiModelProperty("分成实收金额")
|
||||
|
@ -31,5 +33,30 @@ public class RevenueStatVO {
|
|||
return MathUtils.subtractDecimal(bonusAmount, bonusRefundAmount);
|
||||
}
|
||||
|
||||
@ApiModelProperty("运营区数量")
|
||||
private Integer areaCount;
|
||||
@ApiModelProperty("运营区加盟数量")
|
||||
private Integer areaJoinCount;
|
||||
@ApiModelProperty("运营区合伙数量")
|
||||
private Integer areaPartnerCount;
|
||||
@ApiModelProperty("运营区运维数量")
|
||||
private Integer areaOperationCount;
|
||||
|
||||
@ApiModelProperty("设备数量")
|
||||
private Integer deviceCount;
|
||||
@ApiModelProperty("设备状态数量")
|
||||
private Map<String, Integer> deviceStatusMap;
|
||||
@ApiModelProperty("设备在线数量")
|
||||
private Map<String, Integer> deviceOnlineStatusMap;
|
||||
|
||||
@ApiModelProperty("成功提现金额")
|
||||
private BigDecimal withdrawSuccessAmount;
|
||||
@ApiModelProperty("待审核的提现数量")
|
||||
private Integer withdrawWaitVerifyCount;
|
||||
|
||||
@ApiModelProperty("待审核的加盟商申请数量")
|
||||
private Integer mchApplyApprovingCount;
|
||||
|
||||
@ApiModelProperty("待处理的故障数量")
|
||||
private Integer faultPendingCount;
|
||||
}
|
||||
|
|
|
@ -128,7 +128,6 @@ public class DashboardService {
|
|||
public RevenueStatVO selectRevenueStat(RevenueStatQuery query) {
|
||||
RevenueStatVO vo = new RevenueStatVO();
|
||||
List<String> keys = query.getKeys();
|
||||
|
||||
// 订单用户数量
|
||||
if (keys.contains(StatKeys.ORDER_USER_COUNT)) {
|
||||
vo.setOrderUserCount(orderDashboard.selectUserCount(query.toOrderQuery()));
|
||||
|
@ -154,10 +153,65 @@ public class DashboardService {
|
|||
if (keys.contains(StatKeys.BONUS_REFUND_AMOUNT) || keys.contains(StatKeys.BONUS_ACTUAL_AMOUNT)) {
|
||||
vo.setBonusRefundAmount(bonusRefundDashboard.selectSumOfUserBonusRefund(query.toBonusRefundQuery()));
|
||||
}
|
||||
// 分成待分金额
|
||||
if (keys.contains(StatKeys.BONUS_WAIT_DIVIDE_AMOUNT)) {
|
||||
vo.setBonusWaitDivideAmount(bonusDashboard.selectSumOfWaitAmount(query.toBonusQuery()));
|
||||
}
|
||||
// 分成数量
|
||||
if (keys.contains(StatKeys.BONUS_COUNT)) {
|
||||
vo.setBonusCount(bonusDashboard.selectCount(query.toBonusQuery()));
|
||||
}
|
||||
|
||||
// 运营区数量
|
||||
if (keys.contains(StatKeys.AREA_COUNT)) {
|
||||
vo.setAreaCount(areaDashboard.selectCount(query.toAreaQuery()));
|
||||
}
|
||||
|
||||
// 运营区加盟商数量
|
||||
if (keys.contains(StatKeys.AREA_JOIN_COUNT)) {
|
||||
vo.setAreaJoinCount(areaJoinDashboard.selectJoinCount(query.toAreaJoinQuery()));
|
||||
}
|
||||
// 运营区合伙人数量
|
||||
if (keys.contains(StatKeys.AREA_JOIN_PARTNER_COUNT)) {
|
||||
vo.setAreaPartnerCount(areaJoinDashboard.selectPartnerCount(query.toAreaJoinQuery()));
|
||||
}
|
||||
// 运营区运维数量
|
||||
if (keys.contains(StatKeys.AREA_JOIN_OPERATION_COUNT)) {
|
||||
vo.setAreaOperationCount(areaJoinDashboard.selectOperationCount(query.toAreaJoinQuery()));
|
||||
}
|
||||
|
||||
// 设备数量
|
||||
if (keys.contains(StatKeys.DEVICE_COUNT)) {
|
||||
vo.setDeviceCount(deviceDashboard.selectCount(query.toDeviceQuery()));
|
||||
}
|
||||
// 设备状态数量
|
||||
if (keys.contains(StatKeys.DEVICE_STATUS_COUNT)) {
|
||||
vo.setDeviceStatusMap(deviceDashboard.selectStatusCount(query.toDeviceQuery()));
|
||||
}
|
||||
// 设备在线状态数量
|
||||
if (keys.contains(StatKeys.DEVICE_ONLINE_STATUS_COUNT)) {
|
||||
vo.setDeviceOnlineStatusMap(deviceDashboard.selectOnlineStatusCount(query.toDeviceQuery()));
|
||||
}
|
||||
|
||||
// 成功提现金额
|
||||
if (keys.contains(StatKeys.WITHDRAW_SUCCESS_AMOUNT)) {
|
||||
vo.setWithdrawSuccessAmount(withdrawDashboard.selectSuccessAmount(query.toWithdrawQuery()));
|
||||
}
|
||||
// 待审核的提现数量
|
||||
if (keys.contains(StatKeys.WITHDRAW_WAIT_VERIFY_COUNT)) {
|
||||
vo.setWithdrawWaitVerifyCount(withdrawDashboard.selectWaitVerifyCount(query.toWithdrawQuery()));
|
||||
}
|
||||
|
||||
// 待审核的加盟商申请数量
|
||||
if (keys.contains(StatKeys.MCH_APPLY_APPROVING_COUNT)) {
|
||||
vo.setMchApplyApprovingCount(mchApplyDashboard.selectApprovingCount(query.toMchApplyQuery()));
|
||||
}
|
||||
|
||||
// 待处理的故障数量
|
||||
if (keys.contains(StatKeys.FAULT_PENDING_COUNT)) {
|
||||
vo.setFaultPendingCount(faultDashboard.selectPendingCount(query.toFaultQuery()));
|
||||
}
|
||||
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,6 +64,7 @@ public class DashboardController extends BaseController {
|
|||
@PreAuthorize("@ss.hasAnyPermi('dashboard:revenue')")
|
||||
@GetMapping("/revenueStat")
|
||||
public AjaxResult getRevenueStat(RevenueStatQuery query) {
|
||||
query.setScope(true);
|
||||
return success(dashboardService.selectRevenueStat(query));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user