remove
This commit is contained in:
30
pom.xml
30
pom.xml
@@ -264,36 +264,6 @@
|
||||
<version>2.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.40</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.xuxueli</groupId>
|
||||
<artifactId>xxl-job-core</artifactId>
|
||||
<version>3.3.2</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-codec-http</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-processor</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
package org.springblade.common.config;
|
||||
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.task.AsyncTaskExecutor;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
@Configuration
|
||||
@Slf4j
|
||||
public class AsyncConfiguration {
|
||||
|
||||
private static final int CORE_POOL_SIZE = Runtime.getRuntime().availableProcessors();
|
||||
private static final int MAX_POOL_SIZE = CORE_POOL_SIZE * 2;
|
||||
private static final int QUEUE_CAPACITY = 500;
|
||||
private static final int KEEP_ALIVE_SECONDS = 60;
|
||||
private static final int AWAIT_TERMINATION_SECONDS = 60;
|
||||
|
||||
@Bean("common")
|
||||
public AsyncTaskExecutor commonAsyncExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
//核心线程数 cpuNum:线程池创建时候初始化的线程数
|
||||
executor.setCorePoolSize(CORE_POOL_SIZE);
|
||||
//核心线程数 cpuNum:线程池创建时候初始化的线程数
|
||||
executor.setMaxPoolSize(MAX_POOL_SIZE);
|
||||
//缓冲队列500:用来缓冲执行任务的队列
|
||||
executor.setQueueCapacity(QUEUE_CAPACITY);
|
||||
//允许线程的空闲时间60秒:当超过了核心线程出之外的线程在空闲时间到达之后会被销毁
|
||||
executor.setKeepAliveSeconds(KEEP_ALIVE_SECONDS);
|
||||
// CallerRunsPolicy策略:如果添加到线程池失败,那么主线程会自己去执行该任务,不会等待线程池中的线程去执行。
|
||||
//当提交的任务个数大于QueueCapacity,就需要设置该参数,但spring提供的都不太满足业务场景,可以自定义一个,也可以注意不要超过QueueCapacity即可
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
//调度器shutdown被调用时等待当前被调度的任务完成
|
||||
executor.setWaitForTasksToCompleteOnShutdown(true);
|
||||
//等待时长
|
||||
executor.setAwaitTerminationSeconds(AWAIT_TERMINATION_SECONDS);
|
||||
//线程池名的前缀:设置好了之后可以方便我们定位处理任务所在的线程池
|
||||
executor.setThreadNamePrefix("common-Async-");
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Bean("appRegisterExecutor")
|
||||
public AsyncTaskExecutor appRegisterExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
//核心线程数 cpuNum:线程池创建时候初始化的线程数
|
||||
executor.setCorePoolSize(CORE_POOL_SIZE);
|
||||
//核心线程数 cpuNum:线程池创建时候初始化的线程数
|
||||
executor.setMaxPoolSize(MAX_POOL_SIZE);
|
||||
//缓冲队列500:用来缓冲执行任务的队列
|
||||
executor.setQueueCapacity(QUEUE_CAPACITY);
|
||||
//允许线程的空闲时间60秒:当超过了核心线程出之外的线程在空闲时间到达之后会被销毁
|
||||
executor.setKeepAliveSeconds(KEEP_ALIVE_SECONDS);
|
||||
// CallerRunsPolicy策略:如果添加到线程池失败,那么主线程会自己去执行该任务,不会等待线程池中的线程去执行。
|
||||
//当提交的任务个数大于QueueCapacity,就需要设置该参数,但spring提供的都不太满足业务场景,可以自定义一个,也可以注意不要超过QueueCapacity即可
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
//调度器shutdown被调用时等待当前被调度的任务完成
|
||||
executor.setWaitForTasksToCompleteOnShutdown(true);
|
||||
//等待时长
|
||||
executor.setAwaitTerminationSeconds(AWAIT_TERMINATION_SECONDS);
|
||||
//线程池名的前缀:设置好了之后可以方便我们定位处理任务所在的线程池
|
||||
executor.setThreadNamePrefix("appRegister-Async-");
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
|
||||
@Bean("appRevokedExecutor")
|
||||
public AsyncTaskExecutor appRevokedExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
//核心线程数 cpuNum:线程池创建时候初始化的线程数
|
||||
executor.setCorePoolSize(CORE_POOL_SIZE);
|
||||
//核心线程数 cpuNum:线程池创建时候初始化的线程数
|
||||
executor.setMaxPoolSize(MAX_POOL_SIZE);
|
||||
//缓冲队列500:用来缓冲执行任务的队列
|
||||
executor.setQueueCapacity(QUEUE_CAPACITY);
|
||||
//允许线程的空闲时间60秒:当超过了核心线程出之外的线程在空闲时间到达之后会被销毁
|
||||
executor.setKeepAliveSeconds(KEEP_ALIVE_SECONDS);
|
||||
// CallerRunsPolicy策略:如果添加到线程池失败,那么主线程会自己去执行该任务,不会等待线程池中的线程去执行。
|
||||
//当提交的任务个数大于QueueCapacity,就需要设置该参数,但spring提供的都不太满足业务场景,可以自定义一个,也可以注意不要超过QueueCapacity即可
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
//调度器shutdown被调用时等待当前被调度的任务完成
|
||||
executor.setWaitForTasksToCompleteOnShutdown(true);
|
||||
//等待时长
|
||||
executor.setAwaitTerminationSeconds(AWAIT_TERMINATION_SECONDS);
|
||||
//线程池名的前缀:设置好了之后可以方便我们定位处理任务所在的线程池
|
||||
executor.setThreadNamePrefix("appRevoked-Async-");
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
|
||||
|
||||
@Bean("appUserOrderrExecutor")
|
||||
public AsyncTaskExecutor appUserOrderrExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
//核心线程数 cpuNum:线程池创建时候初始化的线程数
|
||||
executor.setCorePoolSize(CORE_POOL_SIZE);
|
||||
//核心线程数 cpuNum:线程池创建时候初始化的线程数
|
||||
executor.setMaxPoolSize(MAX_POOL_SIZE);
|
||||
//缓冲队列500:用来缓冲执行任务的队列
|
||||
executor.setQueueCapacity(QUEUE_CAPACITY);
|
||||
//允许线程的空闲时间60秒:当超过了核心线程出之外的线程在空闲时间到达之后会被销毁
|
||||
executor.setKeepAliveSeconds(KEEP_ALIVE_SECONDS);
|
||||
// CallerRunsPolicy策略:如果添加到线程池失败,那么主线程会自己去执行该任务,不会等待线程池中的线程去执行。
|
||||
//当提交的任务个数大于QueueCapacity,就需要设置该参数,但spring提供的都不太满足业务场景,可以自定义一个,也可以注意不要超过QueueCapacity即可
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
//调度器shutdown被调用时等待当前被调度的任务完成
|
||||
executor.setWaitForTasksToCompleteOnShutdown(true);
|
||||
//等待时长
|
||||
executor.setAwaitTerminationSeconds(AWAIT_TERMINATION_SECONDS);
|
||||
//线程池名的前缀:设置好了之后可以方便我们定位处理任务所在的线程池
|
||||
executor.setThreadNamePrefix("appUserOrderr-Async-");
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package org.springblade.common.config;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class MybatisPlusConfig {
|
||||
|
||||
/**
|
||||
* mybatis-plus.分页插件
|
||||
* @return interceptor
|
||||
*/
|
||||
@Bean
|
||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.POSTGRE_SQL));
|
||||
interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
|
||||
return interceptor;
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package org.springblade.common.config;
|
||||
|
||||
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Slf4j
|
||||
@Configuration
|
||||
public class XxlJobConfig {
|
||||
|
||||
@Value("${xxl.job.admin.addresses}")
|
||||
private String adminAddresses;
|
||||
|
||||
@Value("${xxl.job.accessToken}")
|
||||
private String accessToken;
|
||||
|
||||
@Value("${xxl.job.executor.appname}")
|
||||
private String appname;
|
||||
|
||||
@Value("${xxl.job.executor.address}")
|
||||
private String address;
|
||||
|
||||
@Value("${xxl.job.executor.ip}")
|
||||
private String ip;
|
||||
|
||||
@Value("${xxl.job.executor.port}")
|
||||
private int port;
|
||||
|
||||
@Value("${xxl.job.executor.logpath}")
|
||||
private String logPath;
|
||||
|
||||
@Value("${xxl.job.executor.logretentiondays}")
|
||||
private int logRetentionDays;
|
||||
|
||||
|
||||
@Bean
|
||||
public XxlJobSpringExecutor xxlJobExecutor() {
|
||||
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
|
||||
xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
|
||||
xxlJobSpringExecutor.setAppname(appname);
|
||||
xxlJobSpringExecutor.setAddress(address);
|
||||
xxlJobSpringExecutor.setIp(ip);
|
||||
xxlJobSpringExecutor.setPort(port);
|
||||
xxlJobSpringExecutor.setAccessToken(accessToken);
|
||||
xxlJobSpringExecutor.setLogPath(logPath);
|
||||
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
|
||||
return xxlJobSpringExecutor;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
package org.springblade.modules.appFormal.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.redis.ratelimiter.RateLimiter;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.modules.appFormal.dto.PayOrderDicDTO;
|
||||
import org.springblade.modules.appFormal.manager.FormalAppBaseManager;
|
||||
import org.springblade.modules.appFormal.manager.FormalAppCustomerManager;
|
||||
import org.springblade.modules.appFormal.manager.FormalAppMallManager;
|
||||
import org.springblade.modules.appFormal.request.CustomerSmsRequest;
|
||||
import org.springblade.modules.appFormal.vo.AppFormalBannerVO;
|
||||
import org.springblade.modules.appFormal.vo.AppFormalMallSpuVO;
|
||||
import org.springblade.modules.appFormal.vo.MallCategoryVO;
|
||||
import org.springblade.modules.mall.pojo.vo.MallSpuVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("formal-app/base")
|
||||
@Tag(name = "基本信息", description = "基本信息接口")
|
||||
public class FormalBaseController {
|
||||
|
||||
private final FormalAppBaseManager appBaseManager;
|
||||
private final FormalAppCustomerManager formalAppCustomerManager;
|
||||
private final FormalAppMallManager mallProductManager;
|
||||
|
||||
@Operation(summary = "隐私政策")
|
||||
@GetMapping("/formal-app-privacy")
|
||||
public R<String> formalAppPrivacy() {
|
||||
return R.data(appBaseManager.formalAppPrivacy());
|
||||
}
|
||||
|
||||
@Operation(summary = "用户协议")
|
||||
@GetMapping("/formal-app-agreement")
|
||||
public R<String> formalAppAgreement() {
|
||||
return R.data(appBaseManager.formalAppAgreement());
|
||||
}
|
||||
|
||||
@RateLimiter(value = "yichayilu:sms:send", param = "#request.getPhone()", max =3, ttl = 12, timeUnit = TimeUnit.HOURS)
|
||||
@Operation(summary = "发送验证码")
|
||||
@PostMapping("/send-sms-code")
|
||||
public R<Boolean> sendSmsCode(@RequestBody CustomerSmsRequest request) {
|
||||
return R.data(formalAppCustomerManager.sendSmsCode(request.getPhone()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分类
|
||||
*/
|
||||
@Operation(summary = "商品类别")
|
||||
@GetMapping("/find-category")
|
||||
public R<List<MallCategoryVO>> findCategories() {
|
||||
return R.data(mallProductManager.findCategories());
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
@Operation(summary = "商品分页")
|
||||
@GetMapping("/spu-list")
|
||||
public R<IPage<AppFormalMallSpuVO>> list(Query query , AppFormalMallSpuVO spuVO) {
|
||||
return R.data(mallProductManager.getSpuPage(Condition.getPage(query), spuVO));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Operation(summary = "获得主banner")
|
||||
@GetMapping("/find-main-banner")
|
||||
public R<List<AppFormalBannerVO>> findMainBanner() {
|
||||
return R.data(appBaseManager.findMainBanner());
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "获得商城banner")
|
||||
@GetMapping("/find-mall-banner")
|
||||
public R<List<AppFormalBannerVO>> findMallBanner() {
|
||||
return R.data(appBaseManager.findMallBanner());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
package org.springblade.modules.appFormal.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.qiniu.util.Auth;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.redis.ratelimiter.RateLimiter;
|
||||
import org.springblade.core.secure.utils.AuthUtil;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.modules.appFormal.manager.FormalAppCustomerManager;
|
||||
import org.springblade.modules.appFormal.request.CustomerSmsRequest;
|
||||
import org.springblade.modules.appFormal.request.UpdatePasswordRequest;
|
||||
import org.springblade.modules.appFormal.vo.AppUserNoticeVO;
|
||||
import org.springblade.modules.appFormal.vo.MallIntegralLogVO;
|
||||
import org.springblade.modules.appFormal.vo.MallIntegralVO;
|
||||
import org.springblade.modules.appFormal.vo.UserInfoVO;
|
||||
import org.springblade.modules.desk.pojo.vo.NoticeVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("formal-app/customer")
|
||||
@Tag(name = "用户信息", description = "用户信息接口")
|
||||
public class FormalCustomerController {
|
||||
|
||||
|
||||
private final FormalAppCustomerManager formalAppCustomerManager;
|
||||
|
||||
|
||||
//用户相关
|
||||
|
||||
@Operation(summary = "校验短信")
|
||||
@PostMapping("/check-sms-code")
|
||||
public R<Boolean> checkSmsCode(@RequestBody CustomerSmsRequest request) {
|
||||
return R.data(formalAppCustomerManager.checkSmsCode(request));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询用户信息")
|
||||
@GetMapping("/find-userInfo")
|
||||
public R<UserInfoVO> findUserInfo() {
|
||||
return R.data(formalAppCustomerManager.findUserInfo(AuthUtil.getUserId()));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "修改密码")
|
||||
@PutMapping("/update-password")
|
||||
public R<Boolean> updatePassword(@RequestBody UpdatePasswordRequest request) {
|
||||
return R.data(formalAppCustomerManager.updatePassword(request.setId(AuthUtil.getUserId())));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改密码")
|
||||
@PutMapping("/update-password-non-code")
|
||||
public R<Boolean> updatePasswordNonCode(@RequestBody UpdatePasswordRequest request) {
|
||||
return R.data(formalAppCustomerManager.updatePasswordNonCode(request.setId(AuthUtil.getUserId())));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户退出登录")
|
||||
@PostMapping("/userLogout")
|
||||
public R<Boolean> userLogout() {
|
||||
return R.data(formalAppCustomerManager.userLogout());
|
||||
}
|
||||
|
||||
@Operation(summary = "账号注销")
|
||||
@DeleteMapping("/delete-account")
|
||||
public R<Boolean> deleteAccount() {
|
||||
return R.data(formalAppCustomerManager.deleteAccount(AuthUtil.getUserId()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 商城积分相关
|
||||
|
||||
@Operation(summary = "查询商城积分")
|
||||
@GetMapping("/find-mall-integral")
|
||||
public R<MallIntegralVO> findMallIntegral() {
|
||||
return R.data(formalAppCustomerManager.findMallIntegral(AuthUtil.getUserId()));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询商城积分流水")
|
||||
@GetMapping("/mall-integral-log-page")
|
||||
public R<IPage<MallIntegralLogVO>> findMallIntegralFlow(Query query , MallIntegralLogVO logVO) {
|
||||
return R.data(formalAppCustomerManager.findMallIntegralFlow(Condition.getPage(query), logVO, AuthUtil.getUserId()));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "查询用户通知")
|
||||
@GetMapping("/find-user-notice-page")
|
||||
public R<IPage<AppUserNoticeVO>> findUserNoticePage(Query query , AppUserNoticeVO userNotice) {
|
||||
return R.data(formalAppCustomerManager.findUserNoticePage(Condition.getPage(query), userNotice, AuthUtil.getUserId()));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询用户通知")
|
||||
@PostMapping("/read-user-notice")
|
||||
public R<Boolean> readUserNotice(AppUserNoticeVO userNotice) {
|
||||
return R.status(formalAppCustomerManager.readUserNotice(userNotice.getId()));
|
||||
}
|
||||
|
||||
@Operation(summary = "未读消息总数")
|
||||
@GetMapping("/not-read-notice-count")
|
||||
public R<Integer> notReadNoticeCount(AppUserNoticeVO userNotice) {
|
||||
return R.data(formalAppCustomerManager.notReadNoticeCount(userNotice ,AuthUtil.getUserId()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
package org.springblade.modules.appFormal.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.secure.utils.AuthUtil;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.modules.appFormal.manager.FormalAppMallManager;
|
||||
import org.springblade.modules.appFormal.request.AddressRemoveRequest;
|
||||
import org.springblade.modules.appFormal.request.AddressSubmitRequest;
|
||||
import org.springblade.modules.appFormal.request.MallCartRemoveRequest;
|
||||
import org.springblade.modules.appFormal.request.MallCartRequest;
|
||||
import org.springblade.modules.appFormal.vo.*;
|
||||
import org.springblade.modules.mall.pojo.vo.MallSpuVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("formal-app/mall")
|
||||
@Tag(name = "商城信息", description = "商城信息接口")
|
||||
public class FormalMallController {
|
||||
|
||||
private final FormalAppMallManager mallProductManager;
|
||||
|
||||
|
||||
|
||||
//购物车相关
|
||||
@Operation(summary = "购物车列表")
|
||||
@GetMapping("/cart-list")
|
||||
public R<IPage<AppFormalMallCartVO>> cartList(Query query, AppFormalMallCartVO cartVO) {
|
||||
return R.data(mallProductManager.cartList(Condition.getPage( query), cartVO , AuthUtil.getUserId()));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加购物车")
|
||||
@PostMapping("/add-cart")
|
||||
public R<AppFormalMallCartInfoVO> addCart(@RequestBody MallCartRequest request) {
|
||||
return R.data(mallProductManager.addCart(request.setUserId(AuthUtil.getUserId())));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "添加购物车(创建订单之前调用)")
|
||||
@PostMapping("/add-cart-to-order")
|
||||
public R<AppFormalMallCartInfoVO> addCartToOrder(@RequestBody MallCartRequest request) {
|
||||
return R.data(mallProductManager.addCartToOrder(request.setUserId(AuthUtil.getUserId())));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除购物车")
|
||||
@DeleteMapping("/delete-cart")
|
||||
public R<Boolean> deleteCart(@RequestBody MallCartRemoveRequest request) {
|
||||
return R.status(mallProductManager.deleteCart(request.getIds()));
|
||||
}
|
||||
|
||||
@Operation(summary = "购物车修改数量")
|
||||
@PostMapping("/update-cart-quantity")
|
||||
public R<Boolean> updateCartQuantity(@RequestBody MallCartRequest request) {
|
||||
return R.status(mallProductManager.updateCartQuantity(request));
|
||||
}
|
||||
|
||||
//收货地址相关
|
||||
@Operation(summary = "省市区列表")
|
||||
@GetMapping("/region-list")
|
||||
public R<List<AppFormalRegionInfoVO>> regionInfoList(@RequestParam Integer level, @RequestParam Long pid) {
|
||||
return R.data(mallProductManager.regionInfoList(level , pid));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加收货地址")
|
||||
@PostMapping("/add-address")
|
||||
public R<Boolean> addAddressInfo(@RequestBody AddressSubmitRequest request){
|
||||
return R.data(mallProductManager.submitAddressInfo(request));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改收货地址")
|
||||
@PostMapping("/update-address")
|
||||
public R<Boolean> updateAddressInfo(@RequestBody AddressSubmitRequest request){
|
||||
return R.data(mallProductManager.submitAddressInfo(request));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除收货地址")
|
||||
@DeleteMapping("/delete-address")
|
||||
public R<Boolean> deleteAddressInfo( @RequestBody AddressRemoveRequest request){
|
||||
return R.data(mallProductManager.deleteAddressInfo(request.getIds()));
|
||||
}
|
||||
|
||||
@Operation(summary = "收货地址列表")
|
||||
@GetMapping("/address-list")
|
||||
public R<List<AppFormalAddressVO>> addressInfoList(){
|
||||
return R.data(mallProductManager.addressInfoList(AuthUtil.getUserId()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
package org.springblade.modules.appFormal.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.secure.utils.AuthUtil;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.modules.appFormal.dto.PayOrderDicDTO;
|
||||
import org.springblade.modules.appFormal.manager.FormalAppBaseManager;
|
||||
import org.springblade.modules.appFormal.manager.FormalAppOrderManager;
|
||||
import org.springblade.modules.appFormal.request.*;
|
||||
import org.springblade.modules.appFormal.vo.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("formal-app/order")
|
||||
@Tag(name = "订单信息", description = "订单信息接口")
|
||||
public class FormalOrderController {
|
||||
|
||||
private final FormalAppOrderManager formalAppOrderManager;
|
||||
private final FormalAppBaseManager appBaseManager;
|
||||
|
||||
|
||||
/**
|
||||
* 订单类型列表
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "订单类型列表")
|
||||
@GetMapping("/find-orderBizModel")
|
||||
public R<List<PayOrderDicDTO>> orderBizModel(){
|
||||
return R.data(formalAppOrderManager.orderBizModel());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 订单列表分页
|
||||
*/
|
||||
@Operation(summary = "订单列表分页")
|
||||
@GetMapping("/order-list")
|
||||
public R<IPage<AppFormalOrderVO>> orderList(Query query, AppFormalOrderVO orderVO) {
|
||||
return R.data(formalAppOrderManager.getOrderList(Condition.getPage( query), orderVO));
|
||||
}
|
||||
|
||||
@Operation(summary = "商城订单详情")
|
||||
@GetMapping("/mall-order-detail")
|
||||
public R<AppFormalMallOrderVO> mallOrderDetail(Long id) {
|
||||
return R.data(formalAppOrderManager.mallOrderDetail(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 提交订单
|
||||
*/
|
||||
@PostMapping("/mall-make-order")
|
||||
public R<AppFormalPreviewOrderVO> mallMakeOrder( @RequestBody AppFormalPreviewOrderRequest request) {
|
||||
return R.data(formalAppOrderManager.mallMakeOrder(request, AuthUtil.getUserId()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 取消订单
|
||||
*/
|
||||
@PostMapping("/mall-cancel-order")
|
||||
public R<Boolean> mallCancelOrder( @RequestBody AppForOrderIdRequest request) {
|
||||
|
||||
return R.data(formalAppOrderManager.mallCancelOrder(request.getId(), AuthUtil.getUserId()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 确认收货
|
||||
*/
|
||||
@PostMapping("/mall-confirm-receipt")
|
||||
public R<Boolean> mallConfirmReceipt( @RequestBody AppForOrderIdRequest request) {
|
||||
|
||||
return R.data(formalAppOrderManager.mallConfirmReceipt(request.getId(), AuthUtil.getUserId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付类型
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "获取支付类型")
|
||||
@GetMapping("/find-payType")
|
||||
public R<List<PayOrderDicDTO>> payType(Integer payModel){
|
||||
return R.data(appBaseManager.payType(payModel));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package org.springblade.modules.appFormal.convert;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import org.springblade.modules.appFormal.vo.AppFormalBannerVO;
|
||||
import org.springblade.modules.appFormal.vo.AppUserNoticeVO;
|
||||
import org.springblade.modules.appFormal.vo.MallIntegralLogVO;
|
||||
import org.springblade.modules.customer.pojo.entity.UserNoticeEntity;
|
||||
import org.springblade.modules.mall.pojo.entity.AppBannerEntity;
|
||||
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralLogEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jack
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppBaseConvert {
|
||||
|
||||
AppBaseConvert INSTANCE = Mappers.getMapper(AppBaseConvert.class);
|
||||
|
||||
|
||||
List<AppFormalBannerVO> convertBannerListToVO(List<AppBannerEntity> bannerEntityList);
|
||||
|
||||
AppUserNoticeVO convertUserNoticePageToVO(UserNoticeEntity userNoticeEntity);
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package org.springblade.modules.appFormal.convert;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import org.springblade.modules.appFormal.request.AddressSubmitRequest;
|
||||
import org.springblade.modules.appFormal.vo.*;
|
||||
import org.springblade.modules.mall.pojo.entity.MallCartEntity;
|
||||
import org.springblade.modules.mall.pojo.entity.MallSpuEntity;
|
||||
import org.springblade.modules.mall.pojo.entity.UserAddressEntity;
|
||||
import org.springblade.modules.mall.pojo.entity.YsCategoryEntity;
|
||||
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralLogEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jack
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppFormalMallConvert {
|
||||
|
||||
AppFormalMallConvert INSTANCE = Mappers.getMapper(AppFormalMallConvert.class);
|
||||
|
||||
|
||||
AppFormalMallSpuVO convertMallSpuToVO(MallSpuEntity entity);
|
||||
|
||||
List<AppFormalMallSpuVO> convertMallSpuListToVO(List<MallSpuEntity> list);
|
||||
Page<AppFormalMallSpuVO> convertMallSpuPageToVO(Page<MallSpuEntity> page);
|
||||
|
||||
|
||||
MallCategoryVO convertMallCategoryToVO(YsCategoryEntity entity);
|
||||
List<MallCategoryVO> convertMallCategoryListToVO(List<YsCategoryEntity> list);
|
||||
|
||||
AppFormalMallCartVO convertMallCartToVO(MallCartEntity entity);
|
||||
List<AppFormalMallCartVO> convertMallCartListToVO(List<MallCartEntity> list);
|
||||
|
||||
Page<AppFormalMallCartVO> convertMallCartPageToVO(Page<MallCartEntity> page);
|
||||
|
||||
|
||||
UserAddressEntity convertRequestToPo(AddressSubmitRequest request);
|
||||
|
||||
AppFormalAddressVO convertPoToVO(UserAddressEntity address);
|
||||
|
||||
List<AppFormalAddressVO> convertPoListToVoList(List<UserAddressEntity> addressList);
|
||||
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package org.springblade.modules.appFormal.convert;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import org.springblade.modules.appFormal.vo.MallIntegralLogVO;
|
||||
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralLogEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jack
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppUserInfoConvert {
|
||||
|
||||
AppUserInfoConvert INSTANCE = Mappers.getMapper(AppUserInfoConvert.class);
|
||||
|
||||
|
||||
MallIntegralLogVO convertIntegralToVO(UserMallIntegralLogEntity entity);
|
||||
|
||||
List<MallIntegralLogVO> convertIntegralListToVO(List<UserMallIntegralLogEntity> list);
|
||||
Page<MallIntegralLogVO> convertIntegralPageToVO(Page<UserMallIntegralLogEntity> page);
|
||||
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package org.springblade.modules.appFormal.convert;
|
||||
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.Named;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import org.springblade.modules.appFormal.dto.PreviewDTO;
|
||||
import org.springblade.modules.appFormal.enums.BizTypeEnum;
|
||||
import org.springblade.modules.appFormal.event.OrderEvent;
|
||||
import org.springblade.modules.appFormal.vo.AppFormalMallDetailOrderVO;
|
||||
import org.springblade.modules.appFormal.vo.AppFormalMallOrderVO;
|
||||
import org.springblade.modules.appFormal.vo.AppFormalOrderVO;
|
||||
import org.springblade.modules.appFormal.vo.AppFormalPreviewOrderVO;
|
||||
import org.springblade.modules.order.pojo.entity.MallDetailOrderEntity;
|
||||
import org.springblade.modules.order.pojo.entity.MallSummaryOrderEntity;
|
||||
import org.springblade.modules.order.pojo.entity.UserOrderEntity;
|
||||
|
||||
|
||||
/**
|
||||
* @author jack
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppUserOrderConvert {
|
||||
|
||||
AppUserOrderConvert INSTANCE = Mappers.getMapper(AppUserOrderConvert.class);
|
||||
|
||||
AppFormalOrderVO convertOrderToVO(UserOrderEntity order);
|
||||
|
||||
|
||||
AppFormalMallOrderVO convertMallOrderToVO(MallSummaryOrderEntity order);
|
||||
|
||||
|
||||
AppFormalMallDetailOrderVO convertEntityToVO(MallDetailOrderEntity order);
|
||||
|
||||
|
||||
AppFormalPreviewOrderVO convertPreviewDTOToVO(PreviewDTO previewDTO);
|
||||
|
||||
|
||||
MallSummaryOrderEntity convertPreviewDTOToOrder(PreviewDTO previewDTO);
|
||||
|
||||
MallDetailOrderEntity convertSkuDTOToDetailOrder(PreviewDTO.SkuDTO sku);
|
||||
|
||||
|
||||
UserOrderEntity convertEventToOrder(OrderEvent event);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package org.springblade.modules.appFormal.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class CutAmountRangDTO {
|
||||
|
||||
private BigDecimal min;
|
||||
private BigDecimal max;
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package org.springblade.modules.appFormal.dto;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 字典
|
||||
*
|
||||
* @author ganwu
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PayOrderDicDTO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 标识
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private BigDecimal des;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
package org.springblade.modules.appFormal.dto;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springblade.modules.mall.pojo.entity.UserAddressEntity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PreviewDTO implements Serializable {
|
||||
|
||||
private List<SkuDTO> skuList = Collections.emptyList();
|
||||
|
||||
private BigDecimal freight = BigDecimal.ZERO;
|
||||
|
||||
private Long vendorRegionsId;
|
||||
|
||||
private Long addressId;
|
||||
|
||||
private UserAddressEntity address;
|
||||
|
||||
private Long userId;
|
||||
|
||||
private BigDecimal orderAmount = BigDecimal.ZERO;
|
||||
|
||||
private BigDecimal freightAmount = BigDecimal.ZERO;
|
||||
|
||||
private BigDecimal regularAmount = BigDecimal.ZERO;
|
||||
|
||||
private BigDecimal totalAmount = BigDecimal.ZERO;
|
||||
|
||||
private BigDecimal costAmount = BigDecimal.ZERO;
|
||||
|
||||
|
||||
|
||||
@Data
|
||||
public static class SkuDTO implements Serializable {
|
||||
|
||||
private Long spuId = -1L;
|
||||
|
||||
/**
|
||||
* 商品编码
|
||||
*/
|
||||
private String spuSn;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String spuName;
|
||||
/**
|
||||
* 主图
|
||||
*/
|
||||
private String mainImg;
|
||||
/**
|
||||
* 详情图(多图,逗号分割)
|
||||
*/
|
||||
private String detailImg;
|
||||
/**
|
||||
* 顶图(多图,逗号分割)
|
||||
*/
|
||||
private String topImg;
|
||||
/**
|
||||
* cate_id分类
|
||||
*/
|
||||
private String cateId;
|
||||
/**
|
||||
* cate_id分类
|
||||
*/
|
||||
private String cateIds;
|
||||
|
||||
private BigDecimal costPrice;
|
||||
|
||||
/**
|
||||
* 原价
|
||||
*/
|
||||
private BigDecimal originalPrice;
|
||||
/**
|
||||
* 销售价
|
||||
*/
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
/**
|
||||
* 销量
|
||||
*/
|
||||
private Integer sales;
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
private Integer spuQty;
|
||||
/**
|
||||
* 标签(多标签,逗号分割 )
|
||||
*/
|
||||
private String tags;
|
||||
|
||||
private Integer quantity;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package org.springblade.modules.appFormal.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||
public enum BizTypeEnum {
|
||||
|
||||
MALL(1, "商城");
|
||||
|
||||
|
||||
final Integer code;
|
||||
|
||||
final String name;
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static BizTypeEnum of(Integer code) {
|
||||
if (code == null) return null;
|
||||
return Arrays.stream(BizTypeEnum.values()).filter(i -> i.getCode() == code.intValue()).findAny().orElse(null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取订单 状态
|
||||
* @param orderType
|
||||
* @param orderStatus
|
||||
* @return
|
||||
*/
|
||||
public static String getStatusName(Integer orderType, Integer orderStatus) {
|
||||
BizTypeEnum bizTypeEnum = of(orderType);
|
||||
if (bizTypeEnum == null) return "";
|
||||
switch (bizTypeEnum) {
|
||||
|
||||
case MALL:
|
||||
return MallOrderStatusEnum.getByCode(orderStatus).getDescription();
|
||||
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package org.springblade.modules.appFormal.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum MallOrderStatusEnum {
|
||||
|
||||
FAIL(0, "已取消-商品无库存"),
|
||||
WAIT_PAY(1, "待支付"),
|
||||
WAIT_DELIVERY(2, "待发货"),
|
||||
WAIT_RECEIVE(3, "待收货"),
|
||||
COMPLETED(4, "已完成"),
|
||||
CANCELED(5, "已取消"),
|
||||
AFTER_SERVICE(6, "售后中"),
|
||||
FINISHED(7, "已关闭"),
|
||||
FINISHED_AFTER(11, "已售后完成"),
|
||||
|
||||
;
|
||||
|
||||
private final int code;
|
||||
private final String description;
|
||||
|
||||
MallOrderStatusEnum(int code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
// 通过code获取对应的枚举值
|
||||
public static MallOrderStatusEnum getByCode(int code) {
|
||||
for (MallOrderStatusEnum status : MallOrderStatusEnum.values()) {
|
||||
if (status.getCode() == code) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Invalid PaymentStatus code: " + code);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package org.springblade.modules.appFormal.event;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springblade.modules.appFormal.enums.BizTypeEnum;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderConfirmOfflineEvent {
|
||||
|
||||
private Long orderId;
|
||||
private BizTypeEnum orderType;
|
||||
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package org.springblade.modules.appFormal.event;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springblade.modules.appFormal.enums.BizTypeEnum;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OrderEvent {
|
||||
|
||||
private Long userId;
|
||||
private Long userPhone;
|
||||
private String userName;
|
||||
|
||||
private Integer orderType;
|
||||
|
||||
private Long orderId;
|
||||
|
||||
private String title;
|
||||
|
||||
private String images;
|
||||
|
||||
private Integer quantity;
|
||||
|
||||
private String description;
|
||||
|
||||
private Integer orderStatus;
|
||||
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
private BigDecimal actualAmount;
|
||||
|
||||
private BigDecimal pointAmount;
|
||||
|
||||
private BigDecimal dPointAmount;
|
||||
|
||||
private BigDecimal tokenAmount;
|
||||
|
||||
private Integer paymentType;
|
||||
|
||||
private Date paymentTime;
|
||||
|
||||
private String paymentTrack;
|
||||
|
||||
private Integer paymentStatus;
|
||||
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package org.springblade.modules.appFormal.job;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.modules.appFormal.enums.BizTypeEnum;
|
||||
import org.springblade.modules.appFormal.enums.MallOrderStatusEnum;
|
||||
import org.springblade.modules.order.pojo.entity.MallDetailOrderEntity;
|
||||
import org.springblade.modules.order.pojo.entity.MallSummaryOrderEntity;
|
||||
import org.springblade.modules.order.pojo.entity.UserOrderEntity;
|
||||
import org.springblade.modules.order.service.IMallDetailOrderService;
|
||||
import org.springblade.modules.order.service.IMallSummaryOrderService;
|
||||
import org.springblade.modules.order.service.IUserOrderService;
|
||||
import org.springblade.modules.payment.enums.PaymentStatusEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
@Slf4j
|
||||
public class AppFormalMallUserOrderJob {
|
||||
|
||||
private final IMallDetailOrderService mallDetailOrderService;
|
||||
private final IMallSummaryOrderService mallSummaryOrderService;
|
||||
private final IUserOrderService userOrderService;
|
||||
|
||||
// 商城订单关闭 三天一次
|
||||
@XxlJob("yichayilu-mall-order-close")
|
||||
public void mallOrderClose(){
|
||||
List<MallSummaryOrderEntity> mallSummaryOrderList = mallSummaryOrderService.list(
|
||||
Wrappers.lambdaQuery(MallSummaryOrderEntity.class)
|
||||
.eq(MallSummaryOrderEntity::getPaymentStatus, PaymentStatusEnum.AWAIT.getCode())
|
||||
.eq(MallSummaryOrderEntity::getOrderStatus, MallOrderStatusEnum.WAIT_PAY.getCode())
|
||||
);
|
||||
|
||||
List<MallSummaryOrderEntity> closeOrderList = mallSummaryOrderList.stream().filter(order -> order.getExpireTime().getTime() < System.currentTimeMillis()).toList();
|
||||
|
||||
closeOrderList.forEach(summaryOrder -> {
|
||||
summaryOrder.setOrderStatus(MallOrderStatusEnum.FINISHED.getCode());
|
||||
summaryOrder.setPaymentStatus(PaymentStatusEnum.CLOSE.getCode());
|
||||
|
||||
if (mallSummaryOrderService.updateById( summaryOrder)){
|
||||
List<MallDetailOrderEntity> mallDetailOrderEntities = mallDetailOrderService.list(
|
||||
Wrappers.lambdaQuery(MallDetailOrderEntity.class)
|
||||
.eq(MallDetailOrderEntity::getSummaryOrderId, summaryOrder.getId())
|
||||
.eq(MallDetailOrderEntity::getOrderStatus, MallOrderStatusEnum.WAIT_PAY.getCode())
|
||||
);
|
||||
mallDetailOrderEntities.forEach(detailOrder -> {
|
||||
detailOrder.setOrderStatus(MallOrderStatusEnum.FINISHED.getCode());
|
||||
});
|
||||
mallDetailOrderService.updateBatchById(mallDetailOrderEntities);
|
||||
|
||||
|
||||
UserOrderEntity userOrder = userOrderService.getOne(Wrappers.lambdaQuery(UserOrderEntity.class).eq(UserOrderEntity::getOrderId, summaryOrder.getId()).eq(UserOrderEntity::getOrderType, BizTypeEnum.MALL.getCode()));
|
||||
if (userOrder != null) {
|
||||
userOrder.setOrderStatus(MallOrderStatusEnum.FINISHED.getCode());
|
||||
userOrder.setPaymentStatus(PaymentStatusEnum.CLOSE.getCode());
|
||||
userOrderService.updateById(userOrder);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// 商城订单金额入资金账户
|
||||
@XxlJob("yichayilu-mall-order-recorded")
|
||||
public void mallOrderRecorded(){
|
||||
|
||||
List<MallSummaryOrderEntity> mallSummaryOrderList = mallSummaryOrderService.list(
|
||||
Wrappers.lambdaQuery(MallSummaryOrderEntity.class)
|
||||
.eq(MallSummaryOrderEntity::getPaymentStatus, PaymentStatusEnum.PAY.getCode())
|
||||
.eq(MallSummaryOrderEntity::getIsRecorded, 0)
|
||||
);
|
||||
|
||||
//todo 待完善
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package org.springblade.modules.appFormal.listener;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.modules.appFormal.convert.AppUserOrderConvert;
|
||||
import org.springblade.modules.appFormal.enums.MallOrderStatusEnum;
|
||||
import org.springblade.modules.appFormal.event.OrderConfirmOfflineEvent;
|
||||
import org.springblade.modules.appFormal.event.OrderEvent;
|
||||
import org.springblade.modules.order.pojo.entity.UserOrderEntity;
|
||||
import org.springblade.modules.order.service.IUserOrderService;
|
||||
import org.springblade.modules.payment.enums.PaymentStatusEnum;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class AppOrderListener {
|
||||
|
||||
private final IUserOrderService userOrderService;
|
||||
|
||||
@Async("appUserOrderrExecutor")
|
||||
@EventListener
|
||||
@Transactional(rollbackFor = RuntimeException.class)
|
||||
public void appUserOrderSaveListener(OrderEvent event) {
|
||||
if (event.getTitle() != null && StringUtils.hasLength(event.getTitle()) && event.getTitle().length() > 50) {
|
||||
// 裁剪
|
||||
event.setTitle(event.getTitle().substring(0, 50));
|
||||
}
|
||||
UserOrderEntity order = userOrderService.getOne(Wrappers.lambdaQuery(UserOrderEntity.class).eq(UserOrderEntity::getOrderId, event.getOrderId()).eq(UserOrderEntity::getOrderType, event.getOrderType()));
|
||||
// boolean hasOrder = true;
|
||||
if (order != null) {
|
||||
UserOrderEntity update = AppUserOrderConvert.INSTANCE.convertEventToOrder(event);
|
||||
update.setId(order.getId());
|
||||
userOrderService.updateById(update);
|
||||
} else {
|
||||
// hasOrder = false;
|
||||
userOrderService.save(AppUserOrderConvert.INSTANCE.convertEventToOrder(event));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Async("appUserOrderrExecutor")
|
||||
@EventListener
|
||||
@Transactional(rollbackFor = RuntimeException.class)
|
||||
public void appUserOrderUpdateListener(OrderConfirmOfflineEvent event) {
|
||||
|
||||
UserOrderEntity order = userOrderService.getOne(Wrappers.lambdaQuery(UserOrderEntity.class).eq(UserOrderEntity::getOrderId, event.getOrderId()).eq(UserOrderEntity::getOrderType, event.getOrderType().getCode()));
|
||||
if (order != null) {
|
||||
order.setOrderStatus(MallOrderStatusEnum.WAIT_DELIVERY.getCode());
|
||||
order.setPaymentStatus(PaymentStatusEnum.PAY.getCode());
|
||||
userOrderService.updateById(order);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
package org.springblade.modules.appFormal.manager;
|
||||
|
||||
import cn.hutool.core.util.PhoneUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.jwt.JwtUtil;
|
||||
import org.springblade.core.jwt.props.JwtProperties;
|
||||
import org.springblade.core.oauth2.provider.OAuth2Request;
|
||||
import org.springblade.core.secure.BladeUser;
|
||||
import org.springblade.core.secure.utils.AuthUtil;
|
||||
import org.springblade.modules.appFormal.convert.AppBaseConvert;
|
||||
import org.springblade.modules.appFormal.convert.AppUserInfoConvert;
|
||||
import org.springblade.modules.appFormal.dto.PayOrderDicDTO;
|
||||
import org.springblade.modules.appFormal.request.CustomerSmsRequest;
|
||||
import org.springblade.modules.appFormal.request.UpdatePasswordRequest;
|
||||
import org.springblade.modules.appFormal.vo.AppFormalBannerVO;
|
||||
import org.springblade.modules.appFormal.vo.MallIntegralLogVO;
|
||||
import org.springblade.modules.appFormal.vo.MallIntegralVO;
|
||||
import org.springblade.modules.appFormal.vo.UserInfoVO;
|
||||
import org.springblade.modules.appOffline.event.AppUserRevokedEvent;
|
||||
import org.springblade.modules.mall.pojo.entity.AppBannerEntity;
|
||||
import org.springblade.modules.mall.service.IAppBannerService;
|
||||
import org.springblade.modules.sms.service.AliYunSmsService;
|
||||
import org.springblade.modules.system.pojo.entity.User;
|
||||
import org.springblade.modules.system.service.IParamService;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralEntity;
|
||||
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralLogEntity;
|
||||
import org.springblade.modules.userPoint.service.IUserMallIntegralLogService;
|
||||
import org.springblade.modules.userPoint.service.IUserMallIntegralService;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class FormalAppBaseManager {
|
||||
|
||||
private final IParamService paramService;
|
||||
private final IAppBannerService appBannerService;
|
||||
|
||||
|
||||
public String formalAppPrivacy() {
|
||||
|
||||
return paramService.getFormalAppPrivacy();
|
||||
|
||||
}
|
||||
|
||||
public List<PayOrderDicDTO> payType(Integer payModel) {
|
||||
|
||||
return paramService.findAppFormalPayType(payModel);
|
||||
|
||||
}
|
||||
|
||||
public String formalAppAgreement() {
|
||||
return paramService.formalAppAgreement();
|
||||
}
|
||||
|
||||
public List<AppFormalBannerVO> findMainBanner() {
|
||||
|
||||
List<AppBannerEntity> bannerEntityList = appBannerService.list(
|
||||
Wrappers.<AppBannerEntity>lambdaQuery()
|
||||
.eq(AppBannerEntity::getBannerType, 1)
|
||||
.eq(AppBannerEntity::getIsShow, 1)
|
||||
.orderByDesc(AppBannerEntity::getId)
|
||||
|
||||
);
|
||||
|
||||
return AppBaseConvert.INSTANCE.convertBannerListToVO(bannerEntityList);
|
||||
|
||||
}
|
||||
|
||||
public List<AppFormalBannerVO> findMallBanner() {
|
||||
List<AppBannerEntity> bannerEntityList = appBannerService.list(
|
||||
Wrappers.<AppBannerEntity>lambdaQuery()
|
||||
.eq(AppBannerEntity::getBannerType, 2)
|
||||
.eq(AppBannerEntity::getIsShow, 1)
|
||||
.orderByDesc(AppBannerEntity::getId)
|
||||
|
||||
);
|
||||
|
||||
return AppBaseConvert.INSTANCE.convertBannerListToVO(bannerEntityList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,253 +0,0 @@
|
||||
package org.springblade.modules.appFormal.manager;
|
||||
|
||||
import cn.hutool.core.util.PhoneUtil;
|
||||
import cn.hutool.core.util.RadixUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.jwt.JwtUtil;
|
||||
import org.springblade.core.jwt.props.JwtProperties;
|
||||
import org.springblade.core.oauth2.props.OAuth2Properties;
|
||||
import org.springblade.core.oauth2.provider.OAuth2Request;
|
||||
import org.springblade.core.secure.BladeUser;
|
||||
import org.springblade.core.secure.utils.AuthUtil;
|
||||
import org.springblade.core.tool.utils.DigestUtil;
|
||||
import org.springblade.core.tool.utils.SM2Util;
|
||||
import org.springblade.core.tool.utils.StringUtil;
|
||||
import org.springblade.modules.appFormal.convert.AppBaseConvert;
|
||||
import org.springblade.modules.appFormal.convert.AppUserInfoConvert;
|
||||
import org.springblade.modules.appFormal.request.CustomerSmsRequest;
|
||||
import org.springblade.modules.appFormal.request.UpdatePasswordRequest;
|
||||
import org.springblade.modules.appFormal.vo.AppUserNoticeVO;
|
||||
import org.springblade.modules.appFormal.vo.MallIntegralLogVO;
|
||||
import org.springblade.modules.appFormal.vo.MallIntegralVO;
|
||||
import org.springblade.modules.appFormal.vo.UserInfoVO;
|
||||
import org.springblade.modules.appOffline.event.AppUserRevokedEvent;
|
||||
import org.springblade.modules.auth.constant.BladeAuthConstant;
|
||||
import org.springblade.modules.customer.pojo.entity.UserNoticeEntity;
|
||||
import org.springblade.modules.customer.service.IUserNoticeService;
|
||||
import org.springblade.modules.mall.pojo.entity.YsCategoryEntity;
|
||||
import org.springblade.modules.sms.service.AliYunSmsService;
|
||||
import org.springblade.modules.system.pojo.entity.User;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralEntity;
|
||||
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralLogEntity;
|
||||
import org.springblade.modules.userPoint.service.IUserMallIntegralLogService;
|
||||
import org.springblade.modules.userPoint.service.IUserMallIntegralService;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class FormalAppCustomerManager {
|
||||
|
||||
private final AliYunSmsService aliYunSmsService;
|
||||
private final IUserService userService;
|
||||
private final IUserMallIntegralService userMallIntegralService;
|
||||
private final IUserMallIntegralLogService mallIntegralLogService;
|
||||
private final IUserNoticeService userNoticeService;
|
||||
private final JwtProperties jwtProperties;
|
||||
private final ApplicationEventPublisher publisher;
|
||||
private final OAuth2Properties properties;
|
||||
|
||||
|
||||
public Boolean sendSmsCode(String phone) {
|
||||
Assert.notNull(phone , "手机号不能为空");
|
||||
Assert.isTrue(PhoneUtil.isMobile(phone), "手机号格式不正确");
|
||||
return aliYunSmsService.sendSms(phone);
|
||||
}
|
||||
|
||||
public Boolean checkSmsCode(CustomerSmsRequest request) {
|
||||
Assert.notNull(request.getPhone() , "手机号不能为空");
|
||||
Assert.notNull(request.getCode() , "验证码不能为空");
|
||||
Assert.isTrue(PhoneUtil.isMobile(request.getPhone()), "手机号格式不正确");
|
||||
return aliYunSmsService.verifySms(request.getPhone() , request.getCode());
|
||||
}
|
||||
|
||||
|
||||
public UserInfoVO findUserInfo(Long userId) {
|
||||
User user = userService.getById(userId);
|
||||
return new UserInfoVO()
|
||||
.setUsername(user.getName())
|
||||
.setPhone(user.getPhone())
|
||||
.setAvatar(user.getAvatar())
|
||||
.setInvitationCode(phoneTo32Hex(user.getPhone()));
|
||||
|
||||
}
|
||||
|
||||
public Boolean updatePassword(UpdatePasswordRequest request) {
|
||||
|
||||
Assert.notNull(request.getPhone() , "手机号不能为空");
|
||||
Assert.notNull(request.getCode() , "验证码不能为空");
|
||||
Assert.isTrue(PhoneUtil.isMobile(String.valueOf(request.getPhone())), "手机号格式不正确");
|
||||
aliYunSmsService.verifySms(String.valueOf(request.getPhone()) , request.getCode());
|
||||
Long phone = request.getPhone();
|
||||
User user = userService.getOne(
|
||||
Wrappers.lambdaQuery(User.class)
|
||||
.eq(User::getPhone, String.valueOf(phone))
|
||||
);
|
||||
Assert.notNull(user, "用户不存在");
|
||||
String decryptPassword = SM2Util.decrypt(request.getPassword(), properties.getPrivateKey());
|
||||
|
||||
Predicate<String> isPasswordValid = passwd -> passwd.matches("^(?=.*[0-9])(?=.*[a-zA-Z]){6,12}$");
|
||||
//去掉上面特殊字符校验
|
||||
Assert.isTrue(!isPasswordValid.test(decryptPassword), "密码长度必须在6到12位之间,且需要包含大小写英文与数字");
|
||||
|
||||
return userService.update(
|
||||
Wrappers.lambdaUpdate(User.class)
|
||||
.eq(User::getId, user.getId())
|
||||
.set(User::getPassword, DigestUtil.encrypt(decryptPassword))
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public Boolean updatePasswordNonCode(UpdatePasswordRequest request) {
|
||||
Assert.notNull(request.getPhone() , "手机号不能为空");
|
||||
Assert.notNull(request.getCode() , "验证码不能为空");
|
||||
Assert.isTrue(PhoneUtil.isMobile(String.valueOf(request.getPhone())), "手机号格式不正确");
|
||||
Long phone = request.getPhone();
|
||||
User user = userService.getOne(
|
||||
Wrappers.lambdaQuery(User.class)
|
||||
.eq(User::getPhone, String.valueOf(phone))
|
||||
);
|
||||
Assert.notNull(user, "用户不存在");
|
||||
String decryptPassword = SM2Util.decrypt(request.getPassword(), properties.getPrivateKey());
|
||||
|
||||
|
||||
Predicate<String> isPasswordValid = passwd -> passwd.matches("^(?=.*[0-9])(?=.*[a-zA-Z]){6,12}$");
|
||||
//去掉上面特殊字符校验
|
||||
Assert.isTrue(!isPasswordValid.test(decryptPassword), "密码长度必须在6到12位之间,且需要包含大小写英文与数字");
|
||||
|
||||
return userService.update(
|
||||
Wrappers.lambdaUpdate(User.class)
|
||||
.eq(User::getId, user.getId())
|
||||
.set(User::getPassword, DigestUtil.encrypt(decryptPassword))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public Boolean userLogout() {
|
||||
BladeUser user = AuthUtil.getUser();
|
||||
if (user != null && this.jwtProperties.getState()) {
|
||||
OAuth2Request request = OAuth2Request.create().buildHeaderArgs();
|
||||
String token = JwtUtil.getToken(request.getToken());
|
||||
JwtUtil.removeAccessToken(user.getTenantId(), user.getClientId(), String.valueOf(user.getUserId()), token);
|
||||
JwtUtil.removeRefreshToken(user.getTenantId(), user.getClientId(), String.valueOf(user.getUserId()), token);
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
public Boolean deleteAccount(Long userId) {
|
||||
BladeUser user = AuthUtil.getUser();
|
||||
if (user != null && this.jwtProperties.getState()) {
|
||||
OAuth2Request request = OAuth2Request.create().buildHeaderArgs();
|
||||
String token = JwtUtil.getToken(request.getToken());
|
||||
JwtUtil.removeAccessToken(user.getTenantId(), user.getClientId(), String.valueOf(user.getUserId()), token);
|
||||
JwtUtil.removeRefreshToken(user.getTenantId(), user.getClientId(), String.valueOf(user.getUserId()), token);
|
||||
}
|
||||
if(userService.removeUser(String.valueOf(List.of(userId)))){
|
||||
publisher.publishEvent(
|
||||
new AppUserRevokedEvent()
|
||||
.setUserId(userId)
|
||||
);
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
public MallIntegralVO findMallIntegral(Long userId) {
|
||||
|
||||
UserMallIntegralEntity mallIntegral = userMallIntegralService.getById(userId);
|
||||
if (mallIntegral == null){
|
||||
mallIntegral = new UserMallIntegralEntity();
|
||||
mallIntegral.setId(userId);
|
||||
mallIntegral.setAmount(BigDecimal.ZERO);
|
||||
mallIntegral.setVersion(1);
|
||||
if (userMallIntegralService.save(mallIntegral)){
|
||||
return new MallIntegralVO()
|
||||
.setAmount(BigDecimal.ZERO);
|
||||
}
|
||||
}
|
||||
return new MallIntegralVO()
|
||||
.setAmount(mallIntegral.getAmount());
|
||||
|
||||
}
|
||||
|
||||
public IPage<MallIntegralLogVO> findMallIntegralFlow(IPage<MallIntegralLogVO> page, MallIntegralLogVO logVO, Long userId) {
|
||||
|
||||
|
||||
Page<UserMallIntegralLogEntity> pageResult = mallIntegralLogService.page(
|
||||
new Page<>(page.getCurrent(), page.getSize()),
|
||||
Wrappers.lambdaQuery(UserMallIntegralLogEntity.class)
|
||||
.eq(UserMallIntegralLogEntity::getUserId, userId)
|
||||
//判断type是否为空
|
||||
.eq(Objects.nonNull(logVO.getType()), UserMallIntegralLogEntity::getType, logVO.getType())
|
||||
.eq(Objects.nonNull(logVO.getStatisticalDate()), UserMallIntegralLogEntity::getStatisticalDate, logVO.getStatisticalDate())
|
||||
.orderByDesc(UserMallIntegralLogEntity::getId)
|
||||
);
|
||||
|
||||
return AppUserInfoConvert.INSTANCE.convertIntegralPageToVO(pageResult);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public IPage<AppUserNoticeVO> findUserNoticePage(IPage<AppUserNoticeVO> page, AppUserNoticeVO userNotice, Long userId) {
|
||||
|
||||
Page<UserNoticeEntity> pageResult = userNoticeService.page(
|
||||
new Page<>(page.getCurrent(), page.getSize()),
|
||||
Wrappers.lambdaQuery(UserNoticeEntity.class)
|
||||
.eq(UserNoticeEntity::getUserId, userId)
|
||||
.eq(Objects.nonNull(userNotice.getHasRead()), UserNoticeEntity::getHasRead, userNotice.getHasRead())
|
||||
.eq(Objects.nonNull(userNotice.getNoticeType()), UserNoticeEntity::getNoticeType, userNotice.getNoticeType())
|
||||
.orderByDesc(UserNoticeEntity::getHasRead , UserNoticeEntity::getId)
|
||||
);
|
||||
|
||||
return pageResult.convert(AppBaseConvert.INSTANCE::convertUserNoticePageToVO);
|
||||
}
|
||||
|
||||
public boolean readUserNotice(Long id) {
|
||||
|
||||
UserNoticeEntity userNotice = userNoticeService.getById(id);
|
||||
Assert.notNull(userNotice, "通知不存在");
|
||||
userNotice.setHasRead(1);
|
||||
userNotice.setReleaseTime(new Date());
|
||||
return userNoticeService.updateById(userNotice);
|
||||
}
|
||||
|
||||
public Integer notReadNoticeCount(AppUserNoticeVO userNotice ,Long userId) {
|
||||
long count = userNoticeService.count(
|
||||
Wrappers.lambdaQuery(UserNoticeEntity.class)
|
||||
.eq(UserNoticeEntity::getUserId, userId)
|
||||
.eq(Objects.nonNull(userNotice.getNoticeType()), UserNoticeEntity::getNoticeType, userNotice.getNoticeType())
|
||||
.orderByDesc(UserNoticeEntity::getHasRead, UserNoticeEntity::getId)
|
||||
);
|
||||
return Math.toIntExact(count);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private String phoneTo32Hex(String phone) {
|
||||
return RadixUtil.encode(BladeAuthConstant.BINARY_TEMPLATE, Long.parseLong(phone));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,194 +0,0 @@
|
||||
package org.springblade.modules.appFormal.manager;
|
||||
|
||||
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.secure.utils.AuthUtil;
|
||||
import org.springblade.core.tool.utils.StringUtil;
|
||||
import org.springblade.modules.appFormal.convert.AppFormalMallConvert;
|
||||
import org.springblade.modules.appFormal.request.AddressSubmitRequest;
|
||||
import org.springblade.modules.appFormal.request.MallCartRequest;
|
||||
import org.springblade.modules.appFormal.vo.*;
|
||||
import org.springblade.modules.customer.service.IRegionsInfoService;
|
||||
import org.springblade.modules.mall.pojo.entity.MallCartEntity;
|
||||
import org.springblade.modules.mall.pojo.entity.MallSpuEntity;
|
||||
import org.springblade.modules.mall.pojo.entity.UserAddressEntity;
|
||||
import org.springblade.modules.mall.pojo.entity.YsCategoryEntity;
|
||||
import org.springblade.modules.mall.pojo.vo.MallSpuVO;
|
||||
import org.springblade.modules.mall.service.IMallCartService;
|
||||
import org.springblade.modules.mall.service.IMallSpuService;
|
||||
import org.springblade.modules.mall.service.IUserAddressService;
|
||||
import org.springblade.modules.mall.service.IYsCategoryService;
|
||||
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralLogEntity;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class FormalAppMallManager {
|
||||
|
||||
private final IMallSpuService spuService;
|
||||
private final IYsCategoryService categoryService;
|
||||
private final IMallCartService mallCartService;
|
||||
private final IRegionsInfoService regionInfoService;
|
||||
private final IUserAddressService addressService;
|
||||
|
||||
|
||||
public List<MallCategoryVO> findCategories() {
|
||||
|
||||
List<YsCategoryEntity> list = categoryService.list(
|
||||
Wrappers.lambdaQuery(YsCategoryEntity.class)
|
||||
.eq(YsCategoryEntity::getPid, 0)
|
||||
.orderByDesc(YsCategoryEntity::getId)
|
||||
);
|
||||
|
||||
return AppFormalMallConvert.INSTANCE.convertMallCategoryListToVO(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public IPage<AppFormalMallSpuVO> getSpuPage(IPage<MallSpuVO> page, AppFormalMallSpuVO spuVO) {
|
||||
Page<MallSpuEntity> pageResult = spuService.page(
|
||||
new Page<>(page.getCurrent(), page.getSize()),
|
||||
Wrappers.lambdaQuery(MallSpuEntity.class)
|
||||
.eq(StringUtil.isNotBlank(spuVO.getCateId()), MallSpuEntity::getCateId, spuVO.getCateId())
|
||||
.like(StringUtil.isNotBlank(spuVO.getSpuName()), MallSpuEntity::getSpuName, spuVO.getSpuName())
|
||||
.orderByDesc(MallSpuEntity::getId)
|
||||
);
|
||||
|
||||
return AppFormalMallConvert.INSTANCE.convertMallSpuPageToVO(pageResult);
|
||||
}
|
||||
|
||||
|
||||
public IPage<AppFormalMallCartVO> cartList(IPage<AppFormalMallCartVO> page, AppFormalMallCartVO cartVO, Long userId) {
|
||||
Page<MallCartEntity> pageResult = mallCartService.page(
|
||||
new Page<>(page.getCurrent(), page.getSize()),
|
||||
Wrappers.lambdaQuery(MallCartEntity.class)
|
||||
.eq(MallCartEntity::getUserId, userId)
|
||||
.like(StringUtil.isNotBlank(cartVO.getTitle()), MallCartEntity::getTitle, cartVO.getTitle())
|
||||
.orderByDesc(MallCartEntity::getId)
|
||||
);
|
||||
|
||||
return AppFormalMallConvert.INSTANCE.convertMallCartPageToVO(pageResult);
|
||||
|
||||
}
|
||||
|
||||
public AppFormalMallCartInfoVO addCart(MallCartRequest request) {
|
||||
|
||||
MallSpuEntity mallSpu = spuService.getById(request.getSpuId());
|
||||
Assert.notNull(mallSpu, "商品不存在");
|
||||
|
||||
|
||||
MallCartEntity mallCart = mallCartService.getOne(
|
||||
Wrappers.lambdaQuery(MallCartEntity.class)
|
||||
.eq(MallCartEntity::getUserId, request.getUserId())
|
||||
.eq(MallCartEntity::getSpuId, request.getSpuId())
|
||||
);
|
||||
|
||||
if (mallCart != null){
|
||||
mallCart.setQuantity(mallCart.getQuantity() + request.getQuantity());
|
||||
if (!mallCartService.updateById(mallCart)){
|
||||
throw new RuntimeException("更新购物车失败");
|
||||
}
|
||||
return new AppFormalMallCartInfoVO().setId( mallCart.getId()).setFreight(BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
MallCartEntity cart = new MallCartEntity();
|
||||
cart.setUserId(request.getUserId());
|
||||
cart.setTitle(mallSpu.getSpuName());
|
||||
cart.setQuantity(request.getQuantity());
|
||||
cart.setSpuId(request.getSpuId());
|
||||
cart.setMainImg(mallSpu.getMainImg());
|
||||
cart.setOriginalPrice(mallSpu.getOriginalPrice());
|
||||
cart.setRetailPrice(mallSpu.getRetailPrice());
|
||||
if (mallCartService.save(cart)){
|
||||
return new AppFormalMallCartInfoVO().setFreight(BigDecimal.ZERO).setId(cart.getId());
|
||||
}
|
||||
throw new RuntimeException("添加购物车失败");
|
||||
|
||||
}
|
||||
|
||||
public AppFormalMallCartInfoVO addCartToOrder(MallCartRequest request) {
|
||||
|
||||
MallSpuEntity mallSpu = spuService.getById(request.getSpuId());
|
||||
Assert.notNull(mallSpu, "商品不存在");
|
||||
|
||||
MallCartEntity cart = new MallCartEntity();
|
||||
cart.setUserId(request.getUserId());
|
||||
cart.setTitle(mallSpu.getSpuName());
|
||||
cart.setQuantity(request.getQuantity());
|
||||
cart.setSpuId(request.getSpuId());
|
||||
cart.setMainImg(mallSpu.getMainImg());
|
||||
cart.setOriginalPrice(mallSpu.getOriginalPrice());
|
||||
cart.setRetailPrice(mallSpu.getRetailPrice());
|
||||
if (mallCartService.save(cart)){
|
||||
return new AppFormalMallCartInfoVO().setFreight(BigDecimal.ZERO).setId(cart.getId());
|
||||
}
|
||||
throw new RuntimeException("添加购物车失败");
|
||||
}
|
||||
|
||||
public boolean deleteCart(List<Long> ids) {
|
||||
return mallCartService.removeBatchByIds(ids);
|
||||
}
|
||||
|
||||
public boolean updateCartQuantity(MallCartRequest request) {
|
||||
Assert.isTrue(request.getQuantity() > 0, "商品数量不能小于0");
|
||||
MallCartEntity mallCartEntity = mallCartService.getById(request.getId());
|
||||
Assert.notNull(mallCartEntity, "商品不存在");
|
||||
if (request.getType() == 1){
|
||||
mallCartEntity.setQuantity(mallCartEntity.getQuantity() + request.getQuantity());
|
||||
return mallCartService.updateById(mallCartEntity);
|
||||
}
|
||||
if ((mallCartEntity.getQuantity() - request.getQuantity()) <= 0){
|
||||
return mallCartService.removeById(request.getId());
|
||||
}
|
||||
mallCartEntity.setQuantity(mallCartEntity.getQuantity() - request.getQuantity());
|
||||
return mallCartService.updateById(mallCartEntity);
|
||||
}
|
||||
|
||||
public List<AppFormalRegionInfoVO> regionInfoList(Integer level, Long pid) {
|
||||
return regionInfoService.regionInfoList(level, pid);
|
||||
}
|
||||
|
||||
public Boolean submitAddressInfo(AddressSubmitRequest request) {
|
||||
FullRegionInfoVO regionInfo = regionInfoService.queryFullInfo(request.getRegionsInfoId());
|
||||
Assert.isTrue(regionInfo.getCurrentLevel() == 4, "请选择所属街道");
|
||||
Assert.isTrue(Validator.isMobile(request.getPhone()), "手机号码格式不正确");
|
||||
Assert.isTrue(request.getConsignee().length() < 100 , "名字不能超过100个字");
|
||||
UserAddressEntity address = AppFormalMallConvert.INSTANCE.convertRequestToPo(request);
|
||||
address
|
||||
.setProvince(regionInfo.getProvince())
|
||||
.setCity(regionInfo.getCity())
|
||||
.setDistrict(regionInfo.getDistrict())
|
||||
.setUserId(AuthUtil.getUserId())
|
||||
.setStreet(regionInfo.getStreet());
|
||||
if (request.getIsDefault() == 1) {
|
||||
addressService.update(Wrappers.lambdaUpdate(UserAddressEntity.class).eq(UserAddressEntity::getUserId, AuthUtil.getUserId()).set(UserAddressEntity::getIsDefault, 0));
|
||||
}
|
||||
return addressService.saveOrUpdate(address);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Boolean deleteAddressInfo(List<Long> ids) {
|
||||
return addressService.removeBatchByIds(ids);
|
||||
}
|
||||
|
||||
public List<AppFormalAddressVO> addressInfoList(Long userId) {
|
||||
List<UserAddressEntity> addressList = addressService.list(Wrappers.lambdaQuery(UserAddressEntity.class)
|
||||
.eq(UserAddressEntity::getUserId, userId)
|
||||
.orderByDesc(UserAddressEntity::getIsDefault , UserAddressEntity::getId));
|
||||
return AppFormalMallConvert.INSTANCE.convertPoListToVoList(addressList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,353 +0,0 @@
|
||||
package org.springblade.modules.appFormal.manager;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.common.utils.RandomAmountGenerator;
|
||||
import org.springblade.common.utils.date.DateUtil;
|
||||
import org.springblade.core.secure.utils.AuthUtil;
|
||||
import org.springblade.modules.appFormal.convert.AppUserOrderConvert;
|
||||
import org.springblade.modules.appFormal.dto.CutAmountRangDTO;
|
||||
import org.springblade.modules.appFormal.dto.PayOrderDicDTO;
|
||||
import org.springblade.modules.appFormal.dto.PreviewDTO;
|
||||
import org.springblade.modules.appFormal.enums.BizTypeEnum;
|
||||
import org.springblade.modules.appFormal.enums.MallOrderStatusEnum;
|
||||
import org.springblade.modules.appFormal.event.OrderEvent;
|
||||
import org.springblade.modules.appFormal.vo.*;
|
||||
import org.springblade.modules.payment.api.PaymentFacade;
|
||||
import org.springblade.modules.payment.enums.PaymentStatusEnum;
|
||||
import org.springblade.modules.appFormal.request.AppFormalPreviewOrderRequest;
|
||||
import org.springblade.modules.customer.pojo.entity.RegionsInfoEntity;
|
||||
import org.springblade.modules.customer.service.IRegionsInfoService;
|
||||
import org.springblade.modules.mall.pojo.entity.MallCartEntity;
|
||||
import org.springblade.modules.mall.pojo.entity.MallSpuEntity;
|
||||
import org.springblade.modules.mall.pojo.entity.UserAddressEntity;
|
||||
import org.springblade.modules.mall.service.IMallCartService;
|
||||
import org.springblade.modules.mall.service.IMallSpuService;
|
||||
import org.springblade.modules.mall.service.IUserAddressService;
|
||||
import org.springblade.modules.order.pojo.entity.MallDetailOrderEntity;
|
||||
import org.springblade.modules.order.pojo.entity.MallSummaryOrderEntity;
|
||||
import org.springblade.modules.order.pojo.entity.UserOrderEntity;
|
||||
import org.springblade.modules.order.service.IMallDetailOrderService;
|
||||
import org.springblade.modules.order.service.IMallSummaryOrderService;
|
||||
import org.springblade.modules.order.service.IUserOrderService;
|
||||
import org.springblade.modules.system.pojo.entity.User;
|
||||
import org.springblade.modules.system.service.IParamService;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class FormalAppOrderManager {
|
||||
|
||||
private final IParamService paramService;
|
||||
private final IUserOrderService orderService;
|
||||
private final IMallSummaryOrderService mallSummaryOrderService;
|
||||
private final IMallDetailOrderService mallDetailOrderService;
|
||||
private final IUserService userService;
|
||||
private final IUserAddressService userAddressService;
|
||||
private final IRegionsInfoService regionsInfoService;
|
||||
private final IMallSpuService mallSpuService;
|
||||
private final IMallCartService mallCartService;
|
||||
private final PaymentFacade paymentFacade;
|
||||
private final ApplicationEventPublisher publisher;
|
||||
|
||||
|
||||
public List<PayOrderDicDTO> orderBizModel() {
|
||||
return paramService.getOrderBizModel();
|
||||
}
|
||||
|
||||
|
||||
public IPage<AppFormalOrderVO> getOrderList(IPage<AppFormalOrderVO> page, AppFormalOrderVO orderVO) {
|
||||
|
||||
Page<UserOrderEntity> orderPage = orderService.page(new Page<>(page.getCurrent(), page.getSize()), Wrappers.lambdaQuery(UserOrderEntity.class)
|
||||
.eq(UserOrderEntity::getUserId, AuthUtil.getUserId())
|
||||
.eq(orderVO.getOrderType() != null, UserOrderEntity::getOrderType, orderVO.getOrderType())
|
||||
.eq(orderVO.getPaymentStatus() != null, UserOrderEntity::getPaymentStatus, orderVO.getPaymentStatus())
|
||||
.eq(orderVO.getOrderStatus() != null, UserOrderEntity::getOrderStatus, orderVO.getOrderStatus())
|
||||
.likeLeft(StrUtil.isNotBlank(orderVO.getTitle()), UserOrderEntity::getTitle, orderVO.getTitle())
|
||||
.orderByDesc(UserOrderEntity::getId));
|
||||
if (orderPage.getRecords().isEmpty()) {
|
||||
return orderPage.convert(AppUserOrderConvert.INSTANCE::convertOrderToVO);
|
||||
}
|
||||
return orderPage.convert(order -> {
|
||||
AppFormalOrderVO vo = AppUserOrderConvert.INSTANCE.convertOrderToVO(order);
|
||||
vo.setContent(order.getDescription());
|
||||
vo.setOrderStatusName(BizTypeEnum.getStatusName(order.getOrderType(), order.getOrderStatus()));
|
||||
return vo;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public AppFormalMallOrderVO mallOrderDetail(Long id) {
|
||||
|
||||
MallSummaryOrderEntity order = mallSummaryOrderService.getById(id);
|
||||
Assert.notNull(order, "无效订单");
|
||||
Assert.isTrue(order.getUserId().equals(AuthUtil.getUserId()), "错误订单");
|
||||
AppFormalMallOrderVO orderVO = AppUserOrderConvert.INSTANCE.convertMallOrderToVO(order);
|
||||
|
||||
List<MallDetailOrderEntity> details = mallSummaryOrderService.getDetails(id);
|
||||
List<AppFormalMallDetailOrderVO> skuVOS = details.stream().map(sku -> {
|
||||
AppFormalMallDetailOrderVO skuVO = AppUserOrderConvert.INSTANCE.convertEntityToVO(sku);
|
||||
return skuVO;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
PreviewDTO previewDTO = JSONObject.parseObject(order.getProductsInfo(), PreviewDTO.class);
|
||||
|
||||
|
||||
orderVO.setAddress(previewDTO.getAddress());
|
||||
orderVO.setDetailOrderList(skuVOS);
|
||||
orderVO.setCashAmount(order.getTotalAmount());
|
||||
orderVO.setOrderAmount(order.getActualAmount());
|
||||
return orderVO;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public AppFormalPreviewOrderVO mallMakeOrder(AppFormalPreviewOrderRequest request, Long userId) {
|
||||
// 现金转商城积分比例
|
||||
BigDecimal mallCashToPointRate = paramService.getMallCashToPointRate();
|
||||
//随机立减范围
|
||||
CutAmountRangDTO randomReduceRange = paramService.getMallCutAmountRangDTO();
|
||||
|
||||
User user = userService.getById(userId);
|
||||
Assert.notNull(user, "用户不存在");
|
||||
|
||||
PreviewDTO previewDTO = doPreview(request.getCartIds(), request.getAddressId());
|
||||
|
||||
AppFormalPreviewOrderVO result = AppUserOrderConvert.INSTANCE.convertPreviewDTOToVO(previewDTO);
|
||||
MallSummaryOrderEntity order = AppUserOrderConvert.INSTANCE.convertPreviewDTOToOrder(previewDTO);
|
||||
|
||||
order.setUserName(user.getName());
|
||||
order.setUserPhone(Long.valueOf(user.getPhone()));
|
||||
|
||||
order.setExpireTime(DateUtil.getMinutesLate(new Date(), 30));
|
||||
order.setProductsInfo(JSONObject.toJSONString(previewDTO));
|
||||
order.setUserId(userId);
|
||||
order.setIsRoyalty(0); // 0:否 1:是
|
||||
order.setFreightAmount(previewDTO.getFreightAmount());
|
||||
order.setTotalAmount(previewDTO.getTotalAmount());
|
||||
|
||||
// 订单成本 含运费
|
||||
List<PreviewDTO.SkuDTO> skuList = previewDTO.getSkuList();
|
||||
|
||||
|
||||
List<AppFormalMallSkuVO> appFormalMallSkuVOList = new ArrayList<>();
|
||||
|
||||
List<MallDetailOrderEntity> detailOrderList = skuList.stream().map(sku -> {
|
||||
MallDetailOrderEntity detailOrder = AppUserOrderConvert.INSTANCE.convertSkuDTOToDetailOrder(sku);
|
||||
detailOrder.setId(null);
|
||||
detailOrder.setUserName(user.getName());
|
||||
detailOrder.setUserPhone(Long.valueOf(user.getPhone()));
|
||||
detailOrder.setUserId(userId);
|
||||
detailOrder.setSummaryOrderId(order.getId());
|
||||
detailOrder.setSpuId(sku.getSpuId());
|
||||
detailOrder.setQuantity(sku.getQuantity());
|
||||
detailOrder.setSkuSnapshot(JSONObject.toJSONString(sku));
|
||||
detailOrder.setActualCostAmount(sku.getCostPrice());
|
||||
detailOrder.setOrderAmount(sku.getRetailPrice());
|
||||
detailOrder.setCostAmount(sku.getCostPrice());
|
||||
detailOrder.setActualAmount(sku.getRetailPrice());
|
||||
detailOrder.setGivenAmount(sku.getRetailPrice().multiply(mallCashToPointRate).setScale(2, RoundingMode.HALF_UP));
|
||||
detailOrder.setOrderStatus(MallOrderStatusEnum.WAIT_PAY.getCode());
|
||||
|
||||
appFormalMallSkuVOList.add(
|
||||
new AppFormalMallSkuVO()
|
||||
.setId(sku.getSpuId())
|
||||
.setImage(sku.getMainImg())
|
||||
.setSkuTitle(sku.getSpuName())
|
||||
.setCurrentPrice(sku.getRetailPrice())
|
||||
.setQuantity(sku.getQuantity())
|
||||
.setTotalAmount(sku.getRetailPrice().multiply(BigDecimal.valueOf(sku.getQuantity())))
|
||||
);
|
||||
|
||||
return detailOrder;
|
||||
}).collect(Collectors.toList());
|
||||
// 总利润
|
||||
|
||||
order.setActualGiveToken(BigDecimal.ZERO);
|
||||
|
||||
|
||||
BigDecimal cutAmount = BigDecimal.ZERO;
|
||||
if (order.getTotalAmount().compareTo(BigDecimal.ONE) > 0){
|
||||
cutAmount = RandomAmountGenerator.generateRandomAmount(randomReduceRange.getMin(), randomReduceRange.getMax().multiply(order.getTotalAmount()));
|
||||
order.setCostAmount(cutAmount);
|
||||
}
|
||||
|
||||
order.setActualAmount(previewDTO.getTotalAmount().subtract(cutAmount));
|
||||
order.setGiveToken(order.getActualAmount().multiply(mallCashToPointRate).setScale(2, RoundingMode.HALF_UP));
|
||||
|
||||
order.setOrderStatus(MallOrderStatusEnum.WAIT_PAY.getCode());
|
||||
order.setPaymentStatus(PaymentStatusEnum.AWAIT.getCode());
|
||||
order.setPaymentType(request.getPayType());
|
||||
mallSummaryOrderService.generateOrder(order, detailOrderList);
|
||||
mallCartService.removeBatchByIds(request.getCartIds());
|
||||
syncQffOrder(order);
|
||||
|
||||
result.setSkuList(appFormalMallSkuVOList);
|
||||
result.setFreightAmount(order.getFreightAmount());
|
||||
result.setOrderAmount(order.getOrderAmount());
|
||||
result.setCutAmount(order.getCostAmount());
|
||||
return result.setId(order.getId());
|
||||
|
||||
|
||||
}
|
||||
|
||||
public Boolean mallCancelOrder(Long id, Long userId) {
|
||||
|
||||
MallSummaryOrderEntity order = mallSummaryOrderService.getById(id);
|
||||
Assert.notNull(order, "无效订单!");
|
||||
if (userId != null) {
|
||||
Assert.isTrue(order.getUserId().equals(userId), "订单用户异常");
|
||||
}
|
||||
Assert.isTrue(order.getPaymentStatus() == PaymentStatusEnum.AWAIT.getCode(), "订单支付状态异常");
|
||||
Assert.isTrue(order.getStatus() == MallOrderStatusEnum.WAIT_PAY.getCode(), "订单状态异常");
|
||||
order.setStatus(MallOrderStatusEnum.CANCELED.getCode());
|
||||
order.setPaymentStatus(PaymentStatusEnum.CLOSE.getCode());
|
||||
try {
|
||||
paymentFacade.close(order.getId(), "商城订单取消" + order.getId());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return mallSummaryOrderService.updateById(order);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean mallConfirmReceipt(Long orderId, Long userId) {
|
||||
MallSummaryOrderEntity summaryOrder = mallSummaryOrderService.getById(orderId);
|
||||
Assert.notNull(summaryOrder, "订单不存在");
|
||||
Assert.isTrue(Objects.equals(summaryOrder.getUserId(), userId), "订单不存在");
|
||||
Assert.isTrue(Objects.equals(summaryOrder.getStatus(), MallOrderStatusEnum.WAIT_RECEIVE.getCode())
|
||||
|| Objects.equals(summaryOrder.getStatus(), MallOrderStatusEnum.COMPLETED.getCode()), "订单状态异常");
|
||||
summaryOrder.setStatus(MallOrderStatusEnum.COMPLETED.getCode());
|
||||
mallSummaryOrderService.updateById(summaryOrder);
|
||||
return mallDetailOrderService.update(Wrappers.lambdaUpdate(MallDetailOrderEntity.class)
|
||||
.eq(MallDetailOrderEntity::getSummaryOrderId, summaryOrder.getId())
|
||||
.in(MallDetailOrderEntity::getStatus, MallOrderStatusEnum.WAIT_PAY.getCode(),
|
||||
MallOrderStatusEnum.WAIT_DELIVERY.getCode(),
|
||||
MallOrderStatusEnum.WAIT_RECEIVE.getCode()
|
||||
)
|
||||
.set(MallDetailOrderEntity::getStatus, MallOrderStatusEnum.COMPLETED.getCode()));
|
||||
}
|
||||
|
||||
|
||||
private PreviewDTO doPreview(List<Long> cartIds, Long addressId) {
|
||||
User user = userService.getById(AuthUtil.getUserId());
|
||||
|
||||
Assert.notNull(user, "无效用户");
|
||||
|
||||
UserAddressEntity address = userAddressService.getById(addressId);
|
||||
Assert.notNull(address, "无效地址");
|
||||
RegionsInfoEntity regionInfo = regionsInfoService.getById(address.getRegionsInfoId());
|
||||
Assert.notNull(regionInfo, "无效地区");
|
||||
|
||||
PreviewDTO result = new PreviewDTO().setAddressId(addressId).setAddress(address).setVendorRegionsId(regionInfo.getVendorRegionId());
|
||||
|
||||
List<MallCartEntity> cartList = mallCartService.getCartListByIds(cartIds);
|
||||
List<PreviewDTO.SkuDTO> skuList = new LinkedList<>();
|
||||
|
||||
cartList.forEach(c -> {
|
||||
|
||||
MallSpuEntity mallSpu = mallSpuService.getById(c.getSpuId());
|
||||
|
||||
Assert.notNull(mallSpu, c.getTitle() + "不存在或已下架");
|
||||
Assert.isTrue(mallSpu.getSpuQty() > mallSpu.getSales(), c.getTitle() + "商品库存不足");
|
||||
|
||||
skuList.add(
|
||||
new PreviewDTO.SkuDTO()
|
||||
.setSpuId(mallSpu.getId())
|
||||
.setSpuSn(mallSpu.getSpuSn())
|
||||
.setSpuName(mallSpu.getSpuName())
|
||||
.setMainImg(mallSpu.getMainImg())
|
||||
.setDetailImg(mallSpu.getDetailImg())
|
||||
.setTopImg(mallSpu.getTopImg())
|
||||
.setCateId(mallSpu.getCateId())
|
||||
.setCateIds(mallSpu.getCateIds())
|
||||
.setOriginalPrice(mallSpu.getOriginalPrice())
|
||||
.setRetailPrice(mallSpu.getRetailPrice())
|
||||
.setCostPrice(mallSpu.getCostPrice())
|
||||
.setSales(mallSpu.getSales())
|
||||
.setSpuQty(mallSpu.getSpuQty())
|
||||
.setTags(mallSpu.getTags())
|
||||
.setQuantity(c.getQuantity())
|
||||
);
|
||||
|
||||
|
||||
});
|
||||
|
||||
BigDecimal orderAmount = BigDecimal.ZERO;
|
||||
BigDecimal regularAmount = BigDecimal.ZERO;
|
||||
|
||||
// 供应链成本
|
||||
BigDecimal costAmountAll = BigDecimal.ZERO;
|
||||
for (PreviewDTO.SkuDTO skuDTO : skuList) {
|
||||
BigDecimal totalAmount = skuDTO.getOriginalPrice().multiply(BigDecimal.valueOf(skuDTO.getQuantity()).setScale(2, RoundingMode.UP));
|
||||
BigDecimal regular = skuDTO.getOriginalPrice().multiply(BigDecimal.valueOf(skuDTO.getQuantity()).setScale(2, RoundingMode.UP));
|
||||
BigDecimal costAmount = skuDTO.getCostPrice().multiply(BigDecimal.valueOf(skuDTO.getQuantity()).setScale(2, RoundingMode.UP));
|
||||
orderAmount = orderAmount.add(totalAmount);
|
||||
regularAmount = regularAmount.add(regular);
|
||||
costAmountAll = costAmountAll.add(costAmount);
|
||||
}
|
||||
|
||||
|
||||
;
|
||||
return result.setOrderAmount(orderAmount)
|
||||
.setTotalAmount(orderAmount)
|
||||
.setOrderAmount(orderAmount)
|
||||
.setCostAmount(costAmountAll)
|
||||
.setSkuList(skuList)
|
||||
.setRegularAmount(regularAmount)
|
||||
.setFreightAmount(BigDecimal.ZERO)
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
private void syncQffOrder(MallSummaryOrderEntity order) {
|
||||
// 保存总订单
|
||||
OrderEvent orderEvent = new OrderEvent()
|
||||
.setUserId(order.getUserId())
|
||||
.setUserName(order.getUserName())
|
||||
.setUserPhone(order.getUserPhone())
|
||||
.setOrderType(BizTypeEnum.MALL.getCode())
|
||||
.setOrderId(order.getId())
|
||||
.setOrderStatus(order.getStatus())
|
||||
.setTotalAmount(order.getTotalAmount())
|
||||
.setActualAmount(order.getActualAmount())
|
||||
.setPaymentStatus(order.getPaymentStatus())
|
||||
.setPaymentTime(order.getPaymentCompletedTime())
|
||||
.setPaymentType(order.getPaymentType())
|
||||
|
||||
;
|
||||
PreviewDTO productsInfo = JSONObject.parseObject(order.getProductsInfo(), PreviewDTO.class);
|
||||
if (productsInfo != null) {
|
||||
String desc = productsInfo.getSkuList().stream().map(PreviewDTO.SkuDTO::getSpuName).collect(Collectors.joining(","));
|
||||
PreviewDTO.SkuDTO skuDTO = productsInfo.getSkuList().get(0);
|
||||
orderEvent
|
||||
.setTitle(skuDTO.getSpuName())
|
||||
.setImages(skuDTO.getMainImg())
|
||||
.setQuantity(productsInfo.getSkuList().size())
|
||||
.setDescription(desc);
|
||||
}
|
||||
publisher.publishEvent(orderEvent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package org.springblade.modules.appFormal.request;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AddressRemoveRequest implements Serializable {
|
||||
|
||||
private List<Long> ids;
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package org.springblade.modules.appFormal.request;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AddressSubmitRequest implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long regionsInfoId;
|
||||
|
||||
private String detail;
|
||||
|
||||
private String consignee;
|
||||
|
||||
private String phone;
|
||||
|
||||
private Integer isDefault;
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package org.springblade.modules.appFormal.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class AppForOrderIdRequest implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package org.springblade.modules.appFormal.request;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AppFormalPreviewOrderRequest implements Serializable {
|
||||
|
||||
|
||||
private List<Long> cartIds;
|
||||
|
||||
private Long addressId;
|
||||
|
||||
private Integer payType;
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package org.springblade.modules.appFormal.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class CustomerSmsRequest implements Serializable {
|
||||
|
||||
private String phone;
|
||||
private String code;
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package org.springblade.modules.appFormal.request;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class MallCartRemoveRequest {
|
||||
private List<Long> ids;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package org.springblade.modules.appFormal.request;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class MallCartRequest {
|
||||
private Long id;
|
||||
private Long userId;
|
||||
private Long spuId;
|
||||
private Integer quantity;
|
||||
|
||||
//类型 1-增加 2-减少
|
||||
private Integer type = 1;
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package org.springblade.modules.appFormal.request;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class UpdatePasswordRequest implements Serializable {
|
||||
|
||||
private Long id;
|
||||
private String password;
|
||||
private Long phone;
|
||||
private String code;
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package org.springblade.modules.appFormal.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class AppFormalAddressVO implements Serializable {
|
||||
|
||||
private Long id = -1L;
|
||||
|
||||
private Long regionsInfoId = -1L;
|
||||
|
||||
private String province;
|
||||
|
||||
private String city;
|
||||
|
||||
private String district;
|
||||
|
||||
private String street;
|
||||
|
||||
private String detail;
|
||||
|
||||
private String consignee;
|
||||
|
||||
private String phone;
|
||||
|
||||
private Integer isDefault = -1;
|
||||
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.appFormal.vo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 首页轮播图 实体类
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-02-03
|
||||
*/
|
||||
@Data
|
||||
public class AppFormalBannerVO {
|
||||
|
||||
|
||||
|
||||
private String coverUrl;
|
||||
|
||||
private String route;
|
||||
|
||||
private String outsideUrl;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package org.springblade.modules.appFormal.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AppFormalMallCartInfoVO {
|
||||
private Long id;
|
||||
private BigDecimal freight = BigDecimal.ZERO;
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package org.springblade.modules.appFormal.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AppFormalMallCartVO {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Integer quantity;
|
||||
|
||||
|
||||
private String mainImg;
|
||||
|
||||
private BigDecimal originalPrice;
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package org.springblade.modules.appFormal.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springblade.modules.order.pojo.entity.MallDetailOrderEntity;
|
||||
|
||||
|
||||
@Data
|
||||
public class AppFormalMallDetailOrderVO extends MallDetailOrderEntity {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package org.springblade.modules.appFormal.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springblade.modules.mall.pojo.entity.UserAddressEntity;
|
||||
import org.springblade.modules.order.pojo.entity.MallSummaryOrderEntity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AppFormalMallOrderVO extends MallSummaryOrderEntity {
|
||||
|
||||
/**
|
||||
* 详情订单
|
||||
*/
|
||||
List<AppFormalMallDetailOrderVO> detailOrderList;
|
||||
|
||||
/**
|
||||
* 现金金额
|
||||
*/
|
||||
private BigDecimal cashAmount= BigDecimal.ZERO;
|
||||
|
||||
boolean isCanAfter = false;
|
||||
|
||||
private UserAddressEntity address;
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package org.springblade.modules.appFormal.vo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springblade.common.utils.string.StringPool;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AppFormalMallSkuVO implements Serializable {
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
private String title = StringPool.EMPTY;
|
||||
|
||||
private String skuTitle = StringPool.EMPTY;
|
||||
|
||||
private Integer quantity = -1;
|
||||
|
||||
private String image = StringPool.EMPTY;
|
||||
|
||||
private BigDecimal currentPrice = BigDecimal.ZERO;
|
||||
|
||||
private BigDecimal totalAmount = BigDecimal.ZERO;
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package org.springblade.modules.appFormal.vo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AppFormalMallSpuVO implements Serializable {
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
/**
|
||||
* 商品编码
|
||||
*/
|
||||
private String spuSn;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String spuName;
|
||||
/**
|
||||
* 主图
|
||||
*/
|
||||
private String mainImg;
|
||||
/**
|
||||
* 详情图(多图,逗号分割)
|
||||
*/
|
||||
private String detailImg;
|
||||
/**
|
||||
* 顶图(多图,逗号分割)
|
||||
*/
|
||||
private String topImg;
|
||||
/**
|
||||
* cate_id分类
|
||||
*/
|
||||
private String cateId;
|
||||
/**
|
||||
* cate_id分类
|
||||
*/
|
||||
private String cateIds;
|
||||
|
||||
/**
|
||||
* 原价
|
||||
*/
|
||||
private BigDecimal originalPrice;
|
||||
/**
|
||||
* 销售价
|
||||
*/
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
/**
|
||||
* 销量
|
||||
*/
|
||||
private Integer sales;
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
private Integer spuQty;
|
||||
/**
|
||||
* 标签(多标签,逗号分割 )
|
||||
*/
|
||||
private String tags;
|
||||
|
||||
private BigDecimal freight = BigDecimal.ZERO;
|
||||
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package org.springblade.modules.appFormal.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springblade.modules.appFormal.enums.BizTypeEnum;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class AppFormalOrderVO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
|
||||
private Long orderId;
|
||||
|
||||
private String title;
|
||||
|
||||
private String content;
|
||||
|
||||
private Integer quantity;
|
||||
|
||||
private String images;
|
||||
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
private Integer orderType;
|
||||
|
||||
private Integer orderStatus;
|
||||
|
||||
private String orderStatusName;
|
||||
|
||||
private Integer paymentStatus;
|
||||
|
||||
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date paymentTime;
|
||||
|
||||
/**
|
||||
* 支付方式
|
||||
*/
|
||||
private Integer paymentType;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package org.springblade.modules.appFormal.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AppFormalPreviewOrderVO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private List<AppFormalMallSkuVO> skuList = Collections.emptyList();
|
||||
|
||||
private BigDecimal orderAmount = BigDecimal.ZERO;
|
||||
|
||||
private BigDecimal freightAmount = BigDecimal.ZERO;
|
||||
|
||||
private BigDecimal totalAmount = BigDecimal.ZERO;
|
||||
|
||||
|
||||
/**
|
||||
* 随机立减
|
||||
*/
|
||||
private BigDecimal cutAmount;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package org.springblade.modules.appFormal.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
//
|
||||
public class AppFormalRegionInfoVO implements Serializable {
|
||||
|
||||
//
|
||||
@TableId(type = IdType.NONE)
|
||||
private Long id;
|
||||
|
||||
//
|
||||
private String name;
|
||||
|
||||
//
|
||||
private Integer level;
|
||||
|
||||
//
|
||||
private Long pid;
|
||||
|
||||
//
|
||||
private BigDecimal lon;
|
||||
|
||||
//
|
||||
private BigDecimal lat;
|
||||
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.appFormal.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用户通知 实体类
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-02-03
|
||||
*/
|
||||
@Data
|
||||
public class AppUserNoticeVO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id")
|
||||
private Long id;
|
||||
|
||||
private Integer noticeType;
|
||||
/**
|
||||
* 是否已读 0-否 1-是
|
||||
*/
|
||||
private Integer hasRead;
|
||||
|
||||
private Date releaseTime;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package org.springblade.modules.appFormal.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springblade.common.utils.string.StringPool;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class FullRegionInfoVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer currentLevel = -1;
|
||||
|
||||
private String street = StringPool.EMPTY;
|
||||
|
||||
private String district = StringPool.EMPTY;
|
||||
|
||||
private String city = StringPool.EMPTY;
|
||||
|
||||
private String province = StringPool.EMPTY;
|
||||
|
||||
private Long streetId = -1L;
|
||||
|
||||
private Long districtId = -1L;
|
||||
|
||||
private Long cityId = -1L;
|
||||
|
||||
private Long provinceId = -1L;
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package org.springblade.modules.appFormal.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class MallCategoryVO {
|
||||
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
private String cname;
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package org.springblade.modules.appFormal.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class MallIntegralLogVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户手机号
|
||||
*/
|
||||
private Long userPhone;
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String userName;
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
private String sourceDetail;
|
||||
|
||||
private Long orderId;
|
||||
|
||||
private Integer type;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date statisticalDate;
|
||||
|
||||
|
||||
private String remark;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package org.springblade.modules.appFormal.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class MallIntegralVO implements Serializable {
|
||||
|
||||
private BigDecimal amount;
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package org.springblade.modules.appFormal.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class UserInfoVO implements Serializable {
|
||||
|
||||
private String username;
|
||||
private String phone;
|
||||
private String avatar;
|
||||
private String invitationCode;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
package org.springblade.modules.appOffline.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.secure.utils.AuthUtil;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.modules.appOffline.manager.OfflineAppDailySignManager;
|
||||
import org.springblade.modules.appOffline.request.WatchVideoRequest;
|
||||
import org.springblade.modules.appOffline.vo.AppOffLineAdsVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("offline-app/dailySign")
|
||||
@Tag(name = "积分app签到信息", description = "积分app签到信息接口")
|
||||
public class OffLineDailySignController {
|
||||
|
||||
private final OfflineAppDailySignManager dailySignManager;
|
||||
|
||||
|
||||
@Operation(summary = "查询签到广告列表")
|
||||
@GetMapping("/find-sign-ads-list")
|
||||
public R<List<AppOffLineAdsVO>> findSignAdsList() {
|
||||
return R.data(dailySignManager.findSignAdsList());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 是否看广告
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "是否看广告")
|
||||
@GetMapping("/is-look-Ads-output")
|
||||
public R<Boolean> isLookAtAdsByOutput(){
|
||||
return R.status(dailySignManager.isLookAtAdsByOutput());
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始观看视频
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "开始观看视频")
|
||||
@PostMapping("/start-look-ads")
|
||||
public R<Boolean> startLookAtAds(@RequestBody WatchVideoRequest request){
|
||||
return R.status(dailySignManager.startLookAtAds(request.setUserId(AuthUtil.getUserId())));
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束观看视频
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "结束观看视频")
|
||||
@PostMapping("/end-look-ads")
|
||||
public R<Boolean> endLookAtAdsByOutput(@RequestBody WatchVideoRequest request){
|
||||
return R.status(dailySignManager.endLookAtAds(request.setUserId(AuthUtil.getUserId())));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
package org.springblade.modules.appOffline.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.secure.utils.AuthUtil;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.modules.appFormal.manager.FormalAppCustomerManager;
|
||||
import org.springblade.modules.appFormal.vo.AppUserNoticeVO;
|
||||
import org.springblade.modules.appOffline.manager.OfflineAppCustomerManager;
|
||||
import org.springblade.modules.appOffline.vo.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("offline-app/customer")
|
||||
@Tag(name = "积分app用户信息", description = "积分app用户信息接口")
|
||||
public class OfflineCustomerController {
|
||||
|
||||
private final OfflineAppCustomerManager offlineAppCustomerManager;
|
||||
private final FormalAppCustomerManager formalAppCustomerManager;
|
||||
|
||||
|
||||
|
||||
|
||||
@Operation(summary = "查询用户信息")
|
||||
@GetMapping("/find-user-info")
|
||||
public R<AppOfflineUserInfoVO> findUserInfo() {
|
||||
return R.data(offlineAppCustomerManager.findUserInfo(AuthUtil.getUserId()));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询用户直推")
|
||||
@GetMapping("/find-user-direct-list")
|
||||
public R<List<AppOfflineUserDirectVO>> findUserDirectList() {
|
||||
return R.data(offlineAppCustomerManager.findUserDirectList(AuthUtil.getUserId()));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询用户通知")
|
||||
@GetMapping("/find-user-notice-page")
|
||||
public R<IPage<AppUserNoticeVO>> findUserNoticePage(Query query , AppUserNoticeVO userNotice) {
|
||||
return R.data(formalAppCustomerManager.findUserNoticePage(Condition.getPage(query), userNotice, AuthUtil.getUserId()));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询用户通知")
|
||||
@GetMapping("/read-user-notice")
|
||||
public R<Boolean> readUserNotice(AppUserNoticeVO userNotice) {
|
||||
return R.status(formalAppCustomerManager.readUserNotice(userNotice.getId()));
|
||||
}
|
||||
|
||||
@Operation(summary = "未读消息总数")
|
||||
@GetMapping("/not-read-notice-count")
|
||||
public R<Integer> notReadNoticeCount(AppUserNoticeVO userNotice) {
|
||||
return R.data(formalAppCustomerManager.notReadNoticeCount(userNotice ,AuthUtil.getUserId()));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "查询积分")
|
||||
@GetMapping("/find-user-integral")
|
||||
public R<AppOfflineIntegralVO> findUserIntegral() {
|
||||
return R.data(offlineAppCustomerManager.findUserIntegral(AuthUtil.getUserId()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "查询福利积分流水")
|
||||
@GetMapping("/find-benefit-log")
|
||||
public R<IPage<AppOffLineIntegralLogVO>> findBenefitLog(Query query ,AppOffLineIntegralLogVO log) {
|
||||
return R.data(offlineAppCustomerManager.findBenefitLog(Condition.getPage(query) , log ,AuthUtil.getUserId()));
|
||||
|
||||
}
|
||||
|
||||
@Operation(summary = "查询现金券流水")
|
||||
@GetMapping("/find-cash-log")
|
||||
public R<IPage<AppOffLineIntegralLogVO>> findCashLog(Query query ,AppOffLineIntegralLogVO log) {
|
||||
return R.data(offlineAppCustomerManager.findCashLog(Condition.getPage(query) , log , AuthUtil.getUserId()));
|
||||
|
||||
}
|
||||
|
||||
@Operation(summary = "查询佣金流水")
|
||||
@GetMapping("/find-commission-log")
|
||||
public R<IPage<AppOffLineIntegralLogVO>> findCommissionLog(Query query ,AppOffLineIntegralLogVO log) {
|
||||
return R.data(offlineAppCustomerManager.findCommissionLog(Condition.getPage(query) , log ,AuthUtil.getUserId()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "查询福利包列表")
|
||||
@GetMapping("/find-packagesInfo-list")
|
||||
public R<List<AppOffLinePackageInfoVO>> findPackagesInfoList() {
|
||||
return R.data(offlineAppCustomerManager.findPackagesInfoList());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "查询用户兑换福利包的列表")
|
||||
@PostMapping("/find-user-pack-list")
|
||||
public R<IPage<AppOffLineUserPackInfoVO>> findUserPackList(Query query , AppOffLineUserPackInfoVO packInfo) {
|
||||
return R.data(offlineAppCustomerManager.findUserPackList(Condition.getPage(query) , packInfo ,AuthUtil.getUserId()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package org.springblade.modules.appOffline.convert;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import org.springblade.modules.appOffline.vo.*;
|
||||
import org.springblade.modules.customer.pojo.entity.UserGenealogyEntity;
|
||||
import org.springblade.modules.customer.pojo.entity.UserIncreaseDayEntity;
|
||||
import org.springblade.modules.userPackInfo.pojo.entity.AdsEntity;
|
||||
import org.springblade.modules.userPackInfo.pojo.entity.PackageInfoEntity;
|
||||
import org.springblade.modules.userPackInfo.pojo.entity.UserPackageInfoCopyEntity;
|
||||
import org.springblade.modules.userPoint.pojo.entity.UserBenefitLogEntity;
|
||||
import org.springblade.modules.userPoint.pojo.entity.UserCashLogEntity;
|
||||
import org.springblade.modules.userPoint.pojo.entity.UserCommissionLogEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author jack
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppOfflineUserInfoConvert {
|
||||
|
||||
AppOfflineUserInfoConvert INSTANCE = Mappers.getMapper(AppOfflineUserInfoConvert.class);
|
||||
|
||||
AppOfflineUserInfoVO convertEntityToVO(UserIncreaseDayEntity entity);
|
||||
|
||||
AppOffLineIntegralLogVO convertBenefitLogPageToVO(UserBenefitLogEntity entity);
|
||||
|
||||
AppOffLineIntegralLogVO convertCashLogPageToVO(UserCashLogEntity entity);
|
||||
|
||||
AppOffLineIntegralLogVO convertCommissionLogPageToVO(UserCommissionLogEntity entity);
|
||||
|
||||
List<AppOffLinePackageInfoVO> convertPackageInfoListToVO(List<PackageInfoEntity> packageInfoList);
|
||||
|
||||
AppOffLineUserPackInfoVO convertUserPackInfoPageToVO(UserPackageInfoCopyEntity entity);
|
||||
|
||||
List<AppOffLineAdsVO> convertAdsListToVO(List<AdsEntity> list);
|
||||
|
||||
|
||||
@Mapping(source = "id", target = "userId")
|
||||
@Mapping(source = "createTime", target = "registerTime")
|
||||
AppOfflineUserDirectVO convertGenealogyListToVO(UserGenealogyEntity entity);
|
||||
List<AppOfflineUserDirectVO> convertGenealogyListToListVO(List<UserGenealogyEntity> list);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package org.springblade.modules.appOffline.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WatchVideoTimeRangeDTO {
|
||||
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package org.springblade.modules.appOffline.event;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AppUserRegisterEvent {
|
||||
|
||||
private Long userId;
|
||||
private String username;
|
||||
private String phone;
|
||||
private Integer isRoot = 1;
|
||||
private Long pid = 0L;
|
||||
private String pName = "";
|
||||
private String pPhone = "";
|
||||
|
||||
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package org.springblade.modules.appOffline.event;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain=true)
|
||||
public class AppUserRevokedEvent {
|
||||
|
||||
private Long userId;
|
||||
|
||||
}
|
||||
@@ -1,166 +0,0 @@
|
||||
package org.springblade.modules.appOffline.job;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.common.utils.date.DateUtil;
|
||||
import org.springblade.modules.customer.pojo.entity.UserDailySignEntity;
|
||||
import org.springblade.modules.customer.service.IUserDailySignService;
|
||||
import org.springblade.modules.userPackInfo.pojo.entity.UserPackageInfoCopyEntity;
|
||||
import org.springblade.modules.userPackInfo.service.IUserPackageInfoCopyService;
|
||||
import org.springblade.modules.userPoint.pojo.entity.UserBenefitEntity;
|
||||
import org.springblade.modules.userPoint.pojo.entity.UserBenefitLogEntity;
|
||||
import org.springblade.modules.userPoint.service.IUserBenefitLogService;
|
||||
import org.springblade.modules.userPoint.service.IUserBenefitService;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
@Slf4j
|
||||
public class UserDailySignJob {
|
||||
|
||||
private final IUserDailySignService userDailySignService;
|
||||
private final IUserPackageInfoCopyService userPackageInfoCopyService;
|
||||
private final IUserBenefitService userBenefitService;
|
||||
private final IUserBenefitLogService userBenefitLogService;
|
||||
|
||||
@XxlJob("yichayilu-user-sign-sendpoint")
|
||||
@Transactional(rollbackFor = RuntimeException.class)
|
||||
public void userDailySignSendPoint(){
|
||||
log.info("完成签到任务的用户发放积分");
|
||||
List<UserDailySignEntity> dailySignList = userDailySignService.list(
|
||||
Wrappers.lambdaQuery(UserDailySignEntity.class)
|
||||
.select(UserDailySignEntity::getUserId)
|
||||
.eq(UserDailySignEntity::getStatisticsDate, DateUtil.getYesterday())
|
||||
.eq(UserDailySignEntity::getType, 1)
|
||||
.eq(UserDailySignEntity::getIsComplete, 1)
|
||||
);
|
||||
|
||||
|
||||
HashSet<Long> dailySignUserIdSet = dailySignList.stream()
|
||||
.map(UserDailySignEntity::getUserId)
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
|
||||
|
||||
log.info("签到人数:[{}] , 提取userId数量: [{}]" , dailySignList.size() , dailySignUserIdSet.size());
|
||||
|
||||
List<UserPackageInfoCopyEntity> userPackageInfoList = userPackageInfoCopyService.list(
|
||||
Wrappers.lambdaQuery(UserPackageInfoCopyEntity.class)
|
||||
.eq(UserPackageInfoCopyEntity::getIsExpired, 0)
|
||||
.eq(UserPackageInfoCopyEntity::getIsComplete, 0)
|
||||
);
|
||||
|
||||
Map<Long, List<UserPackageInfoCopyEntity>> userPackageInfoMap = userPackageInfoList.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
UserPackageInfoCopyEntity::getUserId
|
||||
));
|
||||
// 已经签到的福利包
|
||||
List<UserPackageInfoCopyEntity> signUserPackList = new LinkedList<>();
|
||||
// 没有签到的福利包
|
||||
List<UserPackageInfoCopyEntity> notSignUserPackList = new LinkedList<>();
|
||||
// 用户福利积分流水
|
||||
List<UserBenefitLogEntity> userBenefitLogList = new LinkedList<>();
|
||||
// 用户福利积分总计
|
||||
Map<Long , BigDecimal> userBenefitMap = new HashMap<>();
|
||||
|
||||
userPackageInfoMap.forEach((userId, packageInfoList) -> {
|
||||
|
||||
if(dailySignUserIdSet.contains(userId)){
|
||||
signUserPackList.addAll(packageInfoList);
|
||||
userBenefitMap.put(userId, BigDecimal.ZERO);
|
||||
}else {
|
||||
notSignUserPackList.addAll(packageInfoList);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
String yyyyMMdd = DateUtil.convertFromDate(DateUtil.getYesterday(), "yyyyMMdd");
|
||||
Long notSignDay = Long.parseLong(yyyyMMdd);
|
||||
|
||||
notSignUserPackList.forEach(packageInfo -> {
|
||||
List<Long> notSignList = packageInfo.getNotSignList();
|
||||
notSignList.add(notSignDay);
|
||||
packageInfo.setNotSignList(notSignList);
|
||||
packageInfo.setExperienceDay(packageInfo.getExperienceDay() + 1);
|
||||
log.info("用户:[{}]未签到,福利包:[{}],未签到日期:[{}]" , packageInfo.getUserId() ,packageInfo.getPackageName(), packageInfo.getNotSignList());
|
||||
});
|
||||
|
||||
signUserPackList.forEach(packageInfo -> {
|
||||
BigDecimal amountOut = packageInfo.getAmountDay();
|
||||
if (packageInfo.getRemainingAmount().compareTo(amountOut) < 0 ||
|
||||
packageInfo.getDayTotal() - packageInfo.getOutDay() <= 1
|
||||
){
|
||||
amountOut = packageInfo.getRemainingAmount();
|
||||
packageInfo.setRemainingAmount(BigDecimal.ZERO);
|
||||
packageInfo.setIsComplete(1);
|
||||
}else {
|
||||
packageInfo.setRemainingAmount(packageInfo.getRemainingAmount().subtract(amountOut));
|
||||
}
|
||||
|
||||
packageInfo.setOutDay(packageInfo.getOutDay() + 1);
|
||||
packageInfo.setExperienceDay(packageInfo.getExperienceDay() + 1);
|
||||
|
||||
BigDecimal bigDecimal = userBenefitMap.get(packageInfo.getUserId());
|
||||
userBenefitMap.put(packageInfo.getUserId(), bigDecimal.add(amountOut));
|
||||
|
||||
userBenefitLogList.add(
|
||||
new UserBenefitLogEntity()
|
||||
.setUserId(packageInfo.getUserId())
|
||||
.setUserPhone(packageInfo.getPhone())
|
||||
.setUserName(packageInfo.getUserName())
|
||||
.setAmount(amountOut)
|
||||
.setSourceId(packageInfo.getUserId())
|
||||
.setUserPackId(packageInfo.getId())
|
||||
.setSourceDetail(packageInfo.getUserName())
|
||||
.setOrderId(0L)
|
||||
.setType(1)
|
||||
.setStatisticalDate(DateUtil.getYesterday())
|
||||
.setRemark(DateUtil.convertFromDate(DateUtil.getYesterday(), "yyyy-MM-dd") +"签到" + packageInfo.getPackageName() + "发放积分")
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
userBenefitLogList.forEach(userBenefitLog -> {
|
||||
log.info("用户签到福利包发放积分:[{}]" , userBenefitLog);
|
||||
});
|
||||
|
||||
|
||||
|
||||
userBenefitMap.forEach((userId, amount) -> {
|
||||
log.info("用户:[{}]签到福利包发放积分:[{}]" , userId , amount);
|
||||
UserBenefitEntity userBenefit = userBenefitService.getById(userId);
|
||||
Integer version = 1;
|
||||
if (userBenefit == null){
|
||||
userBenefit = new UserBenefitEntity();
|
||||
userBenefit.setId(userId);
|
||||
userBenefit.setAmount(amount);
|
||||
userBenefit.setVersion(version);
|
||||
userBenefitService.save(userBenefit);
|
||||
}else {
|
||||
version = userBenefit.getVersion();
|
||||
|
||||
}
|
||||
if (!userBenefitService.addAmountNotLog(userId , amount , version)){
|
||||
log.error("用户:[{}]福利值更新失败 , 福利值: [{}]", userId , amount);
|
||||
throw new RuntimeException("用户:[" + userId + "]福利值更新失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
log.info("用户签到福利包发放积分完成");
|
||||
userBenefitLogService.saveBatch(userBenefitLogList);
|
||||
|
||||
userPackageInfoCopyService.updateBatchById(signUserPackList);
|
||||
userPackageInfoCopyService.updateBatchById(notSignUserPackList);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,288 +0,0 @@
|
||||
package org.springblade.modules.appOffline.job;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.common.utils.date.DateUtil;
|
||||
import org.springblade.modules.customer.pojo.entity.UserGenealogyEntity;
|
||||
import org.springblade.modules.customer.pojo.entity.UserIncreaseDayEntity;
|
||||
import org.springblade.modules.customer.pojo.entity.UserTreeEntity;
|
||||
import org.springblade.modules.customer.service.IUserGenealogyService;
|
||||
import org.springblade.modules.customer.service.IUserIncreaseDayService;
|
||||
import org.springblade.modules.customer.service.IUserTreeService;
|
||||
import org.springblade.modules.system.pojo.entity.User;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
@Slf4j
|
||||
public class UserGenealogyJob {
|
||||
|
||||
private final IUserTreeService userTreeService;
|
||||
private final IUserGenealogyService userGenealogyService;
|
||||
private final IUserIncreaseDayService userIncreaseDayService;
|
||||
private final IUserService userService;
|
||||
|
||||
//从user_tree 同步信息 到 user_genealogy 15分钟一次
|
||||
@XxlJob("yichayilu-appsync-genealogy")
|
||||
public void appSyncGenealogy(){
|
||||
log.info("开始执行用户层级同步信息");
|
||||
|
||||
List<UserTreeEntity> userTreeList = userTreeService.list(
|
||||
Wrappers.lambdaQuery(UserTreeEntity.class)
|
||||
.eq(UserTreeEntity::getIsSyncGenealogy, 0)
|
||||
);
|
||||
|
||||
//使用stream 根据pid分组
|
||||
Map<Long, List<UserTreeEntity>> userTreeMap = userTreeList.stream().collect(Collectors.groupingBy(UserTreeEntity::getPid));
|
||||
|
||||
//提取 userTreeMap key
|
||||
List<Long> pidList = userTreeMap.keySet().stream().toList();
|
||||
|
||||
//父级用户信息 map
|
||||
Map<Long, UserGenealogyEntity> userGenealogyMap = userGenealogyService.list(
|
||||
Wrappers.lambdaQuery(UserGenealogyEntity.class)
|
||||
.in(UserGenealogyEntity::getId, pidList)
|
||||
).stream().collect(Collectors.toMap(UserGenealogyEntity::getId, item -> item));
|
||||
|
||||
|
||||
userTreeMap.forEach((pid, children) -> {
|
||||
|
||||
//提取children id
|
||||
List<Long> childrenIdList = children.stream().map(UserTreeEntity::getId).toList();
|
||||
|
||||
if(userGenealogyMap.containsKey(pid)){
|
||||
UserGenealogyEntity userGenealogy = userGenealogyMap.get(pid);
|
||||
|
||||
List<Long> userDirectList = userGenealogy.getUserDirectList();
|
||||
userDirectList.addAll(childrenIdList);
|
||||
userGenealogy.setUserDirectList(userDirectList);
|
||||
|
||||
userGenealogy.setUserDirectNumber(userGenealogy.getUserDirectNumber() + childrenIdList.size());
|
||||
userGenealogy.setUserChildNumber(userGenealogy.getUserChildNumber() + childrenIdList.size());
|
||||
if(userGenealogyService.updateById(userGenealogy)){
|
||||
genealogyIncrChildNumber(userGenealogy.getGenealogyList() , childrenIdList.size());
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
userTreeList.forEach(item -> {
|
||||
item.setIsSyncGenealogy(1);
|
||||
});
|
||||
|
||||
userTreeService.updateBatchById(userTreeList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
//每天凌晨1点执行 表达式 0 1 * * ?
|
||||
@XxlJob("yichayilu-appsync-register-tree")
|
||||
public void appSyncRegisterTree(){
|
||||
log.info("同步注册后没结构的用户信息-树结构");
|
||||
List<User> userList = userService.list(
|
||||
Wrappers.lambdaQuery(User.class)
|
||||
.ge(User::getCreateTime, DateUtil.getYesterday())
|
||||
);
|
||||
|
||||
long userTreeRegisterCount = userTreeService.count(
|
||||
Wrappers.lambdaQuery(UserTreeEntity.class)
|
||||
.eq(UserTreeEntity::getRegisterDate, DateUtil.getYesterday())
|
||||
);
|
||||
|
||||
log.info("用户数量 : {} , 树结构数量:{}" ,userList.size() , userTreeRegisterCount);
|
||||
|
||||
if (userList.size() > userTreeRegisterCount) {
|
||||
Set<Long> userTreeIdSet = userTreeService.list(
|
||||
Wrappers.lambdaQuery(UserTreeEntity.class)
|
||||
.eq(UserTreeEntity::getRegisterDate, DateUtil.getYesterday())
|
||||
).stream().map(UserTreeEntity::getId).collect(Collectors.toSet());
|
||||
|
||||
for (User userInfo : userList) {
|
||||
if (!userTreeIdSet.contains(userInfo.getId())) {
|
||||
|
||||
log.info("开始同步树结构信息");
|
||||
|
||||
UserTreeEntity savaUserTree = new UserTreeEntity();
|
||||
savaUserTree.setId(userInfo.getId());
|
||||
savaUserTree.setName(userInfo.getName());
|
||||
savaUserTree.setPhone(Long.valueOf(userInfo.getPhone()));
|
||||
savaUserTree.setLevel(1);
|
||||
savaUserTree.setPid(0L);
|
||||
savaUserTree.setPPhone(null);
|
||||
savaUserTree.setPName("");
|
||||
savaUserTree.setPLevel(0);
|
||||
savaUserTree.setIsSyncGenealogy(0);
|
||||
savaUserTree.setIsRevoked(0);
|
||||
savaUserTree.setRegisterDate(DateUtil.getToday());
|
||||
|
||||
// if (userInfo.getPid() > 0){
|
||||
//
|
||||
// UserTreeEntity parentTree = userTreeService.getById(userInfo.getPid());
|
||||
// if (parentTree != null){
|
||||
//
|
||||
// savaUserTree.setPid(parentTree.getId());
|
||||
// savaUserTree.setPPhone(parentTree.getPhone());
|
||||
// savaUserTree.setPName(parentTree.getName());
|
||||
// savaUserTree.setPLevel(parentTree.getLevel());
|
||||
// savaUserTree.setLevel(parentTree.getLevel() + 1);
|
||||
// }
|
||||
// }
|
||||
userTreeService.save(savaUserTree);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@XxlJob("yichayilu-appsync-register-genealogy")
|
||||
public void appSyncRegisterGenealogy(){
|
||||
log.info("同步注册后没结构的用户信息-族谱");
|
||||
|
||||
List<User> userList = userService.list(
|
||||
Wrappers.lambdaQuery(User.class)
|
||||
.ge(User::getCreateTime, DateUtil.getYesterday())
|
||||
);
|
||||
|
||||
|
||||
long userGenealogyRegisterCount = userGenealogyService.count(
|
||||
Wrappers.lambdaQuery(UserGenealogyEntity.class)
|
||||
.eq(UserGenealogyEntity::getRegisterDate, DateUtil.getYesterday())
|
||||
);
|
||||
|
||||
|
||||
log.info("用户数量 : {} , 族谱数量:{}" ,userList.size() , userGenealogyRegisterCount);
|
||||
|
||||
|
||||
if (userList.size() > userGenealogyRegisterCount) {
|
||||
Set<Long> userGenealogyIdSet = userGenealogyService.list(
|
||||
Wrappers.lambdaQuery(UserGenealogyEntity.class)
|
||||
.eq(UserGenealogyEntity::getRegisterDate, DateUtil.getYesterday())
|
||||
).stream().map(UserGenealogyEntity::getId).collect(Collectors.toSet());
|
||||
for (User userInfo : userList) {
|
||||
if (!userGenealogyIdSet.contains(userInfo.getId())) {
|
||||
log.info("开始同步族谱信息");
|
||||
UserGenealogyEntity savaUserGenealogy = new UserGenealogyEntity();
|
||||
savaUserGenealogy.setId(userInfo.getId());
|
||||
savaUserGenealogy.setName(userInfo.getName());
|
||||
savaUserGenealogy.setPhone(Long.valueOf(userInfo.getPhone()));
|
||||
savaUserGenealogy.setUserDirectNumber(0);
|
||||
savaUserGenealogy.setUserChildNumber(0);
|
||||
savaUserGenealogy.setUserDirectList(new ArrayList<>());
|
||||
savaUserGenealogy.setIsRevoked(0);
|
||||
savaUserGenealogy.setRegisterDate(DateUtil.getToday());
|
||||
|
||||
savaUserGenealogy.setLevel(1);
|
||||
savaUserGenealogy.setPid(0L);
|
||||
savaUserGenealogy.setPPhone(null);
|
||||
savaUserGenealogy.setPName("");
|
||||
savaUserGenealogy.setRootId(userInfo.getId());
|
||||
savaUserGenealogy.setGroupId(userInfo.getId());
|
||||
savaUserGenealogy.setGenealogyList(new ArrayList<>());
|
||||
|
||||
// if (userInfo.getPid() > 0){
|
||||
// UserGenealogyEntity parentGenealogy = userGenealogyService.getById(userInfo.getPid());
|
||||
// if (parentGenealogy != null){
|
||||
// savaUserGenealogy.setLevel(parentGenealogy.getLevel() + 1);
|
||||
// savaUserGenealogy.setPid(parentGenealogy.getId());
|
||||
// savaUserGenealogy.setPPhone(parentGenealogy.getPhone());
|
||||
// savaUserGenealogy.setPName(parentGenealogy.getName());
|
||||
// savaUserGenealogy.setRootId(parentGenealogy.getId());
|
||||
// savaUserGenealogy.setGroupId(parentGenealogy.getId());
|
||||
//
|
||||
// List<Long> genealogyList = parentGenealogy.getGenealogyList();
|
||||
// genealogyList.add(parentGenealogy.getId());
|
||||
// savaUserGenealogy.setGenealogyList(genealogyList);
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
userGenealogyService.save(savaUserGenealogy);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@XxlJob("yichayilu-appsync-register-increaseDay")
|
||||
public void appSyncRegisteIncreaseDayr(){
|
||||
log.info("同步注册后没结构的用户信息-每日新增");
|
||||
|
||||
List<User> userList = userService.list(
|
||||
Wrappers.lambdaQuery(User.class)
|
||||
.ge(User::getCreateTime, DateUtil.getYesterday())
|
||||
);
|
||||
|
||||
long userIncreaseDayRegisterCount = userIncreaseDayService.count(
|
||||
Wrappers.lambdaQuery(UserIncreaseDayEntity.class)
|
||||
.eq(UserIncreaseDayEntity::getRegisterDate, DateUtil.getYesterday())
|
||||
);
|
||||
log.info("用户数量 : {} , 每日新增数量:{}" ,userList.size() , userIncreaseDayRegisterCount);
|
||||
|
||||
|
||||
if (userList.size() > userIncreaseDayRegisterCount) {
|
||||
Set<Long> userIncreaseDayIdSet = userIncreaseDayService.list(
|
||||
Wrappers.lambdaQuery(UserIncreaseDayEntity.class)
|
||||
.eq(UserIncreaseDayEntity::getRegisterDate, DateUtil.getYesterday())
|
||||
).stream().map(UserIncreaseDayEntity::getId).collect(Collectors.toSet());
|
||||
|
||||
for (User userInfo : userList) {
|
||||
if (!userIncreaseDayIdSet.contains(userInfo.getId())) {
|
||||
UserIncreaseDayEntity savaUserIncreaseDay = new UserIncreaseDayEntity();
|
||||
savaUserIncreaseDay.setId(userInfo.getId());
|
||||
savaUserIncreaseDay.setName(userInfo.getName());
|
||||
savaUserIncreaseDay.setPhone(Long.valueOf(userInfo.getPhone()));
|
||||
savaUserIncreaseDay.setCurrentLevelId(0);
|
||||
savaUserIncreaseDay.setCurrentLevelName("普通用户");
|
||||
savaUserIncreaseDay.setIsReal(0);
|
||||
savaUserIncreaseDay.setRegisterDate(DateUtil.getToday());
|
||||
savaUserIncreaseDay.setIsRevoked(0);
|
||||
savaUserIncreaseDay.setRegisterDate(DateUtil.getToday());
|
||||
|
||||
savaUserIncreaseDay.setPid(0L);
|
||||
savaUserIncreaseDay.setPName("");
|
||||
savaUserIncreaseDay.setPPhone(null);
|
||||
savaUserIncreaseDay.setPLevel(0);
|
||||
|
||||
// if (userInfo.getPid() > 0){
|
||||
// UserIncreaseDayEntity parentIncreaseDay = userIncreaseDayService.getById(userInfo.getPid());
|
||||
// if (parentIncreaseDay != null){
|
||||
// savaUserIncreaseDay.setPid(parentIncreaseDay.getId());
|
||||
// savaUserIncreaseDay.setPName(parentIncreaseDay.getName());
|
||||
// savaUserIncreaseDay.setPPhone(parentIncreaseDay.getPhone());
|
||||
// savaUserIncreaseDay.setPLevel(parentIncreaseDay.getCurrentLevelId());
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
userIncreaseDayService.save(savaUserIncreaseDay);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void genealogyIncrChildNumber(List<Long> parentIdList , Integer number) {
|
||||
parentIdList.forEach(parentId -> {
|
||||
userGenealogyService.incrChildNumber(parentId , number);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,184 +0,0 @@
|
||||
package org.springblade.modules.appOffline.listener;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.common.utils.date.DateUtil;
|
||||
import org.springblade.modules.appOffline.event.AppUserRegisterEvent;
|
||||
import org.springblade.modules.appOffline.event.AppUserRevokedEvent;
|
||||
import org.springblade.modules.customer.pojo.entity.UserGenealogyEntity;
|
||||
import org.springblade.modules.customer.pojo.entity.UserIncreaseDayEntity;
|
||||
import org.springblade.modules.customer.pojo.entity.UserTreeEntity;
|
||||
|
||||
import org.springblade.modules.customer.service.IUserGenealogyService;
|
||||
import org.springblade.modules.customer.service.IUserIncreaseDayService;
|
||||
import org.springblade.modules.customer.service.IUserTreeService;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class AppUserInfoListener {
|
||||
|
||||
private final IUserTreeService userTreeService;
|
||||
private final IUserGenealogyService userGenealogyService;
|
||||
private final IUserIncreaseDayService userIncreaseDayService;
|
||||
|
||||
@Async("appRegisterExecutor")
|
||||
@EventListener
|
||||
@Transactional(rollbackFor = RuntimeException.class)
|
||||
public void incrUerRegisterInfo(AppUserRegisterEvent event) {
|
||||
log.info("用户层级同步信息[{}]", event);
|
||||
|
||||
log.info("开始同步树结构信息");
|
||||
UserTreeEntity userTree = userTreeService.getById(event.getUserId());
|
||||
if (userTree == null) {
|
||||
UserTreeEntity savaUserTree = new UserTreeEntity();
|
||||
savaUserTree.setId(event.getUserId());
|
||||
savaUserTree.setName(event.getUsername());
|
||||
savaUserTree.setPhone(Long.valueOf(event.getPhone()));
|
||||
savaUserTree.setLevel(1);
|
||||
savaUserTree.setPid(0L);
|
||||
savaUserTree.setPPhone(null);
|
||||
savaUserTree.setPName("");
|
||||
savaUserTree.setPLevel(0);
|
||||
savaUserTree.setIsSyncGenealogy(0);
|
||||
savaUserTree.setIsRevoked(0);
|
||||
savaUserTree.setRegisterDate(DateUtil.getToday());
|
||||
savaUserTree.setCreateTime(new Date());
|
||||
|
||||
if (event.getIsRoot() == 0){
|
||||
UserTreeEntity parentTree = userTreeService.getById(event.getPid());
|
||||
if (parentTree != null){
|
||||
|
||||
savaUserTree.setPid(parentTree.getId());
|
||||
savaUserTree.setPPhone(parentTree.getPhone());
|
||||
savaUserTree.setPName(parentTree.getName());
|
||||
savaUserTree.setPLevel(parentTree.getLevel());
|
||||
savaUserTree.setLevel(parentTree.getLevel() + 1);
|
||||
}
|
||||
}
|
||||
|
||||
userTreeService.save(savaUserTree);
|
||||
}
|
||||
|
||||
log.info("开始同步族谱信息");
|
||||
UserGenealogyEntity userGenealogy = userGenealogyService.getById(event.getUserId());
|
||||
if (userGenealogy == null) {
|
||||
UserGenealogyEntity savaUserGenealogy = new UserGenealogyEntity();
|
||||
savaUserGenealogy.setId(event.getUserId());
|
||||
savaUserGenealogy.setName(event.getUsername());
|
||||
savaUserGenealogy.setPhone(Long.valueOf(event.getPhone()));
|
||||
savaUserGenealogy.setUserDirectNumber(0);
|
||||
savaUserGenealogy.setUserChildNumber(0);
|
||||
savaUserGenealogy.setUserDirectList(new ArrayList<>());
|
||||
savaUserGenealogy.setIsRevoked(0);
|
||||
savaUserGenealogy.setRegisterDate(DateUtil.getToday());
|
||||
|
||||
savaUserGenealogy.setLevel(1);
|
||||
savaUserGenealogy.setPid(0L);
|
||||
savaUserGenealogy.setPPhone(null);
|
||||
savaUserGenealogy.setPName("");
|
||||
savaUserGenealogy.setRootId(event.getUserId());
|
||||
savaUserGenealogy.setGroupId(event.getUserId());
|
||||
savaUserGenealogy.setGenealogyList(new ArrayList<>());
|
||||
savaUserGenealogy.setCreateTime(new Date());
|
||||
|
||||
if (event.getIsRoot() == 0){
|
||||
UserGenealogyEntity parentGenealogy = userGenealogyService.getById(event.getPid());
|
||||
if (parentGenealogy != null){
|
||||
log.info("打印: [{}]",parentGenealogy);
|
||||
savaUserGenealogy.setLevel(parentGenealogy.getLevel() + 1);
|
||||
savaUserGenealogy.setPid(parentGenealogy.getId());
|
||||
savaUserGenealogy.setPPhone(parentGenealogy.getPhone());
|
||||
savaUserGenealogy.setPName(parentGenealogy.getName());
|
||||
savaUserGenealogy.setRootId(parentGenealogy.getId());
|
||||
savaUserGenealogy.setGroupId(parentGenealogy.getId());
|
||||
|
||||
List<Long> genealogyList = parentGenealogy.getGenealogyList();
|
||||
genealogyList.add(parentGenealogy.getId());
|
||||
savaUserGenealogy.setGenealogyList(genealogyList);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
userGenealogyService.save(savaUserGenealogy);
|
||||
|
||||
}
|
||||
|
||||
|
||||
log.info("开始用户统计信息");
|
||||
UserIncreaseDayEntity userIncreaseDay = userIncreaseDayService.getById(event.getUserId());
|
||||
if (userIncreaseDay == null) {
|
||||
UserIncreaseDayEntity savaUserIncreaseDay = new UserIncreaseDayEntity();
|
||||
savaUserIncreaseDay.setId(event.getUserId());
|
||||
savaUserIncreaseDay.setName(event.getUsername());
|
||||
savaUserIncreaseDay.setPhone(Long.valueOf(event.getPhone()));
|
||||
savaUserIncreaseDay.setCurrentLevelId(0);
|
||||
savaUserIncreaseDay.setCurrentLevelName("普通用户");
|
||||
savaUserIncreaseDay.setIsReal(0);
|
||||
savaUserIncreaseDay.setRegisterDate(DateUtil.getToday());
|
||||
savaUserIncreaseDay.setIsRevoked(0);
|
||||
savaUserIncreaseDay.setRegisterDate(DateUtil.getToday());
|
||||
|
||||
savaUserIncreaseDay.setPid(0L);
|
||||
savaUserIncreaseDay.setPName("");
|
||||
savaUserIncreaseDay.setPPhone(null);
|
||||
savaUserIncreaseDay.setPLevel(0);
|
||||
savaUserIncreaseDay.setCreateTime(new Date());
|
||||
|
||||
if (event.getIsRoot() == 0){
|
||||
UserIncreaseDayEntity parentIncreaseDay = userIncreaseDayService.getById(event.getPid());
|
||||
if (parentIncreaseDay != null){
|
||||
savaUserIncreaseDay.setPid(parentIncreaseDay.getId());
|
||||
savaUserIncreaseDay.setPName(parentIncreaseDay.getName());
|
||||
savaUserIncreaseDay.setPPhone(parentIncreaseDay.getPhone());
|
||||
savaUserIncreaseDay.setPLevel(parentIncreaseDay.getCurrentLevelId());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
userIncreaseDayService.save(savaUserIncreaseDay);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Async("appRevokedExecutor")
|
||||
@EventListener
|
||||
@Transactional(rollbackFor = RuntimeException.class)
|
||||
public void appUserRevokedExecutor(AppUserRevokedEvent event) {
|
||||
log.info("用户注销id : [{}]", event);
|
||||
UserTreeEntity userTree = userTreeService.getById(event.getUserId());
|
||||
if (userTree != null) {
|
||||
userTree.setIsRevoked(1);
|
||||
userTreeService.updateById(userTree);
|
||||
}
|
||||
|
||||
UserGenealogyEntity userGenealogy = userGenealogyService.getById(event.getUserId());
|
||||
if (userGenealogy != null) {
|
||||
userGenealogy.setIsRevoked(1);
|
||||
userGenealogy.setRemark(userGenealogy.getRemark() + "|" + DateUtil.convertFromDate(DateUtil.getToday() , "yyyy-MM-dd HH:mm:ss") + "注销");
|
||||
userGenealogyService.updateById(userGenealogy);
|
||||
}
|
||||
UserIncreaseDayEntity userIncreaseDay = userIncreaseDayService.getById(event.getUserId());
|
||||
if (userIncreaseDay != null) {
|
||||
userIncreaseDay.setIsRevoked(1);
|
||||
userIncreaseDayService.updateById(userIncreaseDay);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,185 +0,0 @@
|
||||
package org.springblade.modules.appOffline.manager;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.modules.appOffline.convert.AppOfflineUserInfoConvert;
|
||||
import org.springblade.modules.appOffline.vo.*;
|
||||
import org.springblade.modules.customer.pojo.entity.UserGenealogyEntity;
|
||||
import org.springblade.modules.customer.pojo.entity.UserIncreaseDayEntity;
|
||||
import org.springblade.modules.customer.service.IUserGenealogyService;
|
||||
import org.springblade.modules.customer.service.IUserIncreaseDayService;
|
||||
import org.springblade.modules.system.pojo.entity.User;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springblade.modules.userPackInfo.pojo.entity.PackageInfoEntity;
|
||||
import org.springblade.modules.userPackInfo.pojo.entity.UserPackageInfoCopyEntity;
|
||||
import org.springblade.modules.userPackInfo.service.IPackageInfoService;
|
||||
import org.springblade.modules.userPackInfo.service.IUserPackageInfoCopyService;
|
||||
import org.springblade.modules.userPoint.pojo.entity.*;
|
||||
import org.springblade.modules.userPoint.service.*;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class OfflineAppCustomerManager {
|
||||
|
||||
|
||||
private final IUserService userService;
|
||||
private final IUserGenealogyService userGenealogyService;
|
||||
private final IUserIncreaseDayService userIncreaseDayService;
|
||||
private final IUserBenefitService userBenefitService;
|
||||
private final IUserCashService userCashService;
|
||||
private final IUserCommissionService userCommissionService;
|
||||
|
||||
private final IUserBenefitLogService userBenefitLogService;
|
||||
private final IUserCashLogService userCashLogService;
|
||||
private final IUserCommissionLogService userCommissionLogService;
|
||||
|
||||
private final IPackageInfoService packageInfoService;
|
||||
private final IUserPackageInfoCopyService userPackageInfoCopyService;
|
||||
|
||||
|
||||
private List<AppOffLinePackageInfoVO> packageInfoVOList;
|
||||
|
||||
@XxlJob("yichayilu-refresh-packageInfoList")
|
||||
@PostConstruct
|
||||
public void initPackageInfoList() {
|
||||
|
||||
List<PackageInfoEntity> packageInfoList = packageInfoService.list(
|
||||
Wrappers.lambdaQuery(PackageInfoEntity.class)
|
||||
.orderByAsc(PackageInfoEntity::getId)
|
||||
);
|
||||
packageInfoVOList = AppOfflineUserInfoConvert.INSTANCE.convertPackageInfoListToVO(packageInfoList);
|
||||
}
|
||||
|
||||
|
||||
public AppOfflineUserInfoVO findUserInfo(Long userId) {
|
||||
User user = userService.getById(userId);
|
||||
Assert.notNull(user, "用户不存在");
|
||||
|
||||
UserIncreaseDayEntity userIncreaseDayEntity = userIncreaseDayService.getById(userId);
|
||||
return AppOfflineUserInfoConvert.INSTANCE.convertEntityToVO(userIncreaseDayEntity);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public List<AppOfflineUserDirectVO> findUserDirectList(Long userId) {
|
||||
|
||||
User user = userService.getById(userId);
|
||||
Assert.notNull(user, "用户不存在");
|
||||
|
||||
List<UserGenealogyEntity> genealogyList = userGenealogyService.list(
|
||||
Wrappers.lambdaQuery(UserGenealogyEntity.class)
|
||||
.eq(UserGenealogyEntity::getPid, userId)
|
||||
.eq(UserGenealogyEntity::getIsRevoked, 0)
|
||||
.orderByDesc(UserGenealogyEntity::getId)
|
||||
|
||||
);
|
||||
|
||||
return AppOfflineUserInfoConvert.INSTANCE.convertGenealogyListToListVO(genealogyList);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public AppOfflineIntegralVO findUserIntegral(Long userId) {
|
||||
|
||||
UserBenefitEntity userBenefit = userBenefitService.getById(userId);
|
||||
if (userBenefit == null) {
|
||||
userBenefit = new UserBenefitEntity();
|
||||
userBenefit.setId(userId);
|
||||
userBenefit.setAmount(BigDecimal.ZERO);
|
||||
userBenefitService.save(userBenefit);
|
||||
}
|
||||
|
||||
UserCashEntity userCash = userCashService.getById(userId);
|
||||
if (userCash == null) {
|
||||
userCash = new UserCashEntity();
|
||||
userCash.setId(userId);
|
||||
userCash.setAmount(BigDecimal.ZERO);
|
||||
userCashService.save(userCash);
|
||||
}
|
||||
|
||||
UserCommissionEntity userCommission = userCommissionService.getById(userId);
|
||||
if (userCommission == null) {
|
||||
userCommission = new UserCommissionEntity();
|
||||
userCommission.setId(userId);
|
||||
userCommission.setAmount(BigDecimal.ZERO);
|
||||
userCommissionService.save(userCommission);
|
||||
}
|
||||
return new AppOfflineIntegralVO().setBenefit(userBenefit.getAmount()).setCash(userCash.getAmount()).setCommission(userCommission.getAmount());
|
||||
}
|
||||
|
||||
public IPage<AppOffLineIntegralLogVO> findBenefitLog(IPage<Object> page, AppOffLineIntegralLogVO log, Long userId) {
|
||||
|
||||
|
||||
Page<UserBenefitLogEntity> pageResult = userBenefitLogService.page(
|
||||
new Page<>(page.getCurrent(), page.getSize()),
|
||||
Wrappers.lambdaQuery(UserBenefitLogEntity.class)
|
||||
.eq(UserBenefitLogEntity::getUserId, userId)
|
||||
.eq(Objects.nonNull(log.getType()), UserBenefitLogEntity::getType, log.getType())
|
||||
.eq(Objects.nonNull(log.getStatisticalDate()), UserBenefitLogEntity::getStatisticalDate, log.getStatisticalDate())
|
||||
.orderByDesc(UserBenefitLogEntity::getId)
|
||||
);
|
||||
|
||||
return pageResult.convert(AppOfflineUserInfoConvert.INSTANCE::convertBenefitLogPageToVO);
|
||||
|
||||
}
|
||||
|
||||
public IPage<AppOffLineIntegralLogVO> findCashLog(IPage<Object> page, AppOffLineIntegralLogVO log, Long userId) {
|
||||
Page<UserCashLogEntity> pageResult = userCashLogService.page(
|
||||
new Page<>(page.getCurrent(), page.getSize()),
|
||||
Wrappers.lambdaQuery(UserCashLogEntity.class)
|
||||
.eq(UserCashLogEntity::getUserId, userId)
|
||||
.eq(Objects.nonNull(log.getType()), UserCashLogEntity::getType, log.getType())
|
||||
.eq(Objects.nonNull(log.getStatisticalDate()), UserCashLogEntity::getStatisticalDate, log.getStatisticalDate())
|
||||
.orderByDesc(UserCashLogEntity::getId)
|
||||
);
|
||||
|
||||
return pageResult.convert(AppOfflineUserInfoConvert.INSTANCE::convertCashLogPageToVO);
|
||||
}
|
||||
|
||||
public IPage<AppOffLineIntegralLogVO> findCommissionLog(IPage<Object> page, AppOffLineIntegralLogVO log, Long userId) {
|
||||
Page<UserCommissionLogEntity> pageResult = userCommissionLogService.page(
|
||||
new Page<>(page.getCurrent(), page.getSize()),
|
||||
Wrappers.lambdaQuery(UserCommissionLogEntity.class)
|
||||
.eq(UserCommissionLogEntity::getUserId, userId)
|
||||
.eq(Objects.nonNull(log.getType()), UserCommissionLogEntity::getType, log.getType())
|
||||
.eq(Objects.nonNull(log.getStatisticalDate()), UserCommissionLogEntity::getStatisticalDate, log.getStatisticalDate())
|
||||
.orderByDesc(UserCommissionLogEntity::getId)
|
||||
);
|
||||
|
||||
return pageResult.convert(AppOfflineUserInfoConvert.INSTANCE::convertCommissionLogPageToVO);
|
||||
}
|
||||
|
||||
public List<AppOffLinePackageInfoVO> findPackagesInfoList() {
|
||||
return packageInfoVOList;
|
||||
}
|
||||
|
||||
public IPage<AppOffLineUserPackInfoVO> findUserPackList(IPage<Object> page, AppOffLineUserPackInfoVO packInfo, Long userId) {
|
||||
|
||||
Page<UserPackageInfoCopyEntity> pageResult = userPackageInfoCopyService.page(
|
||||
new Page<>(page.getCurrent(), page.getSize()),
|
||||
Wrappers.lambdaQuery(UserPackageInfoCopyEntity.class)
|
||||
.eq(UserPackageInfoCopyEntity::getUserId, userId)
|
||||
.eq(Objects.nonNull(packInfo.getType()), UserPackageInfoCopyEntity::getType, packInfo.getType())
|
||||
.eq(Objects.nonNull(packInfo.getStatisticalDate()), UserPackageInfoCopyEntity::getStatisticalDate, packInfo.getStatisticalDate())
|
||||
.eq(Objects.nonNull(packInfo.getIsComplete()), UserPackageInfoCopyEntity::getIsComplete, packInfo.getIsComplete())
|
||||
.eq(Objects.nonNull(packInfo.getIsExpired()), UserPackageInfoCopyEntity::getIsExpired, packInfo.getIsExpired())
|
||||
.orderByDesc(UserPackageInfoCopyEntity::getId)
|
||||
);
|
||||
|
||||
return pageResult.convert(AppOfflineUserInfoConvert.INSTANCE::convertUserPackInfoPageToVO);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,295 +0,0 @@
|
||||
package org.springblade.modules.appOffline.manager;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.common.utils.date.DateUtil;
|
||||
import org.springblade.core.redis.cache.BladeRedis;
|
||||
import org.springblade.modules.appOffline.convert.AppOfflineUserInfoConvert;
|
||||
import org.springblade.modules.appOffline.dto.WatchVideoTimeRangeDTO;
|
||||
import org.springblade.modules.appOffline.request.WatchVideoRequest;
|
||||
import org.springblade.modules.appOffline.vo.AppOffLineAdsVO;
|
||||
import org.springblade.modules.customer.pojo.entity.UserDailySignEntity;
|
||||
import org.springblade.modules.customer.service.IUserDailySignService;
|
||||
import org.springblade.modules.system.pojo.entity.User;
|
||||
import org.springblade.modules.system.service.IParamService;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springblade.modules.userPackInfo.pojo.entity.AdsEntity;
|
||||
import org.springblade.modules.userPackInfo.service.IAdsService;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class OfflineAppDailySignManager {
|
||||
|
||||
private final IAdsService adsService;
|
||||
private final IParamService paramService;
|
||||
private final IUserService userBaseService;
|
||||
private final BladeRedis bladeRedis;
|
||||
private final IUserDailySignService userDailySignService;
|
||||
|
||||
private List<AppOffLineAdsVO> signAdsList;
|
||||
|
||||
|
||||
private final static String OUTPUT_LOG_KEY = "yichayilu:app:sign:red_watch_video:output_log:";
|
||||
private final static String OUTPUT_TIME_KEY = "yichayilu:app:sign:red_watch_video:output_time:";
|
||||
|
||||
private final static String PAYOUTS_LOG_KEY = "yichayilu:app:sign:red_watch_video:payouts_log:";
|
||||
private final static String PAYOUTS_TIME_KEY = "yichayilu:app:sign:red_watch_video:payouts_time:";
|
||||
|
||||
|
||||
@XxlJob("yichayilu-refresh-signAdsList")
|
||||
@PostConstruct
|
||||
public void initSignAdsList() {
|
||||
|
||||
List<AdsEntity> list = adsService.list(
|
||||
Wrappers.lambdaQuery(AdsEntity.class)
|
||||
.eq(AdsEntity::getType, 1)
|
||||
.orderByAsc(AdsEntity::getId)
|
||||
);
|
||||
|
||||
signAdsList = AppOfflineUserInfoConvert.INSTANCE.convertAdsListToVO(list);
|
||||
|
||||
}
|
||||
|
||||
public List<AppOffLineAdsVO> findSignAdsList() {
|
||||
return signAdsList;
|
||||
}
|
||||
|
||||
public Boolean isLookAtAdsByOutput() {
|
||||
|
||||
return paramService.isLookAtAdsByOutput();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public boolean startLookAtAds(WatchVideoRequest request) {
|
||||
Assert.isTrue(paramService.isLookAtAdsByOutput(), "观看广告功能暂不开放");
|
||||
Assert.isTrue(isWatchVideoTime(), "未到开放观看视频时间");
|
||||
User userBase = userBaseService.getById(request.getUserId());
|
||||
Assert.notNull(userBase , "无效用户");
|
||||
|
||||
|
||||
List<AppOffLineAdsVO> adsList = findSignAdsList();
|
||||
// 使用stream将 signAdsList list转成 map
|
||||
Map<Long, AppOffLineAdsVO> adsMap = adsList.stream()
|
||||
.collect(Collectors.toMap(
|
||||
AppOffLineAdsVO::getId, // 使用 ID 作为 key
|
||||
Function.identity() // VO 对象本身作为 value
|
||||
));
|
||||
|
||||
Assert.isTrue(adsMap.containsKey(request.getAdsId()) , "无效广告参数");
|
||||
AppOffLineAdsVO adsInfo = adsMap.get(request.getAdsId());
|
||||
Integer adsIndex = adsInfo.getSort();
|
||||
|
||||
|
||||
String key = OUTPUT_LOG_KEY + userBase.getId() + ":" + DateUtil.convertFromDate(DateUtil.getToday() , "yyyy-MM-dd");
|
||||
|
||||
String outputTimeKey = OUTPUT_TIME_KEY + userBase.getId() + ":" + DateUtil.convertFromDate(DateUtil.getToday() , "yyyy-MM-dd") + ":" + adsIndex;
|
||||
|
||||
Object objectLookAtAds = bladeRedis.get(key);
|
||||
if (objectLookAtAds == null) {
|
||||
bladeRedis.setEx(outputTimeKey, System.currentTimeMillis(), Duration.ofSeconds(60 * 60 * 24));
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
//二进制视频
|
||||
String binaryLookAtAds = (String) objectLookAtAds;
|
||||
if (isLook(binaryLookAtAds , adsIndex)){
|
||||
throw new RuntimeException("此广告今日已经观看");
|
||||
}
|
||||
|
||||
if(userDailySignService.count(
|
||||
Wrappers.lambdaQuery(UserDailySignEntity.class)
|
||||
.eq(UserDailySignEntity::getType, 1)
|
||||
.eq(UserDailySignEntity::getUserId, request.getUserId())
|
||||
.eq(UserDailySignEntity::getStatisticsDate, DateUtil.getToday())
|
||||
.eq(UserDailySignEntity::getIsComplete, 1)
|
||||
|
||||
) > 0){
|
||||
throw new RuntimeException("今日已完成签到");
|
||||
}
|
||||
|
||||
bladeRedis.setEx(outputTimeKey, System.currentTimeMillis(), Duration.ofSeconds(60 * 60 * 24));
|
||||
return Boolean.TRUE;
|
||||
|
||||
}
|
||||
|
||||
public boolean endLookAtAds(WatchVideoRequest request) {
|
||||
|
||||
Assert.isTrue(paramService.isLookAtAdsByOutput(), "观看广告功能暂不开放");
|
||||
Assert.isTrue(isWatchVideoTime(), "未到开放观看视频时间");
|
||||
User userBase = userBaseService.getById(request.getUserId());
|
||||
Assert.notNull(userBase , "无效用户");
|
||||
|
||||
// 查询广告
|
||||
int adsType = 1;
|
||||
List<AppOffLineAdsVO> adsList = findSignAdsList();
|
||||
// 使用stream将 signAdsList list转成 map
|
||||
Map<Long, AppOffLineAdsVO> adsMap = adsList.stream()
|
||||
.collect(Collectors.toMap(
|
||||
AppOffLineAdsVO::getId, // 使用 ID 作为 key
|
||||
Function.identity() // VO 对象本身作为 value
|
||||
));
|
||||
Assert.isTrue(adsMap.containsKey(request.getAdsId()) , "无效广告参数");
|
||||
AppOffLineAdsVO adsInfo = adsMap.get(request.getAdsId());
|
||||
Integer adsIndex = adsInfo.getSort();
|
||||
|
||||
String adsBinary = createBinary(adsList.size(), "1");
|
||||
int adsAnInt = Integer.parseInt(adsBinary, 2);
|
||||
|
||||
String outputTimeKey = OUTPUT_TIME_KEY + userBase.getId() + ":" + DateUtil.convertFromDate(DateUtil.getToday() , "yyyy-MM-dd") + ":" + adsIndex;
|
||||
Object objectOutputTime = bladeRedis.get(outputTimeKey);
|
||||
if (objectOutputTime == null) {
|
||||
throw new RuntimeException("请观看广告");
|
||||
}
|
||||
long outputTime = Long.parseLong(String.valueOf(objectOutputTime));
|
||||
if((System.currentTimeMillis() - outputTime) < (adsInfo.getAdsTime() * 1000)){
|
||||
throw new RuntimeException("检测到观看广告存在作弊行为");
|
||||
}
|
||||
|
||||
String key = OUTPUT_LOG_KEY + userBase.getId() + ":" + DateUtil.convertFromDate(DateUtil.getToday() , "yyyy-MM-dd");
|
||||
Object objectLookAtAds = bladeRedis.get(key);
|
||||
String lookToBinary = createBinary(adsList.size(), "0");;
|
||||
if (objectLookAtAds == null) {
|
||||
lookToBinary = setLookToBinary(lookToBinary, adsIndex);
|
||||
}else {
|
||||
if (isLook(String.valueOf(objectLookAtAds) , adsIndex)){
|
||||
throw new RuntimeException("此广告今日已经观看");
|
||||
}
|
||||
lookToBinary = setLookToBinary(String.valueOf(objectLookAtAds), adsIndex);
|
||||
}
|
||||
bladeRedis.setEx(key, lookToBinary, Duration.ofSeconds(60 * 60 * 24));
|
||||
|
||||
if(userDailySignService.count(
|
||||
Wrappers.lambdaQuery(UserDailySignEntity.class)
|
||||
.eq(UserDailySignEntity::getType, 1)
|
||||
.eq(UserDailySignEntity::getUserId, request.getUserId())
|
||||
.eq(UserDailySignEntity::getStatisticsDate, DateUtil.getToday())
|
||||
.eq(UserDailySignEntity::getIsComplete, 1)
|
||||
|
||||
) > 0){
|
||||
throw new RuntimeException("今日已完成签到");
|
||||
}
|
||||
|
||||
UserDailySignEntity userDailySign = userDailySignService.getOne(
|
||||
Wrappers.lambdaQuery(UserDailySignEntity.class)
|
||||
.eq(UserDailySignEntity::getType, adsType)
|
||||
.eq(UserDailySignEntity::getUserId, userBase.getId())
|
||||
.eq(UserDailySignEntity::getStatisticsDate, DateUtil.getToday())
|
||||
|
||||
);
|
||||
|
||||
String remarks = "广告" + adsIndex + "观看时间:" + DateUtil.convertFromDate(new Date(outputTime) , "yyyy-MM-dd HH:mm:ss") + ",结束时间:" + DateUtil.convertFromDate(new Date(System.currentTimeMillis()) , "yyyy-MM-dd HH:mm:ss");
|
||||
if (userDailySign == null) {
|
||||
userDailySign = new UserDailySignEntity();
|
||||
userDailySign.setType(adsType);
|
||||
userDailySign.setUserId(userBase.getId());
|
||||
userDailySign.setUserName(userBase.getName());
|
||||
userDailySign.setUserPhone(Long.valueOf(userBase.getPhone()));
|
||||
userDailySign.setStatisticsDate(DateUtil.getToday());
|
||||
userDailySign.setSignCount(Integer.parseInt(lookToBinary,2));
|
||||
userDailySign.setIsComplete(0);
|
||||
userDailySign.setRemarks(remarks);
|
||||
if(!userDailySignService.save(userDailySign)){
|
||||
throw new RuntimeException("记录广告异常");
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
if (userDailySign.getSignCount() >= adsAnInt){
|
||||
throw new RuntimeException("今日已经观看完全部广告");
|
||||
}
|
||||
|
||||
int signCount = Integer.parseInt(lookToBinary, 2);
|
||||
userDailySign.setSignCount(signCount);
|
||||
userDailySign.setRemarks(userDailySign.getRemarks() + "|" +remarks);
|
||||
if(!userDailySignService.updateById(userDailySign)){
|
||||
throw new RuntimeException("记录广告异常");
|
||||
}
|
||||
if (signCount >= adsAnInt){
|
||||
userDailySign.setIsComplete(1);
|
||||
userDailySignService.updateById(userDailySign);
|
||||
}
|
||||
|
||||
return Boolean.TRUE;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private String setLookToBinary(String binaryString,Integer adsIndex ) {
|
||||
|
||||
if (binaryString == null || binaryString.isEmpty()) {
|
||||
throw new RuntimeException("广告记录未初始化");
|
||||
}
|
||||
if (adsIndex > binaryString.length()) {
|
||||
throw new RuntimeException("无效广告参数");
|
||||
}
|
||||
StringBuilder stringBuilder = new StringBuilder(binaryString);
|
||||
stringBuilder.setCharAt(adsIndex - 1,'1');
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
|
||||
private String createBinary(Integer size, String value) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < size; i++) {
|
||||
sb.append(value);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
private Boolean isLook(String signCount , Integer adsIndex ) {
|
||||
if (signCount == null || signCount.isEmpty()) {
|
||||
throw new RuntimeException("无效广告参数");
|
||||
}
|
||||
if (adsIndex > signCount.length()) {
|
||||
throw new RuntimeException("无效广告参数");
|
||||
}
|
||||
int anInt = Integer.parseInt(String.valueOf(signCount.charAt(adsIndex - 1)));
|
||||
return anInt == 1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
private boolean isWatchVideoTime(){
|
||||
WatchVideoTimeRangeDTO dto = paramService.watchVideoTimeRange();
|
||||
|
||||
// 获取开始 时间 的小时和分钟
|
||||
String[] startSplit = dto.getStartTime().split(":");
|
||||
String[] endSplit = dto.getEndTime().split(":");
|
||||
|
||||
int startHour = Integer.parseInt(startSplit[0]);
|
||||
int startMinute = Integer.parseInt(startSplit[1]);
|
||||
int endHour = Integer.parseInt(endSplit[0]);
|
||||
int endMinute = Integer.parseInt(endSplit[1]);
|
||||
|
||||
// 获取当前时间
|
||||
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT+8"));
|
||||
int currentHour = calendar.get(Calendar.HOUR_OF_DAY);
|
||||
int currentMinute = calendar.get(Calendar.MINUTE);
|
||||
|
||||
// 计算总的分钟数进行比较
|
||||
int startTotalMinutes = startHour * 60 + startMinute;
|
||||
int endTotalMinutes = endHour * 60 + endMinute;
|
||||
int currentTotalMinutes = currentHour * 60 + currentMinute;
|
||||
|
||||
if (startTotalMinutes <= endTotalMinutes) {
|
||||
// 同一天内的时间范围(如 09:00-18:00)
|
||||
return currentTotalMinutes >= startTotalMinutes && currentTotalMinutes <= endTotalMinutes;
|
||||
} else {
|
||||
// 跨天的时间范围(如 22:00-06:00)
|
||||
return currentTotalMinutes >= startTotalMinutes || currentTotalMinutes <= endTotalMinutes;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package org.springblade.modules.appOffline.request;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lzq
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class WatchVideoRequest implements Serializable {
|
||||
|
||||
private Long userId ;
|
||||
private Long adsId;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.appOffline.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 广告表 实体类
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
@Data
|
||||
@TableName("ads")
|
||||
public class AppOffLineAdsVO {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 视频名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 视频链接
|
||||
*/
|
||||
private String url;
|
||||
|
||||
|
||||
/**
|
||||
* 视频观看时长
|
||||
*/
|
||||
private Integer adsTime;
|
||||
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package org.springblade.modules.appOffline.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AppOffLineIntegralLogVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户手机号
|
||||
*/
|
||||
private Long userPhone;
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String userName;
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
private String sourceDetail;
|
||||
|
||||
private Long orderId;
|
||||
|
||||
private Integer type;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date statisticalDate;
|
||||
|
||||
|
||||
private String remark;
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package org.springblade.modules.appOffline.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AppOffLinePackageInfoVO implements Serializable {
|
||||
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 积分包名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 最大购买数量
|
||||
*/
|
||||
private Integer buyQty;
|
||||
/**
|
||||
* 产出总天数
|
||||
*/
|
||||
private Integer dayTotal;
|
||||
/**
|
||||
* 总产出福利积分
|
||||
*/
|
||||
private BigDecimal amountTotal;
|
||||
/**
|
||||
* 购买赠与福利值
|
||||
*/
|
||||
private BigDecimal giveAmount;
|
||||
/**
|
||||
* 激活比率
|
||||
*/
|
||||
private BigDecimal bonus;
|
||||
/**
|
||||
* 兑换包需要的福利积分
|
||||
*/
|
||||
private BigDecimal userBenefit;
|
||||
/**
|
||||
* 兑换包需要的现金券
|
||||
*/
|
||||
private BigDecimal userCash;
|
||||
|
||||
/**
|
||||
* 全网最大兑换数量
|
||||
*/
|
||||
private Integer maxExchangeQty;
|
||||
/**
|
||||
* 已兑换数量
|
||||
*/
|
||||
private Integer exchangedQty;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
package org.springblade.modules.appOffline.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AppOffLineUserPackInfoVO implements Serializable {
|
||||
|
||||
/**
|
||||
*统计时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date statisticalDate;
|
||||
|
||||
/**
|
||||
* 积分包名称
|
||||
*/
|
||||
private String packageName;
|
||||
/**
|
||||
* 兑换包需要的福利积分
|
||||
*/
|
||||
private BigDecimal userBenefit;
|
||||
/**
|
||||
* 兑换包需要的现金券
|
||||
*/
|
||||
private BigDecimal userCash;
|
||||
/**
|
||||
* 购买赠与福利值
|
||||
*/
|
||||
private BigDecimal giveAmount;
|
||||
/**
|
||||
* 产出总天数
|
||||
*/
|
||||
private Integer dayTotal;
|
||||
/**
|
||||
* 总产出福利积分
|
||||
*/
|
||||
private BigDecimal amountTotal;
|
||||
/**
|
||||
* 每日产出福利积分
|
||||
*/
|
||||
private BigDecimal amountDay;
|
||||
/**
|
||||
* 已产出福利积分
|
||||
*/
|
||||
private BigDecimal amountOut;
|
||||
/**
|
||||
* 剩余可产出福利积分
|
||||
*/
|
||||
private BigDecimal remainingAmount;
|
||||
/**
|
||||
* 已加速多少福利积分
|
||||
*/
|
||||
private BigDecimal acceleratedAmount;
|
||||
|
||||
/**
|
||||
* 产出天数 当前包已经产出天数
|
||||
*/
|
||||
private Integer outDay;
|
||||
/**
|
||||
* 当前包已经经历的天数
|
||||
*/
|
||||
private Integer experienceDay;
|
||||
/**
|
||||
* 未签到日期详情 (数组)
|
||||
*/
|
||||
private List<Long> notSignList;
|
||||
/**
|
||||
* 是否完成 0-未完成 1-完成
|
||||
*/
|
||||
private Integer isComplete;
|
||||
/**
|
||||
* 当前包生效时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date startTime;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date activeTime;
|
||||
|
||||
|
||||
/**
|
||||
* 过期时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date expiredDate;
|
||||
/**
|
||||
* 是否过期 0-未过期 1-已过期
|
||||
*/
|
||||
private Integer isExpired;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 1-积分购买 2-后台划拨
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package org.springblade.modules.appOffline.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AppOfflineIntegralVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 福利积分
|
||||
*/
|
||||
private BigDecimal benefit;
|
||||
|
||||
/**
|
||||
* 现金券
|
||||
*/
|
||||
private BigDecimal cash;
|
||||
|
||||
/**
|
||||
* 佣金
|
||||
*/
|
||||
private BigDecimal commission;
|
||||
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package org.springblade.modules.appOffline.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class AppOfflineUserDirectVO implements Serializable {
|
||||
|
||||
private Long userId;
|
||||
private String name;
|
||||
private Long phone;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
|
||||
private Date registerTime;
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package org.springblade.modules.appOffline.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AppOfflineUserInfoVO implements Serializable {
|
||||
|
||||
private String name;
|
||||
|
||||
private Long phone;
|
||||
|
||||
private Integer currentLevelId;
|
||||
|
||||
private String currentLevelName;
|
||||
|
||||
private Long pid;
|
||||
|
||||
private String pName;
|
||||
|
||||
private Long pPhone;
|
||||
|
||||
private Integer pLevel;
|
||||
|
||||
private Integer isReal;
|
||||
|
||||
private Date realDate;
|
||||
|
||||
private String realName;
|
||||
|
||||
private String realIdCard;
|
||||
|
||||
private Date registerDate;
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package org.springblade.modules.auth.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class UserRegisterRoleDTO {
|
||||
|
||||
private String roleId;
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
private String deptId;
|
||||
/**
|
||||
* 岗位id
|
||||
*/
|
||||
private String postId;
|
||||
|
||||
private String avatar;
|
||||
|
||||
}
|
||||
@@ -19,7 +19,6 @@ import org.springblade.core.secure.TokenInfo;
|
||||
import org.springblade.core.tool.utils.DigestUtil;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.core.tool.utils.SM2Util;
|
||||
import org.springblade.modules.sms.service.AliYunSmsService;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
*/
|
||||
package org.springblade.modules.auth.granter;
|
||||
|
||||
import cn.hutool.core.util.PhoneUtil;
|
||||
import cn.hutool.core.util.RadixUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springblade.common.cache.ParamCache;
|
||||
@@ -49,15 +45,10 @@ import org.springblade.core.secure.TokenInfo;
|
||||
import org.springblade.core.social.props.SocialProperties;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.core.tool.utils.SM2Util;
|
||||
import org.springblade.modules.appOffline.event.AppUserRegisterEvent;
|
||||
import org.springblade.modules.auth.constant.BladeAuthConstant;
|
||||
import org.springblade.modules.auth.provider.UserType;
|
||||
import org.springblade.modules.sms.service.AliYunSmsService;
|
||||
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 java.util.Collections;
|
||||
import java.util.function.Predicate;
|
||||
@@ -76,23 +67,12 @@ public class RegisterTokenGranter extends AbstractTokenGranter {
|
||||
private final IUserService service;
|
||||
private final OAuth2Properties properties;
|
||||
private final SocialProperties socialProperties;
|
||||
private final ApplicationEventPublisher publisher;
|
||||
private final AliYunSmsService aliYunSmsService;
|
||||
|
||||
public RegisterTokenGranter(OAuth2ClientService clientService,
|
||||
OAuth2UserService userService,
|
||||
PasswordHandler passwordHandler,
|
||||
IUserService service,
|
||||
OAuth2Properties properties,
|
||||
SocialProperties socialProperties,
|
||||
ApplicationEventPublisher publisher,
|
||||
AliYunSmsService aliYunSmsService) {
|
||||
public RegisterTokenGranter(OAuth2ClientService clientService, OAuth2UserService userService, PasswordHandler passwordHandler, IUserService service, OAuth2Properties properties, SocialProperties socialProperties) {
|
||||
super(clientService, userService, passwordHandler);
|
||||
this.service = service;
|
||||
this.properties = properties;
|
||||
this.socialProperties = socialProperties;
|
||||
this.publisher = publisher;
|
||||
this.aliYunSmsService = aliYunSmsService;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -102,33 +82,12 @@ public class RegisterTokenGranter extends AbstractTokenGranter {
|
||||
|
||||
@Override
|
||||
public OAuth2User user(OAuth2Request request) {
|
||||
|
||||
|
||||
// 校验注册功能是否开启
|
||||
Boolean registerOpen = Func.toBoolean(ParamCache.getValue(REGISTER_USER_VALUE), false);
|
||||
|
||||
String clientId = request.getClientId();
|
||||
|
||||
if (!registerOpen || !clientId.equals("app")) {
|
||||
if (!registerOpen) {
|
||||
throw new UserInvalidException("注册功能暂未开启,请联系管理员");
|
||||
}
|
||||
|
||||
// 验证码
|
||||
String code = request.getCode();
|
||||
String password = "";
|
||||
if (code != null){
|
||||
aliYunSmsService.verifySms(request.getPhone(), code);
|
||||
// 截取手机号后六位
|
||||
password = createDefaultPassword(request.getPhone());
|
||||
}else {
|
||||
Assert.notNull(password, "密码不能为空");
|
||||
password = SM2Util.decrypt(request.getPassword(), properties.getPrivateKey());
|
||||
//校验密码长度是6到12位, 可以包含字母、数字
|
||||
Predicate<String> isPasswordValid = passwd -> passwd.matches("^(?=.*[0-9])(?=.*[a-zA-Z]){6,12}$");
|
||||
//去掉上面特殊字符校验
|
||||
Assert.isTrue(!isPasswordValid.test(password), "密码长度必须在6到12位之间,且需要包含大小写英文与数字");
|
||||
}
|
||||
|
||||
String sourceParameter = request.getSource();
|
||||
String source = socialProperties.getAlias().getOrDefault(sourceParameter, sourceParameter);
|
||||
log.info("参数source:[{}]", source);
|
||||
@@ -138,7 +97,7 @@ public class RegisterTokenGranter extends AbstractTokenGranter {
|
||||
user.setUserType(UserType.of(request.getUserType()).getCategory());
|
||||
user.setTenantId(request.getTenantId());
|
||||
user.setAccount(request.getPhone());
|
||||
user.setPassword(password);
|
||||
user.setPassword(SM2Util.decrypt(request.getPassword(), properties.getPublicKey(), properties.getPrivateKey()));
|
||||
user.setName(request.getName());
|
||||
user.setRealName(request.getName());
|
||||
user.setPhone(request.getPhone());
|
||||
@@ -146,43 +105,9 @@ public class RegisterTokenGranter extends AbstractTokenGranter {
|
||||
// 校验用户格式
|
||||
validateUser(user);
|
||||
|
||||
Long pid = 0L;
|
||||
String pPhone = "";
|
||||
String pName = "";
|
||||
Integer isRoot = 1;
|
||||
|
||||
if (source != null){
|
||||
JSONObject jsonParameter = JSONObject.parseObject(source);
|
||||
Assert.isTrue(jsonParameter.containsKey(BladeAuthConstant.INVITATION_CODE) , "无效邀请码格式");
|
||||
Assert.notNull(jsonParameter.get(BladeAuthConstant.INVITATION_CODE), "邀请码不能为空");
|
||||
Long parentPhone = HexToPhone(jsonParameter.getString(BladeAuthConstant.INVITATION_CODE));
|
||||
Assert.isTrue(PhoneUtil.isPhone(String.valueOf(parentPhone)), "邀请码格式不正确");
|
||||
log.info("父级手机号:{}" ,parentPhone);
|
||||
User parentInfo = service.getOne(
|
||||
Wrappers.lambdaQuery(User.class)
|
||||
.eq(User::getPhone, String.valueOf(parentPhone))
|
||||
);
|
||||
Assert.notNull(parentInfo, "邀请码人不存在");
|
||||
pid = parentInfo.getId();
|
||||
pPhone = parentInfo.getPhone();
|
||||
pName = parentInfo.getName();
|
||||
isRoot = 0;
|
||||
|
||||
}
|
||||
|
||||
// 执行用户注册
|
||||
if (service.registerUser(user)) {
|
||||
// 构建oauth2所需用户信息
|
||||
publisher.publishEvent(
|
||||
new AppUserRegisterEvent()
|
||||
.setUserId(user.getId())
|
||||
.setUsername(user.getName())
|
||||
.setPhone(user.getPhone())
|
||||
.setPid(pid)
|
||||
.setPName(pName)
|
||||
.setPPhone(pPhone)
|
||||
.setIsRoot(isRoot)
|
||||
);
|
||||
return convertOAuth2UserDetail(user, client(request));
|
||||
}
|
||||
throw new UserInvalidException(ExceptionCode.INVALID_USER.getMessage());
|
||||
@@ -199,25 +124,25 @@ public class RegisterTokenGranter extends AbstractTokenGranter {
|
||||
|
||||
private void validateUser(User user) {
|
||||
Predicate<String> isNameValid = name -> name.matches("^([\\u4e00-\\u9fa5]{2,20}|[a-zA-Z]{2,10})$");
|
||||
// Predicate<String> isUsernameValid = username -> username.matches("^(?=.*[a-zA-Z])[a-zA-Z0-9_\\-@]{3,20}$");
|
||||
Predicate<String> isUsernameValid = username -> username.matches("^(?=.*[a-zA-Z])[a-zA-Z0-9_\\-@]{3,20}$");
|
||||
Predicate<String> isPasswordValid = password -> password.matches("^(?=.*[0-9])(?=.*[a-zA-Z])[\\w@-]{6,20}$");
|
||||
Predicate<String> isPhoneValid = phone -> phone.matches("^1[3-9]\\d{9}$");
|
||||
// Predicate<String> isEmailValid = email -> email.matches("^[A-Za-z0-9+_.-]+@(.+)$");
|
||||
Predicate<String> isEmailValid = email -> email.matches("^[A-Za-z0-9+_.-]+@(.+)$");
|
||||
if (!isNameValid.test(user.getName())) {
|
||||
throw new UserInvalidException("用户姓名长度必须在2-10之间,且仅能设置纯中文或纯英文");
|
||||
}
|
||||
// if (!isUsernameValid.test(user.getAccount())) {
|
||||
// throw new UserInvalidException("用户账号长度必须在3-20之间,且需要包含英文,可额外携带数字、下划线、横杠、@");
|
||||
// }
|
||||
// if (!isPasswordValid.test(user.getPassword())) {
|
||||
// throw new UserInvalidException("用户密码长度必须在6-20之间,且需要包含英文与数字,可额外携带下划线、横杠、@");
|
||||
// }
|
||||
if (!isUsernameValid.test(user.getAccount())) {
|
||||
throw new UserInvalidException("用户账号长度必须在3-20之间,且需要包含英文,可额外携带数字、下划线、横杠、@");
|
||||
}
|
||||
if (!isPasswordValid.test(user.getPassword())) {
|
||||
throw new UserInvalidException("用户密码长度必须在6-20之间,且需要包含英文与数字,可额外携带下划线、横杠、@");
|
||||
}
|
||||
if (!isPhoneValid.test(user.getPhone())) {
|
||||
throw new UserInvalidException("手机号格式不正确");
|
||||
}
|
||||
// if (!isEmailValid.test(user.getEmail())) {
|
||||
// throw new UserInvalidException("邮箱格式不正确");
|
||||
// }
|
||||
if (!isEmailValid.test(user.getEmail())) {
|
||||
throw new UserInvalidException("邮箱格式不正确");
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -236,16 +161,4 @@ public class RegisterTokenGranter extends AbstractTokenGranter {
|
||||
return userDetail;
|
||||
}
|
||||
|
||||
|
||||
private String phoneTo32Hex(String phone) {
|
||||
return RadixUtil.encode(BladeAuthConstant.BINARY_TEMPLATE, Long.parseLong(phone));
|
||||
}
|
||||
private Long HexToPhone(String invitation_code) {
|
||||
return RadixUtil.decode(BladeAuthConstant.BINARY_TEMPLATE, invitation_code);
|
||||
}
|
||||
|
||||
private String createDefaultPassword(String phone) {
|
||||
return phone.substring(phone.length() - 6);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,48 +26,40 @@
|
||||
package org.springblade.modules.auth.granter;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springblade.core.oauth2.constant.OAuth2TokenConstant;
|
||||
import org.springblade.core.oauth2.exception.UserInvalidException;
|
||||
import org.springblade.core.oauth2.granter.AbstractTokenGranter;
|
||||
import org.springblade.core.oauth2.handler.PasswordHandler;
|
||||
import org.springblade.core.oauth2.props.OAuth2Properties;
|
||||
import org.springblade.core.oauth2.provider.OAuth2Request;
|
||||
import org.springblade.core.oauth2.provider.OAuth2Token;
|
||||
import org.springblade.core.oauth2.service.OAuth2ClientService;
|
||||
import org.springblade.core.oauth2.service.OAuth2User;
|
||||
import org.springblade.core.oauth2.service.OAuth2UserService;
|
||||
import org.springblade.core.oauth2.utils.OAuth2Util;
|
||||
import org.springblade.core.secure.TokenInfo;
|
||||
import org.springblade.core.sms.model.SmsCode;
|
||||
import org.springblade.core.tool.utils.*;
|
||||
import org.springblade.core.tool.utils.SM2Util;
|
||||
import org.springblade.core.tool.utils.StringPool;
|
||||
import org.springblade.core.tool.utils.StringUtil;
|
||||
import org.springblade.core.tool.utils.WebUtil;
|
||||
import org.springblade.modules.resource.builder.SmsBuilder;
|
||||
import org.springblade.modules.sms.service.AliYunSmsService;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* SmsTokenGranter
|
||||
*
|
||||
* @author BladeX
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class SmsTokenGranter extends AbstractTokenGranter {
|
||||
|
||||
private final OAuth2UserService userService;
|
||||
private final SmsBuilder smsBuilder;
|
||||
private final OAuth2Properties properties;
|
||||
private final AliYunSmsService aliYunSmsService;
|
||||
|
||||
public SmsTokenGranter(OAuth2ClientService clientService,
|
||||
OAuth2UserService userService,
|
||||
PasswordHandler passwordHandler,
|
||||
OAuth2Properties properties ,
|
||||
AliYunSmsService aliYunSmsService) {
|
||||
public SmsTokenGranter(OAuth2ClientService clientService, OAuth2UserService userService, PasswordHandler passwordHandler, SmsBuilder smsBuilder, OAuth2Properties properties) {
|
||||
super(clientService, userService, passwordHandler);
|
||||
this.userService = userService;
|
||||
this.smsBuilder = smsBuilder;
|
||||
this.properties = properties;
|
||||
this.aliYunSmsService = aliYunSmsService;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -77,29 +69,34 @@ public class SmsTokenGranter extends AbstractTokenGranter {
|
||||
|
||||
@Override
|
||||
public OAuth2User user(OAuth2Request request) {
|
||||
|
||||
log.info("短信登录:[{}]", request);
|
||||
Assert.isTrue(StringUtil.isNotBlank(request.getCode()), "验证码不能为空");
|
||||
// aliYunSmsService.verifySms(request.getPhone(), request.getCode());
|
||||
|
||||
OAuth2User user = userService.loadByPhone(request.getPhone(), request);
|
||||
Assert.notNull(user, "用户不存在");
|
||||
// 获取基础信息
|
||||
String tenantId = request.getTenantId();
|
||||
SmsCode smsCode = buildSmsCode();
|
||||
// 校验手机加密认证
|
||||
String decryptedPhone = SM2Util.decrypt(smsCode.getPhone(), properties.getPublicKey(), properties.getPrivateKey());
|
||||
if (StringUtil.isBlank(decryptedPhone)) {
|
||||
throw new UserInvalidException(OAuth2TokenConstant.USER_PHONE_NOT_FOUND);
|
||||
}
|
||||
// 获取短信验证信息
|
||||
boolean temp = smsBuilder.template(tenantId, StringPool.EMPTY).validateMessage(smsCode.setPhone(decryptedPhone));
|
||||
if (!temp) {
|
||||
throw new UserInvalidException(OAuth2TokenConstant.CAPTCHA_NOT_CORRECT);
|
||||
}
|
||||
// 获取用户信息
|
||||
OAuth2User user = userService.loadByPhone(decryptedPhone, request);
|
||||
// 校验用户信息
|
||||
if (!userService.validateUser(user)) {
|
||||
throw new UserInvalidException(OAuth2TokenConstant.TOKEN_NOT_CORRECT);
|
||||
}
|
||||
// 设置客户端信息
|
||||
user.setClient(client(request));
|
||||
log.info("用户信息:[{}]", user);
|
||||
return user;
|
||||
}
|
||||
|
||||
public OAuth2Token token(OAuth2User user, OAuth2Request request) {
|
||||
TokenInfo accessToken = OAuth2Util.createAccessToken(user);
|
||||
TokenInfo refreshToken = OAuth2Util.createRefreshToken(user);
|
||||
OAuth2Token token = OAuth2Token.create();
|
||||
token.getArgs().set("tenant_id", user.getTenantId()).set("user_id", user.getUserId()).set("dept_id", user.getDeptId()).set("post_id", user.getPostId()).set("role_id", user.getRoleId()).set("oauth_id", user.getOauthId()).set("account", user.getAccount()).set("user_name", user.getAccount()).set("nick_name", user.getName()).set("real_name", user.getRealName()).set("role_name", Func.join(user.getAuthorities())).set("avatar", Func.toStr(user.getAvatar(), "https://bladex.cn/images/logo-small.png")).set("access_token", accessToken.getToken()).set("refresh_token", refreshToken.getToken()).set("token_type", "bearer").set("expires_in", accessToken.getExpire()).set("detail", user.getDetail()).set("license", "powered by bladex");
|
||||
return token.setAccessToken(accessToken.getToken()).setAccessTokenExpire(accessToken.getExpire()).setRefreshToken(refreshToken.getToken()).setRefreshTokenExpire(refreshToken.getExpire());
|
||||
private SmsCode buildSmsCode() {
|
||||
HttpServletRequest request = WebUtil.getRequest();
|
||||
return new SmsCode().setId(request.getParameter("id"))
|
||||
.setPhone(request.getParameter("phone"))
|
||||
.setValue(request.getParameter("value"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
package org.springblade.modules.cashAccount.constant;
|
||||
|
||||
public interface CashAccountNameKey {
|
||||
|
||||
//5%广告补贴佣金
|
||||
String COMMISSION_ADVERTISING = "COMMISSION_ADVERTISING";
|
||||
|
||||
//15%极差代理佣金
|
||||
String COMMISSION_AGENCY = "COMMISSION_AGENCY";
|
||||
|
||||
//5%联创佣金
|
||||
String COMMISSION_CO_CREATOR = "COMMISSION_CO_CREATOR";
|
||||
|
||||
//直推人佣金
|
||||
String COMMISSION_DIRECT_PUSH = "COMMISSION_DIRECT_PUSH";
|
||||
|
||||
//商品成本佣金
|
||||
String COMMISSION_GOODS_COST = "COMMISSION_GOODS_COST";
|
||||
|
||||
//5%运营佣金
|
||||
String COMMISSION_OPERATION = "COMMISSION_OPERATION";
|
||||
|
||||
//5%服务商佣金
|
||||
String COMMISSION_SERVICE_PROVIDER = "COMMISSION_SERVICE_PROVIDER";
|
||||
|
||||
//30%购买人获取用户积分佣金
|
||||
String COMMISSION_USER_POINT_LOG = "COMMISSION_USER_POINT_LOG";
|
||||
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.secure.BladeUser;
|
||||
import org.springblade.core.secure.annotation.IsAdmin;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionAccountEntity;
|
||||
import org.springblade.modules.cashAccount.pojo.vo.UserCommissionAccountVO;
|
||||
import org.springblade.modules.cashAccount.excel.UserCommissionAccountExcel;
|
||||
import org.springblade.modules.cashAccount.wrapper.UserCommissionAccountWrapper;
|
||||
import org.springblade.modules.cashAccount.service.IUserCommissionAccountService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.excel.util.ExcelUtil;
|
||||
import org.springblade.core.tool.constant.BladeConstant;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 用户佣金账户表 控制器
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("blade-user-commissionaccount/commissionAccount")
|
||||
@Tag(name = "用户佣金账户表", description = "用户佣金账户表接口")
|
||||
public class UserCommissionAccountController extends BladeController {
|
||||
|
||||
private final IUserCommissionAccountService commissionAccountService;
|
||||
|
||||
/**
|
||||
* 用户佣金账户表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入commissionAccount")
|
||||
public R<UserCommissionAccountVO> detail(UserCommissionAccountEntity commissionAccount) {
|
||||
UserCommissionAccountEntity detail = commissionAccountService.getOne(Condition.getQueryWrapper(commissionAccount));
|
||||
return R.data(UserCommissionAccountWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 用户佣金账户表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入commissionAccount")
|
||||
public R<IPage<UserCommissionAccountVO>> list(UserCommissionAccountEntity commissionAccount, Query query) {
|
||||
IPage<UserCommissionAccountEntity> pages = commissionAccountService.page(Condition.getPage(query), Condition.getQueryWrapper(commissionAccount));
|
||||
return R.data(UserCommissionAccountWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户佣金账户表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入commissionAccount")
|
||||
public R<IPage<UserCommissionAccountVO>> page(UserCommissionAccountVO commissionAccount, Query query) {
|
||||
IPage<UserCommissionAccountVO> pages = commissionAccountService.selectUserCommissionAccountPage(Condition.getPage(query), commissionAccount);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户佣金账户表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入commissionAccount")
|
||||
public R save(@Valid @RequestBody UserCommissionAccountEntity commissionAccount) {
|
||||
return R.status(commissionAccountService.save(commissionAccount));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户佣金账户表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入commissionAccount")
|
||||
public R update(@Valid @RequestBody UserCommissionAccountEntity commissionAccount) {
|
||||
return R.status(commissionAccountService.updateById(commissionAccount));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户佣金账户表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入commissionAccount")
|
||||
public R submit(@Valid @RequestBody UserCommissionAccountEntity commissionAccount) {
|
||||
return R.status(commissionAccountService.saveOrUpdate(commissionAccount));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户佣金账户表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(commissionAccountService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@IsAdmin
|
||||
@GetMapping("/export-commissionAccount")
|
||||
@ApiOperationSupport(order = 9)
|
||||
@Operation(summary = "导出数据", description = "传入commissionAccount")
|
||||
public void exportUserCommissionAccount(@Parameter(hidden = true) @RequestParam Map<String, Object> commissionAccount, BladeUser bladeUser, HttpServletResponse response) {
|
||||
QueryWrapper<UserCommissionAccountEntity> queryWrapper = Condition.getQueryWrapper(commissionAccount, UserCommissionAccountEntity.class);
|
||||
//if (!AuthUtil.isAdministrator()) {
|
||||
// queryWrapper.lambda().eq(UserCommissionAccount::getTenantId, bladeUser.getTenantId());
|
||||
//}
|
||||
//queryWrapper.lambda().eq(UserCommissionAccountEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||
List<UserCommissionAccountExcel> list = commissionAccountService.exportUserCommissionAccount(queryWrapper);
|
||||
ExcelUtil.export(response, "用户佣金账户表数据" + DateUtil.time(), "用户佣金账户表数据表", list, UserCommissionAccountExcel.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.secure.BladeUser;
|
||||
import org.springblade.core.secure.annotation.IsAdmin;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionAdvertisingLogEntity;
|
||||
import org.springblade.modules.cashAccount.pojo.vo.UserCommissionAdvertisingLogVO;
|
||||
import org.springblade.modules.cashAccount.excel.UserCommissionAdvertisingLogExcel;
|
||||
import org.springblade.modules.cashAccount.wrapper.UserCommissionAdvertisingLogWrapper;
|
||||
import org.springblade.modules.cashAccount.service.IUserCommissionAdvertisingLogService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.excel.util.ExcelUtil;
|
||||
import org.springblade.core.tool.constant.BladeConstant;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 5%广告补贴佣金流水表 控制器
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("blade-user-commissionadvertisinglog/commissionAdvertisingLog")
|
||||
@Tag(name = "5%广告补贴佣金流水表", description = "5%广告补贴佣金流水表接口")
|
||||
public class UserCommissionAdvertisingLogController extends BladeController {
|
||||
|
||||
private final IUserCommissionAdvertisingLogService commissionAdvertisingLogService;
|
||||
|
||||
/**
|
||||
* 5%广告补贴佣金流水表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入commissionAdvertisingLog")
|
||||
public R<UserCommissionAdvertisingLogVO> detail(UserCommissionAdvertisingLogEntity commissionAdvertisingLog) {
|
||||
UserCommissionAdvertisingLogEntity detail = commissionAdvertisingLogService.getOne(Condition.getQueryWrapper(commissionAdvertisingLog));
|
||||
return R.data(UserCommissionAdvertisingLogWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 5%广告补贴佣金流水表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入commissionAdvertisingLog")
|
||||
public R<IPage<UserCommissionAdvertisingLogVO>> list(UserCommissionAdvertisingLogEntity commissionAdvertisingLog, Query query) {
|
||||
IPage<UserCommissionAdvertisingLogEntity> pages = commissionAdvertisingLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commissionAdvertisingLog));
|
||||
return R.data(UserCommissionAdvertisingLogWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%广告补贴佣金流水表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入commissionAdvertisingLog")
|
||||
public R<IPage<UserCommissionAdvertisingLogVO>> page(UserCommissionAdvertisingLogVO commissionAdvertisingLog, Query query) {
|
||||
IPage<UserCommissionAdvertisingLogVO> pages = commissionAdvertisingLogService.selectUserCommissionAdvertisingLogPage(Condition.getPage(query), commissionAdvertisingLog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%广告补贴佣金流水表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入commissionAdvertisingLog")
|
||||
public R save(@Valid @RequestBody UserCommissionAdvertisingLogEntity commissionAdvertisingLog) {
|
||||
return R.status(commissionAdvertisingLogService.save(commissionAdvertisingLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%广告补贴佣金流水表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入commissionAdvertisingLog")
|
||||
public R update(@Valid @RequestBody UserCommissionAdvertisingLogEntity commissionAdvertisingLog) {
|
||||
return R.status(commissionAdvertisingLogService.updateById(commissionAdvertisingLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%广告补贴佣金流水表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入commissionAdvertisingLog")
|
||||
public R submit(@Valid @RequestBody UserCommissionAdvertisingLogEntity commissionAdvertisingLog) {
|
||||
return R.status(commissionAdvertisingLogService.saveOrUpdate(commissionAdvertisingLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%广告补贴佣金流水表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(commissionAdvertisingLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@IsAdmin
|
||||
@GetMapping("/export-commissionAdvertisingLog")
|
||||
@ApiOperationSupport(order = 9)
|
||||
@Operation(summary = "导出数据", description = "传入commissionAdvertisingLog")
|
||||
public void exportUserCommissionAdvertisingLog(@Parameter(hidden = true) @RequestParam Map<String, Object> commissionAdvertisingLog, BladeUser bladeUser, HttpServletResponse response) {
|
||||
QueryWrapper<UserCommissionAdvertisingLogEntity> queryWrapper = Condition.getQueryWrapper(commissionAdvertisingLog, UserCommissionAdvertisingLogEntity.class);
|
||||
//if (!AuthUtil.isAdministrator()) {
|
||||
// queryWrapper.lambda().eq(UserCommissionAdvertisingLog::getTenantId, bladeUser.getTenantId());
|
||||
//}
|
||||
//queryWrapper.lambda().eq(UserCommissionAdvertisingLogEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||
List<UserCommissionAdvertisingLogExcel> list = commissionAdvertisingLogService.exportUserCommissionAdvertisingLog(queryWrapper);
|
||||
ExcelUtil.export(response, "5%广告补贴佣金流水表数据" + DateUtil.time(), "5%广告补贴佣金流水表数据表", list, UserCommissionAdvertisingLogExcel.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.secure.BladeUser;
|
||||
import org.springblade.core.secure.annotation.IsAdmin;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionAgencyLogEntity;
|
||||
import org.springblade.modules.cashAccount.pojo.vo.UserCommissionAgencyLogVO;
|
||||
import org.springblade.modules.cashAccount.excel.UserCommissionAgencyLogExcel;
|
||||
import org.springblade.modules.cashAccount.wrapper.UserCommissionAgencyLogWrapper;
|
||||
import org.springblade.modules.cashAccount.service.IUserCommissionAgencyLogService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.excel.util.ExcelUtil;
|
||||
import org.springblade.core.tool.constant.BladeConstant;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 15%极差代理佣金流水表 控制器
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("blade-user-commissionagencylog/commissionAgencyLog")
|
||||
@Tag(name = "15%极差代理佣金流水表", description = "15%极差代理佣金流水表接口")
|
||||
public class UserCommissionAgencyLogController extends BladeController {
|
||||
|
||||
private final IUserCommissionAgencyLogService commissionAgencyLogService;
|
||||
|
||||
/**
|
||||
* 15%极差代理佣金流水表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入commissionAgencyLog")
|
||||
public R<UserCommissionAgencyLogVO> detail(UserCommissionAgencyLogEntity commissionAgencyLog) {
|
||||
UserCommissionAgencyLogEntity detail = commissionAgencyLogService.getOne(Condition.getQueryWrapper(commissionAgencyLog));
|
||||
return R.data(UserCommissionAgencyLogWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 15%极差代理佣金流水表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入commissionAgencyLog")
|
||||
public R<IPage<UserCommissionAgencyLogVO>> list(UserCommissionAgencyLogEntity commissionAgencyLog, Query query) {
|
||||
IPage<UserCommissionAgencyLogEntity> pages = commissionAgencyLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commissionAgencyLog));
|
||||
return R.data(UserCommissionAgencyLogWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 15%极差代理佣金流水表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入commissionAgencyLog")
|
||||
public R<IPage<UserCommissionAgencyLogVO>> page(UserCommissionAgencyLogVO commissionAgencyLog, Query query) {
|
||||
IPage<UserCommissionAgencyLogVO> pages = commissionAgencyLogService.selectUserCommissionAgencyLogPage(Condition.getPage(query), commissionAgencyLog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 15%极差代理佣金流水表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入commissionAgencyLog")
|
||||
public R save(@Valid @RequestBody UserCommissionAgencyLogEntity commissionAgencyLog) {
|
||||
return R.status(commissionAgencyLogService.save(commissionAgencyLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 15%极差代理佣金流水表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入commissionAgencyLog")
|
||||
public R update(@Valid @RequestBody UserCommissionAgencyLogEntity commissionAgencyLog) {
|
||||
return R.status(commissionAgencyLogService.updateById(commissionAgencyLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 15%极差代理佣金流水表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入commissionAgencyLog")
|
||||
public R submit(@Valid @RequestBody UserCommissionAgencyLogEntity commissionAgencyLog) {
|
||||
return R.status(commissionAgencyLogService.saveOrUpdate(commissionAgencyLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 15%极差代理佣金流水表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(commissionAgencyLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@IsAdmin
|
||||
@GetMapping("/export-commissionAgencyLog")
|
||||
@ApiOperationSupport(order = 9)
|
||||
@Operation(summary = "导出数据", description = "传入commissionAgencyLog")
|
||||
public void exportUserCommissionAgencyLog(@Parameter(hidden = true) @RequestParam Map<String, Object> commissionAgencyLog, BladeUser bladeUser, HttpServletResponse response) {
|
||||
QueryWrapper<UserCommissionAgencyLogEntity> queryWrapper = Condition.getQueryWrapper(commissionAgencyLog, UserCommissionAgencyLogEntity.class);
|
||||
//if (!AuthUtil.isAdministrator()) {
|
||||
// queryWrapper.lambda().eq(UserCommissionAgencyLog::getTenantId, bladeUser.getTenantId());
|
||||
//}
|
||||
//queryWrapper.lambda().eq(UserCommissionAgencyLogEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||
List<UserCommissionAgencyLogExcel> list = commissionAgencyLogService.exportUserCommissionAgencyLog(queryWrapper);
|
||||
ExcelUtil.export(response, "15%极差代理佣金流水表数据" + DateUtil.time(), "15%极差代理佣金流水表数据表", list, UserCommissionAgencyLogExcel.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.secure.BladeUser;
|
||||
import org.springblade.core.secure.annotation.IsAdmin;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionCoCreatorLogEntity;
|
||||
import org.springblade.modules.cashAccount.pojo.vo.UserCommissionCoCreatorLogVO;
|
||||
import org.springblade.modules.cashAccount.excel.UserCommissionCoCreatorLogExcel;
|
||||
import org.springblade.modules.cashAccount.wrapper.UserCommissionCoCreatorLogWrapper;
|
||||
import org.springblade.modules.cashAccount.service.IUserCommissionCoCreatorLogService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.excel.util.ExcelUtil;
|
||||
import org.springblade.core.tool.constant.BladeConstant;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 5%联创佣金流水表 控制器
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("blade-user-commissioncocreatorlog/commissionCoCreatorLog")
|
||||
@Tag(name = "5%联创佣金流水表", description = "5%联创佣金流水表接口")
|
||||
public class UserCommissionCoCreatorLogController extends BladeController {
|
||||
|
||||
private final IUserCommissionCoCreatorLogService commissionCoCreatorLogService;
|
||||
|
||||
/**
|
||||
* 5%联创佣金流水表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入commissionCoCreatorLog")
|
||||
public R<UserCommissionCoCreatorLogVO> detail(UserCommissionCoCreatorLogEntity commissionCoCreatorLog) {
|
||||
UserCommissionCoCreatorLogEntity detail = commissionCoCreatorLogService.getOne(Condition.getQueryWrapper(commissionCoCreatorLog));
|
||||
return R.data(UserCommissionCoCreatorLogWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 5%联创佣金流水表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入commissionCoCreatorLog")
|
||||
public R<IPage<UserCommissionCoCreatorLogVO>> list(UserCommissionCoCreatorLogEntity commissionCoCreatorLog, Query query) {
|
||||
IPage<UserCommissionCoCreatorLogEntity> pages = commissionCoCreatorLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commissionCoCreatorLog));
|
||||
return R.data(UserCommissionCoCreatorLogWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%联创佣金流水表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入commissionCoCreatorLog")
|
||||
public R<IPage<UserCommissionCoCreatorLogVO>> page(UserCommissionCoCreatorLogVO commissionCoCreatorLog, Query query) {
|
||||
IPage<UserCommissionCoCreatorLogVO> pages = commissionCoCreatorLogService.selectUserCommissionCoCreatorLogPage(Condition.getPage(query), commissionCoCreatorLog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%联创佣金流水表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入commissionCoCreatorLog")
|
||||
public R save(@Valid @RequestBody UserCommissionCoCreatorLogEntity commissionCoCreatorLog) {
|
||||
return R.status(commissionCoCreatorLogService.save(commissionCoCreatorLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%联创佣金流水表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入commissionCoCreatorLog")
|
||||
public R update(@Valid @RequestBody UserCommissionCoCreatorLogEntity commissionCoCreatorLog) {
|
||||
return R.status(commissionCoCreatorLogService.updateById(commissionCoCreatorLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%联创佣金流水表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入commissionCoCreatorLog")
|
||||
public R submit(@Valid @RequestBody UserCommissionCoCreatorLogEntity commissionCoCreatorLog) {
|
||||
return R.status(commissionCoCreatorLogService.saveOrUpdate(commissionCoCreatorLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%联创佣金流水表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(commissionCoCreatorLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@IsAdmin
|
||||
@GetMapping("/export-commissionCoCreatorLog")
|
||||
@ApiOperationSupport(order = 9)
|
||||
@Operation(summary = "导出数据", description = "传入commissionCoCreatorLog")
|
||||
public void exportUserCommissionCoCreatorLog(@Parameter(hidden = true) @RequestParam Map<String, Object> commissionCoCreatorLog, BladeUser bladeUser, HttpServletResponse response) {
|
||||
QueryWrapper<UserCommissionCoCreatorLogEntity> queryWrapper = Condition.getQueryWrapper(commissionCoCreatorLog, UserCommissionCoCreatorLogEntity.class);
|
||||
//if (!AuthUtil.isAdministrator()) {
|
||||
// queryWrapper.lambda().eq(UserCommissionCoCreatorLog::getTenantId, bladeUser.getTenantId());
|
||||
//}
|
||||
//queryWrapper.lambda().eq(UserCommissionCoCreatorLogEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||
List<UserCommissionCoCreatorLogExcel> list = commissionCoCreatorLogService.exportUserCommissionCoCreatorLog(queryWrapper);
|
||||
ExcelUtil.export(response, "5%联创佣金流水表数据" + DateUtil.time(), "5%联创佣金流水表数据表", list, UserCommissionCoCreatorLogExcel.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.secure.BladeUser;
|
||||
import org.springblade.core.secure.annotation.IsAdmin;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionDirectPushLogEntity;
|
||||
import org.springblade.modules.cashAccount.pojo.vo.UserCommissionDirectPushLogVO;
|
||||
import org.springblade.modules.cashAccount.excel.UserCommissionDirectPushLogExcel;
|
||||
import org.springblade.modules.cashAccount.wrapper.UserCommissionDirectPushLogWrapper;
|
||||
import org.springblade.modules.cashAccount.service.IUserCommissionDirectPushLogService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.excel.util.ExcelUtil;
|
||||
import org.springblade.core.tool.constant.BladeConstant;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 10%直推人佣金流水表 控制器
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("blade-user-commissiondirectpushlog/commissionDirectPushLog")
|
||||
@Tag(name = "10%直推人佣金流水表", description = "10%直推人佣金流水表接口")
|
||||
public class UserCommissionDirectPushLogController extends BladeController {
|
||||
|
||||
private final IUserCommissionDirectPushLogService commissionDirectPushLogService;
|
||||
|
||||
/**
|
||||
* 10%直推人佣金流水表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入commissionDirectPushLog")
|
||||
public R<UserCommissionDirectPushLogVO> detail(UserCommissionDirectPushLogEntity commissionDirectPushLog) {
|
||||
UserCommissionDirectPushLogEntity detail = commissionDirectPushLogService.getOne(Condition.getQueryWrapper(commissionDirectPushLog));
|
||||
return R.data(UserCommissionDirectPushLogWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 10%直推人佣金流水表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入commissionDirectPushLog")
|
||||
public R<IPage<UserCommissionDirectPushLogVO>> list(UserCommissionDirectPushLogEntity commissionDirectPushLog, Query query) {
|
||||
IPage<UserCommissionDirectPushLogEntity> pages = commissionDirectPushLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commissionDirectPushLog));
|
||||
return R.data(UserCommissionDirectPushLogWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 10%直推人佣金流水表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入commissionDirectPushLog")
|
||||
public R<IPage<UserCommissionDirectPushLogVO>> page(UserCommissionDirectPushLogVO commissionDirectPushLog, Query query) {
|
||||
IPage<UserCommissionDirectPushLogVO> pages = commissionDirectPushLogService.selectUserCommissionDirectPushLogPage(Condition.getPage(query), commissionDirectPushLog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 10%直推人佣金流水表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入commissionDirectPushLog")
|
||||
public R save(@Valid @RequestBody UserCommissionDirectPushLogEntity commissionDirectPushLog) {
|
||||
return R.status(commissionDirectPushLogService.save(commissionDirectPushLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 10%直推人佣金流水表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入commissionDirectPushLog")
|
||||
public R update(@Valid @RequestBody UserCommissionDirectPushLogEntity commissionDirectPushLog) {
|
||||
return R.status(commissionDirectPushLogService.updateById(commissionDirectPushLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 10%直推人佣金流水表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入commissionDirectPushLog")
|
||||
public R submit(@Valid @RequestBody UserCommissionDirectPushLogEntity commissionDirectPushLog) {
|
||||
return R.status(commissionDirectPushLogService.saveOrUpdate(commissionDirectPushLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 10%直推人佣金流水表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(commissionDirectPushLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@IsAdmin
|
||||
@GetMapping("/export-commissionDirectPushLog")
|
||||
@ApiOperationSupport(order = 9)
|
||||
@Operation(summary = "导出数据", description = "传入commissionDirectPushLog")
|
||||
public void exportUserCommissionDirectPushLog(@Parameter(hidden = true) @RequestParam Map<String, Object> commissionDirectPushLog, BladeUser bladeUser, HttpServletResponse response) {
|
||||
QueryWrapper<UserCommissionDirectPushLogEntity> queryWrapper = Condition.getQueryWrapper(commissionDirectPushLog, UserCommissionDirectPushLogEntity.class);
|
||||
//if (!AuthUtil.isAdministrator()) {
|
||||
// queryWrapper.lambda().eq(UserCommissionDirectPushLog::getTenantId, bladeUser.getTenantId());
|
||||
//}
|
||||
//queryWrapper.lambda().eq(UserCommissionDirectPushLogEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||
List<UserCommissionDirectPushLogExcel> list = commissionDirectPushLogService.exportUserCommissionDirectPushLog(queryWrapper);
|
||||
ExcelUtil.export(response, "10%直推人佣金流水表数据" + DateUtil.time(), "10%直推人佣金流水表数据表", list, UserCommissionDirectPushLogExcel.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.secure.BladeUser;
|
||||
import org.springblade.core.secure.annotation.IsAdmin;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionGoodsCostLogEntity;
|
||||
import org.springblade.modules.cashAccount.pojo.vo.UserCommissionGoodsCostLogVO;
|
||||
import org.springblade.modules.cashAccount.excel.UserCommissionGoodsCostLogExcel;
|
||||
import org.springblade.modules.cashAccount.wrapper.UserCommissionGoodsCostLogWrapper;
|
||||
import org.springblade.modules.cashAccount.service.IUserCommissionGoodsCostLogService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.excel.util.ExcelUtil;
|
||||
import org.springblade.core.tool.constant.BladeConstant;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 25%商品成本佣金流水表 控制器
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("blade-user-commissiongoodscostlog/commissionGoodsCostLog")
|
||||
@Tag(name = "25%商品成本佣金流水表", description = "25%商品成本佣金流水表接口")
|
||||
public class UserCommissionGoodsCostLogController extends BladeController {
|
||||
|
||||
private final IUserCommissionGoodsCostLogService commissionGoodsCostLogService;
|
||||
|
||||
/**
|
||||
* 25%商品成本佣金流水表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入commissionGoodsCostLog")
|
||||
public R<UserCommissionGoodsCostLogVO> detail(UserCommissionGoodsCostLogEntity commissionGoodsCostLog) {
|
||||
UserCommissionGoodsCostLogEntity detail = commissionGoodsCostLogService.getOne(Condition.getQueryWrapper(commissionGoodsCostLog));
|
||||
return R.data(UserCommissionGoodsCostLogWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 25%商品成本佣金流水表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入commissionGoodsCostLog")
|
||||
public R<IPage<UserCommissionGoodsCostLogVO>> list(UserCommissionGoodsCostLogEntity commissionGoodsCostLog, Query query) {
|
||||
IPage<UserCommissionGoodsCostLogEntity> pages = commissionGoodsCostLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commissionGoodsCostLog));
|
||||
return R.data(UserCommissionGoodsCostLogWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 25%商品成本佣金流水表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入commissionGoodsCostLog")
|
||||
public R<IPage<UserCommissionGoodsCostLogVO>> page(UserCommissionGoodsCostLogVO commissionGoodsCostLog, Query query) {
|
||||
IPage<UserCommissionGoodsCostLogVO> pages = commissionGoodsCostLogService.selectUserCommissionGoodsCostLogPage(Condition.getPage(query), commissionGoodsCostLog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 25%商品成本佣金流水表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入commissionGoodsCostLog")
|
||||
public R save(@Valid @RequestBody UserCommissionGoodsCostLogEntity commissionGoodsCostLog) {
|
||||
return R.status(commissionGoodsCostLogService.save(commissionGoodsCostLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 25%商品成本佣金流水表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入commissionGoodsCostLog")
|
||||
public R update(@Valid @RequestBody UserCommissionGoodsCostLogEntity commissionGoodsCostLog) {
|
||||
return R.status(commissionGoodsCostLogService.updateById(commissionGoodsCostLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 25%商品成本佣金流水表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入commissionGoodsCostLog")
|
||||
public R submit(@Valid @RequestBody UserCommissionGoodsCostLogEntity commissionGoodsCostLog) {
|
||||
return R.status(commissionGoodsCostLogService.saveOrUpdate(commissionGoodsCostLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 25%商品成本佣金流水表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(commissionGoodsCostLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@IsAdmin
|
||||
@GetMapping("/export-commissionGoodsCostLog")
|
||||
@ApiOperationSupport(order = 9)
|
||||
@Operation(summary = "导出数据", description = "传入commissionGoodsCostLog")
|
||||
public void exportUserCommissionGoodsCostLog(@Parameter(hidden = true) @RequestParam Map<String, Object> commissionGoodsCostLog, BladeUser bladeUser, HttpServletResponse response) {
|
||||
QueryWrapper<UserCommissionGoodsCostLogEntity> queryWrapper = Condition.getQueryWrapper(commissionGoodsCostLog, UserCommissionGoodsCostLogEntity.class);
|
||||
//if (!AuthUtil.isAdministrator()) {
|
||||
// queryWrapper.lambda().eq(UserCommissionGoodsCostLog::getTenantId, bladeUser.getTenantId());
|
||||
//}
|
||||
//queryWrapper.lambda().eq(UserCommissionGoodsCostLogEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||
List<UserCommissionGoodsCostLogExcel> list = commissionGoodsCostLogService.exportUserCommissionGoodsCostLog(queryWrapper);
|
||||
ExcelUtil.export(response, "25%商品成本佣金流水表数据" + DateUtil.time(), "25%商品成本佣金流水表数据表", list, UserCommissionGoodsCostLogExcel.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.secure.BladeUser;
|
||||
import org.springblade.core.secure.annotation.IsAdmin;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionOperationLogEntity;
|
||||
import org.springblade.modules.cashAccount.pojo.vo.UserUserCommissionOperationLogVO;
|
||||
import org.springblade.modules.cashAccount.excel.UserUserCommissionOperationLogExcel;
|
||||
import org.springblade.modules.cashAccount.wrapper.UserUserCommissionOperationLogWrapper;
|
||||
import org.springblade.modules.cashAccount.service.IUserCommissionOperationLogService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.excel.util.ExcelUtil;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 5%运营佣金流水表 控制器
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("blade-user-commissionoperationlog/commissionOperationLog")
|
||||
@Tag(name = "5%运营佣金流水表", description = "5%运营佣金流水表接口")
|
||||
public class UserCommissionOperationLogController extends BladeController {
|
||||
|
||||
private final IUserCommissionOperationLogService commissionOperationLogService;
|
||||
|
||||
/**
|
||||
* 5%运营佣金流水表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入commissionOperationLog")
|
||||
public R<UserUserCommissionOperationLogVO> detail(UserCommissionOperationLogEntity commissionOperationLog) {
|
||||
UserCommissionOperationLogEntity detail = commissionOperationLogService.getOne(Condition.getQueryWrapper(commissionOperationLog));
|
||||
return R.data(UserUserCommissionOperationLogWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 5%运营佣金流水表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入commissionOperationLog")
|
||||
public R<IPage<UserUserCommissionOperationLogVO>> list(UserCommissionOperationLogEntity commissionOperationLog, Query query) {
|
||||
IPage<UserCommissionOperationLogEntity> pages = commissionOperationLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commissionOperationLog));
|
||||
return R.data(UserUserCommissionOperationLogWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%运营佣金流水表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入commissionOperationLog")
|
||||
public R<IPage<UserUserCommissionOperationLogVO>> page(UserUserCommissionOperationLogVO commissionOperationLog, Query query) {
|
||||
IPage<UserUserCommissionOperationLogVO> pages = commissionOperationLogService.selectUserUserCommissionOperationLogPage(Condition.getPage(query), commissionOperationLog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%运营佣金流水表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入commissionOperationLog")
|
||||
public R save(@Valid @RequestBody UserCommissionOperationLogEntity commissionOperationLog) {
|
||||
return R.status(commissionOperationLogService.save(commissionOperationLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%运营佣金流水表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入commissionOperationLog")
|
||||
public R update(@Valid @RequestBody UserCommissionOperationLogEntity commissionOperationLog) {
|
||||
return R.status(commissionOperationLogService.updateById(commissionOperationLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%运营佣金流水表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入commissionOperationLog")
|
||||
public R submit(@Valid @RequestBody UserCommissionOperationLogEntity commissionOperationLog) {
|
||||
return R.status(commissionOperationLogService.saveOrUpdate(commissionOperationLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%运营佣金流水表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(commissionOperationLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@IsAdmin
|
||||
@GetMapping("/export-commissionOperationLog")
|
||||
@ApiOperationSupport(order = 9)
|
||||
@Operation(summary = "导出数据", description = "传入commissionOperationLog")
|
||||
public void exportUserUserCommissionOperationLog(@Parameter(hidden = true) @RequestParam Map<String, Object> commissionOperationLog, BladeUser bladeUser, HttpServletResponse response) {
|
||||
QueryWrapper<UserCommissionOperationLogEntity> queryWrapper = Condition.getQueryWrapper(commissionOperationLog, UserCommissionOperationLogEntity.class);
|
||||
//if (!AuthUtil.isAdministrator()) {
|
||||
// queryWrapper.lambda().eq(UserUserCommissionOperationLog::getTenantId, bladeUser.getTenantId());
|
||||
//}
|
||||
//queryWrapper.lambda().eq(UserUserCommissionOperationLogEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||
List<UserUserCommissionOperationLogExcel> list = commissionOperationLogService.exportUserUserCommissionOperationLog(queryWrapper);
|
||||
ExcelUtil.export(response, "5%运营佣金流水表数据" + DateUtil.time(), "5%运营佣金流水表数据表", list, UserUserCommissionOperationLogExcel.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.secure.BladeUser;
|
||||
import org.springblade.core.secure.annotation.IsAdmin;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionServiceProviderLogEntity;
|
||||
import org.springblade.modules.cashAccount.pojo.vo.UserCommissionServiceProviderLogVO;
|
||||
import org.springblade.modules.cashAccount.excel.UserCommissionServiceProviderLogExcel;
|
||||
import org.springblade.modules.cashAccount.wrapper.UserCommissionServiceProviderLogWrapper;
|
||||
import org.springblade.modules.cashAccount.service.IUserCommissionServiceProviderLogService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.excel.util.ExcelUtil;
|
||||
import org.springblade.core.tool.constant.BladeConstant;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 5%服务商佣金流水表 控制器
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("blade-user-commissionserviceproviderlog/commissionServiceProviderLog")
|
||||
@Tag(name = "5%服务商佣金流水表", description = "5%服务商佣金流水表接口")
|
||||
public class UserCommissionServiceProviderLogController extends BladeController {
|
||||
|
||||
private final IUserCommissionServiceProviderLogService commissionServiceProviderLogService;
|
||||
|
||||
/**
|
||||
* 5%服务商佣金流水表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入commissionServiceProviderLog")
|
||||
public R<UserCommissionServiceProviderLogVO> detail(UserCommissionServiceProviderLogEntity commissionServiceProviderLog) {
|
||||
UserCommissionServiceProviderLogEntity detail = commissionServiceProviderLogService.getOne(Condition.getQueryWrapper(commissionServiceProviderLog));
|
||||
return R.data(UserCommissionServiceProviderLogWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 5%服务商佣金流水表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入commissionServiceProviderLog")
|
||||
public R<IPage<UserCommissionServiceProviderLogVO>> list(UserCommissionServiceProviderLogEntity commissionServiceProviderLog, Query query) {
|
||||
IPage<UserCommissionServiceProviderLogEntity> pages = commissionServiceProviderLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commissionServiceProviderLog));
|
||||
return R.data(UserCommissionServiceProviderLogWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%服务商佣金流水表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入commissionServiceProviderLog")
|
||||
public R<IPage<UserCommissionServiceProviderLogVO>> page(UserCommissionServiceProviderLogVO commissionServiceProviderLog, Query query) {
|
||||
IPage<UserCommissionServiceProviderLogVO> pages = commissionServiceProviderLogService.selectUserCommissionServiceProviderLogPage(Condition.getPage(query), commissionServiceProviderLog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%服务商佣金流水表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入commissionServiceProviderLog")
|
||||
public R save(@Valid @RequestBody UserCommissionServiceProviderLogEntity commissionServiceProviderLog) {
|
||||
return R.status(commissionServiceProviderLogService.save(commissionServiceProviderLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%服务商佣金流水表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入commissionServiceProviderLog")
|
||||
public R update(@Valid @RequestBody UserCommissionServiceProviderLogEntity commissionServiceProviderLog) {
|
||||
return R.status(commissionServiceProviderLogService.updateById(commissionServiceProviderLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%服务商佣金流水表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入commissionServiceProviderLog")
|
||||
public R submit(@Valid @RequestBody UserCommissionServiceProviderLogEntity commissionServiceProviderLog) {
|
||||
return R.status(commissionServiceProviderLogService.saveOrUpdate(commissionServiceProviderLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 5%服务商佣金流水表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(commissionServiceProviderLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@IsAdmin
|
||||
@GetMapping("/export-commissionServiceProviderLog")
|
||||
@ApiOperationSupport(order = 9)
|
||||
@Operation(summary = "导出数据", description = "传入commissionServiceProviderLog")
|
||||
public void exportUserCommissionServiceProviderLog(@Parameter(hidden = true) @RequestParam Map<String, Object> commissionServiceProviderLog, BladeUser bladeUser, HttpServletResponse response) {
|
||||
QueryWrapper<UserCommissionServiceProviderLogEntity> queryWrapper = Condition.getQueryWrapper(commissionServiceProviderLog, UserCommissionServiceProviderLogEntity.class);
|
||||
//if (!AuthUtil.isAdministrator()) {
|
||||
// queryWrapper.lambda().eq(UserCommissionServiceProviderLog::getTenantId, bladeUser.getTenantId());
|
||||
//}
|
||||
//queryWrapper.lambda().eq(UserCommissionServiceProviderLogEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||
List<UserCommissionServiceProviderLogExcel> list = commissionServiceProviderLogService.exportUserCommissionServiceProviderLog(queryWrapper);
|
||||
ExcelUtil.export(response, "5%服务商佣金流水表数据" + DateUtil.time(), "5%服务商佣金流水表数据表", list, UserCommissionServiceProviderLogExcel.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.secure.BladeUser;
|
||||
import org.springblade.core.secure.annotation.IsAdmin;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionUserPointLogEntity;
|
||||
import org.springblade.modules.cashAccount.pojo.vo.UserCommissionUserPointLogVO;
|
||||
import org.springblade.modules.cashAccount.excel.UserCommissionUserPointLogExcel;
|
||||
import org.springblade.modules.cashAccount.wrapper.UserCommissionUserPointLogWrapper;
|
||||
import org.springblade.modules.cashAccount.service.IUserCommissionUserPointLogService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.excel.util.ExcelUtil;
|
||||
import org.springblade.core.tool.constant.BladeConstant;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 30%购买人获取用户积分佣金流水表 控制器
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("blade-user-commissionuserpointlog/commissionUserPointLog")
|
||||
@Tag(name = "30%购买人获取用户积分佣金流水表", description = "30%购买人获取用户积分佣金流水表接口")
|
||||
public class UserCommissionUserPointLogController extends BladeController {
|
||||
|
||||
private final IUserCommissionUserPointLogService commissionUserPointLogService;
|
||||
|
||||
/**
|
||||
* 30%购买人获取用户积分佣金流水表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入commissionUserPointLog")
|
||||
public R<UserCommissionUserPointLogVO> detail(UserCommissionUserPointLogEntity commissionUserPointLog) {
|
||||
UserCommissionUserPointLogEntity detail = commissionUserPointLogService.getOne(Condition.getQueryWrapper(commissionUserPointLog));
|
||||
return R.data(UserCommissionUserPointLogWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 30%购买人获取用户积分佣金流水表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入commissionUserPointLog")
|
||||
public R<IPage<UserCommissionUserPointLogVO>> list(UserCommissionUserPointLogEntity commissionUserPointLog, Query query) {
|
||||
IPage<UserCommissionUserPointLogEntity> pages = commissionUserPointLogService.page(Condition.getPage(query), Condition.getQueryWrapper(commissionUserPointLog));
|
||||
return R.data(UserCommissionUserPointLogWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 30%购买人获取用户积分佣金流水表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入commissionUserPointLog")
|
||||
public R<IPage<UserCommissionUserPointLogVO>> page(UserCommissionUserPointLogVO commissionUserPointLog, Query query) {
|
||||
IPage<UserCommissionUserPointLogVO> pages = commissionUserPointLogService.selectUserCommissionUserPointLogPage(Condition.getPage(query), commissionUserPointLog);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 30%购买人获取用户积分佣金流水表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入commissionUserPointLog")
|
||||
public R save(@Valid @RequestBody UserCommissionUserPointLogEntity commissionUserPointLog) {
|
||||
return R.status(commissionUserPointLogService.save(commissionUserPointLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 30%购买人获取用户积分佣金流水表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入commissionUserPointLog")
|
||||
public R update(@Valid @RequestBody UserCommissionUserPointLogEntity commissionUserPointLog) {
|
||||
return R.status(commissionUserPointLogService.updateById(commissionUserPointLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 30%购买人获取用户积分佣金流水表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入commissionUserPointLog")
|
||||
public R submit(@Valid @RequestBody UserCommissionUserPointLogEntity commissionUserPointLog) {
|
||||
return R.status(commissionUserPointLogService.saveOrUpdate(commissionUserPointLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 30%购买人获取用户积分佣金流水表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(commissionUserPointLogService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@IsAdmin
|
||||
@GetMapping("/export-commissionUserPointLog")
|
||||
@ApiOperationSupport(order = 9)
|
||||
@Operation(summary = "导出数据", description = "传入commissionUserPointLog")
|
||||
public void exportUserCommissionUserPointLog(@Parameter(hidden = true) @RequestParam Map<String, Object> commissionUserPointLog, BladeUser bladeUser, HttpServletResponse response) {
|
||||
QueryWrapper<UserCommissionUserPointLogEntity> queryWrapper = Condition.getQueryWrapper(commissionUserPointLog, UserCommissionUserPointLogEntity.class);
|
||||
//if (!AuthUtil.isAdministrator()) {
|
||||
// queryWrapper.lambda().eq(UserCommissionUserPointLog::getTenantId, bladeUser.getTenantId());
|
||||
//}
|
||||
//queryWrapper.lambda().eq(UserCommissionUserPointLogEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||
List<UserCommissionUserPointLogExcel> list = commissionUserPointLogService.exportUserCommissionUserPointLog(queryWrapper);
|
||||
ExcelUtil.export(response, "30%购买人获取用户积分佣金流水表数据" + DateUtil.time(), "30%购买人获取用户积分佣金流水表数据表", list, UserCommissionUserPointLogExcel.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package org.springblade.modules.cashAccount.dto;
|
||||
|
||||
public class CashAccountConfigDTO {
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package org.springblade.modules.cashAccount.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author lzq
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PointsDto implements Serializable {
|
||||
|
||||
private Long id;
|
||||
private BigDecimal amount;
|
||||
private String remark;
|
||||
|
||||
private Long sourceId;
|
||||
private String sourceDetail;
|
||||
|
||||
private Long orderId;
|
||||
private Integer orderType;
|
||||
private String orderDetail;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.excel;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||
import java.io.Serializable;
|
||||
import java.io.Serial;
|
||||
|
||||
|
||||
/**
|
||||
* 用户佣金账户表 Excel实体类
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(25)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class UserCommissionAccountExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
/**
|
||||
* 账户名称
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户名称")
|
||||
private String accountName;
|
||||
/**
|
||||
* 账户编号
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户编号")
|
||||
private String accountNumber;
|
||||
/**
|
||||
* 账户代码
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户代码")
|
||||
private String accountCode;
|
||||
/**
|
||||
* 账户总余额
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户总余额")
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("版本号")
|
||||
private Integer version;
|
||||
/**
|
||||
* 是否已删除
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("是否已删除")
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
@@ -1,165 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.excel;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||
import java.io.Serializable;
|
||||
import java.io.Serial;
|
||||
|
||||
|
||||
/**
|
||||
* 5%广告补贴佣金流水表 Excel实体类
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(25)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class UserCommissionAdvertisingLogExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
/**
|
||||
* 账户id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户id")
|
||||
private Long accountId;
|
||||
/**
|
||||
* 账户名称
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户名称")
|
||||
private String accountName;
|
||||
/**
|
||||
* 账户编号
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户编号")
|
||||
private String accountNumber;
|
||||
/**
|
||||
* 账户代码
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户代码")
|
||||
private String accountCode;
|
||||
/**
|
||||
* 变动金额
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("变动金额")
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 来源id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("来源id")
|
||||
private Long sourceId;
|
||||
/**
|
||||
* 来源详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("来源详情")
|
||||
private String sourceDetail;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单id")
|
||||
private Long orderId;
|
||||
/**
|
||||
* 订单详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单详情")
|
||||
private String orderDetail;
|
||||
/**
|
||||
* 类型 1-收入 2-支出
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("类型 1-收入 2-支出")
|
||||
private Integer type;
|
||||
/**
|
||||
* 统计时间
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("统计时间")
|
||||
private Date statisticalDate;
|
||||
/**
|
||||
* 渠道
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("渠道")
|
||||
private String channel;
|
||||
/**
|
||||
* 渠道详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("渠道详情")
|
||||
private String channelDetail;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
/**
|
||||
* 每日统计日期
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("每日统计日期")
|
||||
private Date dailyStatisticsDate;
|
||||
/**
|
||||
* 统计周期
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("统计周期")
|
||||
private String statisticsCycle;
|
||||
/**
|
||||
* 是否已删除
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("是否已删除")
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
@@ -1,183 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.excel;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||
import java.io.Serializable;
|
||||
import java.io.Serial;
|
||||
|
||||
|
||||
/**
|
||||
* 15%极差代理佣金流水表 Excel实体类
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(25)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class UserCommissionAgencyLogExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
/**
|
||||
* 账户id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户id")
|
||||
private Long accountId;
|
||||
/**
|
||||
* 账户名称
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户名称")
|
||||
private String accountName;
|
||||
/**
|
||||
* 账户编号
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户编号")
|
||||
private String accountNumber;
|
||||
/**
|
||||
* 账户代码
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户代码")
|
||||
private String accountCode;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户手机号
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户手机号")
|
||||
private Long userPhone;
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户名称")
|
||||
private String userName;
|
||||
/**
|
||||
* 变动金额
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("变动金额")
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 来源id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("来源id")
|
||||
private Long sourceId;
|
||||
/**
|
||||
* 来源详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("来源详情")
|
||||
private String sourceDetail;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单id")
|
||||
private Long orderId;
|
||||
/**
|
||||
* 订单详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单详情")
|
||||
private String orderDetail;
|
||||
/**
|
||||
* 类型 1-收入 2-支出
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("类型 1-收入 2-支出")
|
||||
private Integer type;
|
||||
/**
|
||||
* 统计时间
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("统计时间")
|
||||
private Date statisticalDate;
|
||||
/**
|
||||
* 渠道
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("渠道")
|
||||
private String channel;
|
||||
/**
|
||||
* 渠道详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("渠道详情")
|
||||
private String channelDetail;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
/**
|
||||
* 代理级别
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("代理级别")
|
||||
private String agencyLevel;
|
||||
/**
|
||||
* 上级代理ID
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("上级代理ID")
|
||||
private Long agencyParentId;
|
||||
/**
|
||||
* 是否已删除
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("是否已删除")
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
@@ -1,183 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.excel;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||
import java.io.Serializable;
|
||||
import java.io.Serial;
|
||||
|
||||
|
||||
/**
|
||||
* 5%联创佣金流水表 Excel实体类
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(25)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class UserCommissionCoCreatorLogExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
/**
|
||||
* 账户id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户id")
|
||||
private Long accountId;
|
||||
/**
|
||||
* 账户名称
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户名称")
|
||||
private String accountName;
|
||||
/**
|
||||
* 账户编号
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户编号")
|
||||
private String accountNumber;
|
||||
/**
|
||||
* 账户代码
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户代码")
|
||||
private String accountCode;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("")
|
||||
private Long userId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("")
|
||||
private Long userPhone;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("")
|
||||
private String userName;
|
||||
/**
|
||||
* 变动金额
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("变动金额")
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 来源id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("来源id")
|
||||
private Long sourceId;
|
||||
/**
|
||||
* 来源详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("来源详情")
|
||||
private String sourceDetail;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单id")
|
||||
private Long orderId;
|
||||
/**
|
||||
* 订单详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单详情")
|
||||
private String orderDetail;
|
||||
/**
|
||||
* 类型 1-收入 2-支出
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("类型 1-收入 2-支出")
|
||||
private Integer type;
|
||||
/**
|
||||
* 统计时间
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("统计时间")
|
||||
private Date statisticalDate;
|
||||
/**
|
||||
* 渠道
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("渠道")
|
||||
private String channel;
|
||||
/**
|
||||
* 渠道详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("渠道详情")
|
||||
private String channelDetail;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
/**
|
||||
* 联创类型
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("联创类型")
|
||||
private String coCreatorType;
|
||||
/**
|
||||
* 联创等级
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("联创等级")
|
||||
private String coCreatorRank;
|
||||
/**
|
||||
* 是否已删除
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("是否已删除")
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
@@ -1,171 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.excel;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||
import java.io.Serializable;
|
||||
import java.io.Serial;
|
||||
|
||||
|
||||
/**
|
||||
* 10%直推人佣金流水表 Excel实体类
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(25)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class UserCommissionDirectPushLogExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
/**
|
||||
* 账户id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户id")
|
||||
private Long accountId;
|
||||
/**
|
||||
* 账户名称
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户名称")
|
||||
private String accountName;
|
||||
/**
|
||||
* 账户编号
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户编号")
|
||||
private String accountNumber;
|
||||
/**
|
||||
* 账户代码
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户代码")
|
||||
private String accountCode;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户手机号
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户手机号")
|
||||
private Long userPhone;
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户名称")
|
||||
private String userName;
|
||||
/**
|
||||
* 变动金额
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("变动金额")
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 来源id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("来源id")
|
||||
private Long sourceId;
|
||||
/**
|
||||
* 来源详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("来源详情")
|
||||
private String sourceDetail;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单id")
|
||||
private Long orderId;
|
||||
/**
|
||||
* 订单详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单详情")
|
||||
private String orderDetail;
|
||||
/**
|
||||
* 类型 1-收入 2-支出
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("类型 1-收入 2-支出")
|
||||
private Integer type;
|
||||
/**
|
||||
* 统计时间
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("统计时间")
|
||||
private Date statisticalDate;
|
||||
/**
|
||||
* 渠道
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("渠道")
|
||||
private String channel;
|
||||
/**
|
||||
* 渠道详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("渠道详情")
|
||||
private String channelDetail;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
/**
|
||||
* 是否已删除
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("是否已删除")
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
@@ -1,171 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.excel;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||
import java.io.Serializable;
|
||||
import java.io.Serial;
|
||||
|
||||
|
||||
/**
|
||||
* 25%商品成本佣金流水表 Excel实体类
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(25)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class UserCommissionGoodsCostLogExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
/**
|
||||
* 账户id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户id")
|
||||
private Long accountId;
|
||||
/**
|
||||
* 账户名称
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户名称")
|
||||
private String accountName;
|
||||
/**
|
||||
* 账户编号
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户编号")
|
||||
private String accountNumber;
|
||||
/**
|
||||
* 账户代码
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户代码")
|
||||
private String accountCode;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户手机号
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户手机号")
|
||||
private Long userPhone;
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户名称")
|
||||
private String userName;
|
||||
/**
|
||||
* 变动金额
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("变动金额")
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 来源id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("来源id")
|
||||
private Long sourceId;
|
||||
/**
|
||||
* 来源详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("来源详情")
|
||||
private String sourceDetail;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单id")
|
||||
private Long orderId;
|
||||
/**
|
||||
* 订单详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单详情")
|
||||
private String orderDetail;
|
||||
/**
|
||||
* 类型 1-收入 2-支出
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("类型 1-收入 2-支出")
|
||||
private Integer type;
|
||||
/**
|
||||
* 统计时间
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("统计时间")
|
||||
private Date statisticalDate;
|
||||
/**
|
||||
* 渠道
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("渠道")
|
||||
private String channel;
|
||||
/**
|
||||
* 渠道详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("渠道详情")
|
||||
private String channelDetail;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
/**
|
||||
* 是否已删除
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("是否已删除")
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
@@ -1,183 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.excel;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||
import java.io.Serializable;
|
||||
import java.io.Serial;
|
||||
|
||||
|
||||
/**
|
||||
* 5%服务商佣金流水表 Excel实体类
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(25)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class UserCommissionServiceProviderLogExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
/**
|
||||
* 账户id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户id")
|
||||
private Long accountId;
|
||||
/**
|
||||
* 账户名称
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户名称")
|
||||
private String accountName;
|
||||
/**
|
||||
* 账户编号
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户编号")
|
||||
private String accountNumber;
|
||||
/**
|
||||
* 账户代码
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户代码")
|
||||
private String accountCode;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("")
|
||||
private Long userId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("")
|
||||
private Long userPhone;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("")
|
||||
private String userName;
|
||||
/**
|
||||
* 变动金额
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("变动金额")
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 来源id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("来源id")
|
||||
private Long sourceId;
|
||||
/**
|
||||
* 来源详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("来源详情")
|
||||
private String sourceDetail;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单id")
|
||||
private Long orderId;
|
||||
/**
|
||||
* 订单详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单详情")
|
||||
private String orderDetail;
|
||||
/**
|
||||
* 类型 1-收入 2-支出
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("类型 1-收入 2-支出")
|
||||
private Integer type;
|
||||
/**
|
||||
* 统计时间
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("统计时间")
|
||||
private Date statisticalDate;
|
||||
/**
|
||||
* 渠道
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("渠道")
|
||||
private String channel;
|
||||
/**
|
||||
* 渠道详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("渠道详情")
|
||||
private String channelDetail;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
/**
|
||||
* 服务类型
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("服务类型")
|
||||
private String serviceType;
|
||||
/**
|
||||
* 服务商ID
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("服务商ID")
|
||||
private Long serviceProviderId;
|
||||
/**
|
||||
* 是否已删除
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("是否已删除")
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
@@ -1,171 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.excel;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||
import java.io.Serializable;
|
||||
import java.io.Serial;
|
||||
|
||||
|
||||
/**
|
||||
* 30%购买人获取用户积分佣金流水表 Excel实体类
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(25)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class UserCommissionUserPointLogExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
/**
|
||||
* 账户id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户id")
|
||||
private Long accountId;
|
||||
/**
|
||||
* 账户名称
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户名称")
|
||||
private String accountName;
|
||||
/**
|
||||
* 账户编号
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户编号")
|
||||
private String accountNumber;
|
||||
/**
|
||||
* 账户代码
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户代码")
|
||||
private String accountCode;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户手机号
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户手机号")
|
||||
private Long userPhone;
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户名称")
|
||||
private String userName;
|
||||
/**
|
||||
* 变动金额
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("变动金额")
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 来源id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("来源id")
|
||||
private Long sourceId;
|
||||
/**
|
||||
* 来源详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("来源详情")
|
||||
private String sourceDetail;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单id")
|
||||
private Long orderId;
|
||||
/**
|
||||
* 订单详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单详情")
|
||||
private String orderDetail;
|
||||
/**
|
||||
* 类型 1-收入 2-支出
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("类型 1-收入 2-支出")
|
||||
private Integer type;
|
||||
/**
|
||||
* 统计时间
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("统计时间")
|
||||
private Date statisticalDate;
|
||||
/**
|
||||
* 渠道
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("渠道")
|
||||
private String channel;
|
||||
/**
|
||||
* 渠道详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("渠道详情")
|
||||
private String channelDetail;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
/**
|
||||
* 是否已删除
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("是否已删除")
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
@@ -1,183 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.excel;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||
import java.io.Serializable;
|
||||
import java.io.Serial;
|
||||
|
||||
|
||||
/**
|
||||
* 5%运营佣金流水表 Excel实体类
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(25)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class UserUserCommissionOperationLogExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
/**
|
||||
* 账户id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户id")
|
||||
private Long accountId;
|
||||
/**
|
||||
* 账户名称
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户名称")
|
||||
private String accountName;
|
||||
/**
|
||||
* 账户编号
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户编号")
|
||||
private String accountNumber;
|
||||
/**
|
||||
* 账户代码
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("账户代码")
|
||||
private String accountCode;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户手机号
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户手机号")
|
||||
private Long userPhone;
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户名称")
|
||||
private String userName;
|
||||
/**
|
||||
* 变动金额
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("变动金额")
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 来源id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("来源id")
|
||||
private Long sourceId;
|
||||
/**
|
||||
* 来源详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("来源详情")
|
||||
private String sourceDetail;
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单id")
|
||||
private Long orderId;
|
||||
/**
|
||||
* 订单详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单详情")
|
||||
private String orderDetail;
|
||||
/**
|
||||
* 类型 1-收入 2-支出
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("类型 1-收入 2-支出")
|
||||
private Integer type;
|
||||
/**
|
||||
* 统计时间
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("统计时间")
|
||||
private Date statisticalDate;
|
||||
/**
|
||||
* 渠道
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("渠道")
|
||||
private String channel;
|
||||
/**
|
||||
* 渠道详情
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("渠道详情")
|
||||
private String channelDetail;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
/**
|
||||
* 随机立减金额
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("随机立减金额")
|
||||
private BigDecimal randomDeduction;
|
||||
/**
|
||||
* 随机立减说明
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("随机立减说明")
|
||||
private String randomDeductionDesc;
|
||||
/**
|
||||
* 是否已删除
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("是否已删除")
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.mapper;
|
||||
|
||||
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionAccountEntity;
|
||||
import org.springblade.modules.cashAccount.pojo.vo.UserCommissionAccountVO;
|
||||
import org.springblade.modules.cashAccount.excel.UserCommissionAccountExcel;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户佣金账户表 Mapper 接口
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
public interface UserCommissionAccountMapper extends BaseMapper<UserCommissionAccountEntity> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param commissionAccount 查询参数
|
||||
* @return List<UserCommissionAccountVO>
|
||||
*/
|
||||
List<UserCommissionAccountVO> selectUserCommissionAccountPage(IPage page, UserCommissionAccountVO commissionAccount);
|
||||
|
||||
|
||||
/**
|
||||
* 获取导出数据
|
||||
*
|
||||
* @param queryWrapper 查询条件
|
||||
* @return List<UserCommissionAccountExcel>
|
||||
*/
|
||||
List<UserCommissionAccountExcel> exportUserCommissionAccount(@Param("ew") Wrapper<UserCommissionAccountEntity> queryWrapper);
|
||||
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.springblade.modules.cashAccount.mapper.UserCommissionAccountMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="commissionAccountResultMap" type="org.springblade.modules.cashAccount.pojo.entity.UserCommissionAccountEntity">
|
||||
<result column="id" property="id"/>
|
||||
<result column="account_name" property="accountName"/>
|
||||
<result column="account_number" property="accountNumber"/>
|
||||
<result column="account_code" property="accountCode"/>
|
||||
<result column="amount" property="amount"/>
|
||||
<result column="version" property="version"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectUserCommissionAccountPage" resultMap="commissionAccountResultMap">
|
||||
select * from user_commission_account where is_deleted = 0
|
||||
</select>
|
||||
|
||||
|
||||
<select id="exportUserCommissionAccount" resultType="org.springblade.modules.cashAccount.excel.UserCommissionAccountExcel">
|
||||
SELECT * FROM user_commission_account ${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,63 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.mapper;
|
||||
|
||||
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionAdvertisingLogEntity;
|
||||
import org.springblade.modules.cashAccount.pojo.vo.UserCommissionAdvertisingLogVO;
|
||||
import org.springblade.modules.cashAccount.excel.UserCommissionAdvertisingLogExcel;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 5%广告补贴佣金流水表 Mapper 接口
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
public interface UserCommissionAdvertisingLogMapper extends BaseMapper<UserCommissionAdvertisingLogEntity> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param commissionAdvertisingLog 查询参数
|
||||
* @return List<UserCommissionAdvertisingLogVO>
|
||||
*/
|
||||
List<UserCommissionAdvertisingLogVO> selectUserCommissionAdvertisingLogPage(IPage page, UserCommissionAdvertisingLogVO commissionAdvertisingLog);
|
||||
|
||||
|
||||
/**
|
||||
* 获取导出数据
|
||||
*
|
||||
* @param queryWrapper 查询条件
|
||||
* @return List<UserCommissionAdvertisingLogExcel>
|
||||
*/
|
||||
List<UserCommissionAdvertisingLogExcel> exportUserCommissionAdvertisingLog(@Param("ew") Wrapper<UserCommissionAdvertisingLogEntity> queryWrapper);
|
||||
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.springblade.modules.cashAccount.mapper.UserCommissionAdvertisingLogMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="commissionAdvertisingLogResultMap" type="org.springblade.modules.cashAccount.pojo.entity.UserCommissionAdvertisingLogEntity">
|
||||
<result column="id" property="id"/>
|
||||
<result column="account_id" property="accountId"/>
|
||||
<result column="account_name" property="accountName"/>
|
||||
<result column="account_number" property="accountNumber"/>
|
||||
<result column="account_code" property="accountCode"/>
|
||||
<result column="amount" property="amount"/>
|
||||
<result column="source_id" property="sourceId"/>
|
||||
<result column="source_detail" property="sourceDetail"/>
|
||||
<result column="order_id" property="orderId"/>
|
||||
<result column="order_detail" property="orderDetail"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="statistical_date" property="statisticalDate"/>
|
||||
<result column="channel" property="channel"/>
|
||||
<result column="channel_detail" property="channelDetail"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="daily_statistics_date" property="dailyStatisticsDate"/>
|
||||
<result column="statistics_cycle" property="statisticsCycle"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectUserCommissionAdvertisingLogPage" resultMap="commissionAdvertisingLogResultMap">
|
||||
select * from user_commission_advertising_log where is_deleted = 0
|
||||
</select>
|
||||
|
||||
|
||||
<select id="exportUserCommissionAdvertisingLog" resultType="org.springblade.modules.cashAccount.excel.UserCommissionAdvertisingLogExcel">
|
||||
SELECT * FROM user_commission_advertising_log ${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,63 +0,0 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.cashAccount.mapper;
|
||||
|
||||
import org.springblade.modules.cashAccount.pojo.entity.UserCommissionAgencyLogEntity;
|
||||
import org.springblade.modules.cashAccount.pojo.vo.UserCommissionAgencyLogVO;
|
||||
import org.springblade.modules.cashAccount.excel.UserCommissionAgencyLogExcel;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 15%极差代理佣金流水表 Mapper 接口
|
||||
*
|
||||
* @author lzq
|
||||
* @since 2026-01-28
|
||||
*/
|
||||
public interface UserCommissionAgencyLogMapper extends BaseMapper<UserCommissionAgencyLogEntity> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param commissionAgencyLog 查询参数
|
||||
* @return List<UserCommissionAgencyLogVO>
|
||||
*/
|
||||
List<UserCommissionAgencyLogVO> selectUserCommissionAgencyLogPage(IPage page, UserCommissionAgencyLogVO commissionAgencyLog);
|
||||
|
||||
|
||||
/**
|
||||
* 获取导出数据
|
||||
*
|
||||
* @param queryWrapper 查询条件
|
||||
* @return List<UserCommissionAgencyLogExcel>
|
||||
*/
|
||||
List<UserCommissionAgencyLogExcel> exportUserCommissionAgencyLog(@Param("ew") Wrapper<UserCommissionAgencyLogEntity> queryWrapper);
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.springblade.modules.cashAccount.mapper.UserCommissionAgencyLogMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="commissionAgencyLogResultMap" type="org.springblade.modules.cashAccount.pojo.entity.UserCommissionAgencyLogEntity">
|
||||
<result column="id" property="id"/>
|
||||
<result column="account_id" property="accountId"/>
|
||||
<result column="account_name" property="accountName"/>
|
||||
<result column="account_number" property="accountNumber"/>
|
||||
<result column="account_code" property="accountCode"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="user_phone" property="userPhone"/>
|
||||
<result column="user_name" property="userName"/>
|
||||
<result column="amount" property="amount"/>
|
||||
<result column="source_id" property="sourceId"/>
|
||||
<result column="source_detail" property="sourceDetail"/>
|
||||
<result column="order_id" property="orderId"/>
|
||||
<result column="order_detail" property="orderDetail"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="statistical_date" property="statisticalDate"/>
|
||||
<result column="channel" property="channel"/>
|
||||
<result column="channel_detail" property="channelDetail"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="agency_level" property="agencyLevel"/>
|
||||
<result column="agency_parent_id" property="agencyParentId"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectUserCommissionAgencyLogPage" resultMap="commissionAgencyLogResultMap">
|
||||
select * from user_commission_agency_log where is_deleted = 0
|
||||
</select>
|
||||
|
||||
|
||||
<select id="exportUserCommissionAgencyLog" resultType="org.springblade.modules.cashAccount.excel.UserCommissionAgencyLogExcel">
|
||||
SELECT * FROM user_commission_agency_log ${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user