跟新海上商城mall会员模块添加了分销模块定义
parent
527a635155
commit
c0645f0d17
|
@ -26,6 +26,10 @@
|
|||
<module>yudao-module-trade-biz</module>
|
||||
<module>yudao-module-statistics-api</module>
|
||||
<module>yudao-module-statistics-biz</module>
|
||||
<module>yudao-module-hshy-api</module>
|
||||
<module>yudao-module-hshy-biz</module>
|
||||
<module>yudao-module-hsfx-api</module>
|
||||
<module>yudao-module-hsfx-biz</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-mall</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>yudao-module-hsfx-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
product 模块 API,暴露给其它模块调用
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-ui</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 参数校验 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- RPC 远程调用相关 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,118 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-mall</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>yudao-module-hsfx-biz</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
product 模块,主要实现商品相关功能
|
||||
例如:品牌、商品分类、spu、sku等功能。
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- Spring Cloud 基础 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-env</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 依赖服务 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-product-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-member-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 业务组件 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- DB 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RPC 远程调用相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-rpc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Registry 注册中心相关 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Config 配置中心相关 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Test 测试相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 工具类相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-excel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 监控相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-monitor</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<!-- 设置构建的 jar 包名 -->
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<!-- 打包 -->
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal> <!-- 将引入的 jar 打入其中 -->
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,16 @@
|
|||
package cn.iocoder.yudao.module.hsfx;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 项目的启动类
|
||||
*
|
||||
* @author tpj
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class HsfxServerApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(HsfxServerApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.admin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - hsfx")
|
||||
@RestController
|
||||
@RequestMapping("/hsfx/test")
|
||||
@Validated
|
||||
public class DemoTestController {
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获取 海上会员分销信息 信息")
|
||||
public CommonResult<String> get() {
|
||||
return success("true");
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.app;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "APP - 管理后台 - hsfx")
|
||||
@RestController
|
||||
@RequestMapping("/hsfx/test")
|
||||
@Validated
|
||||
public class AppDemoTestController {
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获取 分销app 信息")
|
||||
public CommonResult<String> get() {
|
||||
return success("true");
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package cn.iocoder.yudao.module.hsfx.framework.security.config;
|
||||
|
||||
import cn.iocoder.yudao.framework.security.config.AuthorizeRequestsCustomizer;
|
||||
import cn.iocoder.yudao.module.product.enums.ApiConstants;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer;
|
||||
|
||||
/**
|
||||
* Product 模块的 Security 配置
|
||||
*/
|
||||
@Configuration("productSecurityConfiguration")
|
||||
public class SecurityConfiguration {
|
||||
|
||||
@Bean("productAuthorizeRequestsCustomizer")
|
||||
public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() {
|
||||
return new AuthorizeRequestsCustomizer() {
|
||||
|
||||
@Override
|
||||
public void customize(AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry registry) {
|
||||
// Swagger 接口文档
|
||||
registry.requestMatchers("/v3/api-docs/**").permitAll()
|
||||
.requestMatchers("/webjars/**").permitAll()
|
||||
.requestMatchers("/swagger-ui").permitAll()
|
||||
.requestMatchers("/swagger-ui/**").permitAll();
|
||||
// Spring Boot Actuator 的安全配置
|
||||
registry.requestMatchers("/actuator").permitAll()
|
||||
.requestMatchers("/actuator/**").permitAll();
|
||||
// Druid 监控
|
||||
registry.requestMatchers("/druid/**").permitAll();
|
||||
// RPC 服务的安全配置
|
||||
registry.requestMatchers(ApiConstants.PREFIX + "/**").permitAll();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
<configuration>
|
||||
<!-- 引用 Spring Boot 的 logback 基础配置 -->
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
|
||||
<!-- 变量 yudao.info.base-package,基础业务包 -->
|
||||
<springProperty scope="context" name="yudao.info.base-package" source="yudao.info.base-package"/>
|
||||
<!-- 格式化输出:%d 表示日期,%X{tid} SkWalking 链路追踪编号,%thread 表示线程名,%-5level:级别从左显示 5 个字符宽度,%msg:日志消息,%n是换行符 -->
|
||||
<property name="PATTERN_DEFAULT" value="%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} | %highlight(${LOG_LEVEL_PATTERN:-%5p} ${PID:- }) | %boldYellow(%thread [%tid]) %boldGreen(%-40.40logger{39}) | %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/>
|
||||
|
||||
<!-- 控制台 Appender -->
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<pattern>${PATTERN_DEFAULT}</pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 文件 Appender -->
|
||||
<!-- 参考 Spring Boot 的 file-appender.xml 编写 -->
|
||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<pattern>${PATTERN_DEFAULT}</pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
<!-- 日志文件名 -->
|
||||
<file>${LOG_FILE}</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!-- 滚动后的日志文件名 -->
|
||||
<fileNamePattern>${LOGBACK_ROLLINGPOLICY_FILE_NAME_PATTERN:-${LOG_FILE}.%d{yyyy-MM-dd}.%i.gz}</fileNamePattern>
|
||||
<!-- 启动服务时,是否清理历史日志,一般不建议清理 -->
|
||||
<cleanHistoryOnStart>${LOGBACK_ROLLINGPOLICY_CLEAN_HISTORY_ON_START:-false}</cleanHistoryOnStart>
|
||||
<!-- 日志文件,到达多少容量,进行滚动 -->
|
||||
<maxFileSize>${LOGBACK_ROLLINGPOLICY_MAX_FILE_SIZE:-10MB}</maxFileSize>
|
||||
<!-- 日志文件的总大小,0 表示不限制 -->
|
||||
<totalSizeCap>${LOGBACK_ROLLINGPOLICY_TOTAL_SIZE_CAP:-0}</totalSizeCap>
|
||||
<!-- 日志文件的保留天数 -->
|
||||
<maxHistory>${LOGBACK_ROLLINGPOLICY_MAX_HISTORY:-30}</maxHistory>
|
||||
</rollingPolicy>
|
||||
</appender>
|
||||
<!-- 异步写入日志,提升性能 -->
|
||||
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
|
||||
<!-- 不丢失日志。默认的,如果队列的 80% 已满,则会丢弃 TRACT、DEBUG、INFO 级别的日志 -->
|
||||
<discardingThreshold>0</discardingThreshold>
|
||||
<!-- 更改默认的队列的深度,该值会影响性能。默认值为 256 -->
|
||||
<queueSize>256</queueSize>
|
||||
<appender-ref ref="FILE"/>
|
||||
</appender>
|
||||
|
||||
<!-- SkyWalking GRPC 日志收集,实现日志中心。注意:SkyWalking 8.4.0 版本开始支持 -->
|
||||
<appender name="GRPC" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<pattern>${PATTERN_DEFAULT}</pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 本地环境 -->
|
||||
<springProfile name="local">
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT"/>
|
||||
<appender-ref ref="GRPC"/> <!-- 本地环境下,如果不想接入 SkyWalking 日志服务,可以注释掉本行 -->
|
||||
<appender-ref ref="ASYNC"/> <!-- 本地环境下,如果不想打印日志,可以注释掉本行 -->
|
||||
</root>
|
||||
</springProfile>
|
||||
<!-- 其它环境 -->
|
||||
<springProfile name="dev,test,stage,prod,default">
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT"/>
|
||||
<appender-ref ref="ASYNC"/>
|
||||
<appender-ref ref="GRPC"/>
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
</configuration>
|
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-mall</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>yudao-module-hshy-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
product 模块 API,暴露给其它模块调用
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-ui</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 参数校验 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- RPC 远程调用相关 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,18 @@
|
|||
package cn.iocoder.yudao.module.hshy.api.pointruleitem;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.hshy.api.pointruleitem.dto.PointRuleItemReqDTO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface PointRuleItemApi {
|
||||
|
||||
@Operation(summary = "根据类型获取规则明细")
|
||||
@Parameter(name = "type", description = "类型", required = true, example = "code")
|
||||
CommonResult<List<PointRuleItemReqDTO>> getPointRuleItemList(@RequestParam("type") String type);
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package cn.iocoder.yudao.module.hshy.api.pointruleitem.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 规则明细 Response TDO")
|
||||
@Data
|
||||
public class PointRuleItemReqDTO {
|
||||
@Schema(description = "编码")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "规则类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "标签")
|
||||
private String label;
|
||||
|
||||
@Schema(description = "开始键值")
|
||||
private String starValue;
|
||||
|
||||
@Schema(description = "结束键值")
|
||||
private String endValue;
|
||||
|
||||
@Schema(description = "排序")
|
||||
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态(0正常 1停用)")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "颜色类型", example = "2")
|
||||
private String colorType;
|
||||
|
||||
@Schema(description = "css 样式")
|
||||
private String cssClass;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package cn.iocoder.yudao.module.hshy.api.userblack;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.hshy.api.userblack.dto.UserBlackReqDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UserBlackApi {
|
||||
/**
|
||||
* 获得所有会员黑名单
|
||||
*
|
||||
*/
|
||||
CommonResult<List<UserBlackReqDTO>> listUserBlack();
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package cn.iocoder.yudao.module.hshy.api.userblack.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
public class UserBlackReqDTO {
|
||||
@Schema(description = "会员编号", example = "1034")
|
||||
@NotNull(message = "会员编号")
|
||||
private Long memberUserId;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package cn.iocoder.yudao.module.hshy.enums;
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
|
||||
|
||||
/**
|
||||
* 海上会员 错误码枚举类
|
||||
*
|
||||
* 海上会员 系统,使用 1-100-000-000 段
|
||||
*/
|
||||
public interface ErrorCodeConstants {
|
||||
// ========== 会员黑名单 TODO 补充编号 ==========
|
||||
ErrorCode USER_BLACK_NOT_EXISTS = new ErrorCode(1-100-001-000, "登录异常,请联系管理员!");
|
||||
|
||||
// ========== 规则 TODO 补充编号 ==========
|
||||
ErrorCode POINT_RULE_NOT_EXISTS = new ErrorCode(1-101-001-000, "规则不存在");
|
||||
|
||||
// ========== 规则明细 TODO 补充编号 ==========
|
||||
ErrorCode POINT_RULE_ITEM_NOT_EXISTS = new ErrorCode(1-102-001-000, "规则明细不存在");
|
||||
|
||||
// ========== 用户积分金额冻结 TODO 补充编号 ==========
|
||||
ErrorCode POINT_CONGEAL_NOT_EXISTS = new ErrorCode(1-103-001-000, "用户积分金额冻结不存在");
|
||||
|
||||
// ========== 商品扩展 TODO 补充编号 ==========
|
||||
ErrorCode EXTEND_NOT_EXISTS = new ErrorCode(1-104-001-000, "商品扩展不存在");
|
||||
|
||||
// ========== 会员条件配置 TODO 补充编号 ==========
|
||||
ErrorCode USER_CONFIG_NOT_EXISTS = new ErrorCode(1-105-001-000, "会员条件配置不存在");
|
||||
|
||||
// ========== 会员积分兑换 TODO 补充编号 ==========
|
||||
ErrorCode POINT_EXCHANGE_NOT_EXISTS = new ErrorCode(1-106-001-000, "会员积分兑换不存在");
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,127 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-mall</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>yudao-module-hshy-biz</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
product 模块,主要实现商品相关功能
|
||||
例如:品牌、商品分类、spu、sku等功能。
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- Spring Cloud 基础 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-env</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 依赖服务 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-hshy-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-product-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-member-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 业务组件 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- DB 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RPC 远程调用相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-rpc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Registry 注册中心相关 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Config 配置中心相关 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Test 测试相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 工具类相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-excel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 监控相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-monitor</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<!-- 设置构建的 jar 包名 -->
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<!-- 打包 -->
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal> <!-- 将引入的 jar 打入其中 -->
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,17 @@
|
|||
package cn.iocoder.yudao.module.hshy;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 项目的启动类
|
||||
*
|
||||
* @author tpj
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class HshyServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(HshyServerApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package cn.iocoder.yudao.module.hshy.api.pointruleitem;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.hshy.api.pointruleitem.dto.PointRuleItemReqDTO;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.pointruleitem.PointRuleItemDO;
|
||||
import cn.iocoder.yudao.module.hshy.service.pointruleitem.PointRuleItemService;
|
||||
import cn.iocoder.yudao.module.product.api.sku.dto.ProductSkuRespDTO;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
public class PointRuleItemImpl implements PointRuleItemApi {
|
||||
|
||||
@Resource
|
||||
private PointRuleItemService pointRuleItemService;
|
||||
@Override
|
||||
public CommonResult<List<PointRuleItemReqDTO>> getPointRuleItemList(String type) {
|
||||
List<PointRuleItemDO> list =pointRuleItemService.getPointRuleItemList(type);
|
||||
return success(BeanUtils.toBean(list, PointRuleItemReqDTO.class));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package cn.iocoder.yudao.module.hshy.api.userblack;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.hshy.api.userblack.dto.UserBlackReqDTO;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.userblack.UserBlackDO;
|
||||
import cn.iocoder.yudao.module.hshy.service.userblack.UserBlackService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
public class UserBlackApiImpl implements UserBlackApi {
|
||||
|
||||
@Resource
|
||||
private UserBlackService userBlackService;
|
||||
@Override
|
||||
public CommonResult<List<UserBlackReqDTO>> listUserBlack() {
|
||||
List<UserBlackDO> list= userBlackService.listUserBlack();
|
||||
return success(BeanUtils.toBean(list, UserBlackReqDTO.class));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.extend;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.extend.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.extend.ExtendDO;
|
||||
import cn.iocoder.yudao.module.hshy.service.extend.ExtendService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Tag(name = "管理后台 - 商品扩展")
|
||||
@RestController
|
||||
@RequestMapping("/hshy/extend")
|
||||
@Validated
|
||||
public class ExtendController {
|
||||
|
||||
@Resource
|
||||
private ExtendService extendService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建商品扩展")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:extend:create')")
|
||||
public CommonResult<Integer> createExtend(@Valid @RequestBody ExtendSaveReqVO createReqVO) {
|
||||
return success(extendService.createExtend(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新商品扩展")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:extend:update')")
|
||||
public CommonResult<Boolean> updateExtend(@Valid @RequestBody ExtendSaveReqVO updateReqVO) {
|
||||
extendService.updateExtend(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除商品扩展")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('hshy:extend:delete')")
|
||||
public CommonResult<Boolean> deleteExtend(@RequestParam("id") Integer id) {
|
||||
extendService.deleteExtend(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "根据spuId获取扩展信息")
|
||||
@Parameter(name = "spuId", description = "商品 SPU 编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:extend:query')")
|
||||
public CommonResult<ExtendRespVO> getExtend(@RequestParam("spuId") Integer spuId) {
|
||||
ExtendDO extend = extendService.getExtend(spuId);
|
||||
return success(BeanUtils.toBean(extend, ExtendRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得商品扩展分页")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:extend:query')")
|
||||
public CommonResult<PageResult<ExtendRespVO>> getExtendPage(@Valid ExtendPageReqVO pageReqVO) {
|
||||
PageResult<ExtendDO> pageResult = extendService.getExtendPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ExtendRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出商品扩展 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:extend:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportExtendExcel(@Valid ExtendPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ExtendDO> list = extendService.getExtendPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "商品扩展.xls", "数据", ExtendRespVO.class,
|
||||
BeanUtils.toBean(list, ExtendRespVO.class));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.extend.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 商品扩展分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ExtendPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "是否是推广商品(0否 1是)")
|
||||
private Integer isPromotion;
|
||||
|
||||
@Schema(description = "是否是指定商品(0否 1是)")
|
||||
private Integer isAppoint;
|
||||
|
||||
@Schema(description = "是否是特殊商品(0否 1是)")
|
||||
private Integer isSpecial;
|
||||
|
||||
@Schema(description = "状态(0正常 1停用)", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "说明", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "商品 SPU 编号", example = "26933")
|
||||
private Long spuId;
|
||||
|
||||
@Schema(description = "商品 SKU 编号", example = "3820")
|
||||
private Long skuId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "删除时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] deletedTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.extend.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 商品扩展分页 Request VO")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class ExtendReqVO {
|
||||
@Schema(description = "商品 SPU 编号", example = "26933")
|
||||
private Long spuId;
|
||||
|
||||
@Schema(description = "商品 SKU 编号", example = "3820")
|
||||
private Long skuId;
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.extend.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 商品扩展 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ExtendRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25961")
|
||||
@ExcelProperty("主键")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "是否是推广商品(0否 1是)")
|
||||
@ExcelProperty("是否是推广商品(0否 1是)")
|
||||
private Integer isPromotion;
|
||||
|
||||
@Schema(description = "是否是指定商品(0否 1是)")
|
||||
@ExcelProperty("是否是指定商品(0否 1是)")
|
||||
private Integer isAppoint;
|
||||
|
||||
@Schema(description = "是否是特殊商品(0否 1是)")
|
||||
@ExcelProperty("是否是特殊商品(0否 1是)")
|
||||
private Integer isSpecial;
|
||||
|
||||
@Schema(description = "状态(0正常 1停用)", example = "2")
|
||||
@ExcelProperty("状态(0正常 1停用)")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "说明", example = "随便")
|
||||
@ExcelProperty("说明")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "商品 SPU 编号", example = "26933")
|
||||
@ExcelProperty("商品 SPU 编号")
|
||||
private Long spuId;
|
||||
|
||||
@Schema(description = "商品 SKU 编号", example = "3820")
|
||||
@ExcelProperty("商品 SKU 编号")
|
||||
private Long skuId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "删除时间")
|
||||
@ExcelProperty("删除时间")
|
||||
private LocalDateTime deletedTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.extend.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 商品扩展新增/修改 Request VO")
|
||||
@Data
|
||||
public class ExtendSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25961")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "是否是推广商品(0否 1是)")
|
||||
private Integer isPromotion;
|
||||
|
||||
@Schema(description = "是否是指定商品(0否 1是)")
|
||||
private Integer isAppoint;
|
||||
|
||||
@Schema(description = "是否是特殊商品(0否 1是)")
|
||||
private Integer isSpecial;
|
||||
|
||||
@Schema(description = "状态(0正常 1停用)", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "说明", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "商品 SPU 编号", example = "26933")
|
||||
private Long spuId;
|
||||
|
||||
@Schema(description = "商品 SKU 编号", example = "3820")
|
||||
private Long skuId;
|
||||
|
||||
@Schema(description = "删除时间")
|
||||
private LocalDateTime deletedTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.pointcongeal;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.pointcongeal.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.pointcongeal.PointCongealDO;
|
||||
import cn.iocoder.yudao.module.hshy.service.pointcongeal.PointCongealService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Tag(name = "管理后台 - 用户积分金额冻结")
|
||||
@RestController
|
||||
@RequestMapping("/hshy/point-congeal")
|
||||
@Validated
|
||||
public class PointCongealController {
|
||||
|
||||
@Resource
|
||||
private PointCongealService pointCongealService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建用户积分金额冻结")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-congeal:create')")
|
||||
public CommonResult<Integer> createPointCongeal(@Valid @RequestBody PointCongealSaveReqVO createReqVO) {
|
||||
return success(pointCongealService.createPointCongeal(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户积分金额冻结")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-congeal:update')")
|
||||
public CommonResult<Boolean> updatePointCongeal(@Valid @RequestBody PointCongealSaveReqVO updateReqVO) {
|
||||
pointCongealService.updatePointCongeal(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户积分金额冻结")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-congeal:delete')")
|
||||
public CommonResult<Boolean> deletePointCongeal(@RequestParam("id") Integer id) {
|
||||
pointCongealService.deletePointCongeal(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户积分金额冻结")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-congeal:query')")
|
||||
public CommonResult<PointCongealRespVO> getPointCongeal(@RequestParam("id") Integer id) {
|
||||
PointCongealDO pointCongeal = pointCongealService.getPointCongeal(id);
|
||||
return success(BeanUtils.toBean(pointCongeal, PointCongealRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户积分金额冻结分页")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-congeal:query')")
|
||||
public CommonResult<PageResult<PointCongealRespVO>> getPointCongealPage(@Valid PointCongealPageReqVO pageReqVO) {
|
||||
PageResult<PointCongealDO> pageResult = pointCongealService.getPointCongealPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PointCongealRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出用户积分金额冻结 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-congeal:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPointCongealExcel(@Valid PointCongealPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PointCongealDO> list = pointCongealService.getPointCongealPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "用户积分金额冻结.xls", "数据", PointCongealRespVO.class,
|
||||
BeanUtils.toBean(list, PointCongealRespVO.class));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.pointcongeal.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 用户积分金额冻结分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class PointCongealPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "会员编码", example = "26604")
|
||||
private Long memberUserId;
|
||||
|
||||
@Schema(description = "用户积分主键", example = "8748")
|
||||
private Long pointCongealId;
|
||||
|
||||
@Schema(description = "冻结金额")
|
||||
private Integer amount;
|
||||
|
||||
@Schema(description = "冻结积分")
|
||||
private Integer point;
|
||||
|
||||
@Schema(description = "描述", example = "你说的对")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.pointcongeal.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户积分金额冻结 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PointCongealRespVO {
|
||||
|
||||
@Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "10758")
|
||||
@ExcelProperty("自增主键")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "会员编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "26604")
|
||||
@ExcelProperty("会员编码")
|
||||
private Long memberUserId;
|
||||
|
||||
@Schema(description = "用户积分主键", example = "8748")
|
||||
@ExcelProperty("用户积分主键")
|
||||
private Long pointCongealId;
|
||||
|
||||
@Schema(description = "冻结金额")
|
||||
@ExcelProperty("冻结金额")
|
||||
private Integer amount;
|
||||
|
||||
@Schema(description = "冻结积分", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("冻结积分")
|
||||
private Integer point;
|
||||
|
||||
@Schema(description = "描述", example = "你说的对")
|
||||
@ExcelProperty("描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.pointcongeal.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
@Schema(description = "管理后台 - 用户积分金额冻结新增/修改 Request VO")
|
||||
@Data
|
||||
public class PointCongealSaveReqVO {
|
||||
|
||||
@Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "10758")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "会员编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "26604")
|
||||
@NotNull(message = "会员编码不能为空")
|
||||
private Long memberUserId;
|
||||
|
||||
@Schema(description = "用户积分主键", example = "8748")
|
||||
private Long pointCongealId;
|
||||
|
||||
@Schema(description = "冻结金额")
|
||||
private Integer amount;
|
||||
|
||||
@Schema(description = "冻结积分")
|
||||
private Integer point;
|
||||
|
||||
@Schema(description = "描述", example = "你说的对")
|
||||
private String description;
|
||||
|
||||
}
|
|
@ -0,0 +1,104 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.pointexchange;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.pointexchange.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.pointexchange.PointExchangeDO;
|
||||
import cn.iocoder.yudao.module.hshy.service.pointexchange.PointExchangeService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Tag(name = "管理后台 - 会员积分兑换")
|
||||
@RestController
|
||||
@RequestMapping("/hshy/point-exchange")
|
||||
@Validated
|
||||
public class PointExchangeController {
|
||||
|
||||
@Resource
|
||||
private PointExchangeService pointExchangeService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建会员积分兑换")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-exchange:create')")
|
||||
public CommonResult<Integer> createPointExchange(@Valid @RequestBody PointExchangeSaveReqVO createReqVO) {
|
||||
return success(pointExchangeService.createPointExchange(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新会员积分兑换")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-exchange:update')")
|
||||
public CommonResult<Boolean> updatePointExchange(@Valid @RequestBody PointExchangeSaveReqVO updateReqVO) {
|
||||
pointExchangeService.updatePointExchange(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/audit")
|
||||
@Operation(summary = "会员积分兑换审核")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-exchange:update')")
|
||||
public CommonResult<Boolean> auditPointExchange(@Valid @RequestBody PointExchangeAuditReqVO auditReqVO) {
|
||||
pointExchangeService.auditPointExchange(auditReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除会员积分兑换")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-exchange:delete')")
|
||||
public CommonResult<Boolean> deletePointExchange(@RequestParam("id") Integer id) {
|
||||
pointExchangeService.deletePointExchange(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得会员积分兑换")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-exchange:query')")
|
||||
public CommonResult<PointExchangeRespVO> getPointExchange(@RequestParam("id") Integer id) {
|
||||
PointExchangeDO pointExchange = pointExchangeService.getPointExchange(id);
|
||||
return success(BeanUtils.toBean(pointExchange, PointExchangeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得会员积分兑换分页")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-exchange:query')")
|
||||
public CommonResult<PageResult<PointExchangeRespVO>> getPointExchangePage(@Valid PointExchangePageReqVO pageReqVO) {
|
||||
PageResult<PointExchangeDO> pageResult = pointExchangeService.getPointExchangePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PointExchangeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出会员积分兑换 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-exchange:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPointExchangeExcel(@Valid PointExchangePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PointExchangeDO> list = pointExchangeService.getPointExchangePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "会员积分兑换.xls", "数据", PointExchangeRespVO.class,
|
||||
BeanUtils.toBean(list, PointExchangeRespVO.class));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.pointexchange.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 会员积分兑换审核 Request VO")
|
||||
@Data
|
||||
public class PointExchangeAuditReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "22548")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "审核状态", example = "2")
|
||||
private String auditStatus;
|
||||
|
||||
@Schema(description = "审核备注")
|
||||
private String auditNotes;
|
||||
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.pointexchange.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员积分兑换分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class PointExchangePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "会员Id", example = "14170")
|
||||
private Long memberUserId;
|
||||
|
||||
@Schema(description = "会员类型", example = "1")
|
||||
private String userType;
|
||||
|
||||
@Schema(description = "业务类型(余额,商品,其他)", example = "1")
|
||||
private String bizType;
|
||||
|
||||
@Schema(description = "规则明细")
|
||||
private String jsonRule;
|
||||
|
||||
@Schema(description = "余额.积分")
|
||||
private Integer balance;
|
||||
|
||||
@Schema(description = "累积支出")
|
||||
private Integer totalExpense;
|
||||
|
||||
@Schema(description = "累积充值")
|
||||
private Integer totalRecharge;
|
||||
|
||||
@Schema(description = "状态(0正常 1停用)", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "说明", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "审核状态", example = "2")
|
||||
private String auditStatus;
|
||||
|
||||
@Schema(description = "审核人")
|
||||
private String audit;
|
||||
|
||||
@Schema(description = "审核时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] auditTime;
|
||||
|
||||
@Schema(description = "审核备注")
|
||||
private String auditNotes;
|
||||
|
||||
@Schema(description = "商品 SPU 编号", example = "852")
|
||||
private Long spuId;
|
||||
|
||||
@Schema(description = "商品 SKU 编号", example = "28024")
|
||||
private Long skuId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "删除时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] deletedTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.pointexchange.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
|
||||
@Schema(description = "管理后台 - 会员积分兑换 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PointExchangeRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "22548")
|
||||
@ExcelProperty("主键")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "会员Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14170")
|
||||
@ExcelProperty("会员Id")
|
||||
private Long memberUserId;
|
||||
|
||||
@Schema(description = "会员类型", example = "1")
|
||||
@ExcelProperty("会员类型")
|
||||
private String userType;
|
||||
|
||||
@Schema(description = "业务类型(余额,商品,其他)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty(value = "业务类型(余额,商品,其他)", converter = DictConvert.class)
|
||||
@DictFormat("member_point_exchange_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String bizType;
|
||||
|
||||
@Schema(description = "规则明细", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("规则明细")
|
||||
private String jsonRule;
|
||||
|
||||
@Schema(description = "余额.积分")
|
||||
@ExcelProperty("余额.积分")
|
||||
private Integer balance;
|
||||
|
||||
@Schema(description = "累积支出")
|
||||
@ExcelProperty("累积支出")
|
||||
private Integer totalExpense;
|
||||
|
||||
@Schema(description = "累积充值")
|
||||
@ExcelProperty("累积充值")
|
||||
private Integer totalRecharge;
|
||||
|
||||
@Schema(description = "状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("状态(0正常 1停用)")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "说明", example = "随便")
|
||||
@ExcelProperty("说明")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "审核状态", example = "2")
|
||||
@ExcelProperty(value = "审核状态", converter = DictConvert.class)
|
||||
@DictFormat("member_point_exchange_audit_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String auditStatus;
|
||||
|
||||
@Schema(description = "审核人")
|
||||
@ExcelProperty("审核人")
|
||||
private String audit;
|
||||
|
||||
@Schema(description = "审核时间")
|
||||
@ExcelProperty("审核时间")
|
||||
private LocalDateTime auditTime;
|
||||
|
||||
@Schema(description = "审核备注")
|
||||
@ExcelProperty("审核备注")
|
||||
private String auditNotes;
|
||||
|
||||
@Schema(description = "商品 SPU 编号", example = "852")
|
||||
@ExcelProperty("商品 SPU 编号")
|
||||
private Long spuId;
|
||||
|
||||
@Schema(description = "商品 SKU 编号", example = "28024")
|
||||
@ExcelProperty("商品 SKU 编号")
|
||||
private Long skuId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "删除时间")
|
||||
@ExcelProperty("删除时间")
|
||||
private LocalDateTime deletedTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.pointexchange.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 会员积分兑换新增/修改 Request VO")
|
||||
@Data
|
||||
public class PointExchangeSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "22548")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "会员Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14170")
|
||||
@NotNull(message = "会员Id不能为空")
|
||||
private Long memberUserId;
|
||||
|
||||
@Schema(description = "会员类型", example = "1")
|
||||
private String userType;
|
||||
|
||||
@Schema(description = "业务类型(余额,商品,其他)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "业务类型(余额,商品,其他)不能为空")
|
||||
private String bizType;
|
||||
|
||||
@Schema(description = "规则明细", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "规则明细不能为空")
|
||||
private String jsonRule;
|
||||
|
||||
@Schema(description = "余额.积分")
|
||||
private Integer balance;
|
||||
|
||||
@Schema(description = "累积支出")
|
||||
private Integer totalExpense;
|
||||
|
||||
@Schema(description = "累积充值")
|
||||
private Integer totalRecharge;
|
||||
|
||||
@Schema(description = "状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "状态(0正常 1停用)不能为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "说明", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "审核状态", example = "2")
|
||||
private String auditStatus;
|
||||
|
||||
@Schema(description = "审核人")
|
||||
private String audit;
|
||||
|
||||
@Schema(description = "审核时间")
|
||||
private LocalDateTime auditTime;
|
||||
|
||||
@Schema(description = "审核备注")
|
||||
private String auditNotes;
|
||||
|
||||
@Schema(description = "商品 SPU 编号", example = "852")
|
||||
private Long spuId;
|
||||
|
||||
@Schema(description = "商品 SKU 编号", example = "28024")
|
||||
private Long skuId;
|
||||
|
||||
@Schema(description = "删除时间")
|
||||
private LocalDateTime deletedTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.pointrule;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.pointrule.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.pointrule.PointRuleDO;
|
||||
import cn.iocoder.yudao.module.hshy.service.pointrule.PointRuleService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Tag(name = "管理后台 - 规则")
|
||||
@RestController
|
||||
@RequestMapping("/hshy/point-rule")
|
||||
@Validated
|
||||
public class PointRuleController {
|
||||
|
||||
@Resource
|
||||
private PointRuleService pointRuleService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建规则")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-rule:create')")
|
||||
public CommonResult<Integer> createPointRule(@Valid @RequestBody PointRuleSaveReqVO createReqVO) {
|
||||
return success(pointRuleService.createPointRule(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新规则")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-rule:update')")
|
||||
public CommonResult<Boolean> updatePointRule(@Valid @RequestBody PointRuleSaveReqVO updateReqVO) {
|
||||
pointRuleService.updatePointRule(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除规则")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-rule:delete')")
|
||||
public CommonResult<Boolean> deletePointRule(@RequestParam("id") Integer id) {
|
||||
pointRuleService.deletePointRule(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得规则")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-rule:query')")
|
||||
public CommonResult<PointRuleRespVO> getPointRule(@RequestParam("id") Integer id) {
|
||||
PointRuleDO pointRule = pointRuleService.getPointRule(id);
|
||||
return success(BeanUtils.toBean(pointRule, PointRuleRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得规则分页")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-rule:query')")
|
||||
public CommonResult<PageResult<PointRuleRespVO>> getPointRulePage(@Valid PointRulePageReqVO pageReqVO) {
|
||||
PageResult<PointRuleDO> pageResult = pointRuleService.getPointRulePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PointRuleRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出规则 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-rule:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPointRuleExcel(@Valid PointRulePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PointRuleDO> list = pointRuleService.getPointRulePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "规则.xls", "数据", PointRuleRespVO.class,
|
||||
BeanUtils.toBean(list, PointRuleRespVO.class));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.pointrule.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 规则分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class PointRulePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "类型(天数,时间,条款,区间,升级,降级)", example = "1")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "名称", example = "赵六")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "状态(0正常 1停用)", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "说明", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "删除时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] deletedTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.pointrule.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 规则 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PointRuleRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15498")
|
||||
@ExcelProperty("主键")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "类型(天数,时间,条款,区间,升级,降级)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("类型(天数,时间,条款,区间,升级,降级)")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@ExcelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("状态(0正常 1停用)")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "说明", example = "你猜")
|
||||
@ExcelProperty("说明")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "删除时间")
|
||||
@ExcelProperty("删除时间")
|
||||
private LocalDateTime deletedTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.pointrule.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 规则新增/修改 Request VO")
|
||||
@Data
|
||||
public class PointRuleSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15498")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "类型(天数,时间,条款,区间,升级,降级)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "类型(天数,时间,条款,区间,升级,降级)不能为空")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@NotEmpty(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "状态(0正常 1停用)不能为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "说明", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "删除时间")
|
||||
private LocalDateTime deletedTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.pointruleitem;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.pointruleitem.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.pointruleitem.PointRuleItemDO;
|
||||
import cn.iocoder.yudao.module.hshy.service.pointruleitem.PointRuleItemService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Tag(name = "管理后台 - 规则明细")
|
||||
@RestController
|
||||
@RequestMapping("/hshy/point-rule-item")
|
||||
@Validated
|
||||
public class PointRuleItemController {
|
||||
|
||||
@Resource
|
||||
private PointRuleItemService pointRuleItemService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建规则明细")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-rule-item:create')")
|
||||
public CommonResult<Integer> createPointRuleItem(@Valid @RequestBody PointRuleItemSaveReqVO createReqVO) {
|
||||
return success(pointRuleItemService.createPointRuleItem(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新规则明细")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-rule-item:update')")
|
||||
public CommonResult<Boolean> updatePointRuleItem(@Valid @RequestBody PointRuleItemSaveReqVO updateReqVO) {
|
||||
pointRuleItemService.updatePointRuleItem(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除规则明细")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-rule-item:delete')")
|
||||
public CommonResult<Boolean> deletePointRuleItem(@RequestParam("id") Integer id) {
|
||||
pointRuleItemService.deletePointRuleItem(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得规则明细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-rule-item:query')")
|
||||
public CommonResult<PointRuleItemRespVO> getPointRuleItem(@RequestParam("id") Integer id) {
|
||||
PointRuleItemDO pointRuleItem = pointRuleItemService.getPointRuleItem(id);
|
||||
return success(BeanUtils.toBean(pointRuleItem, PointRuleItemRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得规则明细分页")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-rule-item:query')")
|
||||
public CommonResult<PageResult<PointRuleItemRespVO>> getPointRuleItemPage(@Valid PointRuleItemPageReqVO pageReqVO) {
|
||||
PageResult<PointRuleItemDO> pageResult = pointRuleItemService.getPointRuleItemPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PointRuleItemRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/detail")
|
||||
@Operation(summary = "根据type获取规则明细")
|
||||
@Parameter(name = "type", description = "类型", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-rule-item:query')")
|
||||
public CommonResult<List<PointRuleItemRespVO>> detail(@Valid String type) {
|
||||
List<PointRuleItemDO> pageResult = pointRuleItemService.getPointRuleItemList(type);
|
||||
return success(BeanUtils.toBean(pageResult, PointRuleItemRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出规则明细 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-rule-item:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPointRuleItemExcel(@Valid PointRuleItemPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PointRuleItemDO> list = pointRuleItemService.getPointRuleItemPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "规则明细.xls", "数据", PointRuleItemRespVO.class,
|
||||
BeanUtils.toBean(list, PointRuleItemRespVO.class));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.pointruleitem.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 规则明细分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class PointRuleItemPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "编码")
|
||||
private Long code;
|
||||
|
||||
@Schema(description = "规则类型", example = "2")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "标签")
|
||||
private String label;
|
||||
|
||||
@Schema(description = "开始键值")
|
||||
private String starValue;
|
||||
|
||||
@Schema(description = "结束键值")
|
||||
private String endValue;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态(0正常 1停用)", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "颜色类型", example = "2")
|
||||
private String colorType;
|
||||
|
||||
@Schema(description = "css 样式")
|
||||
private String cssClass;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.pointruleitem.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 规则明细 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PointRuleItemRespVO {
|
||||
|
||||
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "25327")
|
||||
@ExcelProperty("编码")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "编码")
|
||||
@ExcelProperty("编码")
|
||||
private Long code;
|
||||
|
||||
@Schema(description = "规则类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("规则类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "标签", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("标签")
|
||||
private String label;
|
||||
|
||||
@Schema(description = "开始键值")
|
||||
@ExcelProperty("开始键值")
|
||||
private String starValue;
|
||||
|
||||
@Schema(description = "结束键值", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("结束键值")
|
||||
private String endValue;
|
||||
|
||||
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("状态(0正常 1停用)")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "颜色类型", example = "2")
|
||||
@ExcelProperty("颜色类型")
|
||||
private String colorType;
|
||||
|
||||
@Schema(description = "css 样式")
|
||||
@ExcelProperty("css 样式")
|
||||
private String cssClass;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.pointruleitem.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.*;
|
||||
|
||||
@Schema(description = "管理后台 - 规则明细新增/修改 Request VO")
|
||||
@Data
|
||||
public class PointRuleItemSaveReqVO {
|
||||
|
||||
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "25327")
|
||||
private Integer id;
|
||||
|
||||
|
||||
@Schema(description = "规则类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "规则类型不能为空")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "标签", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "标签不能为空")
|
||||
private String label;
|
||||
|
||||
@Schema(description = "开始键值")
|
||||
private String starValue;
|
||||
|
||||
@Schema(description = "结束键值", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String endValue;
|
||||
|
||||
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "排序不能为空")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "状态(0正常 1停用)不能为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "颜色类型", example = "2")
|
||||
private String colorType;
|
||||
|
||||
@Schema(description = "css 样式")
|
||||
private String cssClass;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.userblack;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.userblack.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.userblack.UserBlackDO;
|
||||
import cn.iocoder.yudao.module.hshy.service.userblack.UserBlackService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Tag(name = "管理后台 - 会员黑名单")
|
||||
@RestController
|
||||
@RequestMapping("/hshy/user-black")
|
||||
@Validated
|
||||
public class UserBlackController {
|
||||
|
||||
@Resource
|
||||
private UserBlackService userBlackService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "批量创建会员黑名单")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-black-list:create')")
|
||||
public CommonResult<Boolean> createUserBlackList(@Valid @RequestBody UserBlackSaveReqVO createReqVO) {
|
||||
return success(userBlackService.createUserBlack(createReqVO));
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新会员黑名单")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:user-black:update')")
|
||||
public CommonResult<Boolean> updateUserBlack(@Valid @RequestBody UserBlackSaveReqVO updateReqVO) {
|
||||
userBlackService.updateUserBlack(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "批量删除会员黑名单")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-black-list:delete')")
|
||||
public CommonResult<Boolean> deleteUserBlackList(@Valid @RequestBody UserBlackSaveReqVO deleteReqVO) {
|
||||
userBlackService.deleteUserBlack(deleteReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得会员黑名单")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:user-black:query')")
|
||||
public CommonResult<Boolean> getUserBlack(@RequestParam("id") Integer id) {
|
||||
return success(userBlackService.getUserBlack(id));
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得会员黑名单分页")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:user-black:query')")
|
||||
public CommonResult<PageResult<UserBlackRespVO>> getUserBlackPage(@Valid UserBlackPageReqVO pageReqVO) {
|
||||
PageResult<UserBlackDO> pageResult = userBlackService.getUserBlackPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, UserBlackRespVO.class));
|
||||
}
|
||||
|
||||
// @GetMapping("/export-excel")
|
||||
// @Operation(summary = "导出会员黑名单 Excel")
|
||||
// @PreAuthorize("@ss.hasPermission('hshy:user-black:export')")
|
||||
// @ApiAccessLog(operateType = EXPORT)
|
||||
// public void exportUserBlackExcel(@Valid UserBlackPageReqVO pageReqVO,
|
||||
// HttpServletResponse response) throws IOException {
|
||||
// pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
// List<UserBlackDO> list = userBlackService.getUserBlackPage(pageReqVO).getList();
|
||||
// // 导出 Excel
|
||||
// ExcelUtils.write(response, "会员黑名单.xls", "数据", UserBlackRespVO.class,
|
||||
// BeanUtils.toBean(list, UserBlackRespVO.class));
|
||||
// }
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.userblack.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员黑名单分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserBlackPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "会员编号", example = "1034")
|
||||
private Long memberUserId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.userblack.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员黑名单 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class UserBlackRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11987")
|
||||
@ExcelProperty("编号")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "会员编号", example = "1034")
|
||||
@ExcelProperty("会员编号")
|
||||
private Long memberUserId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.userblack.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员黑名单新增/修改 Request VO")
|
||||
@Data
|
||||
public class UserBlackSaveReqVO {
|
||||
|
||||
@Schema(description = "会员编号", example = "8642")
|
||||
private List<Long> memberUserIds;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.userconfig;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.userconfig.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.userconfig.UserConfigDO;
|
||||
import cn.iocoder.yudao.module.hshy.service.userconfig.UserConfigService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Tag(name = "管理后台 - 会员条件配置")
|
||||
@RestController
|
||||
@RequestMapping("/hshy/user-config")
|
||||
@Validated
|
||||
public class UserConfigController {
|
||||
|
||||
@Resource
|
||||
private UserConfigService userConfigService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建会员条件配置")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:user-config:create')")
|
||||
public CommonResult<Integer> createUserConfig(@Valid @RequestBody UserConfigSaveReqVO createReqVO) {
|
||||
return success(userConfigService.createUserConfig(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新会员条件配置")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:user-config:update')")
|
||||
public CommonResult<Boolean> updateUserConfig(@Valid @RequestBody UserConfigSaveReqVO updateReqVO) {
|
||||
userConfigService.updateUserConfig(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除会员条件配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('hshy:user-config:delete')")
|
||||
public CommonResult<Boolean> deleteUserConfig(@RequestParam("id") Integer id) {
|
||||
userConfigService.deleteUserConfig(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得会员条件配置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:user-config:query')")
|
||||
public CommonResult<UserConfigRespVO> getUserConfig(@RequestParam("id") Integer id) {
|
||||
UserConfigDO userConfig = userConfigService.getUserConfig(id);
|
||||
return success(BeanUtils.toBean(userConfig, UserConfigRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得会员条件配置分页")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:user-config:query')")
|
||||
public CommonResult<PageResult<UserConfigRespVO>> getUserConfigPage(@Valid UserConfigPageReqVO pageReqVO) {
|
||||
PageResult<UserConfigDO> pageResult = userConfigService.getUserConfigPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, UserConfigRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出会员条件配置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:user-config:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportUserConfigExcel(@Valid UserConfigPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<UserConfigDO> list = userConfigService.getUserConfigPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "会员条件配置.xls", "数据", UserConfigRespVO.class,
|
||||
BeanUtils.toBean(list, UserConfigRespVO.class));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.userconfig.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员条件配置分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserConfigPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "会员编码", example = "6413")
|
||||
private Long memberUserId;
|
||||
|
||||
@Schema(description = "业务类型", example = "2")
|
||||
private String bizType;
|
||||
|
||||
@Schema(description = "前置条件")
|
||||
private String beforeJson;
|
||||
|
||||
@Schema(description = "后置条件")
|
||||
private String afterJson;
|
||||
|
||||
@Schema(description = "业务值")
|
||||
private String bizValue;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.userconfig.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员条件配置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class UserConfigRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "28791")
|
||||
@ExcelProperty("编号")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "会员编码", example = "6413")
|
||||
@ExcelProperty("会员编码")
|
||||
private Long memberUserId;
|
||||
|
||||
@Schema(description = "业务类型", example = "2")
|
||||
@ExcelProperty("业务类型")
|
||||
private String bizType;
|
||||
|
||||
@Schema(description = "前置条件")
|
||||
@ExcelProperty("前置条件")
|
||||
private String beforeJson;
|
||||
|
||||
@Schema(description = "后置条件")
|
||||
@ExcelProperty("后置条件")
|
||||
private String afterJson;
|
||||
|
||||
@Schema(description = "业务值")
|
||||
@ExcelProperty("业务值")
|
||||
private String bizValue;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.admin.userconfig.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员条件配置新增/修改 Request VO")
|
||||
@Data
|
||||
public class UserConfigSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "28791")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "会员编码", example = "6413")
|
||||
private Long memberUserId;
|
||||
|
||||
@Schema(description = "业务类型", example = "2")
|
||||
private String bizType;
|
||||
|
||||
@Schema(description = "前置条件")
|
||||
private String beforeJson;
|
||||
|
||||
@Schema(description = "后置条件")
|
||||
private String afterJson;
|
||||
|
||||
@Schema(description = "业务值")
|
||||
private String bizValue;
|
||||
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.app.pointexchange.vo;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.pointexchange.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.pointexchange.PointExchangeDO;
|
||||
import cn.iocoder.yudao.module.hshy.service.pointexchange.PointExchangeService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Tag(name = "管理后台 - 会员积分兑换")
|
||||
@RestController
|
||||
@RequestMapping("/hshy/point-exchange")
|
||||
@Validated
|
||||
public class AppPointExchangeController {
|
||||
|
||||
@Resource
|
||||
private PointExchangeService pointExchangeService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建会员积分兑换")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-exchange:create')")
|
||||
public CommonResult<Integer> createPointExchange(@Valid @RequestBody PointExchangeSaveReqVO createReqVO) {
|
||||
return success(pointExchangeService.createPointExchange(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新会员积分兑换")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-exchange:update')")
|
||||
public CommonResult<Boolean> updatePointExchange(@Valid @RequestBody PointExchangeSaveReqVO updateReqVO) {
|
||||
pointExchangeService.updatePointExchange(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除会员积分兑换")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-exchange:delete')")
|
||||
public CommonResult<Boolean> deletePointExchange(@RequestParam("id") Integer id) {
|
||||
pointExchangeService.deletePointExchange(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得会员积分兑换")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-exchange:query')")
|
||||
public CommonResult<PointExchangeRespVO> getPointExchange(@RequestParam("id") Integer id) {
|
||||
PointExchangeDO pointExchange = pointExchangeService.getPointExchange(id);
|
||||
return success(BeanUtils.toBean(pointExchange, PointExchangeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得会员积分兑换分页")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-exchange:query')")
|
||||
public CommonResult<PageResult<PointExchangeRespVO>> getPointExchangePage(@Valid PointExchangePageReqVO pageReqVO) {
|
||||
PageResult<PointExchangeDO> pageResult = pointExchangeService.getPointExchangePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PointExchangeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出会员积分兑换 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:point-exchange:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPointExchangeExcel(@Valid PointExchangePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PointExchangeDO> list = pointExchangeService.getPointExchangePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "会员积分兑换.xls", "数据", PointExchangeRespVO.class,
|
||||
BeanUtils.toBean(list, PointExchangeRespVO.class));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.app.userblack;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.hshy.controller.app.userblack.vo.UserBlackPageReqVO;
|
||||
import cn.iocoder.yudao.module.hshy.controller.app.userblack.vo.UserBlackRespVO;
|
||||
import cn.iocoder.yudao.module.hshy.controller.app.userblack.vo.UserBlackSaveReqVO;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.userblack.UserBlackDO;
|
||||
import cn.iocoder.yudao.module.hshy.service.userblack.UserBlackService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "APP后台 - 会员黑名单")
|
||||
@RestController
|
||||
@RequestMapping("/hshy/user-black")
|
||||
@Validated
|
||||
public class AppUserBlackController {
|
||||
|
||||
@Resource
|
||||
private UserBlackService userBlackService;
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "APP获得会员黑名单")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('hshy:user-black:query')")
|
||||
public CommonResult<Boolean> getUserBlack(@RequestParam("id") Integer id) {
|
||||
return success(userBlackService.getUserBlack(id));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.app.userblack.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员黑名单分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserBlackPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "会员编号", example = "1034")
|
||||
private Long memberUserId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.app.userblack.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 会员黑名单 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class UserBlackRespVO {
|
||||
@Schema(description = "会员编号", example = "1034")
|
||||
@ExcelProperty("会员编号")
|
||||
private Long memberUserId;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package cn.iocoder.yudao.module.hshy.controller.app.userblack.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 会员黑名单新增/修改 Request VO")
|
||||
@Data
|
||||
public class UserBlackSaveReqVO {
|
||||
|
||||
@Schema(description = "会员编号", example = "8642")
|
||||
private List<Long> memberUserIds;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
package cn.iocoder.yudao.module.hshy.convert;
|
||||
|
||||
public class SnowflakeIdWorker {
|
||||
|
||||
// 开始时间戳(毫秒级)
|
||||
private final long twepoch = 1288834974657L;
|
||||
|
||||
// 机器ID所占的位数
|
||||
private final long workerIdBits = 10L;
|
||||
|
||||
// 数据中心ID所占的位数
|
||||
private final long datacenterIdBits = 10L;
|
||||
|
||||
// 支持的最大机器ID,结果是1023
|
||||
private final long maxWorkerId = -1L ^ (-1L << workerIdBits);
|
||||
|
||||
// 支持的最大数据中心ID,结果是1023
|
||||
private final long maxDatacenterId = -1L ^ (-1L << datacenterIdBits);
|
||||
|
||||
// 序列号所占的位数
|
||||
private final long sequenceBits = 12L;
|
||||
|
||||
// 机器ID左移12位
|
||||
private final long workerIdShift = sequenceBits;
|
||||
|
||||
// 数据中心ID左移22位
|
||||
private final long datacenterIdShift = sequenceBits + workerIdBits;
|
||||
|
||||
// 时间戳左移32位
|
||||
private final long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits;
|
||||
|
||||
// 序列号掩码
|
||||
private final long sequenceMask = -1L ^ (-1L << sequenceBits);
|
||||
|
||||
// 上次生成ID的时间戳
|
||||
private long lastTimestamp = -1L;
|
||||
|
||||
// 机器ID
|
||||
private long workerId;
|
||||
|
||||
// 数据中心ID
|
||||
private long datacenterId;
|
||||
|
||||
// 序列号
|
||||
private long sequence = 0L;
|
||||
|
||||
// 构造函数
|
||||
public SnowflakeIdWorker(long workerId, long datacenterId) {
|
||||
if (workerId > maxWorkerId || workerId < 0) {
|
||||
throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", maxWorkerId));
|
||||
}
|
||||
if (datacenterId > maxDatacenterId || datacenterId < 0) {
|
||||
throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId));
|
||||
}
|
||||
this.workerId = workerId;
|
||||
this.datacenterId = datacenterId;
|
||||
}
|
||||
|
||||
// 获取下一个ID
|
||||
public synchronized long nextId() {
|
||||
long timestamp = timeGen();
|
||||
|
||||
if (timestamp < lastTimestamp) {
|
||||
throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
|
||||
}
|
||||
|
||||
if (lastTimestamp == timestamp) {
|
||||
sequence = (sequence + 1) & sequenceMask;
|
||||
if (sequence == 0) {
|
||||
timestamp = tilNextMillis(lastTimestamp);
|
||||
}
|
||||
} else {
|
||||
sequence = 0L;
|
||||
}
|
||||
|
||||
lastTimestamp = timestamp;
|
||||
|
||||
return ((timestamp - twepoch) << timestampLeftShift) | (datacenterId << datacenterIdShift) | (workerId << workerIdShift) | sequence;
|
||||
}
|
||||
|
||||
// 阻塞到下一个毫秒,直到获得新的时间戳
|
||||
private long tilNextMillis(long lastTimestamp) {
|
||||
long timestamp = timeGen();
|
||||
while (timestamp <= lastTimestamp) {
|
||||
timestamp = timeGen();
|
||||
}
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
// 获取当前时间戳
|
||||
private long timeGen() {
|
||||
return System.currentTimeMillis();
|
||||
}
|
||||
|
||||
// 测试
|
||||
// public static void main(String[] args) {
|
||||
//
|
||||
// for (int i = 0; i < 100; i++) {
|
||||
// System.out.println(idWorker.nextId());
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package cn.iocoder.yudao.module.hshy.dal.dataobject.extend;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 商品扩展 DO
|
||||
*
|
||||
* @author 超级管理员
|
||||
*/
|
||||
@TableName("product_extend")
|
||||
@KeySequence("product_extend_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ExtendDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 是否是推广商品(0否 1是)
|
||||
*/
|
||||
private Integer isPromotion;
|
||||
/**
|
||||
* 是否是指定商品(0否 1是)
|
||||
*/
|
||||
private Integer isAppoint;
|
||||
/**
|
||||
* 是否是特殊商品(0否 1是)
|
||||
*/
|
||||
private Integer isSpecial;
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 商品 SPU 编号
|
||||
*/
|
||||
private Long spuId;
|
||||
/**
|
||||
* 商品 SKU 编号
|
||||
*/
|
||||
private Long skuId;
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
private LocalDateTime deletedTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package cn.iocoder.yudao.module.hshy.dal.dataobject.pointcongeal;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 用户积分金额冻结 DO
|
||||
*
|
||||
* @author 超级管理员
|
||||
*/
|
||||
@TableName("member_point_congeal")
|
||||
@KeySequence("member_point_congeal_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PointCongealDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 会员编码
|
||||
*/
|
||||
private Long memberUserId;
|
||||
/**
|
||||
* 用户积分主键
|
||||
*/
|
||||
private Long pointCongealId;
|
||||
/**
|
||||
* 冻结金额
|
||||
*/
|
||||
private Integer amount;
|
||||
/**
|
||||
* 冻结积分
|
||||
*/
|
||||
private Integer point;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
}
|
|
@ -0,0 +1,101 @@
|
|||
package cn.iocoder.yudao.module.hshy.dal.dataobject.pointexchange;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 会员积分兑换 DO
|
||||
*
|
||||
* @author 超级管理员
|
||||
*/
|
||||
@TableName("member_point_exchange")
|
||||
@KeySequence("member_point_exchange_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PointExchangeDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 会员Id
|
||||
*/
|
||||
private Long memberUserId;
|
||||
/**
|
||||
* 会员类型
|
||||
*/
|
||||
private String userType;
|
||||
/**
|
||||
* 业务类型(余额,商品,其他)
|
||||
*
|
||||
* 枚举 {@link TODO member_point_exchange_type 对应的类}
|
||||
*/
|
||||
private String bizType;
|
||||
/**
|
||||
* 规则明细
|
||||
*/
|
||||
private String jsonRule;
|
||||
/**
|
||||
* 余额.积分
|
||||
*/
|
||||
private Integer balance;
|
||||
/**
|
||||
* 累积支出
|
||||
*/
|
||||
private Integer totalExpense;
|
||||
/**
|
||||
* 累积充值
|
||||
*/
|
||||
private Integer totalRecharge;
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 审核状态
|
||||
*
|
||||
* 枚举 {@link TODO member_point_exchange_audit_type 对应的类}
|
||||
*/
|
||||
private String auditStatus;
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
private String audit;
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
private LocalDateTime auditTime;
|
||||
/**
|
||||
* 审核备注
|
||||
*/
|
||||
private String auditNotes;
|
||||
/**
|
||||
* 商品 SPU 编号
|
||||
*/
|
||||
private Long spuId;
|
||||
/**
|
||||
* 商品 SKU 编号
|
||||
*/
|
||||
private Long skuId;
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
private LocalDateTime deletedTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package cn.iocoder.yudao.module.hshy.dal.dataobject.pointrule;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 规则 DO
|
||||
*
|
||||
* @author 唐
|
||||
*/
|
||||
@TableName("member_point_rule")
|
||||
@KeySequence("member_point_rule_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PointRuleDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 类型(天数,时间,条款,区间,升级,降级)
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
private LocalDateTime deletedTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package cn.iocoder.yudao.module.hshy.dal.dataobject.pointruleitem;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 规则明细 DO
|
||||
*
|
||||
* @author 唐
|
||||
*/
|
||||
@TableName("member_point_rule_item")
|
||||
@KeySequence("member_point_rule_item_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PointRuleItemDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private Long code;
|
||||
/**
|
||||
* 规则类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
private String label;
|
||||
/**
|
||||
* 开始键值
|
||||
*/
|
||||
private String starValue;
|
||||
/**
|
||||
* 结束键值
|
||||
*/
|
||||
private String endValue;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 颜色类型
|
||||
*/
|
||||
private String colorType;
|
||||
/**
|
||||
* css 样式
|
||||
*/
|
||||
private String cssClass;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package cn.iocoder.yudao.module.hshy.dal.dataobject.userblack;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 会员黑名单 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("member_user_black_list")
|
||||
@KeySequence("member_user_black_list_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserBlackDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 会员编号
|
||||
*/
|
||||
private Long memberUserId;
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package cn.iocoder.yudao.module.hshy.dal.dataobject.userconfig;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 会员条件配置 DO
|
||||
*
|
||||
* @author 超级管理员
|
||||
*/
|
||||
@TableName("member_user_config")
|
||||
@KeySequence("member_user_config_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserConfigDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 会员编码
|
||||
*/
|
||||
private Long memberUserId;
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
private String bizType;
|
||||
/**
|
||||
* 前置条件
|
||||
*/
|
||||
private String beforeJson;
|
||||
/**
|
||||
* 后置条件
|
||||
*/
|
||||
private String afterJson;
|
||||
/**
|
||||
* 业务值
|
||||
*/
|
||||
private String bizValue;
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package cn.iocoder.yudao.module.hshy.dal.mysql.extend;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.extend.ExtendDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.extend.vo.*;
|
||||
|
||||
/**
|
||||
* 商品扩展 Mapper
|
||||
*
|
||||
* @author 超级管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface ExtendMapper extends BaseMapperX<ExtendDO> {
|
||||
|
||||
default PageResult<ExtendDO> selectPage(ExtendPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ExtendDO>()
|
||||
.eqIfPresent(ExtendDO::getIsPromotion, reqVO.getIsPromotion())
|
||||
.eqIfPresent(ExtendDO::getIsAppoint, reqVO.getIsAppoint())
|
||||
.eqIfPresent(ExtendDO::getIsSpecial, reqVO.getIsSpecial())
|
||||
.eqIfPresent(ExtendDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ExtendDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(ExtendDO::getSpuId, reqVO.getSpuId())
|
||||
.eqIfPresent(ExtendDO::getSkuId, reqVO.getSkuId())
|
||||
.betweenIfPresent(ExtendDO::getCreateTime, reqVO.getCreateTime())
|
||||
.betweenIfPresent(ExtendDO::getDeletedTime, reqVO.getDeletedTime())
|
||||
.orderByDesc(ExtendDO::getId));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package cn.iocoder.yudao.module.hshy.dal.mysql.pointcongeal;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.pointcongeal.PointCongealDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.pointcongeal.vo.*;
|
||||
|
||||
/**
|
||||
* 用户积分金额冻结 Mapper
|
||||
*
|
||||
* @author 超级管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface PointCongealMapper extends BaseMapperX<PointCongealDO> {
|
||||
|
||||
default PageResult<PointCongealDO> selectPage(PointCongealPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PointCongealDO>()
|
||||
.eqIfPresent(PointCongealDO::getMemberUserId, reqVO.getMemberUserId())
|
||||
.eqIfPresent(PointCongealDO::getPointCongealId, reqVO.getPointCongealId())
|
||||
.eqIfPresent(PointCongealDO::getAmount, reqVO.getAmount())
|
||||
.eqIfPresent(PointCongealDO::getPoint, reqVO.getPoint())
|
||||
.eqIfPresent(PointCongealDO::getDescription, reqVO.getDescription())
|
||||
.betweenIfPresent(PointCongealDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(PointCongealDO::getId));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package cn.iocoder.yudao.module.hshy.dal.mysql.pointexchange;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.pointexchange.PointExchangeDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.pointexchange.vo.*;
|
||||
|
||||
/**
|
||||
* 会员积分兑换 Mapper
|
||||
*
|
||||
* @author 超级管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface PointExchangeMapper extends BaseMapperX<PointExchangeDO> {
|
||||
|
||||
default PageResult<PointExchangeDO> selectPage(PointExchangePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PointExchangeDO>()
|
||||
.eqIfPresent(PointExchangeDO::getMemberUserId, reqVO.getMemberUserId())
|
||||
.eqIfPresent(PointExchangeDO::getUserType, reqVO.getUserType())
|
||||
.eqIfPresent(PointExchangeDO::getBizType, reqVO.getBizType())
|
||||
.eqIfPresent(PointExchangeDO::getJsonRule, reqVO.getJsonRule())
|
||||
.eqIfPresent(PointExchangeDO::getBalance, reqVO.getBalance())
|
||||
.eqIfPresent(PointExchangeDO::getTotalExpense, reqVO.getTotalExpense())
|
||||
.eqIfPresent(PointExchangeDO::getTotalRecharge, reqVO.getTotalRecharge())
|
||||
.eqIfPresent(PointExchangeDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(PointExchangeDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(PointExchangeDO::getAuditStatus, reqVO.getAuditStatus())
|
||||
.eqIfPresent(PointExchangeDO::getAudit, reqVO.getAudit())
|
||||
.betweenIfPresent(PointExchangeDO::getAuditTime, reqVO.getAuditTime())
|
||||
.eqIfPresent(PointExchangeDO::getAuditNotes, reqVO.getAuditNotes())
|
||||
.eqIfPresent(PointExchangeDO::getSpuId, reqVO.getSpuId())
|
||||
.eqIfPresent(PointExchangeDO::getSkuId, reqVO.getSkuId())
|
||||
.betweenIfPresent(PointExchangeDO::getCreateTime, reqVO.getCreateTime())
|
||||
.betweenIfPresent(PointExchangeDO::getDeletedTime, reqVO.getDeletedTime())
|
||||
.orderByDesc(PointExchangeDO::getId));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package cn.iocoder.yudao.module.hshy.dal.mysql.pointrule;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.pointrule.PointRuleDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.pointrule.vo.*;
|
||||
|
||||
/**
|
||||
* 规则 Mapper
|
||||
*
|
||||
* @author 唐
|
||||
*/
|
||||
@Mapper
|
||||
public interface PointRuleMapper extends BaseMapperX<PointRuleDO> {
|
||||
|
||||
default PageResult<PointRuleDO> selectPage(PointRulePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PointRuleDO>()
|
||||
.eqIfPresent(PointRuleDO::getType, reqVO.getType())
|
||||
.likeIfPresent(PointRuleDO::getName, reqVO.getName())
|
||||
.eqIfPresent(PointRuleDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(PointRuleDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(PointRuleDO::getCreateTime, reqVO.getCreateTime())
|
||||
.betweenIfPresent(PointRuleDO::getDeletedTime, reqVO.getDeletedTime())
|
||||
.orderByDesc(PointRuleDO::getId));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package cn.iocoder.yudao.module.hshy.dal.mysql.pointruleitem;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.pointruleitem.PointRuleItemDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.pointruleitem.vo.*;
|
||||
|
||||
/**
|
||||
* 规则明细 Mapper
|
||||
*
|
||||
* @author 唐
|
||||
*/
|
||||
@Mapper
|
||||
public interface PointRuleItemMapper extends BaseMapperX<PointRuleItemDO> {
|
||||
|
||||
default PageResult<PointRuleItemDO> selectPage(PointRuleItemPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PointRuleItemDO>()
|
||||
.eqIfPresent(PointRuleItemDO::getType, reqVO.getType())
|
||||
.eqIfPresent(PointRuleItemDO::getLabel, reqVO.getLabel())
|
||||
.eqIfPresent(PointRuleItemDO::getStarValue, reqVO.getStarValue())
|
||||
.eqIfPresent(PointRuleItemDO::getEndValue, reqVO.getEndValue())
|
||||
.eqIfPresent(PointRuleItemDO::getSort, reqVO.getSort())
|
||||
.eqIfPresent(PointRuleItemDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(PointRuleItemDO::getColorType, reqVO.getColorType())
|
||||
.eqIfPresent(PointRuleItemDO::getCssClass, reqVO.getCssClass())
|
||||
.eqIfPresent(PointRuleItemDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(PointRuleItemDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(PointRuleItemDO::getId));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package cn.iocoder.yudao.module.hshy.dal.mysql.userblack;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.userblack.UserBlackDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.userblack.vo.*;
|
||||
|
||||
/**
|
||||
* 会员黑名单 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserBlackMapper extends BaseMapperX<UserBlackDO> {
|
||||
|
||||
default PageResult<UserBlackDO> selectPage(UserBlackPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<UserBlackDO>()
|
||||
.eqIfPresent(UserBlackDO::getMemberUserId, reqVO.getMemberUserId())
|
||||
.betweenIfPresent(UserBlackDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(UserBlackDO::getId));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package cn.iocoder.yudao.module.hshy.dal.mysql.userconfig;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.userconfig.UserConfigDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.userconfig.vo.*;
|
||||
|
||||
/**
|
||||
* 会员条件配置 Mapper
|
||||
*
|
||||
* @author 超级管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserConfigMapper extends BaseMapperX<UserConfigDO> {
|
||||
|
||||
default PageResult<UserConfigDO> selectPage(UserConfigPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<UserConfigDO>()
|
||||
.eqIfPresent(UserConfigDO::getMemberUserId, reqVO.getMemberUserId())
|
||||
.eqIfPresent(UserConfigDO::getBizType, reqVO.getBizType())
|
||||
.eqIfPresent(UserConfigDO::getBeforeJson, reqVO.getBeforeJson())
|
||||
.eqIfPresent(UserConfigDO::getAfterJson, reqVO.getAfterJson())
|
||||
.eqIfPresent(UserConfigDO::getBizValue, reqVO.getBizValue())
|
||||
.betweenIfPresent(UserConfigDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(UserConfigDO::getId));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package cn.iocoder.yudao.module.hshy.framework.security.config;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.framework.security.config.AuthorizeRequestsCustomizer;
|
||||
import cn.iocoder.yudao.module.product.enums.ApiConstants;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer;
|
||||
|
||||
/**
|
||||
* Product 模块的 Security 配置
|
||||
*/
|
||||
@Configuration("productSecurityConfiguration")
|
||||
public class SecurityConfiguration {
|
||||
|
||||
@Bean("productAuthorizeRequestsCustomizer")
|
||||
public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() {
|
||||
return new AuthorizeRequestsCustomizer() {
|
||||
|
||||
@Override
|
||||
public void customize(AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry registry) {
|
||||
// Swagger 接口文档
|
||||
registry.requestMatchers("/v3/api-docs/**").permitAll()
|
||||
.requestMatchers("/webjars/**").permitAll()
|
||||
.requestMatchers("/swagger-ui").permitAll()
|
||||
.requestMatchers("/swagger-ui/**").permitAll();
|
||||
// Spring Boot Actuator 的安全配置
|
||||
registry.requestMatchers("/actuator").permitAll()
|
||||
.requestMatchers("/actuator/**").permitAll();
|
||||
// Druid 监控
|
||||
registry.requestMatchers("/druid/**").permitAll();
|
||||
// RPC 服务的安全配置
|
||||
registry.requestMatchers(ApiConstants.PREFIX + "/**").permitAll();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package cn.iocoder.yudao.module.hshy.service.extend;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.Valid;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.extend.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.extend.ExtendDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 商品扩展 Service 接口
|
||||
*
|
||||
* @author 超级管理员
|
||||
*/
|
||||
public interface ExtendService {
|
||||
|
||||
/**
|
||||
* 创建商品扩展
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createExtend(@Valid ExtendSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新商品扩展
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateExtend(@Valid ExtendSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除商品扩展
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteExtend(Integer id);
|
||||
|
||||
/**
|
||||
* 获得商品扩展
|
||||
*
|
||||
* @param spuId 编号
|
||||
* @return 商品扩展
|
||||
*/
|
||||
ExtendDO getExtend(Integer spuId);
|
||||
|
||||
/**
|
||||
* 获得商品扩展分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 商品扩展分页
|
||||
*/
|
||||
PageResult<ExtendDO> getExtendPage(ExtendPageReqVO pageReqVO);
|
||||
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
package cn.iocoder.yudao.module.hshy.service.extend;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.extend.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.extend.ExtendDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.hshy.dal.mysql.extend.ExtendMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.hshy.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 商品扩展 Service 实现类
|
||||
*
|
||||
* @author 超级管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ExtendServiceImpl implements ExtendService {
|
||||
|
||||
@Resource
|
||||
private ExtendMapper extendMapper;
|
||||
|
||||
@Override
|
||||
public Integer createExtend(ExtendSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ExtendDO extend = BeanUtils.toBean(createReqVO, ExtendDO.class);
|
||||
extendMapper.insert(extend);
|
||||
// 返回
|
||||
return extend.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateExtend(ExtendSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateExtendExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ExtendDO updateObj = BeanUtils.toBean(updateReqVO, ExtendDO.class);
|
||||
extendMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteExtend(Integer id) {
|
||||
// 校验存在
|
||||
validateExtendExists(id);
|
||||
// 删除
|
||||
extendMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateExtendExists(Integer id) {
|
||||
if (extendMapper.selectById(id) == null) {
|
||||
throw exception(EXTEND_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExtendDO getExtend(Integer spuId) {
|
||||
return extendMapper.selectOne(new LambdaQueryWrapper<>(ExtendDO.class)
|
||||
.eq(ExtendDO::getSpuId, spuId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ExtendDO> getExtendPage(ExtendPageReqVO pageReqVO) {
|
||||
return extendMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package cn.iocoder.yudao.module.hshy.service.pointcongeal;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.pointcongeal.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.pointcongeal.PointCongealDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 用户积分金额冻结 Service 接口
|
||||
*
|
||||
* @author 超级管理员
|
||||
*/
|
||||
public interface PointCongealService {
|
||||
|
||||
/**
|
||||
* 创建用户积分金额冻结
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createPointCongeal(@Valid PointCongealSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新用户积分金额冻结
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePointCongeal(@Valid PointCongealSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除用户积分金额冻结
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePointCongeal(Integer id);
|
||||
|
||||
/**
|
||||
* 获得用户积分金额冻结
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 用户积分金额冻结
|
||||
*/
|
||||
PointCongealDO getPointCongeal(Integer id);
|
||||
|
||||
/**
|
||||
* 获得用户积分金额冻结分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 用户积分金额冻结分页
|
||||
*/
|
||||
PageResult<PointCongealDO> getPointCongealPage(PointCongealPageReqVO pageReqVO);
|
||||
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package cn.iocoder.yudao.module.hshy.service.pointcongeal;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.pointcongeal.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.pointcongeal.PointCongealDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.hshy.dal.mysql.pointcongeal.PointCongealMapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.hshy.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 用户积分金额冻结 Service 实现类
|
||||
*
|
||||
* @author 超级管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PointCongealServiceImpl implements PointCongealService {
|
||||
|
||||
@Resource
|
||||
private PointCongealMapper pointCongealMapper;
|
||||
|
||||
@Override
|
||||
public Integer createPointCongeal(PointCongealSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
PointCongealDO pointCongeal = BeanUtils.toBean(createReqVO, PointCongealDO.class);
|
||||
pointCongealMapper.insert(pointCongeal);
|
||||
// 返回
|
||||
return pointCongeal.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePointCongeal(PointCongealSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validatePointCongealExists(updateReqVO.getId());
|
||||
// 更新
|
||||
PointCongealDO updateObj = BeanUtils.toBean(updateReqVO, PointCongealDO.class);
|
||||
pointCongealMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePointCongeal(Integer id) {
|
||||
// 校验存在
|
||||
validatePointCongealExists(id);
|
||||
// 删除
|
||||
pointCongealMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validatePointCongealExists(Integer id) {
|
||||
if (pointCongealMapper.selectById(id) == null) {
|
||||
throw exception(POINT_CONGEAL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PointCongealDO getPointCongeal(Integer id) {
|
||||
return pointCongealMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PointCongealDO> getPointCongealPage(PointCongealPageReqVO pageReqVO) {
|
||||
return pointCongealMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package cn.iocoder.yudao.module.hshy.service.pointexchange;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.pointexchange.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.pointexchange.PointExchangeDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 会员积分兑换 Service 接口
|
||||
*
|
||||
* @author 超级管理员
|
||||
*/
|
||||
public interface PointExchangeService {
|
||||
|
||||
/**
|
||||
* 创建会员积分兑换
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createPointExchange(@Valid PointExchangeSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新会员积分兑换
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePointExchange(@Valid PointExchangeSaveReqVO updateReqVO);
|
||||
|
||||
|
||||
/**
|
||||
* 更新会员积分兑换
|
||||
*
|
||||
* @param auditReqVO 更新信息
|
||||
*/
|
||||
void auditPointExchange(@Valid PointExchangeAuditReqVO auditReqVO);
|
||||
|
||||
/**
|
||||
* 删除会员积分兑换
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePointExchange(Integer id);
|
||||
|
||||
/**
|
||||
* 获得会员积分兑换
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 会员积分兑换
|
||||
*/
|
||||
PointExchangeDO getPointExchange(Integer id);
|
||||
|
||||
/**
|
||||
* 获得会员积分兑换分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 会员积分兑换分页
|
||||
*/
|
||||
PageResult<PointExchangeDO> getPointExchangePage(PointExchangePageReqVO pageReqVO);
|
||||
|
||||
}
|
|
@ -0,0 +1,90 @@
|
|||
package cn.iocoder.yudao.module.hshy.service.pointexchange;
|
||||
|
||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.pointexchange.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.pointexchange.PointExchangeDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.hshy.dal.mysql.pointexchange.PointExchangeMapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.hshy.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 会员积分兑换 Service 实现类
|
||||
*
|
||||
* @author 超级管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PointExchangeServiceImpl implements PointExchangeService {
|
||||
|
||||
@Resource
|
||||
private PointExchangeMapper pointExchangeMapper;
|
||||
|
||||
@Override
|
||||
public Integer createPointExchange(PointExchangeSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
PointExchangeDO pointExchange = BeanUtils.toBean(createReqVO, PointExchangeDO.class);
|
||||
pointExchangeMapper.insert(pointExchange);
|
||||
// 返回
|
||||
return pointExchange.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePointExchange(PointExchangeSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validatePointExchangeExists(updateReqVO.getId());
|
||||
// 更新
|
||||
PointExchangeDO updateObj = BeanUtils.toBean(updateReqVO, PointExchangeDO.class);
|
||||
pointExchangeMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void auditPointExchange(PointExchangeAuditReqVO auditReqVO) {
|
||||
|
||||
// 校验存在
|
||||
validatePointExchangeExists(auditReqVO.getId());
|
||||
// 更新
|
||||
PointExchangeDO updateObj = BeanUtils.toBean(auditReqVO, PointExchangeDO.class);
|
||||
updateObj.setAuditTime(LocalDateTime.now());
|
||||
updateObj.setAudit(WebFrameworkUtils.getLoginUserId().toString());
|
||||
pointExchangeMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePointExchange(Integer id) {
|
||||
// 校验存在
|
||||
validatePointExchangeExists(id);
|
||||
// 删除
|
||||
pointExchangeMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validatePointExchangeExists(Integer id) {
|
||||
if (pointExchangeMapper.selectById(id) == null) {
|
||||
throw exception(POINT_EXCHANGE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PointExchangeDO getPointExchange(Integer id) {
|
||||
return pointExchangeMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PointExchangeDO> getPointExchangePage(PointExchangePageReqVO pageReqVO) {
|
||||
return pointExchangeMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package cn.iocoder.yudao.module.hshy.service.pointrule;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.pointrule.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.pointrule.PointRuleDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 规则 Service 接口
|
||||
*
|
||||
* @author 唐
|
||||
*/
|
||||
public interface PointRuleService {
|
||||
|
||||
/**
|
||||
* 创建规则
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createPointRule(@Valid PointRuleSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新规则
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePointRule(@Valid PointRuleSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除规则
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePointRule(Integer id);
|
||||
|
||||
/**
|
||||
* 获得规则
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 规则
|
||||
*/
|
||||
PointRuleDO getPointRule(Integer id);
|
||||
|
||||
/**
|
||||
* 获得规则分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 规则分页
|
||||
*/
|
||||
PageResult<PointRuleDO> getPointRulePage(PointRulePageReqVO pageReqVO);
|
||||
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package cn.iocoder.yudao.module.hshy.service.pointrule;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.pointrule.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.pointrule.PointRuleDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.hshy.dal.mysql.pointrule.PointRuleMapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.hshy.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 规则 Service 实现类
|
||||
*
|
||||
* @author 唐
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PointRuleServiceImpl implements PointRuleService {
|
||||
|
||||
@Resource
|
||||
private PointRuleMapper pointRuleMapper;
|
||||
|
||||
@Override
|
||||
public Integer createPointRule(PointRuleSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
PointRuleDO pointRule = BeanUtils.toBean(createReqVO, PointRuleDO.class);
|
||||
pointRuleMapper.insert(pointRule);
|
||||
// 返回
|
||||
return pointRule.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePointRule(PointRuleSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validatePointRuleExists(updateReqVO.getId());
|
||||
// 更新
|
||||
PointRuleDO updateObj = BeanUtils.toBean(updateReqVO, PointRuleDO.class);
|
||||
pointRuleMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePointRule(Integer id) {
|
||||
// 校验存在
|
||||
validatePointRuleExists(id);
|
||||
// 删除
|
||||
pointRuleMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validatePointRuleExists(Integer id) {
|
||||
if (pointRuleMapper.selectById(id) == null) {
|
||||
throw exception(POINT_RULE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PointRuleDO getPointRule(Integer id) {
|
||||
return pointRuleMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PointRuleDO> getPointRulePage(PointRulePageReqVO pageReqVO) {
|
||||
return pointRuleMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package cn.iocoder.yudao.module.hshy.service.pointruleitem;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.pointruleitem.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.pointruleitem.PointRuleItemDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 规则明细 Service 接口
|
||||
*
|
||||
* @author 唐
|
||||
*/
|
||||
public interface PointRuleItemService {
|
||||
|
||||
/**
|
||||
* 创建规则明细
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createPointRuleItem(@Valid PointRuleItemSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新规则明细
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePointRuleItem(@Valid PointRuleItemSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除规则明细
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePointRuleItem(Integer id);
|
||||
|
||||
/**
|
||||
* 获得规则明细
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 规则明细
|
||||
*/
|
||||
PointRuleItemDO getPointRuleItem(Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 根据规则类型获取规则明细
|
||||
*
|
||||
* @param type 编号
|
||||
* @return 规则明细
|
||||
*/
|
||||
List<PointRuleItemDO> getPointRuleItemList(String type);
|
||||
|
||||
|
||||
/**
|
||||
* 获得规则明细分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 规则明细分页
|
||||
*/
|
||||
PageResult<PointRuleItemDO> getPointRuleItemPage(PointRuleItemPageReqVO pageReqVO);
|
||||
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
package cn.iocoder.yudao.module.hshy.service.pointruleitem;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.hshy.convert.SnowflakeIdWorker;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.pointruleitem.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.pointruleitem.PointRuleItemDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.hshy.dal.mysql.pointruleitem.PointRuleItemMapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.hshy.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 规则明细 Service 实现类
|
||||
*
|
||||
* @author 唐
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PointRuleItemServiceImpl implements PointRuleItemService {
|
||||
|
||||
@Resource
|
||||
private PointRuleItemMapper pointRuleItemMapper;
|
||||
|
||||
@Override
|
||||
public Integer createPointRuleItem(PointRuleItemSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
PointRuleItemDO pointRuleItem = BeanUtils.toBean(createReqVO, PointRuleItemDO.class);
|
||||
SnowflakeIdWorker idWorker = new SnowflakeIdWorker(0, 0);
|
||||
pointRuleItem.setCode(idWorker.nextId());
|
||||
pointRuleItemMapper.insert(pointRuleItem);
|
||||
// 返回
|
||||
return pointRuleItem.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePointRuleItem(PointRuleItemSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validatePointRuleItemExists(updateReqVO.getId());
|
||||
// 更新
|
||||
PointRuleItemDO updateObj = BeanUtils.toBean(updateReqVO, PointRuleItemDO.class);
|
||||
pointRuleItemMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePointRuleItem(Integer id) {
|
||||
// 校验存在
|
||||
validatePointRuleItemExists(id);
|
||||
// 删除
|
||||
pointRuleItemMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validatePointRuleItemExists(Integer id) {
|
||||
if (pointRuleItemMapper.selectById(id) == null) {
|
||||
throw exception(POINT_RULE_ITEM_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PointRuleItemDO getPointRuleItem(Integer id) {
|
||||
return pointRuleItemMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PointRuleItemDO> getPointRuleItemList(String type) {
|
||||
return pointRuleItemMapper.selectList(new LambdaQueryWrapper<>(PointRuleItemDO.class)
|
||||
.eq(PointRuleItemDO::getType, type));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PointRuleItemDO> getPointRuleItemPage(PointRuleItemPageReqVO pageReqVO) {
|
||||
return pointRuleItemMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package cn.iocoder.yudao.module.hshy.service.userblack;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.userblack.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.userblack.UserBlackDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 会员黑名单 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface UserBlackService {
|
||||
|
||||
/**
|
||||
* 创建会员黑名单
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Boolean createUserBlack(@Valid UserBlackSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新会员黑名单
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateUserBlack(@Valid UserBlackSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除会员黑名单
|
||||
*
|
||||
* @param deleteReqVO 编号
|
||||
*/
|
||||
void deleteUserBlack(UserBlackSaveReqVO deleteReqVO);
|
||||
|
||||
/**
|
||||
* 获得会员黑名单
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
Boolean getUserBlack(long id);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获得所有会员黑名单
|
||||
*
|
||||
*/
|
||||
List<UserBlackDO> listUserBlack();
|
||||
|
||||
/**
|
||||
* 获得会员黑名单分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 会员黑名单分页
|
||||
*/
|
||||
PageResult<UserBlackDO> getUserBlackPage(UserBlackPageReqVO pageReqVO);
|
||||
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
package cn.iocoder.yudao.module.hshy.service.userblack;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.userblack.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.userblack.UserBlackDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.hshy.dal.mysql.userblack.UserBlackMapper;
|
||||
import javax.annotation.Resource;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.hshy.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 会员黑名单 Service 实现类
|
||||
*
|
||||
* @author tpj
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class UserBlackServiceImpl implements UserBlackService {
|
||||
|
||||
@Resource
|
||||
private UserBlackMapper userBlackMapper;
|
||||
|
||||
@Override
|
||||
public Boolean createUserBlack(UserBlackSaveReqVO createReqVO) {
|
||||
// 批量插入
|
||||
List<UserBlackDO> list = new ArrayList<>();
|
||||
//查询会员是否存在
|
||||
List<UserBlackDO> validList =
|
||||
userBlackMapper.selectList(new LambdaQueryWrapper<UserBlackDO>().in(UserBlackDO::getMemberUserId, createReqVO.getMemberUserIds()));
|
||||
for (Long memberUserId : createReqVO.getMemberUserIds()) {
|
||||
//查询会员是否存在
|
||||
boolean isExists = validList.stream().anyMatch(userBlackListDO -> userBlackListDO.getMemberUserId().equals(memberUserId));
|
||||
if (isExists) {
|
||||
continue;
|
||||
}
|
||||
UserBlackDO userBlackListDO = new UserBlackDO();
|
||||
userBlackListDO.setMemberUserId(memberUserId);
|
||||
list.add(userBlackListDO);
|
||||
}
|
||||
return userBlackMapper.insertBatch(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUserBlack(UserBlackSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
// validateUserBlackExists(updateReqVO.getId());
|
||||
// 更新
|
||||
UserBlackDO updateObj = BeanUtils.toBean(updateReqVO, UserBlackDO.class);
|
||||
userBlackMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteUserBlack(UserBlackSaveReqVO deleteReqVO) {
|
||||
// 校验存在
|
||||
userBlackMapper.deleteByIds(deleteReqVO.getMemberUserIds());
|
||||
}
|
||||
|
||||
private Boolean validateUserBlackExists(long id) {
|
||||
List<UserBlackDO> list= userBlackMapper.selectList(new LambdaQueryWrapper<UserBlackDO>().eq(UserBlackDO::getMemberUserId,id));
|
||||
//判断list
|
||||
return list != null && !list.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean getUserBlack(long id) {
|
||||
return validateUserBlackExists(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserBlackDO> listUserBlack() {
|
||||
|
||||
return userBlackMapper.selectList(new LambdaQueryWrapper<>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<UserBlackDO> getUserBlackPage(UserBlackPageReqVO pageReqVO) {
|
||||
return userBlackMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package cn.iocoder.yudao.module.hshy.service.userconfig;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.userconfig.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.userconfig.UserConfigDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 会员条件配置 Service 接口
|
||||
*
|
||||
* @author 超级管理员
|
||||
*/
|
||||
public interface UserConfigService {
|
||||
|
||||
/**
|
||||
* 创建会员条件配置
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createUserConfig(@Valid UserConfigSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新会员条件配置
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateUserConfig(@Valid UserConfigSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除会员条件配置
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteUserConfig(Integer id);
|
||||
|
||||
/**
|
||||
* 获得会员条件配置
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 会员条件配置
|
||||
*/
|
||||
UserConfigDO getUserConfig(Integer id);
|
||||
|
||||
/**
|
||||
* 获得会员条件配置分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 会员条件配置分页
|
||||
*/
|
||||
PageResult<UserConfigDO> getUserConfigPage(UserConfigPageReqVO pageReqVO);
|
||||
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package cn.iocoder.yudao.module.hshy.service.userconfig;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.hshy.controller.admin.userconfig.vo.*;
|
||||
import cn.iocoder.yudao.module.hshy.dal.dataobject.userconfig.UserConfigDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.hshy.dal.mysql.userconfig.UserConfigMapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.hshy.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 会员条件配置 Service 实现类
|
||||
*
|
||||
* @author 超级管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class UserConfigServiceImpl implements UserConfigService {
|
||||
|
||||
@Resource
|
||||
private UserConfigMapper userConfigMapper;
|
||||
|
||||
@Override
|
||||
public Integer createUserConfig(UserConfigSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
UserConfigDO userConfig = BeanUtils.toBean(createReqVO, UserConfigDO.class);
|
||||
userConfigMapper.insert(userConfig);
|
||||
// 返回
|
||||
return userConfig.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUserConfig(UserConfigSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateUserConfigExists(updateReqVO.getId());
|
||||
// 更新
|
||||
UserConfigDO updateObj = BeanUtils.toBean(updateReqVO, UserConfigDO.class);
|
||||
userConfigMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteUserConfig(Integer id) {
|
||||
// 校验存在
|
||||
validateUserConfigExists(id);
|
||||
// 删除
|
||||
userConfigMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateUserConfigExists(Integer id) {
|
||||
if (userConfigMapper.selectById(id) == null) {
|
||||
throw exception(USER_CONFIG_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserConfigDO getUserConfig(Integer id) {
|
||||
return userConfigMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<UserConfigDO> getUserConfigPage(UserConfigPageReqVO pageReqVO) {
|
||||
return userConfigMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
<configuration>
|
||||
<!-- 引用 Spring Boot 的 logback 基础配置 -->
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
|
||||
<!-- 变量 yudao.info.base-package,基础业务包 -->
|
||||
<springProperty scope="context" name="yudao.info.base-package" source="yudao.info.base-package"/>
|
||||
<!-- 格式化输出:%d 表示日期,%X{tid} SkWalking 链路追踪编号,%thread 表示线程名,%-5level:级别从左显示 5 个字符宽度,%msg:日志消息,%n是换行符 -->
|
||||
<property name="PATTERN_DEFAULT" value="%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} | %highlight(${LOG_LEVEL_PATTERN:-%5p} ${PID:- }) | %boldYellow(%thread [%tid]) %boldGreen(%-40.40logger{39}) | %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/>
|
||||
|
||||
<!-- 控制台 Appender -->
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<pattern>${PATTERN_DEFAULT}</pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 文件 Appender -->
|
||||
<!-- 参考 Spring Boot 的 file-appender.xml 编写 -->
|
||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<pattern>${PATTERN_DEFAULT}</pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
<!-- 日志文件名 -->
|
||||
<file>${LOG_FILE}</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!-- 滚动后的日志文件名 -->
|
||||
<fileNamePattern>${LOGBACK_ROLLINGPOLICY_FILE_NAME_PATTERN:-${LOG_FILE}.%d{yyyy-MM-dd}.%i.gz}</fileNamePattern>
|
||||
<!-- 启动服务时,是否清理历史日志,一般不建议清理 -->
|
||||
<cleanHistoryOnStart>${LOGBACK_ROLLINGPOLICY_CLEAN_HISTORY_ON_START:-false}</cleanHistoryOnStart>
|
||||
<!-- 日志文件,到达多少容量,进行滚动 -->
|
||||
<maxFileSize>${LOGBACK_ROLLINGPOLICY_MAX_FILE_SIZE:-10MB}</maxFileSize>
|
||||
<!-- 日志文件的总大小,0 表示不限制 -->
|
||||
<totalSizeCap>${LOGBACK_ROLLINGPOLICY_TOTAL_SIZE_CAP:-0}</totalSizeCap>
|
||||
<!-- 日志文件的保留天数 -->
|
||||
<maxHistory>${LOGBACK_ROLLINGPOLICY_MAX_HISTORY:-30}</maxHistory>
|
||||
</rollingPolicy>
|
||||
</appender>
|
||||
<!-- 异步写入日志,提升性能 -->
|
||||
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
|
||||
<!-- 不丢失日志。默认的,如果队列的 80% 已满,则会丢弃 TRACT、DEBUG、INFO 级别的日志 -->
|
||||
<discardingThreshold>0</discardingThreshold>
|
||||
<!-- 更改默认的队列的深度,该值会影响性能。默认值为 256 -->
|
||||
<queueSize>256</queueSize>
|
||||
<appender-ref ref="FILE"/>
|
||||
</appender>
|
||||
|
||||
<!-- SkyWalking GRPC 日志收集,实现日志中心。注意:SkyWalking 8.4.0 版本开始支持 -->
|
||||
<appender name="GRPC" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<pattern>${PATTERN_DEFAULT}</pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 本地环境 -->
|
||||
<springProfile name="local">
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT"/>
|
||||
<appender-ref ref="GRPC"/> <!-- 本地环境下,如果不想接入 SkyWalking 日志服务,可以注释掉本行 -->
|
||||
<appender-ref ref="ASYNC"/> <!-- 本地环境下,如果不想打印日志,可以注释掉本行 -->
|
||||
</root>
|
||||
</springProfile>
|
||||
<!-- 其它环境 -->
|
||||
<springProfile name="dev,test,stage,prod,default">
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT"/>
|
||||
<appender-ref ref="ASYNC"/>
|
||||
<appender-ref ref="GRPC"/>
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
</configuration>
|
|
@ -0,0 +1,12 @@
|
|||
<?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="cn.iocoder.yudao.module.hshy.dal.mysql.extend.ExtendMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,12 @@
|
|||
<?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="cn.iocoder.yudao.module.hshy.dal.mysql.pointcongeal.PointCongealMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,12 @@
|
|||
<?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="cn.iocoder.yudao.module.hshy.dal.mysql.pointexchange.PointExchangeMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,12 @@
|
|||
<?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="cn.iocoder.yudao.module.hshy.dal.mysql.pointrule.PointRuleMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,12 @@
|
|||
<?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="cn.iocoder.yudao.module.hshy.dal.mysql.pointruleitem.PointRuleItemMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,12 @@
|
|||
<?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="cn.iocoder.yudao.module.hshy.dal.mysql.userblack.UserBlackMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,12 @@
|
|||
<?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="cn.iocoder.yudao.module.hshy.dal.mysql.userconfig.UserConfigMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue