现金业绩拆分成可分红业绩, 总业绩.
升级看总业绩 , 分红看分红业绩
This commit is contained in:
@@ -118,7 +118,7 @@ public class AccelUpgradeCashProcessor implements BasicProcessor {
|
||||
Wrappers.lambdaQuery(CommonOrderConfirmLogEntity.class)
|
||||
.eq(CommonOrderConfirmLogEntity::getIsAgencyDistributed, 0)
|
||||
.func(queryWrapper -> queryWrapper.apply("UPPER(order_type) = {0}", orderType))
|
||||
.in(CommonOrderConfirmLogEntity::getPaymentType, List.of(1, 2))
|
||||
.in(CommonOrderConfirmLogEntity::getPaymentType, List.of(PaymentType.ALI.getCode() , PaymentType.WECHAT.getCode()))
|
||||
.ge(CommonOrderConfirmLogEntity::getCreateTime, startDate)
|
||||
.le(CommonOrderConfirmLogEntity::getCreateTime, endDate)
|
||||
.orderByAsc(CommonOrderConfirmLogEntity::getId)
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.springblade.core.tool.sensitive.SensitiveUtil;
|
||||
import org.springblade.modules.common.eums.BusinessModule;
|
||||
import org.springblade.modules.common.eums.OrderStatus;
|
||||
import org.springblade.modules.common.eums.PaymentStatus;
|
||||
import org.springblade.modules.common.eums.PaymentType;
|
||||
import org.springblade.modules.common.pojo.entity.CommonOrderConfirmLogEntity;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||
import org.springblade.modules.common.service.ICommonOrderConfirmLogService;
|
||||
@@ -63,7 +64,7 @@ public class StatsCalculatorCashProcessor implements BasicProcessor {
|
||||
|
||||
List<CommonOrderConfirmLogEntity> orderPageList = orderConfirmLogService.list(
|
||||
Wrappers.lambdaQuery(CommonOrderConfirmLogEntity.class)
|
||||
.in(CommonOrderConfirmLogEntity::getPaymentType, List.of(1, 2))
|
||||
.in(CommonOrderConfirmLogEntity::getPaymentType, List.of(PaymentType.ALI.getCode() , PaymentType.WECHAT.getCode() , PaymentType.OFFLINE.getCode()))
|
||||
.func(queryWrapper -> queryWrapper.apply("UPPER(order_type) = {0}", orderType))
|
||||
.ge(CommonOrderConfirmLogEntity::getCreateTime, startDate)
|
||||
.le(CommonOrderConfirmLogEntity::getCreateTime, endDate)
|
||||
@@ -106,8 +107,8 @@ public class StatsCalculatorCashProcessor implements BasicProcessor {
|
||||
}
|
||||
BigDecimal finalActualAmount = actualAmount;
|
||||
// 构建详情
|
||||
String sourceDetail = String.format("现金业绩详情:订单号:%d;商品:%s;实付金额:%s元",
|
||||
order.getId(), order.getItemName(), actualAmount);
|
||||
String sourceDetail = String.format("现金业绩详情:订单号:%d;商品:%s;实付金额:%s元;支付渠道:%s",
|
||||
order.getId(), order.getItemName(), actualAmount , PaymentType.fromCode(order.getPaymentType()).getName());
|
||||
|
||||
// 获取用户账号 (用于脱敏)
|
||||
User user = userMap.get(userId);
|
||||
@@ -138,12 +139,24 @@ public class StatsCalculatorCashProcessor implements BasicProcessor {
|
||||
MarketCashPerformanceEntity entity = new MarketCashPerformanceEntity();
|
||||
entity.setId(ancestorId);
|
||||
entity.setTotalAmount(finalActualAmount);
|
||||
if (order.getPaymentType() == PaymentType.ALI.getCode() || order.getPaymentType() == PaymentType.WECHAT.getCode()){
|
||||
entity.setDividendAmount(finalActualAmount);
|
||||
}else {
|
||||
entity.setDividendAmount(BigDecimal.ZERO);
|
||||
}
|
||||
entity.setUpdateTime(new Date());
|
||||
cashPerformanceMap.put(ancestorId, entity);
|
||||
|
||||
}else {
|
||||
MarketCashPerformanceEntity entity = cashPerformanceMap.get(ancestorId);
|
||||
entity.setTotalAmount(entity.getTotalAmount().add(finalActualAmount));
|
||||
|
||||
if (order.getPaymentType() == PaymentType.ALI.getCode() || order.getPaymentType() == PaymentType.WECHAT.getCode()){
|
||||
entity.setDividendAmount(entity.getDividendAmount().add(finalActualAmount));
|
||||
}else {
|
||||
entity.setDividendAmount(entity.getDividendAmount().add(BigDecimal.ZERO));
|
||||
}
|
||||
|
||||
cashPerformanceMap.put(ancestorId, entity);
|
||||
}
|
||||
|
||||
@@ -160,7 +173,7 @@ public class StatsCalculatorCashProcessor implements BasicProcessor {
|
||||
|
||||
}else {
|
||||
MarketCashPerformanceEntity entity = owenCashPerformanceMap.get(userId);
|
||||
entity.setOwenAmount(entity.getTotalAmount().add(finalActualAmount));
|
||||
entity.setOwenAmount(entity.getOwenAmount().add(finalActualAmount));
|
||||
owenCashPerformanceMap.put(userId, entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
INSERT INTO market_cash_performance (
|
||||
id,
|
||||
total_amount,
|
||||
dividend_amount,
|
||||
update_time,
|
||||
version
|
||||
) VALUES
|
||||
@@ -35,12 +36,14 @@
|
||||
(
|
||||
#{entity.id},
|
||||
#{entity.totalAmount},
|
||||
#{entity.dividendAmount},
|
||||
#{entity.updateTime},
|
||||
1
|
||||
)
|
||||
</foreach>
|
||||
ON CONFLICT (id) DO UPDATE SET
|
||||
total_amount = market_cash_performance.total_amount + EXCLUDED.total_amount,
|
||||
dividend_amount = market_cash_performance.dividend_amount + EXCLUDED.dividend_amount,
|
||||
update_time = EXCLUDED.update_time,
|
||||
version = market_cash_performance.version + 1
|
||||
|
||||
|
||||
@@ -33,6 +33,13 @@ public class MarketCashPerformanceEntity extends BaseEntity {
|
||||
*/
|
||||
@Schema(description = "总业绩")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 可分红业绩
|
||||
*/
|
||||
@Schema(description = "可分红业绩")
|
||||
private BigDecimal dividendAmount;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user