update:
1. fix biz-log module
This commit is contained in:
@@ -2,13 +2,31 @@ package org.springblade.job.processor;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.modules.market.service.IMarketDailySummaryService;
|
||||
import org.springblade.modules.market.service.IMarketInfoService;
|
||||
import org.springframework.stereotype.Component;
|
||||
import tech.powerjob.worker.core.processor.ProcessResult;
|
||||
import tech.powerjob.worker.core.processor.TaskContext;
|
||||
import tech.powerjob.worker.core.processor.sdk.BasicProcessor;
|
||||
import tech.powerjob.worker.log.OmsLogger;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class DailyBenefitLogProcessor {
|
||||
public class DailyBenefitLogProcessor implements BasicProcessor {
|
||||
|
||||
private final IMarketDailySummaryService dailySummaryService;
|
||||
|
||||
private final IMarketInfoService marketInfoService;
|
||||
|
||||
|
||||
@Override
|
||||
public ProcessResult process(TaskContext context) throws Exception {
|
||||
OmsLogger omsLogger = context.getOmsLogger();
|
||||
omsLogger.info("每日动态结算任务开始:{}", context.getJobParams());
|
||||
ProcessResult result = new ProcessResult();
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,9 +11,9 @@ import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.secure.annotation.PreAuth;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.modules.common.excel.CommonUserPointLogExcel;
|
||||
import org.springblade.modules.common.manager.CommonUserManager;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointLogEntity;
|
||||
@@ -41,7 +41,6 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
public class CommonUserPointLogController extends BladeController {
|
||||
|
||||
private final ICommonUserPointLogService commonUserPointLogService;
|
||||
private final CommonUserManager commonUserManager;
|
||||
|
||||
/**
|
||||
* 用户商城积分流水表 详情
|
||||
@@ -116,13 +115,12 @@ public class CommonUserPointLogController extends BladeController {
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/exportFlowToExcel")
|
||||
@GetMapping("/export")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "导出用户佣金流水")
|
||||
public void exportFlowToExcel(@RequestParam String account , @RequestParam List<String> searchDateRange , HttpServletResponse response) {
|
||||
List<CommonUserPointLogExcel> excelList = commonUserManager.exportUserPointToExcel(account ,searchDateRange);
|
||||
ExcelUtil.export(response, "用户积分流水日志" + org.springblade.core.tool.utils.DateUtil.time(), "用户积分流水日志", excelList, CommonUserPointLogExcel.class);
|
||||
|
||||
List<CommonUserPointLogExcel> excelList = commonUserPointLogService.exportUserPointLog(account ,searchDateRange);
|
||||
ExcelUtil.export(response, "用户积分流水日志" + DateUtil.time(), "用户积分流水日志", excelList, CommonUserPointLogExcel.class);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,26 +8,17 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.common.utils.date.DateUtil;
|
||||
import org.springblade.core.excel.util.ExcelUtil;
|
||||
import org.springblade.core.log.exception.ServiceException;
|
||||
import org.springblade.core.oauth2.exception.UserInvalidException;
|
||||
import org.springblade.modules.common.eums.*;
|
||||
import org.springblade.modules.common.event.PaymentSuccessEvent;
|
||||
import org.springblade.modules.common.excel.CommonUserBackOrderExcel;
|
||||
import org.springblade.modules.common.excel.CommonUserOrderExcel;
|
||||
import org.springblade.modules.common.excel.CommonUserPointLogExcel;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointLogEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonImportUserBackOrderError;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserOrderVO;
|
||||
import org.springblade.modules.common.service.ICommonUserOrderService;
|
||||
import org.springblade.modules.common.service.ICommonUserPointLogService;
|
||||
|
||||
import org.springblade.modules.common.service.ICommonUserPointService;
|
||||
import org.springblade.modules.system.pojo.entity.User;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.*;
|
||||
@@ -36,63 +27,11 @@ import java.util.*;
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class CommonUserManager {
|
||||
private final IUserService userService;
|
||||
private final ICommonUserPointLogService commonUserPointLogService;
|
||||
|
||||
private final ICommonUserOrderService commonUserOrderService;
|
||||
|
||||
private final ApplicationEventPublisher eventPublisher;
|
||||
private final ICommonUserPointService userPointService;
|
||||
|
||||
public List<CommonUserPointLogExcel> exportUserPointToExcel(String account, List<String> searchDateRange) {
|
||||
|
||||
Assert.isTrue(StringUtils.hasLength(account), "请选择账号");
|
||||
|
||||
User user = userService.getOne(
|
||||
Wrappers.lambdaQuery(User.class)
|
||||
.eq(User::getAccount, account)
|
||||
);
|
||||
Assert.notNull(user, "账号不存在");
|
||||
Date startDate = null;
|
||||
Date endDate = null;
|
||||
if (searchDateRange == null) {
|
||||
throw new RuntimeException("请选择时间范围");
|
||||
}
|
||||
|
||||
startDate = DateUtil.convertFromString(searchDateRange.get(0), "yyyy-MM-dd hh:mm:ss");
|
||||
endDate = DateUtil.convertFromString(searchDateRange.get(1), "yyyy-MM-dd hh:mm:ss");
|
||||
|
||||
if (startDate.getTime() >= endDate.getTime()) {
|
||||
throw new RuntimeException("开始时间不能大于结束时间");
|
||||
}
|
||||
|
||||
List<CommonUserPointLogEntity> pointLogList = commonUserPointLogService.list(
|
||||
Wrappers.lambdaQuery(CommonUserPointLogEntity.class)
|
||||
.eq(CommonUserPointLogEntity::getIsComplete, 1)
|
||||
.eq(CommonUserPointLogEntity::getUserId, user.getId())
|
||||
.ge(CommonUserPointLogEntity::getCreateTime, startDate)
|
||||
.lt(CommonUserPointLogEntity::getCreateTime, endDate)
|
||||
.orderByDesc(CommonUserPointLogEntity::getCreateTime)
|
||||
);
|
||||
|
||||
List<CommonUserPointLogExcel> excelList = new ArrayList<>();
|
||||
|
||||
pointLogList.forEach(pointLog -> {
|
||||
|
||||
CommonUserPointLogExcel pointLogExcel = new CommonUserPointLogExcel();
|
||||
|
||||
pointLogExcel.setAccount(user.getAccount());
|
||||
pointLogExcel.setAmount(pointLog.getAmount());
|
||||
pointLogExcel.setLastAmount(pointLog.getLastAmount());
|
||||
pointLogExcel.setType(pointLog.getType() == 1 ? "收入" : "支出");
|
||||
pointLogExcel.setCreateTime(pointLog.getCreateTime());
|
||||
pointLogExcel.setRemark(pointLog.getRemark());
|
||||
|
||||
excelList.add(pointLogExcel);
|
||||
|
||||
});
|
||||
|
||||
return excelList;
|
||||
|
||||
}
|
||||
|
||||
public List<CommonUserOrderExcel> exportUserMallOrderToExcel(Integer orderStatus, String account, List<String> searchDateRange) {
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package org.springblade.modules.common.mapper;
|
||||
|
||||
import org.springblade.modules.common.excel.CommonUserPointLogExcel;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointLogEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserPointLogVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -24,4 +27,5 @@ public interface CommonUserPointLogMapper extends BaseMapper<CommonUserPointLogE
|
||||
List<CommonUserPointLogVO> selectCommonUserPointLogPage(IPage page, CommonUserPointLogVO pointLog);
|
||||
|
||||
|
||||
List<CommonUserPointLogExcel> exportUserPointLog(String account, Date startTime, Date endTime);
|
||||
}
|
||||
|
||||
@@ -38,5 +38,16 @@
|
||||
order by upl.id desc
|
||||
</select>
|
||||
|
||||
<select id="exportUserPointLog" resultType="org.springblade.modules.common.excel.CommonUserPointLogExcel">
|
||||
select bu.account, upl.amount, upl.last_amount,upl.type,upl.remark, upl.create_time
|
||||
from user_point_log upl
|
||||
left join blade_user bu on upl.user_id = bu.id
|
||||
where upl.is_deleted = 0 and upl.create_time >= #{startTime} and upl.create_time <= #{endTime}
|
||||
<if test="account != null and account.trim() != ''">
|
||||
and bu.account = #{account}
|
||||
</if>
|
||||
order by upl.id desc
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
*/
|
||||
package org.springblade.modules.common.service;
|
||||
|
||||
import org.springblade.modules.common.excel.CommonUserPointLogExcel;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointEntity;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointLogEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserPointLogVO;
|
||||
@@ -32,6 +33,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户商城积分流水表 服务类
|
||||
@@ -51,4 +53,6 @@ public interface ICommonUserPointLogService extends BaseService<CommonUserPointL
|
||||
|
||||
Boolean recordPointChangeLog(CommonUserPointEntity commonUserPoint, BigDecimal lastAmount, String sourceType, BigDecimal amount, Integer type, Long sourceId, String sourceDetail);
|
||||
|
||||
List<CommonUserPointLogExcel> exportUserPointLog(String account, List<String> searchDateRange);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
package org.springblade.modules.common.service.impl;
|
||||
|
||||
import org.springblade.common.utils.date.DateUtil;
|
||||
import org.springblade.modules.common.excel.CommonUserPointLogExcel;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointEntity;
|
||||
import org.springblade.modules.common.pojo.entity.CommonUserPointLogEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserPointLogVO;
|
||||
import org.springblade.modules.common.mapper.CommonUserPointLogMapper;
|
||||
import org.springblade.modules.common.service.ICommonUserPointLogService;
|
||||
import org.springblade.modules.market.eums.MarketLogType;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户商城积分流水表 服务实现类
|
||||
@@ -41,5 +45,25 @@ public class CommonUserPointLogServiceImpl extends BaseServiceImpl<CommonUserPoi
|
||||
return save(userPointLog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonUserPointLogExcel> exportUserPointLog(String account, List<String> searchDateRange) {
|
||||
Date startTime;
|
||||
Date endTime;
|
||||
|
||||
if (searchDateRange == null) {
|
||||
throw new RuntimeException("请选择时间范围");
|
||||
}
|
||||
|
||||
startTime = DateUtil.convertFromString(searchDateRange.get(0), "yyyy-MM-dd hh:mm:ss");
|
||||
endTime = DateUtil.convertFromString(searchDateRange.get(1), "yyyy-MM-dd hh:mm:ss");
|
||||
|
||||
if (startTime.getTime() >= endTime.getTime()) {
|
||||
throw new RuntimeException("开始时间不能大于结束时间");
|
||||
}
|
||||
List<CommonUserPointLogExcel> logExcelList = baseMapper.exportUserPointLog(account, startTime, endTime);
|
||||
logExcelList.forEach(log -> log.setType(MarketLogType.of(Integer.parseInt(log.getType())).getDescription()));
|
||||
return logExcelList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -13,9 +13,9 @@ import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.secure.annotation.PreAuth;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.modules.market.excel.MarketBenefitPointLogExcel;
|
||||
import org.springblade.modules.market.manager.MarketUserPointManager;
|
||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPointLogEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -41,7 +41,6 @@ import java.util.Map;
|
||||
public class MarketBenefitPointLogController extends BladeController {
|
||||
|
||||
private final IMarketBenefitPointLogService marketBenefitPointLogService;
|
||||
private final MarketUserPointManager userPointManager;
|
||||
|
||||
/**
|
||||
* 用户福利值流水表 详情
|
||||
@@ -116,13 +115,12 @@ public class MarketBenefitPointLogController extends BladeController {
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/exportFlowToExcel")
|
||||
@GetMapping("/export")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "导出福利积分流水")
|
||||
public void exportFlowToExcel(@RequestParam String account , @RequestParam List<String> searchDateRange , HttpServletResponse response) {
|
||||
List<MarketBenefitPointLogExcel> excelList = userPointManager.exportBenefitPointToExcel(account ,searchDateRange);
|
||||
ExcelUtil.export(response, "福利积分流水日志" + org.springblade.core.tool.utils.DateUtil.time(), "福利积分流水日志", excelList, MarketBenefitPointLogExcel.class);
|
||||
|
||||
List<MarketBenefitPointLogExcel> excelList = marketBenefitPointLogService.exportBenefitPointLog(account ,searchDateRange);
|
||||
ExcelUtil.export(response, "福利积分流水日志" + DateUtil.time(), "福利积分流水日志", excelList, MarketBenefitPointLogExcel.class);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.secure.annotation.PreAuth;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.modules.market.excel.MarketCashCouponLogExcel;
|
||||
import org.springblade.modules.market.manager.MarketUserPointManager;
|
||||
import org.springblade.modules.market.pojo.entity.MarketCashCouponLogEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -41,7 +41,6 @@ import java.util.Map;
|
||||
public class MarketCashCouponLogController extends BladeController {
|
||||
|
||||
private final IMarketCashCouponLogService marketCashCouponLogService;
|
||||
private final MarketUserPointManager userPointManager;
|
||||
|
||||
/**
|
||||
* 用户现金券流水表 详情
|
||||
@@ -115,13 +114,12 @@ public class MarketCashCouponLogController extends BladeController {
|
||||
return R.status(marketCashCouponLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
@GetMapping("/exportFlowToExcel")
|
||||
@GetMapping("/export")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "导出现金券流水")
|
||||
public void exportFlowToExcel(@RequestParam String account , @RequestParam List<String> searchDateRange , HttpServletResponse response) {
|
||||
List<MarketCashCouponLogExcel> excelList = userPointManager.exportCashCouponToExcel(account ,searchDateRange);
|
||||
ExcelUtil.export(response, "现金券流水日志" + org.springblade.core.tool.utils.DateUtil.time(), "现金券流水日志", excelList, MarketCashCouponLogExcel.class);
|
||||
|
||||
List<MarketCashCouponLogExcel> excelList = marketCashCouponLogService.exportCashCouponLog(account ,searchDateRange);
|
||||
ExcelUtil.export(response, "现金券流水日志" + DateUtil.time(), "现金券流水日志", excelList, MarketCashCouponLogExcel.class);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ import org.springblade.core.secure.annotation.PreAuth;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.modules.market.excel.MarketUserCommissionLogExcel;
|
||||
import org.springblade.modules.market.manager.MarketUserPointManager;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.market.pojo.entity.MarketUserCommissionLogEntity;
|
||||
@@ -43,8 +42,6 @@ import java.util.Map;
|
||||
public class MarketUserCommissionLogController extends BladeController {
|
||||
|
||||
private final IMarketUserCommissionLogService userCommissionLogService;
|
||||
private final MarketUserPointManager userPointManager;
|
||||
|
||||
/**
|
||||
* 用户佣金流水表 详情
|
||||
*/
|
||||
@@ -117,11 +114,11 @@ public class MarketUserCommissionLogController extends BladeController {
|
||||
return R.status(userCommissionLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
@GetMapping("/exportFlowToExcel")
|
||||
@GetMapping("/export")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "导出用户佣金流水")
|
||||
public void exportFlowToExcel(@RequestParam String account , @RequestParam List<String> searchDateRange , HttpServletResponse response) {
|
||||
List<MarketUserCommissionLogExcel> excelList = userPointManager.exportUserCommissionToExcel(account ,searchDateRange);
|
||||
List<MarketUserCommissionLogExcel> excelList = userCommissionLogService.exportUserCommissionLog(account ,searchDateRange);
|
||||
ExcelUtil.export(response, "用户佣金流水日志" + org.springblade.core.tool.utils.DateUtil.time(), "用户佣金流水日志", excelList, MarketUserCommissionLogExcel.class);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package org.springblade.modules.market.eums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum MarketLogType {
|
||||
|
||||
INCOME(1, "收入"),
|
||||
EXPENSE(2, "支出");
|
||||
|
||||
private final int code;
|
||||
private final String description;
|
||||
|
||||
MarketLogType(int code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public static MarketLogType of(int code) {
|
||||
for (MarketLogType type : values()) {
|
||||
if (type.code == code) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("无效的消费类型 code: " + code);
|
||||
}
|
||||
|
||||
public static MarketLogType parse(Integer code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (MarketLogType type : values()) {
|
||||
if (type.code == code) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -4,15 +4,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.common.utils.date.DateUtil;
|
||||
import org.springblade.core.secure.utils.AuthUtil;
|
||||
import org.springblade.modules.api.vo.MarketUserBenefitPointLogVO;
|
||||
import org.springblade.modules.api.vo.MarketUserCashCouponLogVO;
|
||||
import org.springblade.modules.api.vo.MarketUserCommissionLogVO;
|
||||
import org.springblade.modules.market.convert.MarketUserMarketInfoConvert;
|
||||
import org.springblade.modules.market.excel.MarketBenefitPointLogExcel;
|
||||
import org.springblade.modules.market.excel.MarketCashCouponLogExcel;
|
||||
import org.springblade.modules.market.excel.MarketUserCommissionLogExcel;
|
||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPointLogEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MarketCashCouponLogEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MarketUserCommissionLogEntity;
|
||||
@@ -26,12 +22,8 @@ import org.springblade.modules.system.pojo.entity.User;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Slf4j
|
||||
@@ -48,7 +40,7 @@ public class MarketUserPointManager {
|
||||
|
||||
public boolean transfer(BenefitPointTransferRequest request) {
|
||||
User user = userService.getById(request.getId());
|
||||
Assert.notNull(user , "用户不存在或已注销");
|
||||
Assert.notNull(user, "用户不存在或已注销");
|
||||
|
||||
User creditUser = userService.getOne(
|
||||
Wrappers.lambdaQuery(User.class)
|
||||
@@ -63,7 +55,7 @@ public class MarketUserPointManager {
|
||||
MarketBenefitPointEntity benefitPoint = marketBenefitPointService.getById(user.getId());
|
||||
Assert.isTrue(benefitPoint != null && benefitPoint.getAmount().compareTo(request.getAmount()) >= 0, "福利积分不足");
|
||||
|
||||
if(!marketBenefitPointService.transfer(user.getId(), creditUser.getId(), request.getAmount())){
|
||||
if (!marketBenefitPointService.transfer(user.getId(), creditUser.getId(), request.getAmount())) {
|
||||
throw new RuntimeException("福利积分转让失败");
|
||||
}
|
||||
|
||||
@@ -114,164 +106,4 @@ public class MarketUserPointManager {
|
||||
return pageResult.convert(MarketUserMarketInfoConvert.INSTANCE::convertMarketUserCommissionLogVO);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public List<MarketBenefitPointLogExcel> exportBenefitPointToExcel(String account , List<String> searchDateRange) {
|
||||
|
||||
Assert.isTrue(StringUtils.hasLength(account), "请选择账号");
|
||||
|
||||
User user = userService.getOne(
|
||||
Wrappers.lambdaQuery(User.class)
|
||||
.eq(User::getAccount, account)
|
||||
);
|
||||
Assert.notNull(user, "账号不存在");
|
||||
Date startDate = null ;
|
||||
Date endDate = null ;
|
||||
if (searchDateRange == null){
|
||||
throw new RuntimeException("请选择时间范围");
|
||||
}
|
||||
|
||||
startDate = DateUtil.convertFromString(searchDateRange.get(0), "yyyy-MM-dd hh:mm:ss");
|
||||
endDate = DateUtil.convertFromString(searchDateRange.get(1), "yyyy-MM-dd hh:mm:ss");
|
||||
|
||||
if (startDate.getTime() >=endDate.getTime()){
|
||||
throw new RuntimeException("开始时间不能大于结束时间");
|
||||
}
|
||||
|
||||
List<MarketBenefitPointLogEntity> pointLogList = marketBenefitPointLogService.list(
|
||||
Wrappers.lambdaQuery(MarketBenefitPointLogEntity.class)
|
||||
.eq(MarketBenefitPointLogEntity::getIsComplete, 1)
|
||||
.eq(MarketBenefitPointLogEntity::getUserId, user.getId())
|
||||
.ge(MarketBenefitPointLogEntity::getCreateTime, startDate)
|
||||
.lt(MarketBenefitPointLogEntity::getCreateTime, endDate)
|
||||
.orderByDesc(MarketBenefitPointLogEntity::getCreateTime)
|
||||
);
|
||||
|
||||
List<MarketBenefitPointLogExcel> excelList = new ArrayList<>();
|
||||
|
||||
pointLogList.forEach(pointLog -> {
|
||||
|
||||
MarketBenefitPointLogExcel pointLogExcel = new MarketBenefitPointLogExcel();
|
||||
|
||||
pointLogExcel.setAccount(user.getAccount());
|
||||
pointLogExcel.setAmount(pointLog.getAmount());
|
||||
pointLogExcel.setLastAmount(pointLog.getLastAmount());
|
||||
pointLogExcel.setFee(pointLog.getFee());
|
||||
pointLogExcel.setType(pointLog.getType() == 1 ? "收入" : "支出");
|
||||
pointLogExcel.setCreateTime(pointLog.getCreateTime());
|
||||
pointLogExcel.setRemark(pointLog.getRemark());
|
||||
|
||||
excelList.add(pointLogExcel);
|
||||
|
||||
|
||||
});
|
||||
|
||||
return excelList;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public List<MarketCashCouponLogExcel> exportCashCouponToExcel(String account, List<String> searchDateRange) {
|
||||
|
||||
Assert.isTrue(StringUtils.hasLength(account), "请选择账号");
|
||||
|
||||
User user = userService.getOne(
|
||||
Wrappers.lambdaQuery(User.class)
|
||||
.eq(User::getAccount, account)
|
||||
);
|
||||
Assert.notNull(user, "账号不存在");
|
||||
Date startDate = null ;
|
||||
Date endDate = null ;
|
||||
if (searchDateRange == null){
|
||||
throw new RuntimeException("请选择时间范围");
|
||||
}
|
||||
|
||||
startDate = DateUtil.convertFromString(searchDateRange.get(0), "yyyy-MM-dd hh:mm:ss");
|
||||
endDate = DateUtil.convertFromString(searchDateRange.get(1), "yyyy-MM-dd hh:mm:ss");
|
||||
|
||||
if (startDate.getTime() >=endDate.getTime()){
|
||||
throw new RuntimeException("开始时间不能大于结束时间");
|
||||
}
|
||||
|
||||
List<MarketCashCouponLogEntity> pointLogList = marketCashCouponLogService.list(
|
||||
Wrappers.lambdaQuery(MarketCashCouponLogEntity.class)
|
||||
.eq(MarketCashCouponLogEntity::getIsComplete, 1)
|
||||
.eq(MarketCashCouponLogEntity::getUserId, user.getId())
|
||||
.ge(MarketCashCouponLogEntity::getCreateTime, startDate)
|
||||
.lt(MarketCashCouponLogEntity::getCreateTime, endDate)
|
||||
.orderByDesc(MarketCashCouponLogEntity::getCreateTime)
|
||||
);
|
||||
|
||||
List<MarketCashCouponLogExcel> excelList = new ArrayList<>();
|
||||
|
||||
pointLogList.forEach(pointLog -> {
|
||||
|
||||
MarketCashCouponLogExcel pointLogExcel = new MarketCashCouponLogExcel();
|
||||
|
||||
pointLogExcel.setAccount(user.getAccount());
|
||||
pointLogExcel.setAmount(pointLog.getAmount());
|
||||
pointLogExcel.setLastAmount(pointLog.getLastAmount());
|
||||
pointLogExcel.setType(pointLog.getType() == 1 ? "收入" : "支出");
|
||||
pointLogExcel.setCreateTime(pointLog.getCreateTime());
|
||||
pointLogExcel.setRemark(pointLog.getRemark());
|
||||
|
||||
excelList.add(pointLogExcel);
|
||||
|
||||
});
|
||||
|
||||
return excelList;
|
||||
|
||||
}
|
||||
|
||||
public List<MarketUserCommissionLogExcel> exportUserCommissionToExcel(String account, List<String> searchDateRange) {
|
||||
|
||||
Assert.isTrue(StringUtils.hasLength(account), "请选择账号");
|
||||
|
||||
User user = userService.getOne(
|
||||
Wrappers.lambdaQuery(User.class)
|
||||
.eq(User::getAccount, account)
|
||||
);
|
||||
Assert.notNull(user, "账号不存在");
|
||||
Date startDate = null ;
|
||||
Date endDate = null ;
|
||||
if (searchDateRange == null){
|
||||
throw new RuntimeException("请选择时间范围");
|
||||
}
|
||||
|
||||
startDate = DateUtil.convertFromString(searchDateRange.get(0), "yyyy-MM-dd hh:mm:ss");
|
||||
endDate = DateUtil.convertFromString(searchDateRange.get(1), "yyyy-MM-dd hh:mm:ss");
|
||||
|
||||
if (startDate.getTime() >=endDate.getTime()){
|
||||
throw new RuntimeException("开始时间不能大于结束时间");
|
||||
}
|
||||
|
||||
List<MarketUserCommissionLogEntity> pointLogList = marketUserCommissionLogService.list(
|
||||
Wrappers.lambdaQuery(MarketUserCommissionLogEntity.class)
|
||||
.eq(MarketUserCommissionLogEntity::getIsComplete, 1)
|
||||
.eq(MarketUserCommissionLogEntity::getUserId, user.getId())
|
||||
.ge(MarketUserCommissionLogEntity::getCreateTime, startDate)
|
||||
.lt(MarketUserCommissionLogEntity::getCreateTime, endDate)
|
||||
.orderByDesc(MarketUserCommissionLogEntity::getCreateTime)
|
||||
);
|
||||
|
||||
List<MarketUserCommissionLogExcel> excelList = new ArrayList<>();
|
||||
|
||||
pointLogList.forEach(pointLog -> {
|
||||
|
||||
MarketUserCommissionLogExcel pointLogExcel = new MarketUserCommissionLogExcel();
|
||||
|
||||
pointLogExcel.setAccount(user.getAccount());
|
||||
pointLogExcel.setAmount(pointLog.getAmount());
|
||||
pointLogExcel.setLastAmount(pointLog.getLastAmount());
|
||||
pointLogExcel.setType(pointLog.getType() == 1 ? "收入" : "支出");
|
||||
pointLogExcel.setCreateTime(pointLog.getCreateTime());
|
||||
pointLogExcel.setRemark(pointLog.getRemark());
|
||||
|
||||
excelList.add(pointLogExcel);
|
||||
|
||||
});
|
||||
|
||||
return excelList;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package org.springblade.modules.market.mapper;
|
||||
|
||||
import org.springblade.modules.market.excel.MarketBenefitPointLogExcel;
|
||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPointLogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketBenefitPointLogVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -24,4 +27,5 @@ public interface MarketBenefitPointLogMapper extends BaseMapper<MarketBenefitPoi
|
||||
List<MarketBenefitPointLogVO> selectCommonBenefitPointLogPage(IPage page, MarketBenefitPointLogVO pointLog);
|
||||
|
||||
|
||||
List<MarketBenefitPointLogExcel> exportBenefitPointLog(String account, Date startTime, Date endTime);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,17 @@
|
||||
order by bpl.id desc
|
||||
</select>
|
||||
|
||||
<select id="exportBenefitPointLog" resultType="org.springblade.modules.market.excel.MarketBenefitPointLogExcel">
|
||||
select bu.account, bpl.amount, bpl.last_amount, bpl.fee, bpl.type, bpl.create_time, bpl.remark
|
||||
from benefit_point_log bpl
|
||||
left join blade_user bu on bpl.user_id = bu.id
|
||||
where bpl.is_deleted = 0 and bpl.create_time >= #{startTime} and bpl.create_time <= #{endTime}
|
||||
<if test="account != null and account.trim() != ''">
|
||||
and bu.account = #{account}
|
||||
</if>
|
||||
order by bpl.id desc
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package org.springblade.modules.market.mapper;
|
||||
|
||||
import org.springblade.modules.market.excel.MarketCashCouponLogExcel;
|
||||
import org.springblade.modules.market.pojo.entity.MarketCashCouponLogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketCashCouponLogVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -23,4 +26,5 @@ public interface MarketCashCouponLogMapper extends BaseMapper<MarketCashCouponLo
|
||||
*/
|
||||
List<MarketCashCouponLogVO> selectCommonCashCouponLogPage(IPage page, MarketCashCouponLogVO cashLog);
|
||||
|
||||
List<MarketCashCouponLogExcel> exportCashCouponLog(String account, Date startTime, Date endTime);
|
||||
}
|
||||
|
||||
@@ -40,6 +40,16 @@
|
||||
|
||||
</select>
|
||||
|
||||
<select id="exportCashCouponLog" resultType="org.springblade.modules.market.excel.MarketCashCouponLogExcel">
|
||||
select bu.account, ccl.amount, ccl.last_amount,ccl.type,ccl.remark, ccl.create_time
|
||||
from cash_coupon_log ccl
|
||||
left join blade_user bu on ccl.user_id = bu.id
|
||||
where ccl.is_deleted = 0 and ccl.create_time >= #{startTime} and ccl.create_time <= #{endTime}
|
||||
<if test="account != null and account.trim() != ''">
|
||||
and bu.account = #{account}
|
||||
</if>
|
||||
order by ccl.id desc
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -25,10 +25,13 @@
|
||||
*/
|
||||
package org.springblade.modules.market.mapper;
|
||||
|
||||
import org.springblade.modules.market.excel.MarketUserCommissionLogExcel;
|
||||
import org.springblade.modules.market.pojo.entity.MarketUserCommissionLogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketUserCommissionLogVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -49,5 +52,5 @@ public interface MarketUserCommissionLogMapper extends BaseMapper<MarketUserComm
|
||||
List<MarketUserCommissionLogVO> selectUserCommissionLogPage(IPage page, MarketUserCommissionLogVO commissionLog);
|
||||
|
||||
|
||||
|
||||
List<MarketUserCommissionLogExcel> exportUserCommissionLog(String account, Date startTime, Date endTime);
|
||||
}
|
||||
|
||||
@@ -39,5 +39,17 @@
|
||||
</select>
|
||||
|
||||
|
||||
<select id="exportUserCommissionLog" resultType="org.springblade.modules.market.excel.MarketUserCommissionLogExcel">
|
||||
select bu.account, ucl.amount, ucl.last_amount, ucl.type, ucl.create_time, ucl.remark
|
||||
from user_commission_log ucl
|
||||
left join blade_user bu on ucl.user_id = bu.id
|
||||
where ucl.is_deleted = 0 and ucl.create_time >= #{startTime} and ucl.create_time <= #{endTime}
|
||||
<if test="account != null and account.trim() != ''">
|
||||
and bu.account = #{account}
|
||||
</if>
|
||||
order by ucl.id desc
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package org.springblade.modules.market.service;
|
||||
|
||||
import org.springblade.modules.market.excel.MarketBenefitPointLogExcel;
|
||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPointLogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketBenefitPointLogVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户福利值流水表 服务类
|
||||
*
|
||||
@@ -21,5 +24,6 @@ public interface IMarketBenefitPointLogService extends BaseService<MarketBenefit
|
||||
*/
|
||||
IPage<MarketBenefitPointLogVO> selectCommonBenefitPointLogPage(IPage<MarketBenefitPointLogVO> page, MarketBenefitPointLogVO commonBenefitPointLog);
|
||||
|
||||
List<MarketBenefitPointLogExcel> exportBenefitPointLog(String account, List<String> searchDateRange);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
|
||||
package org.springblade.modules.market.service;
|
||||
|
||||
import org.springblade.modules.market.excel.MarketCashCouponLogExcel;
|
||||
import org.springblade.modules.market.pojo.entity.MarketCashCouponLogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketCashCouponLogVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户现金券流水表 服务类
|
||||
*
|
||||
@@ -23,4 +26,5 @@ public interface IMarketCashCouponLogService extends BaseService<MarketCashCoupo
|
||||
IPage<MarketCashCouponLogVO> selectCommonCashCouponLogPage(IPage<MarketCashCouponLogVO> page, MarketCashCouponLogVO commonCashCouponLog);
|
||||
|
||||
|
||||
List<MarketCashCouponLogExcel> exportCashCouponLog(String account, List<String> searchDateRange);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
*/
|
||||
package org.springblade.modules.market.service;
|
||||
|
||||
import org.springblade.modules.market.excel.MarketUserCommissionLogExcel;
|
||||
import org.springblade.modules.market.pojo.entity.MarketUserCommissionEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MarketUserCommissionLogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketUserCommissionLogVO;
|
||||
@@ -32,6 +33,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户佣金流水表 服务类
|
||||
@@ -51,4 +53,7 @@ public interface IMarketUserCommissionLogService extends BaseService<MarketUserC
|
||||
|
||||
|
||||
boolean recordCommissionChangeLog(MarketUserCommissionEntity userCommission, BigDecimal lastAmount, String sourceType, BigDecimal amount, Integer type, Long sourceId, String sourceDetail);
|
||||
|
||||
List<MarketUserCommissionLogExcel> exportUserCommissionLog(String account, List<String> searchDateRange);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,15 +2,19 @@ package org.springblade.modules.market.service.impl;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.common.utils.date.DateUtil;
|
||||
import org.springblade.modules.market.eums.MarketLogType;
|
||||
import org.springblade.modules.market.excel.MarketBenefitPointLogExcel;
|
||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPointLogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketBenefitPointLogVO;
|
||||
import org.springblade.modules.market.mapper.MarketBenefitPointLogMapper;
|
||||
import org.springblade.modules.market.service.IMarketBenefitPointLogService;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户福利值流水表 服务实现类
|
||||
*
|
||||
@@ -21,8 +25,6 @@ import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
@AllArgsConstructor
|
||||
public class MarketBenefitPointLogServiceImpl extends BaseServiceImpl<MarketBenefitPointLogMapper, MarketBenefitPointLogEntity> implements IMarketBenefitPointLogService {
|
||||
|
||||
private final IUserService userService;
|
||||
|
||||
@Override
|
||||
public IPage<MarketBenefitPointLogVO> selectCommonBenefitPointLogPage(IPage<MarketBenefitPointLogVO> page, MarketBenefitPointLogVO commonBenefitPointLog) {
|
||||
if (commonBenefitPointLog.getSearchDateRange() != null){
|
||||
@@ -35,4 +37,25 @@ public class MarketBenefitPointLogServiceImpl extends BaseServiceImpl<MarketBene
|
||||
return page.setRecords(baseMapper.selectCommonBenefitPointLogPage(page, commonBenefitPointLog));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MarketBenefitPointLogExcel> exportBenefitPointLog(String account, List<String> searchDateRange) {
|
||||
Date startTime;
|
||||
Date endTime;
|
||||
|
||||
if (searchDateRange == null) {
|
||||
throw new RuntimeException("请选择时间范围");
|
||||
}
|
||||
|
||||
startTime = DateUtil.convertFromString(searchDateRange.get(0), "yyyy-MM-dd hh:mm:ss");
|
||||
endTime = DateUtil.convertFromString(searchDateRange.get(1), "yyyy-MM-dd hh:mm:ss");
|
||||
|
||||
if (startTime.getTime() >= endTime.getTime()) {
|
||||
throw new RuntimeException("开始时间不能大于结束时间");
|
||||
}
|
||||
|
||||
List<MarketBenefitPointLogExcel> logExcelList = baseMapper.exportBenefitPointLog(account, startTime, endTime);
|
||||
logExcelList.forEach(log -> log.setType(MarketLogType.of(Integer.parseInt(log.getType())).getDescription()));
|
||||
return logExcelList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
*/
|
||||
package org.springblade.modules.market.service.impl;
|
||||
|
||||
import org.springblade.common.utils.date.DateUtil;
|
||||
import org.springblade.modules.market.eums.MarketLogType;
|
||||
import org.springblade.modules.market.excel.MarketCashCouponLogExcel;
|
||||
import org.springblade.modules.market.pojo.entity.MarketCashCouponLogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketCashCouponLogVO;
|
||||
import org.springblade.modules.market.mapper.MarketCashCouponLogMapper;
|
||||
@@ -33,6 +36,9 @@ import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户现金券流水表 服务实现类
|
||||
*
|
||||
@@ -47,6 +53,25 @@ public class MarketCashCouponLogServiceImpl extends BaseServiceImpl<MarketCashCo
|
||||
return page.setRecords(baseMapper.selectCommonCashCouponLogPage(page, commonCashCouponLog));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MarketCashCouponLogExcel> exportCashCouponLog(String account, List<String> searchDateRange) {
|
||||
Date startTime;
|
||||
Date endTime;
|
||||
|
||||
if (searchDateRange == null) {
|
||||
throw new RuntimeException("请选择时间范围");
|
||||
}
|
||||
|
||||
startTime = DateUtil.convertFromString(searchDateRange.get(0), "yyyy-MM-dd hh:mm:ss");
|
||||
endTime = DateUtil.convertFromString(searchDateRange.get(1), "yyyy-MM-dd hh:mm:ss");
|
||||
|
||||
if (startTime.getTime() >= endTime.getTime()) {
|
||||
throw new RuntimeException("开始时间不能大于结束时间");
|
||||
}
|
||||
List<MarketCashCouponLogExcel> logExcelList = baseMapper.exportCashCouponLog(account, startTime, endTime);
|
||||
logExcelList.forEach(log -> log.setType(MarketLogType.of(Integer.parseInt(log.getType())).getDescription()));
|
||||
return logExcelList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
package org.springblade.modules.market.service.impl;
|
||||
|
||||
import org.springblade.common.utils.date.DateUtil;
|
||||
import org.springblade.modules.market.eums.MarketLogType;
|
||||
import org.springblade.modules.market.excel.MarketUserCommissionLogExcel;
|
||||
import org.springblade.modules.market.pojo.entity.MarketUserCommissionEntity;
|
||||
import org.springblade.modules.market.pojo.entity.MarketUserCommissionLogEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketUserCommissionLogVO;
|
||||
@@ -36,6 +38,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户佣金流水表 服务实现类
|
||||
@@ -66,5 +70,25 @@ public class MarketUserCommissionLogServiceImpl extends BaseServiceImpl<MarketUs
|
||||
return save(commissionLog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MarketUserCommissionLogExcel> exportUserCommissionLog(String account, List<String> searchDateRange) {
|
||||
Date startTime;
|
||||
Date endTime;
|
||||
|
||||
if (searchDateRange == null) {
|
||||
throw new RuntimeException("请选择时间范围");
|
||||
}
|
||||
|
||||
startTime = DateUtil.convertFromString(searchDateRange.get(0), "yyyy-MM-dd hh:mm:ss");
|
||||
endTime = DateUtil.convertFromString(searchDateRange.get(1), "yyyy-MM-dd hh:mm:ss");
|
||||
|
||||
if (startTime.getTime() >= endTime.getTime()) {
|
||||
throw new RuntimeException("开始时间不能大于结束时间");
|
||||
}
|
||||
List<MarketUserCommissionLogExcel> logExcelList = baseMapper.exportUserCommissionLog(account, startTime, endTime);
|
||||
logExcelList.forEach(log -> log.setType(MarketLogType.of(Integer.parseInt(log.getType())).getDescription()));
|
||||
return logExcelList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user