回滚分成
This commit is contained in:
parent
027ef83a0d
commit
2cb3a7b9ae
|
@ -282,26 +282,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
<foreach open="bb.wait_amount = CASE id" collection="list" item="item" close="END,">
|
||||
<choose>
|
||||
<when test="item.waitAmount != null">
|
||||
WHEN #{item.id} THEN #{item.waitAmount}
|
||||
</when>
|
||||
<otherwise>
|
||||
WHEN #{item.id} THEN bb.wait_amount
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
<foreach open="bb.amount = CASE id" collection="list" item="item" close="END,">
|
||||
<choose>
|
||||
<when test="item.amount != null">
|
||||
WHEN #{item.id} THEN #{item.amount}
|
||||
</when>
|
||||
<otherwise>
|
||||
WHEN #{item.id} THEN bb.amount
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
where bb.id in
|
||||
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||
|
|
|
@ -18,5 +18,5 @@ public interface BonusConverter {
|
|||
* 将设备、合伙人、加盟商转换为分成列表
|
||||
*/
|
||||
List<Bonus> toBaseBonusListPlatform(DeviceVO device, List<AreaJoinVO> partners, AreaJoinVO join);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ public interface BonusService {
|
|||
* @param bstId 业务ID
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean prepayByBst(BonusBstType bstType, Long bstId, BigDecimal amount);
|
||||
public boolean prepayByBst(BonusBstType bstType, Long bstId);
|
||||
|
||||
/**
|
||||
* 分成打款
|
||||
|
|
|
@ -68,6 +68,7 @@ public class BonusConverterImpl implements BonusConverter {
|
|||
|
||||
// 设置分成金额
|
||||
Order order = bo.getOrder();
|
||||
BonusUtil.partAmount(result, order.getPayAmount());
|
||||
|
||||
ChannelVO channel = bo.getChannel();
|
||||
|
||||
|
@ -78,6 +79,7 @@ public class BonusConverterImpl implements BonusConverter {
|
|||
bonus.setBstType(BonusBstType.ORDER.getType());
|
||||
bonus.setBstId(order.getId());
|
||||
bonus.setStatus(BonusStatus.INVALID.getStatus());
|
||||
bonus.setInvalidAmount(bonus.getAmount());
|
||||
bonus.setToBalance(true);
|
||||
bonus.setAreaId(order.getAreaId());
|
||||
if (channel != null) {
|
||||
|
@ -90,7 +92,7 @@ public class BonusConverterImpl implements BonusConverter {
|
|||
|
||||
/**
|
||||
* 获取基础分成列表
|
||||
*
|
||||
*
|
||||
* @param device 设备
|
||||
* @param partners 运营区合伙人列表
|
||||
* @param join 设备的所属用户在对应区域的加盟信息
|
||||
|
|
|
@ -182,7 +182,7 @@ public class BonusServiceImpl implements BonusService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean prepayByBst(BonusBstType bstType, Long bstId, BigDecimal amount) {
|
||||
public boolean prepayByBst(BonusBstType bstType, Long bstId) {
|
||||
if (bstType == null || bstId == null) {
|
||||
return false;
|
||||
}
|
||||
|
@ -192,19 +192,16 @@ public class BonusServiceImpl implements BonusService {
|
|||
query.setBstType(bstType.getType());
|
||||
query.setBstId(bstId);
|
||||
List<BonusVO> list = this.selectBonusList(query);
|
||||
int rows = prepay(list, amount);
|
||||
int rows = prepay(list);
|
||||
return rows == list.size();
|
||||
}
|
||||
|
||||
// 预分成
|
||||
private int prepay(List<BonusVO> list, BigDecimal amount) {
|
||||
private int prepay(List<BonusVO> list) {
|
||||
if (CollectionUtils.isEmptyElement(list)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 根据分成列表,计算分成金额
|
||||
BonusUtil.partAmount(list, amount);
|
||||
|
||||
// 获取用户列表
|
||||
List<UserVO> userList = userService.selectByIds(list.stream()
|
||||
.filter(item -> BonusArrivalType.userList().contains(item.getArrivalType()))
|
||||
|
@ -213,7 +210,6 @@ public class BonusServiceImpl implements BonusService {
|
|||
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
for (BonusVO bonus : list) {
|
||||
bonus.setWaitAmount(bonus.getAmount());
|
||||
// 设置预计分成时间
|
||||
if (BonusArrivalType.userList().contains(bonus.getArrivalType())) {
|
||||
UserVO user = userList.stream().filter(item -> item.getUserId().equals(bonus.getArrivalId()))
|
||||
|
@ -325,7 +321,7 @@ public class BonusServiceImpl implements BonusService {
|
|||
|
||||
/**
|
||||
* 分成退款
|
||||
*
|
||||
*
|
||||
* @param bonusList
|
||||
* @param refundAmount
|
||||
* @param payAmount
|
||||
|
|
|
@ -190,7 +190,4 @@ public class Order extends BaseEntity {
|
|||
@ApiModelProperty("审核备注")
|
||||
private String verifyRemark;
|
||||
|
||||
@Excel(name = "实收金额")
|
||||
private BigDecimal actualAmount;
|
||||
|
||||
}
|
||||
|
|
|
@ -10,15 +10,15 @@ import lombok.Getter;
|
|||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum OrderStatus {
|
||||
|
||||
|
||||
WAIT_PAY("WAIT_PAY", "待支付"),
|
||||
PROCESSING("PROCESSING", "进行中"),
|
||||
PROCESSING("PROCESSING", "进行中"),
|
||||
FINISHED("FINISHED", "已结束"),
|
||||
CANCELED("CANCELED", "已取消"),
|
||||
WAIT_VERIFY("WAIT_VERIFY", "待审核"),
|
||||
REJECTED("REJECTED", "已驳回"),
|
||||
REFUNDED("REFUNDED", "已退款");
|
||||
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
|
@ -57,7 +57,7 @@ public enum OrderStatus {
|
|||
public static List<String> canCancelPay() {
|
||||
return CollectionUtils.map(OrderStatus::getCode, WAIT_PAY);
|
||||
}
|
||||
|
||||
|
||||
// 可以审核的订单状态
|
||||
public static List<String> canVerify() {
|
||||
return CollectionUtils.map(OrderStatus::getCode, WAIT_VERIFY);
|
||||
|
@ -67,4 +67,9 @@ public enum OrderStatus {
|
|||
public static List<String> valid() {
|
||||
return CollectionUtils.map(OrderStatus::getCode, PROCESSING, FINISHED, WAIT_VERIFY, REJECTED, REFUNDED);
|
||||
}
|
||||
|
||||
// 已完成的订单
|
||||
public static List<String> finishedList() {
|
||||
return CollectionUtils.map(OrderStatus::getCode, FINISHED, WAIT_VERIFY, REJECTED, REFUNDED);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
bo.area_user_id,
|
||||
bo.area_agent_id,
|
||||
bo.cancel_remark,
|
||||
bo.actual_amount,
|
||||
ba.name as area_name,
|
||||
su.nick_name as user_name,
|
||||
su.user_name as user_phone,
|
||||
|
@ -233,7 +232,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="areaUserId != null">area_user_id,</if>
|
||||
<if test="areaAgentId != null">area_agent_id,</if>
|
||||
<if test="cancelRemark != null">cancel_remark,</if>
|
||||
<if test="actualAmount != null">actual_amount,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="no != null and no != ''">#{no},</if>
|
||||
|
@ -276,7 +274,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="areaUserId != null">#{areaUserId},</if>
|
||||
<if test="areaAgentId != null">#{areaAgentId},</if>
|
||||
<if test="cancelRemark != null">#{cancelRemark},</if>
|
||||
<if test="actualAmount != null">#{actualAmount},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
@ -329,7 +326,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="data.areaUserId != null">area_user_id = #{data.areaUserId},</if>
|
||||
<if test="data.areaAgentId != null">area_agent_id = #{data.areaAgentId},</if>
|
||||
<if test="data.cancelRemark != null">cancel_remark = #{data.cancelRemark},</if>
|
||||
<if test="data.actualAmount != null">actual_amount = #{data.actualAmount},</if>
|
||||
</sql>
|
||||
|
||||
<delete id="deleteOrderById" parameterType="Long">
|
||||
|
@ -438,7 +434,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select
|
||||
bo.area_id,
|
||||
ba.name as area_name,
|
||||
sum(bo.actual_amount) as actual_amount,
|
||||
LEAST(sum(bo.total_fee), sum(bp.amount)) as actual_amount,
|
||||
count(bo.id) as `count`,
|
||||
sum(if(bo.status = 'PROCESSING', 1, 0)) as processing_count
|
||||
from <include refid="searchTables"/>
|
||||
|
@ -467,8 +463,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<update id="addDeductionFee">
|
||||
update bst_order bo
|
||||
set bo.deduction_fee = bo.deduction_fee + #{deductionFee},
|
||||
bo.total_fee = bo.total_fee + #{deductionFee},
|
||||
bo.actual_amount = max(bo.actual_amount + #{deductionFee}, bo.pay_amount)
|
||||
bo.total_fee = bo.total_fee + #{deductionFee}
|
||||
where bo.id = #{id} and bo.total_fee + #{deductionFee} <= bo.deposit_fee
|
||||
</update>
|
||||
|
||||
|
@ -482,19 +477,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<!-- subtractActualAmount -->
|
||||
|
||||
<update id="subtractActualAmount">
|
||||
update bst_order bo
|
||||
set bo.actual_amount = bo.actual_amount - #{amount}
|
||||
where bo.id = #{id} and bo.actual_amount >= #{amount}
|
||||
</update>
|
||||
|
||||
|
||||
<!-- selectSumOfActualAmount -->
|
||||
<!-- selectSumOfActualAmount -->
|
||||
|
||||
<select id="selectSumOfActualAmount" resultType="BigDecimal">
|
||||
select sum(bo.actual_amount)
|
||||
select sum(LEAST(bo.total_fee, bp.amount))
|
||||
from <include refid="searchTables"/>
|
||||
<where>
|
||||
<include refid="searchCondition"/>
|
||||
|
|
|
@ -24,8 +24,7 @@ import com.ruoyi.bst.pay.domain.vo.DoPayVO;
|
|||
* @author ruoyi
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
public interface OrderService
|
||||
{
|
||||
public interface OrderService {
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
|
@ -80,6 +79,7 @@ public interface OrderService
|
|||
|
||||
/**
|
||||
* 查询单个订单
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 订单
|
||||
*/
|
||||
|
@ -87,6 +87,7 @@ public interface OrderService
|
|||
|
||||
/**
|
||||
* 创建订单
|
||||
*
|
||||
* @param dto 创建订单DTO
|
||||
* @return 订单
|
||||
*/
|
||||
|
@ -94,7 +95,8 @@ public interface OrderService
|
|||
|
||||
/**
|
||||
* 查询订单
|
||||
* @param no 订单编号
|
||||
*
|
||||
* @param no 订单编号
|
||||
* @param scope 是否数据隔离
|
||||
* @return 订单
|
||||
*/
|
||||
|
@ -102,6 +104,7 @@ public interface OrderService
|
|||
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
* @param no 订单编号
|
||||
* @return 订单
|
||||
*/
|
||||
|
@ -111,6 +114,7 @@ public interface OrderService
|
|||
|
||||
/**
|
||||
* 取消订单
|
||||
*
|
||||
* @param id 订单ID
|
||||
* @return 结果
|
||||
*/
|
||||
|
@ -118,6 +122,7 @@ public interface OrderService
|
|||
|
||||
/**
|
||||
* 取消过期订单
|
||||
*
|
||||
* @param order 订单
|
||||
*/
|
||||
public void cancelWhenExpired(Order order);
|
||||
|
@ -132,6 +137,7 @@ public interface OrderService
|
|||
|
||||
/**
|
||||
* 计算订单金额
|
||||
*
|
||||
* @param dto 参数
|
||||
* @return 结果
|
||||
*/
|
||||
|
@ -139,6 +145,7 @@ public interface OrderService
|
|||
|
||||
/**
|
||||
* 退款
|
||||
*
|
||||
* @param dto 参数
|
||||
* @return 结果
|
||||
*/
|
||||
|
@ -164,7 +171,8 @@ public interface OrderService
|
|||
|
||||
/**
|
||||
* 更新订单设备ID
|
||||
* @param id 订单ID
|
||||
*
|
||||
* @param id 订单ID
|
||||
* @param orderDeviceId 订单设备ID
|
||||
* @return 结果
|
||||
*/
|
||||
|
@ -172,6 +180,7 @@ public interface OrderService
|
|||
|
||||
/**
|
||||
* 换车
|
||||
*
|
||||
* @param dto 换车DTO
|
||||
* @return 结果
|
||||
*/
|
||||
|
@ -179,6 +188,7 @@ public interface OrderService
|
|||
|
||||
/**
|
||||
* 还车审核
|
||||
*
|
||||
* @param dto 审核DTO
|
||||
* @return 结果
|
||||
*/
|
||||
|
@ -186,13 +196,15 @@ public interface OrderService
|
|||
|
||||
/**
|
||||
* 查询ID列表
|
||||
*
|
||||
* @param query
|
||||
*/
|
||||
public List<Long> selectIdList(OrderQuery query);
|
||||
|
||||
/**
|
||||
* 更新订单距离
|
||||
* @param id 订单ID
|
||||
*
|
||||
* @param id 订单ID
|
||||
* @param distance 距离
|
||||
*/
|
||||
public int updateDisatance(Long id, BigDecimal distance);
|
||||
|
|
|
@ -337,7 +337,6 @@ public class OrderConverterImpl implements OrderConverter{
|
|||
data.setReturnType(order.getReturnType());
|
||||
data.setEndAreaSubName(order.getEndAreaSubName());
|
||||
data.setEndReason(order.getEndReason());
|
||||
data.setActualAmount(order.getActualAmount());
|
||||
return data;
|
||||
}
|
||||
|
||||
|
|
|
@ -477,7 +477,6 @@ public class OrderServiceImpl implements OrderService {
|
|||
order.setDispatchFee(orderFee.getDispatchFee());
|
||||
order.setRidingFee(orderFee.getRidingFee());
|
||||
order.setTotalFee(orderFee.getTotalFee());
|
||||
order.setActualAmount(MathUtils.min(order.getPayedAmount(), order.getTotalFee())); // 实收金额
|
||||
}
|
||||
|
||||
private int refundRemainAmount(OrderVO order) {
|
||||
|
@ -486,7 +485,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
}
|
||||
// 订单剩余金额退款
|
||||
// 退款金额 = 实付金额 - 实收金额
|
||||
BigDecimal refund = MathUtils.subtractDecimal(order.getPayedAmount(), order.getActualAmount());
|
||||
BigDecimal refund = MathUtils.subtractDecimal(order.getPayedAmount(), order.getTotalFee());
|
||||
if (refund != null && refund.compareTo(BigDecimal.ZERO) > 0) {
|
||||
return this.refund(order, refund, null, null, "系统", RefundType.AUTO.getCode());
|
||||
}
|
||||
|
@ -527,16 +526,10 @@ public class OrderServiceImpl implements OrderService {
|
|||
|
||||
Integer result = transactionTemplate.execute(status -> {
|
||||
|
||||
// 人工退款时,分成需要退款
|
||||
if (RefundType.ADMIN.getCode().equals(type)) {
|
||||
boolean bonusRefund = bonusService.refundByBst(BonusBstType.ORDER, order.getId(), amount,
|
||||
order.getActualAmount(), finalRefundReason);
|
||||
ServiceUtil.assertion(!bonusRefund, "ID为%s的订单分成退款失败", order.getId());
|
||||
}
|
||||
|
||||
// 订单实收扣减
|
||||
int sub = orderMapper.subtractActualAmount(order.getId(), amount);
|
||||
ServiceUtil.assertion(sub != 1, "订单实收金额扣减失败,请检查金额是否充足");
|
||||
// 分成退款
|
||||
boolean bonusRefund = bonusService.refundByBst(BonusBstType.ORDER, order.getId(), amount,
|
||||
order.getPayAmount(), finalRefundReason);
|
||||
ServiceUtil.assertion(!bonusRefund, "ID为%s的订单分成退款失败", order.getId());
|
||||
|
||||
// 支付退款
|
||||
PayRefundDTO dto = new PayRefundDTO();
|
||||
|
@ -760,7 +753,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
if (order == null) {
|
||||
return false;
|
||||
}
|
||||
return bonusService.prepayByBst(BonusBstType.ORDER, orderId, order.getActualAmount());
|
||||
return bonusService.prepayByBst(BonusBstType.ORDER, orderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -178,7 +178,7 @@ public class OrderUtil {
|
|||
if (order == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return order.getActualAmount();
|
||||
return MathUtils.subtractDecimal(order.getPayAmount(), order.getPayRefunding(), order.getPayRefunded());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,8 +19,18 @@ public class StatKeys {
|
|||
public static final String ORDER_WAIT_VERIFY_COUNT = "order_wait_verify_count";
|
||||
// 订单状态数量
|
||||
public static final String ORDER_STATUS_COUNT = "order_status_count";
|
||||
// 订单完成状态数量
|
||||
public static final String ORDER_END_STATUS_COUNT = "order_end_status_count";
|
||||
// 订单实收金额
|
||||
public static final String ORDER_ACTUAL_AMOUNT = "order_actual_amount";
|
||||
// 订单骑行费
|
||||
public static final String ORDER_RIDDING_FEE = "order_ridding_fee";
|
||||
// 订单车损费
|
||||
public static final String ORDER_DEDUCTION_FEE = "order_deduction_fee";
|
||||
// 订单调度费
|
||||
public static final String ORDER_DISPATCH_FEE = "order_dispatch_fee";
|
||||
// 订单管理费
|
||||
public static final String ORDER_MANAGE_FEE = "order_manage_fee";
|
||||
|
||||
// 分成数量
|
||||
public static final String BONUS_COUNT = "bonus_count";
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ruoyi.dashboard.domain.revenueStat;
|
|||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ruoyi.bst.order.domain.enums.OrderStatus;
|
||||
import com.ruoyi.common.utils.MathUtils;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
@ -13,12 +14,39 @@ public class RevenueStatVO {
|
|||
|
||||
@ApiModelProperty("订单用户数量")
|
||||
private Integer orderUserCount;
|
||||
@ApiModelProperty("订单实收金额")
|
||||
private BigDecimal orderActualAmount;
|
||||
@ApiModelProperty("订单总金额")
|
||||
private BigDecimal orderActualTotalAmount;
|
||||
@ApiModelProperty("订单骑行费")
|
||||
private BigDecimal orderRiddingFee;
|
||||
@ApiModelProperty("订单车损费")
|
||||
private BigDecimal orderDeductionFee;
|
||||
@ApiModelProperty("订单调度费")
|
||||
private BigDecimal orderDispatchFee;
|
||||
@ApiModelProperty("订单管理费")
|
||||
private BigDecimal orderManageFee;
|
||||
@ApiModelProperty("订单总数量")
|
||||
private Integer orderCount;
|
||||
@ApiModelProperty("订单状态数量")
|
||||
@ApiModelProperty("订单退款金额")
|
||||
private BigDecimal orderRefundAmount;
|
||||
@ApiModelProperty("订单状态数量(创建时间)")
|
||||
private Map<String, Integer> orderStatusMap;
|
||||
@ApiModelProperty("订单状态数量(完成时间)")
|
||||
private Map<String, Integer> orderEndStatusMap;
|
||||
@ApiModelProperty("已完成的订单")
|
||||
public Integer getFinishedOrderCount() {
|
||||
if (orderEndStatusMap == null) {
|
||||
return 0;
|
||||
}
|
||||
int count = 0;
|
||||
for (String status : OrderStatus.finishedList()) {
|
||||
count += MathUtils.dv(orderEndStatusMap.get(status));
|
||||
}
|
||||
return count;
|
||||
}
|
||||
@ApiModelProperty("订单实收金额")
|
||||
public BigDecimal getOrderActualAmount() {
|
||||
return MathUtils.subtractDecimal(orderActualTotalAmount, orderRefundAmount);
|
||||
}
|
||||
|
||||
@ApiModelProperty("分成总金额")
|
||||
private BigDecimal bonusAmount;
|
||||
|
@ -32,7 +60,7 @@ public class RevenueStatVO {
|
|||
public BigDecimal getBonusActualAmount() {
|
||||
return MathUtils.subtractDecimal(bonusAmount, bonusRefundAmount);
|
||||
}
|
||||
|
||||
|
||||
@ApiModelProperty("运营区数量")
|
||||
private Integer areaCount;
|
||||
@ApiModelProperty("运营区加盟数量")
|
||||
|
|
|
@ -86,10 +86,14 @@ public class DashboardService {
|
|||
}
|
||||
|
||||
public List<DailyStatVO> selectDailyStat(DailyStatQuery query) {
|
||||
List<OrderDailyStatVO> orderList = orderDashboard.selectDailyStat(DashboardUtil.toOrderQuery(query), query.getOrderKeys());
|
||||
List<OrderDailyRefundStatVO> orderRefundList = orderDashboard.selectDailyRefundStat(DashboardUtil.toOrderRefundQuery(query), query.getOrderRefundKeys());
|
||||
List<BonusDailyStatVO> bonusList = bonusDashboard.selectDailyStat(DashboardUtil.toBonusQuery(query), query.getBonusKeys());
|
||||
List<BonusRefundDailyStatVO> bonusRefundList = bonusRefundDashboard.selectDailyStat(DashboardUtil.toBonusRefundQuery(query), query.getBonusRefundKeys());
|
||||
List<OrderDailyStatVO> orderList = orderDashboard.selectDailyStat(DashboardUtil.toOrderQuery(query),
|
||||
query.getOrderKeys());
|
||||
List<OrderDailyRefundStatVO> orderRefundList = orderDashboard
|
||||
.selectDailyRefundStat(DashboardUtil.toOrderRefundQuery(query), query.getOrderRefundKeys());
|
||||
List<BonusDailyStatVO> bonusList = bonusDashboard.selectDailyStat(DashboardUtil.toBonusQuery(query),
|
||||
query.getBonusKeys());
|
||||
List<BonusRefundDailyStatVO> bonusRefundList = bonusRefundDashboard
|
||||
.selectDailyStat(DashboardUtil.toBonusRefundQuery(query), query.getBonusRefundKeys());
|
||||
|
||||
List<DailyStatVO> result = new ArrayList<>();
|
||||
if (query.getDateRange() != null && query.getDateRange().size() >= 2) {
|
||||
|
@ -124,7 +128,6 @@ public class DashboardService {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
public RevenueStatVO selectRevenueStat(RevenueStatQuery query) {
|
||||
RevenueStatVO vo = new RevenueStatVO();
|
||||
List<String> keys = query.getKeys();
|
||||
|
@ -134,7 +137,7 @@ public class DashboardService {
|
|||
}
|
||||
// 订单实收金额
|
||||
if (keys.contains(StatKeys.ORDER_ACTUAL_AMOUNT)) {
|
||||
vo.setOrderActualAmount(orderDashboard.selectSumOfActualAmount(query.toOrderQueryForEnd()));
|
||||
vo.setOrderActualTotalAmount(orderDashboard.selectSumOfActualAmount(query.toOrderQueryForEnd()));
|
||||
}
|
||||
// 订单数量
|
||||
if (keys.contains(StatKeys.ORDER_COUNT)) {
|
||||
|
@ -184,7 +187,7 @@ public class DashboardService {
|
|||
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()));
|
||||
}
|
||||
|
@ -206,7 +209,7 @@ public class DashboardService {
|
|||
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()));
|
||||
|
|
Loading…
Reference in New Issue
Block a user