|
@@ -6,11 +6,15 @@ import com.qs.mp.admin.domain.TicketBox;
|
|
|
import com.qs.mp.admin.service.ITicketBoxService;
|
|
|
import com.qs.mp.channel.domain.Channel;
|
|
|
import com.qs.mp.channel.domain.ChannelCommission;
|
|
|
+import com.qs.mp.channel.domain.ChannelCouponVerifyLog;
|
|
|
import com.qs.mp.channel.domain.ChannelWithdraw;
|
|
|
import com.qs.mp.channel.service.IChannelCommissionService;
|
|
|
+import com.qs.mp.channel.service.IChannelCouponVerifyLogService;
|
|
|
import com.qs.mp.channel.service.IChannelService;
|
|
|
import com.qs.mp.channel.service.IChannelWithdrawService;
|
|
|
+import com.qs.mp.common.enums.ChannelWithdrawStatusEnum;
|
|
|
import com.qs.mp.common.enums.CoinLogTypeEnum;
|
|
|
+import com.qs.mp.common.enums.CouponDiscountTypeEnum;
|
|
|
import com.qs.mp.common.enums.TicketBoxStatusEnum;
|
|
|
import com.qs.mp.common.enums.TicketTypeEnum;
|
|
|
import com.qs.mp.common.enums.UserTicketOrderStatusEnum;
|
|
@@ -72,6 +76,9 @@ public class DayStatTask {
|
|
|
@Autowired
|
|
|
private IUserCoinLogService userCoinLogService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IChannelCouponVerifyLogService channelCouponVerifyLogService;
|
|
|
+
|
|
|
@Value("${export.page-size}")
|
|
|
private int pageSize;
|
|
|
|
|
@@ -170,14 +177,35 @@ public class DayStatTask {
|
|
|
new BigDecimal(100), 2, RoundingMode.DOWN)).append("元\n");
|
|
|
}
|
|
|
|
|
|
+ Map<String, Object> couponMap = channelCouponVerifyLogService.getMap(
|
|
|
+ new QueryWrapper<ChannelCouponVerifyLog>()
|
|
|
+ .select("IFNULL(sum(discount) ,0) as discount")
|
|
|
+ .lambda().ge(ChannelCouponVerifyLog::getCreatedTime, bizDay)
|
|
|
+ .lt(ChannelCouponVerifyLog::getCreatedTime, DateUtils.addDays(bizDay, 1))
|
|
|
+ .eq(ChannelCouponVerifyLog::getDiscountType, CouponDiscountTypeEnum.MONEY_OFF));
|
|
|
+ Map<String, Object> allCouponMap = channelCouponVerifyLogService.getMap(
|
|
|
+ new QueryWrapper<ChannelCouponVerifyLog>()
|
|
|
+ .select("IFNULL(sum(discount) ,0) as discount")
|
|
|
+ .lambda().eq(ChannelCouponVerifyLog::getDiscountType, CouponDiscountTypeEnum.MONEY_OFF));
|
|
|
+ if (null != commMap) {
|
|
|
+ sb.append("累计核销:").append(
|
|
|
+ new BigDecimal(Integer.valueOf(String.valueOf(allCouponMap.get("discount")))).divide(
|
|
|
+ new BigDecimal(100), 2, RoundingMode.DOWN))
|
|
|
+ .append("元,当日:").append(
|
|
|
+ new BigDecimal(Integer.valueOf(String.valueOf(couponMap.get("discount")))).divide(
|
|
|
+ new BigDecimal(100), 2, RoundingMode.DOWN)).append("元\n");
|
|
|
+ }
|
|
|
+
|
|
|
Map<String, Object> withdrawMap = channelWithdrawService.getMap(
|
|
|
new QueryWrapper<ChannelWithdraw>()
|
|
|
.select("IFNULL(sum(money) ,0) as withdrawAmt")
|
|
|
.lambda().ge(ChannelWithdraw::getCreateTime, bizDay)
|
|
|
- .lt(ChannelWithdraw::getCreateTime, DateUtils.addDays(bizDay, 1)));
|
|
|
+ .lt(ChannelWithdraw::getCreateTime, DateUtils.addDays(bizDay, 1))
|
|
|
+ .eq(ChannelWithdraw::getStatus, ChannelWithdrawStatusEnum.FINISHED));
|
|
|
Map<String, Object> allWithdrawMap = channelWithdrawService.getMap(
|
|
|
new QueryWrapper<ChannelWithdraw>()
|
|
|
- .select("IFNULL(sum(money) ,0) as withdrawAmt"));
|
|
|
+ .select("IFNULL(sum(money) ,0) as withdrawAmt")
|
|
|
+ .lambda().eq(ChannelWithdraw::getStatus, ChannelWithdrawStatusEnum.FINISHED));
|
|
|
if (null != withdrawMap) {
|
|
|
sb.append("累计提现:").append(
|
|
|
new BigDecimal(Integer.valueOf(String.valueOf(allWithdrawMap.get("withdrawAmt")))).divide(
|