分销模块基础代码
parent
b3afcfaa72
commit
3d151e97ef
|
|
@ -0,0 +1,33 @@
|
|||
package cn.iocoder.yudao.module.hsfx.api.brokeragebaseconfig;
|
||||
|
||||
import cn.iocoder.yudao.module.hsfx.api.brokeragebaseconfig.dto.RpcBrokerageBaseConfigDto;
|
||||
import cn.iocoder.yudao.module.hsfx.api.brokeragelevelhistory.dto.RpcBroLevelHisRespDto;
|
||||
import cn.iocoder.yudao.module.hsfx.enums.ApiConstants;
|
||||
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.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
/**
|
||||
* @author izao
|
||||
* @Description 分销基础配置远程调用接口
|
||||
* @date 2024/12/26 10:57
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "RPC服务-分销基础配置远程调用接口")
|
||||
public interface BrokerageBaseConfigApi {
|
||||
String PREFIX = ApiConstants.PREFIX + "/brokerage-baseconfig";//controller层访问前缀
|
||||
|
||||
/**
|
||||
* @Description 根据id获取分销基础配置详情
|
||||
* @author izao
|
||||
* @date 2024/12/26 11:58
|
||||
* @param id
|
||||
* @return RpcBroLevelHisRespDto
|
||||
*/
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@Operation(summary = "根据id获取分销基础配置详情")
|
||||
@Parameter(name = "id", description = "分销基础配置id", example = "1", required = true)
|
||||
RpcBrokerageBaseConfigDto getBroBaseConfigById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package cn.iocoder.yudao.module.hsfx.api.brokeragebaseconfig.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "RPC服务 - 分销基础配置 返回DTO")
|
||||
@Data
|
||||
public class RpcBrokerageBaseConfigDto {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1354")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "基础配置json")
|
||||
private String baseConfigJson;
|
||||
|
||||
@Schema(description = "结算设置配置json")
|
||||
private String settleConfigJson;
|
||||
|
||||
@Schema(description = "文字设置配置json")
|
||||
private String textConfigJson;
|
||||
|
||||
@Schema(description = "业绩中心配置json")
|
||||
private String perforConfigJson;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package cn.iocoder.yudao.module.hsfx.api.brokeragelevel;
|
||||
|
||||
import cn.iocoder.yudao.module.hsfx.api.brokeragelevel.dto.RpcBrokerageLevelDto;
|
||||
import cn.iocoder.yudao.module.hsfx.enums.ApiConstants;
|
||||
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.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
/**
|
||||
* @author izao
|
||||
* @Description 分销商等级远程调用接口
|
||||
* @date 2024/12/26 11:05
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "RPC服务-分销商等级")
|
||||
public interface BrokerageLevelApi {
|
||||
String PREFIX = ApiConstants.PREFIX + "/brokerage-level";//controller层访问前缀
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* @return RpcBrokerageLevelDto
|
||||
* @Description 获取分销商等级详情
|
||||
* @author izao
|
||||
* @date 2024/12/26 11:44
|
||||
*/
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@Operation(summary = "获取分销用户详情")
|
||||
@Parameter(name = "id", description = "分销用户id", example = "1", required = true)
|
||||
RpcBrokerageLevelDto getBroLevelHisById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package cn.iocoder.yudao.module.hsfx.api.brokeragelevel.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "RPC服务 - 分销商等级返回DTO")
|
||||
@Data
|
||||
public class RpcBrokerageLevelDto {
|
||||
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "23559")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "等级 默认等级、一级、二级、三级等")
|
||||
private String level;
|
||||
|
||||
@Schema(description = "等级名称")
|
||||
private String levelName;
|
||||
|
||||
@Schema(description = "基础配置json;一级、二级、三级佣金比例、培育奖等")
|
||||
private String baseConfig;
|
||||
|
||||
@Schema(description = "升级策略配置json 升级到此等级需要的条件")
|
||||
private String upgradeConfig;
|
||||
|
||||
@Schema(description = "降级策略配置json 不满足此条件则降级")
|
||||
private String downgradeConfig;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package cn.iocoder.yudao.module.hsfx.api.brokeragelevelhistory;
|
||||
|
||||
import cn.iocoder.yudao.module.hsfx.api.brokeragelevelhistory.dto.RpcBroLevelHisRespDto;
|
||||
import cn.iocoder.yudao.module.hsfx.enums.ApiConstants;
|
||||
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.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
/**
|
||||
* @Description 分销等级变更历史记录远程调用接口
|
||||
* @author izao
|
||||
* @date 2024/12/26 10:57
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "RPC服务-分销等级变更历史记录")
|
||||
public interface BroLevelHisApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/brokerage-levelhistory";//controller层访问前缀
|
||||
|
||||
/**
|
||||
* @Description 获取等级变更历史记录详情
|
||||
* @author izao
|
||||
* @date 2024/12/26 11:52
|
||||
* @param id
|
||||
* @return RpcBroLevelHisRespDto
|
||||
*/
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@Operation(summary = "获取等级变更历史记录详情")
|
||||
@Parameter(name = "id", description = "等级变更历史记录id", example = "1", required = true)
|
||||
RpcBroLevelHisRespDto getBroLevelHisById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package cn.iocoder.yudao.module.hsfx.api.brokeragelevelhistory.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "RPC服务 - 分销商等级变更历史记录返回DTO")
|
||||
@Data
|
||||
public class RpcBroLevelHisRespDto {
|
||||
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20579")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "分销用户id", example = "29277")
|
||||
private Long brokerageUserId;
|
||||
|
||||
@Schema(description = "初始等级id", example = "28982")
|
||||
private Long initLevelId;
|
||||
|
||||
@Schema(description = "目标(现在)等级id", example = "5160")
|
||||
private Long toLevelId;
|
||||
|
||||
@Schema(description = "变动原因", example = "不满足条件自动降级")
|
||||
private String changeReason;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private String brokerageMemberNickName;//分销用户会员昵称
|
||||
|
||||
private String initLevelName;//初始等级名称
|
||||
|
||||
private String toLevelName;//变动目标等级
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package cn.iocoder.yudao.module.hsfx.api.brokerageuser;
|
||||
|
||||
import cn.iocoder.yudao.module.hsfx.api.brokerageuser.dto.RpcBrokerageUserRespDto;
|
||||
import cn.iocoder.yudao.module.hsfx.enums.ApiConstants;
|
||||
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.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* @Description 分销用户远程调用接口
|
||||
* @Author izao
|
||||
* @Date 2024/12/26 10:31
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "RPC服务-分销用户")
|
||||
public interface BrokerageUserApi {
|
||||
String PREFIX = ApiConstants.PREFIX + "/brokerage-user";//controller层访问前缀
|
||||
|
||||
|
||||
/**
|
||||
* @Description 远程调用 获取分销用户详情
|
||||
* @author izao
|
||||
* @date 2024/12/26 10:51
|
||||
* @param id
|
||||
* @return BrokerageUserRespDto
|
||||
*/
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@Operation(summary = "获取分销用户详情")
|
||||
@Parameter(name = "id", description = "分销用户id", example = "1", required = true)
|
||||
RpcBrokerageUserRespDto getBrokerageUserById(@RequestParam("id") Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package cn.iocoder.yudao.module.hsfx.api.brokerageuser.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "RPC服务 - 分销用户返回DTO")
|
||||
@Data
|
||||
public class RpcBrokerageUserRespDto {
|
||||
@Schema(description = "分销商id", example = "8493")
|
||||
private Long id;//分销商id
|
||||
|
||||
@Schema(description = "会员id", example = "2354")
|
||||
private Long memberUserId;//会员id
|
||||
|
||||
@Schema(description = "会员昵称", example = "芊芊")
|
||||
private String nickName;//会员昵称
|
||||
|
||||
@Schema(description = "会员名称", example = "李四")
|
||||
private String name;//会员名称
|
||||
|
||||
@Schema(description = "会员手机号", example = "15801123344")
|
||||
private String phone;//会员手机号
|
||||
|
||||
@Schema(description = "分销商等级id", example = "2")
|
||||
private Long levelId;//分销商等级id
|
||||
|
||||
@Schema(description = "等级名称", example = "测试等级")
|
||||
private String levelName;//等级名称
|
||||
|
||||
@Schema(description = "上级分销商id", example = "123")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "上级会员id", example = "123")
|
||||
private Long parentMemberUserId;
|
||||
|
||||
@Schema(description = "上级分销商昵称", example = "张三")
|
||||
private String parentMemberNickName;
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package cn.iocoder.yudao.module.hsfx.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.RpcConstants;
|
||||
|
||||
public class ApiConstants {
|
||||
// hsfx-server/hsfx/xxx
|
||||
/**
|
||||
* 服务名
|
||||
*
|
||||
* 注意,需要保证和 spring.application.name 保持一致
|
||||
*/
|
||||
public static final String NAME = "hsfx-server";
|
||||
|
||||
/**
|
||||
* controller访问前缀
|
||||
*/
|
||||
public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/hsfx";
|
||||
|
||||
public static final String VERSION = "1.0.0";
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package cn.iocoder.yudao.module.hsfx.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
|
||||
|
||||
/**
|
||||
* 海上分销 错误码枚举类
|
||||
* <p>
|
||||
* 海上分销 系统,使用 1-100-000-000 段
|
||||
*/
|
||||
public interface ErrorCodeConstants {
|
||||
// ========== 分销用户不存在 TODO 补充编号 ==========
|
||||
|
||||
//分销商 1-100-001-xxx
|
||||
//分销等级 1-100-002-xxx
|
||||
//分销基础配置 1-100-003-xxx
|
||||
//等级变更历史 1-100-004-xxx
|
||||
|
||||
ErrorCode MEMBER_USER_NOT_EXISTS = new ErrorCode(1 - 100 - 001 - 001, "分销会员信息不存在!");
|
||||
ErrorCode PARENT_BROKERAGE_USER_NOT_EXISTS = new ErrorCode(1 - 001 - 100 - 002, "上级分销用户不存在!");
|
||||
ErrorCode BROKERAGE_USER_NOT_EXISTS = new ErrorCode(1 - 100 - 001 - 003, "分销用户不存在!");
|
||||
ErrorCode BROKERAGE_USER_ALREADY_EXISTS = new ErrorCode(1 - 100 - 001 - 004, "分销用户已存在!");
|
||||
ErrorCode BROKERAGE_USER_MEMBER_MISMATCH = new ErrorCode(1 - 100 - 001 - 005, "分销用户与会员不对应!");
|
||||
|
||||
ErrorCode BROKERAGE_LEVEL_NOT_EXISTS = new ErrorCode(1 - 100 - 002 - 001, "分销等级不存在!");
|
||||
ErrorCode BROKERAGE_LEVEL_ALREADY_EXISTS = new ErrorCode(1 - 100 - 002 - 002, "分销等级名称已经存在!");
|
||||
ErrorCode BROKERAGE_LEVEL_LEVELNAME_NOTEXISTS = new ErrorCode(1 - 100 - 002 - 003, "分销等级基础信息配置不能为空!");
|
||||
ErrorCode BROKERAGE_LEVEL_BASECONFIG_NOTEXISTS = new ErrorCode(1 - 100 - 002 - 004, "分销等级基础信息配置不能为空!");
|
||||
ErrorCode BROKERAGE_LEVEL_UPGRADECONFIG_NOTEXISTS = new ErrorCode(1 - 100 - 002 - 005, "分销等级升级配置不能为空!");
|
||||
ErrorCode BROKERAGE_LEVEL_DOWNGRADECONFIG_NOTEXISTS = new ErrorCode(1 - 100 - 002 - 006, "分销等级基础信息配置不能为空!");
|
||||
|
||||
|
||||
ErrorCode BROKERAGE_BASECONFIG_NOT_EXISTS = new ErrorCode(1 - 100 - 003 - 001, "分销基础配置不存在!");
|
||||
ErrorCode BROKERAGE_BASECONFIG_SINGLE_PROPERTY = new ErrorCode(1 - 100 - 003 - 002, "分销基础配置只能同时更新一个!");
|
||||
ErrorCode BROKERAGE_BASECONFIG_BASECONFIGJSON_NOTEXISTS = new ErrorCode(1 - 100 - 003 - 003, "分销基础配置字段不能为空!");
|
||||
ErrorCode BROKERAGE_BASECONFIG_SETTLECONFIGJSON_NOTEXISTS = new ErrorCode(1 - 100 - 003 - 004, "分销结算设置配置字段不能为空!");
|
||||
ErrorCode BROKERAGE_BASECONFIG_TEXTCONFIGJSON_NOTEXISTS = new ErrorCode(1 - 100 - 003 - 005, "分销文字设置配置字段不能为空!");
|
||||
ErrorCode BROKERAGE_BASECONFIG_PREFORCONFIGJSON_NOTEXISTS = new ErrorCode(1 - 100 - 003 - 006, "分销业绩中心设置配置字段不能为空!");
|
||||
|
||||
|
||||
ErrorCode BROKERAGE_LEVELHISTORY_NOT_EXISTS = new ErrorCode(1 - 100 - 004 - 001, "分销等级变更历史信息不存在!");
|
||||
|
||||
ErrorCode JSON_FORMATCHECK_FAIL=new ErrorCode(1-100-005-001,"JSON类型属性格式校验异常");
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -36,6 +36,13 @@
|
|||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-hsfx-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- 业务组件 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package cn.iocoder.yudao.module.hsfx.api.brokeragebaseconfig;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.hsfx.api.brokeragebaseconfig.dto.RpcBrokerageBaseConfigDto;
|
||||
import cn.iocoder.yudao.module.hsfx.api.brokeragelevelhistory.dto.RpcBroLevelHisRespDto;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragebaseconfig.BrokerageBaseconfigDO;
|
||||
import cn.iocoder.yudao.module.hsfx.service.brokeragebaseconfig.BrokerageBaseconfigService;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
public class BrokerageBaseConfigImpl implements BrokerageBaseConfigApi {
|
||||
|
||||
@Autowired
|
||||
private BrokerageBaseconfigService brokerageBaseconfigService;
|
||||
|
||||
@Override
|
||||
public RpcBrokerageBaseConfigDto getBroBaseConfigById(Long id) {
|
||||
BrokerageBaseconfigDO brokerageBaseconfig = brokerageBaseconfigService.getBrokerageBaseconfig(id);
|
||||
RpcBrokerageBaseConfigDto rpcBrokerageBaseConfigDto = new RpcBrokerageBaseConfigDto();
|
||||
BeanUtils.copyProperties(brokerageBaseconfig, rpcBrokerageBaseConfigDto);
|
||||
return rpcBrokerageBaseConfigDto;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package cn.iocoder.yudao.module.hsfx.api.brokeragelevel;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.hsfx.api.brokeragelevel.dto.RpcBrokerageLevelDto;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragelevel.BrokerageLevelDO;
|
||||
import cn.iocoder.yudao.module.hsfx.service.brokeragelevel.BrokerageLevelService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
public class BrokerageLevelImpl implements BrokerageLevelApi {
|
||||
|
||||
|
||||
@Autowired
|
||||
private BrokerageLevelService brokerageLevelService;
|
||||
|
||||
@Override
|
||||
public RpcBrokerageLevelDto getBroLevelHisById(Long id) {
|
||||
BrokerageLevelDO brokerageLevel = brokerageLevelService.getBrokerageLevel(id);
|
||||
RpcBrokerageLevelDto rpcBrokerageLevelDto = new RpcBrokerageLevelDto();
|
||||
BeanUtils.copyProperties(brokerageLevel, rpcBrokerageLevelDto);
|
||||
return rpcBrokerageLevelDto;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package cn.iocoder.yudao.module.hsfx.api.brokeragelevelhistory;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.hsfx.api.brokeragelevelhistory.dto.RpcBroLevelHisRespDto;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokeragelevelhistory.vo.BrokerageLevelhistoryRespVO;
|
||||
import cn.iocoder.yudao.module.hsfx.service.brokeragelevelhistory.BrokerageLevelhistoryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author izao
|
||||
* @Description 用户等级变更历史记录远程调用接口实现类
|
||||
* @date 2024/12/26 11:21
|
||||
*/
|
||||
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
public class BrokerageLevelHisImpl implements BroLevelHisApi {
|
||||
|
||||
@Autowired
|
||||
private BrokerageLevelhistoryService levelhistoryService;
|
||||
|
||||
@Override
|
||||
public RpcBroLevelHisRespDto getBroLevelHisById(Long id) {
|
||||
BrokerageLevelhistoryRespVO levelhistoryRespVO = levelhistoryService.getBrokerageLevelhistory(id);
|
||||
RpcBroLevelHisRespDto rpcBroLevelHisRespDto = new RpcBroLevelHisRespDto();
|
||||
BeanUtils.copyProperties(levelhistoryRespVO, rpcBroLevelHisRespDto);
|
||||
return rpcBroLevelHisRespDto;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package cn.iocoder.yudao.module.hsfx.api.brokerageuser;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.hsfx.api.brokerageuser.dto.RpcBrokerageUserRespDto;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokerageuser.vo.BrokerageUserPageResVO;
|
||||
import cn.iocoder.yudao.module.hsfx.service.brokerageuser.BrokerageUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
||||
/**
|
||||
* @Description 分销用户远程调用接口实现类
|
||||
* @author izao
|
||||
* @date 2024/12/26 10:54
|
||||
*/
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
public class BrokerageUserImpl implements BrokerageUserApi{
|
||||
|
||||
@Autowired
|
||||
private BrokerageUserService brokerageUserService;
|
||||
|
||||
@Override
|
||||
public RpcBrokerageUserRespDto getBrokerageUserById(Long id) {
|
||||
RpcBrokerageUserRespDto rpcBrokerageUserRespDto = new RpcBrokerageUserRespDto();
|
||||
BrokerageUserPageResVO brokerageUser = brokerageUserService.getBrokerageUser(id);
|
||||
BeanUtils.copyProperties(brokerageUser, rpcBrokerageUserRespDto);
|
||||
return rpcBrokerageUserRespDto;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.admin.brokeragebaseconfig;
|
||||
|
||||
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.hsfx.controller.admin.brokeragebaseconfig.vo.*;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragebaseconfig.BrokerageBaseconfigDO;
|
||||
import cn.iocoder.yudao.module.hsfx.service.brokeragebaseconfig.BrokerageBaseconfigService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Tag(name = "管理后台 - 分销配置")
|
||||
@RestController
|
||||
@RequestMapping("/hsfx/brokerage-baseconfig")
|
||||
@Validated
|
||||
public class BrokerageBaseconfigController {
|
||||
|
||||
@Resource
|
||||
private BrokerageBaseconfigService brokerageBaseconfigService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建分销配置")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-baseconfig:create')")
|
||||
public CommonResult<Long> createBrokerageBaseconfig(@Valid @RequestBody BrokerageBaseconfigSaveReqVO createReqVO) {
|
||||
return success(brokerageBaseconfigService.createBrokerageBaseconfig(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新分销配置")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-baseconfig:update')")
|
||||
public CommonResult<Boolean> updateBrokerageBaseconfig(@Valid @RequestBody BrokerageBaseconfigSaveReqVO updateReqVO) {
|
||||
brokerageBaseconfigService.updateBrokerageBaseconfig(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除分销配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-baseconfig:delete')")
|
||||
public CommonResult<Boolean> deleteBrokerageBaseconfig(@RequestParam("id") Long id) {
|
||||
brokerageBaseconfigService.deleteBrokerageBaseconfig(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得分销配置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-baseconfig:query')")
|
||||
public CommonResult<BrokerageBaseconfigRespVO> getBrokerageBaseconfig(@RequestParam("id") Long id) {
|
||||
BrokerageBaseconfigDO brokerageBaseconfig = brokerageBaseconfigService.getBrokerageBaseconfig(id);
|
||||
return success(BeanUtils.toBean(brokerageBaseconfig, BrokerageBaseconfigRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得分销配置分页")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-baseconfig:query')")
|
||||
public CommonResult<PageResult<BrokerageBaseconfigRespVO>> getBrokerageBaseconfigPage(@Valid BrokerageBaseconfigPageReqVO pageReqVO) {
|
||||
PageResult<BrokerageBaseconfigDO> pageResult = brokerageBaseconfigService.getBrokerageBaseconfigPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, BrokerageBaseconfigRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出分销配置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-baseconfig:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportBrokerageBaseconfigExcel(@Valid BrokerageBaseconfigPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<BrokerageBaseconfigDO> list = brokerageBaseconfigService.getBrokerageBaseconfigPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "分销配置.xls", "数据", BrokerageBaseconfigRespVO.class,
|
||||
BeanUtils.toBean(list, BrokerageBaseconfigRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.admin.brokeragebaseconfig.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 BrokerageBaseconfigPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "基础配置json")
|
||||
private String baseConfigJson;
|
||||
|
||||
@Schema(description = "结算设置配置json")
|
||||
private String settleConfigJson;
|
||||
|
||||
@Schema(description = "文字设置配置json")
|
||||
private String textConfigJson;
|
||||
|
||||
@Schema(description = "业绩中心配置json")
|
||||
private String perforConfigJson;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.admin.brokeragebaseconfig.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 分销配置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class BrokerageBaseconfigRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1354")
|
||||
@ExcelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "基础配置json")
|
||||
@ExcelProperty("基础配置json")
|
||||
private String baseConfigJson;
|
||||
|
||||
@Schema(description = "结算设置配置json")
|
||||
@ExcelProperty("结算设置配置json")
|
||||
private String settleConfigJson;
|
||||
|
||||
@Schema(description = "文字设置配置json")
|
||||
@ExcelProperty("文字设置配置json")
|
||||
private String textConfigJson;
|
||||
|
||||
@Schema(description = "业绩中心配置json")
|
||||
@ExcelProperty("业绩中心配置json")
|
||||
private String perforConfigJson;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.admin.brokeragebaseconfig.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
|
||||
@Schema(description = "管理后台 - 分销配置新增/修改 Request VO")
|
||||
@Data
|
||||
public class BrokerageBaseconfigSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1354")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "基础配置json")
|
||||
private String baseConfigJson;
|
||||
|
||||
@Schema(description = "结算设置配置json")
|
||||
private String settleConfigJson;
|
||||
|
||||
@Schema(description = "文字设置配置json")
|
||||
private String textConfigJson;
|
||||
|
||||
@Schema(description = "业绩中心配置json")
|
||||
private String perforConfigJson;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.admin.brokeragelevel;
|
||||
|
||||
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.hsfx.controller.admin.brokeragelevel.vo.*;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragelevel.BrokerageLevelDO;
|
||||
import cn.iocoder.yudao.module.hsfx.service.brokeragelevel.BrokerageLevelService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Tag(name = "管理后台 - 分销商等级")
|
||||
@RestController
|
||||
@RequestMapping("/hsfx/brokerage-level")
|
||||
@Validated
|
||||
public class BrokerageLevelController {
|
||||
|
||||
@Resource
|
||||
private BrokerageLevelService brokerageLevelService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建分销商等级")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-level:create')")
|
||||
public CommonResult<Long> createBrokerageLevel(@Valid @RequestBody BrokerageLevelSaveReqVO createReqVO) {
|
||||
return success(brokerageLevelService.createBrokerageLevel(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新分销商等级")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-level:update')")
|
||||
public CommonResult<Boolean> updateBrokerageLevel(@Valid @RequestBody BrokerageLevelSaveReqVO updateReqVO) {
|
||||
brokerageLevelService.updateBrokerageLevel(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除分销商等级")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-level:delete')")
|
||||
public CommonResult<Boolean> deleteBrokerageLevel(@RequestParam("id") Long id) {
|
||||
brokerageLevelService.deleteBrokerageLevel(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得分销商等级")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-level:query')")
|
||||
public CommonResult<BrokerageLevelRespVO> getBrokerageLevel(@RequestParam("id") Long id) {
|
||||
BrokerageLevelDO brokerageLevel = brokerageLevelService.getBrokerageLevel(id);
|
||||
return success(BeanUtils.toBean(brokerageLevel, BrokerageLevelRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得分销商等级分页")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-level:query')")
|
||||
public CommonResult<PageResult<BrokerageLevelRespVO>> getBrokerageLevelPage(@Valid BrokerageLevelPageReqVO pageReqVO) {
|
||||
PageResult<BrokerageLevelDO> pageResult = brokerageLevelService.getBrokerageLevelPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, BrokerageLevelRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出分销商等级 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-level:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportBrokerageLevelExcel(@Valid BrokerageLevelPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<BrokerageLevelDO> list = brokerageLevelService.getBrokerageLevelPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "分销商等级.xls", "数据", BrokerageLevelRespVO.class,
|
||||
BeanUtils.toBean(list, BrokerageLevelRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.admin.brokeragelevel.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 BrokerageLevelPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "等级 默认等级、一级、二级、三级等")
|
||||
private String level;
|
||||
|
||||
@Schema(description = "等级名称")
|
||||
private String levelName;
|
||||
|
||||
@Schema(description = "基础配置json;一级、二级、三级佣金比例、培育奖等")
|
||||
private String baseConfig;
|
||||
|
||||
@Schema(description = "升级策略配置json 升级到此等级需要的条件")
|
||||
private String upgradeConfig;
|
||||
|
||||
@Schema(description = "降级策略配置json 不满足此条件则降级")
|
||||
private String downgradeConfig;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.admin.brokeragelevel.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 BrokerageLevelRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "23559")
|
||||
@ExcelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "等级 默认等级、一级、二级、三级等")
|
||||
@ExcelProperty("等级 默认等级、一级、二级、三级等")
|
||||
private String level;
|
||||
|
||||
@Schema(description = "等级名称")
|
||||
@ExcelProperty("等级名称")
|
||||
private String levelName;
|
||||
|
||||
@Schema(description = "基础配置json;一级、二级、三级佣金比例、培育奖等")
|
||||
@ExcelProperty("基础配置json;一级、二级、三级佣金比例、培育奖等")
|
||||
private String baseConfig;
|
||||
|
||||
@Schema(description = "升级策略配置json 升级到此等级需要的条件")
|
||||
@ExcelProperty("升级策略配置json 升级到此等级需要的条件")
|
||||
private String upgradeConfig;
|
||||
|
||||
@Schema(description = "降级策略配置json 不满足此条件则降级")
|
||||
@ExcelProperty("降级策略配置json 不满足此条件则降级")
|
||||
private String downgradeConfig;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.admin.brokeragelevel.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
|
||||
@Schema(description = "管理后台 - 分销商等级新增/修改 Request VO")
|
||||
@Data
|
||||
public class BrokerageLevelSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "23559")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "等级 默认等级、一级、二级、三级等")
|
||||
private String level;
|
||||
|
||||
@Schema(description = "等级名称")
|
||||
private String levelName;
|
||||
|
||||
@Schema(description = "基础配置json;一级、二级、三级佣金比例、培育奖等")
|
||||
private String baseConfig;
|
||||
|
||||
@Schema(description = "升级策略配置json 升级到此等级需要的条件")
|
||||
private String upgradeConfig;
|
||||
|
||||
@Schema(description = "降级策略配置json 不满足此条件则降级")
|
||||
private String downgradeConfig;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.admin.brokeragelevelhistory;
|
||||
|
||||
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.hsfx.controller.admin.brokeragelevelhistory.vo.*;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragelevelhistory.BrokerageLevelhistoryDO;
|
||||
import cn.iocoder.yudao.module.hsfx.service.brokeragelevelhistory.BrokerageLevelhistoryService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Tag(name = "管理后台 - 等级变更历史记录")
|
||||
@RestController
|
||||
@RequestMapping("/hsfx/brokerage-levelhistory")
|
||||
@Validated
|
||||
public class BrokerageLevelhistoryController {
|
||||
|
||||
@Resource
|
||||
private BrokerageLevelhistoryService brokerageLevelhistoryService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建等级变更历史记录")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-levelhistory:create')")
|
||||
public CommonResult<Long> createBrokerageLevelhistory(@Valid @RequestBody BrokerageLevelhistorySaveReqVO createReqVO) {
|
||||
return success(brokerageLevelhistoryService.createBrokerageLevelhistory(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新等级变更历史记录")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-levelhistory:update')")
|
||||
public CommonResult<Boolean> updateBrokerageLevelhistory(@Valid @RequestBody BrokerageLevelhistorySaveReqVO updateReqVO) {
|
||||
brokerageLevelhistoryService.updateBrokerageLevelhistory(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除等级变更历史记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-levelhistory:delete')")
|
||||
public CommonResult<Boolean> deleteBrokerageLevelhistory(@RequestParam("id") Long id) {
|
||||
brokerageLevelhistoryService.deleteBrokerageLevelhistory(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得等级变更历史记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-levelhistory:query')")
|
||||
public CommonResult<BrokerageLevelhistoryRespVO> getBrokerageLevelhistory(@RequestParam("id") Long id) {
|
||||
return success(brokerageLevelhistoryService.getBrokerageLevelhistory(id));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得等级变更历史记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-levelhistory:query')")
|
||||
public CommonResult<PageResult<BrokerageLevelhistoryRespVO>> getBrokerageLevelhistoryPage(@Valid BrokerageLevelhistoryPageReqVO pageReqVO) {
|
||||
PageResult<BrokerageLevelhistoryRespVO> pageResult = brokerageLevelhistoryService.getBrokerageLevelhistoryPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, BrokerageLevelhistoryRespVO.class));
|
||||
}
|
||||
|
||||
// @GetMapping("/export-excel")
|
||||
// @Operation(summary = "导出等级变更历史记录 Excel")
|
||||
// @PreAuthorize("@ss.hasPermission('hsfx:brokerage-levelhistory:export')")
|
||||
// @ApiAccessLog(operateType = EXPORT)
|
||||
// public void exportBrokerageLevelhistoryExcel(@Valid BrokerageLevelhistoryPageReqVO pageReqVO,
|
||||
// HttpServletResponse response) throws IOException {
|
||||
// pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
// List<BrokerageLevelhistoryDO> list = brokerageLevelhistoryService.getBrokerageLevelhistoryPage(pageReqVO).getList();
|
||||
// // 导出 Excel
|
||||
// ExcelUtils.write(response, "等级变更历史记录.xls", "数据", BrokerageLevelhistoryRespVO.class,
|
||||
// BeanUtils.toBean(list, BrokerageLevelhistoryRespVO.class));
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.admin.brokeragelevelhistory.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 BrokerageLevelhistoryPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "分销用户id", example = "29277")
|
||||
private Long brokerageUserId;
|
||||
|
||||
@Schema(description = "初始等级id", example = "28982")
|
||||
private Long initLevelId;
|
||||
|
||||
@Schema(description = "目标(现在)等级id", example = "5160")
|
||||
private Long toLevelId;
|
||||
|
||||
@Schema(description = "变动原因", example = "不满足条件自动降级")
|
||||
private String changeReason;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.admin.brokeragelevelhistory.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 BrokerageLevelhistoryRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20579")
|
||||
@ExcelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "分销用户id", example = "29277")
|
||||
@ExcelProperty("分销用户id")
|
||||
private Long brokerageUserId;
|
||||
|
||||
@Schema(description = "初始等级id", example = "28982")
|
||||
@ExcelProperty("初始等级id")
|
||||
private Long initLevelId;
|
||||
|
||||
@Schema(description = "目标(现在)等级id", example = "5160")
|
||||
@ExcelProperty("目标(现在)等级id")
|
||||
private Long toLevelId;
|
||||
|
||||
@Schema(description = "变动原因", example = "不满足条件自动降级")
|
||||
@ExcelProperty("变动原因")
|
||||
private String changeReason;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private String brokerageMemberNickName;//分销用户会员昵称
|
||||
|
||||
private String initLevelName;//初始等级名称
|
||||
|
||||
private String toLevelName;//变动目标等级
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.admin.brokeragelevelhistory.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
@Schema(description = "管理后台 - 等级变更历史记录新增/修改 Request VO")
|
||||
@Data
|
||||
public class BrokerageLevelhistorySaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20579")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "分销用户id", example = "29277")
|
||||
private Long brokerageUserId;
|
||||
|
||||
@Schema(description = "初始等级id", example = "28982")
|
||||
private Long initLevelId;
|
||||
|
||||
@Schema(description = "目标(现在)等级id", example = "5160")
|
||||
private Long toLevelId;
|
||||
|
||||
@Schema(description = "变动原因", example = "不满足条件自动降级")
|
||||
private String changeReason;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.admin.brokerageuser;
|
||||
|
||||
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.hsfx.controller.admin.brokerageuser.vo.*;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokerageuser.BrokerageUserDO;
|
||||
import cn.iocoder.yudao.module.hsfx.service.brokerageuser.BrokerageUserService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Tag(name = "管理后台 - 分销用户")
|
||||
@RestController
|
||||
@RequestMapping("/hsfx/brokerage-user")
|
||||
@Validated
|
||||
public class BrokerageUserController {
|
||||
|
||||
@Resource
|
||||
private BrokerageUserService brokerageUserService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建分销用户")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-user:create')")
|
||||
public CommonResult<Long> createBrokerageUser(@Valid @RequestBody BrokerageUserSaveReqVO createReqVO) {
|
||||
return success(brokerageUserService.createBrokerageUser(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新分销用户")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-user:update')")
|
||||
public CommonResult<Boolean> updateBrokerageUser(@Valid @RequestBody BrokerageUserSaveReqVO updateReqVO) {
|
||||
brokerageUserService.updateBrokerageUser(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除分销用户")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-user:delete')")
|
||||
public CommonResult<Boolean> deleteBrokerageUser(@RequestParam("id") Long id) {
|
||||
brokerageUserService.deleteBrokerageUser(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得分销用户")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-user:query')")
|
||||
public CommonResult<BrokerageUserPageResVO> getBrokerageUser(@RequestParam("id") Long id) {
|
||||
BrokerageUserPageResVO brokerageUser = brokerageUserService.getBrokerageUser(id);
|
||||
return CommonResult.success(brokerageUser);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得分销用户分页")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-user:query')")
|
||||
public CommonResult<PageResult<BrokerageUserPageResVO>> getBrokerageUserPage(@Valid BrokerageUserPageReqVO pageReqVO) {
|
||||
PageResult<BrokerageUserPageResVO> pageResult = brokerageUserService.getBrokerageUserPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, BrokerageUserPageResVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出分销用户 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-user:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportBrokerageUserExcel(@Valid BrokerageUserPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<BrokerageUserPageResVO> list = brokerageUserService.getBrokerageUserPage(pageReqVO).getList();
|
||||
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "分销用户.xls", "数据", BrokerageUserRespVO.class,
|
||||
BeanUtils.toBean(list, BrokerageUserRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.admin.brokerageuser.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 BrokerageUserPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "用户id", example = "8493")
|
||||
private Long memberUserId;
|
||||
|
||||
@Schema(description = "分销商等级id", example = "24915")
|
||||
private Long levelId;
|
||||
|
||||
@Schema(description = "上级用户id", example = "9225")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "数据字典 是否启用")
|
||||
private Integer isEnable;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.admin.brokerageuser.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BrokerageUserPageResVO {
|
||||
|
||||
private Long id;//分销商id
|
||||
private Long memberUserId;//会员id
|
||||
private String nickName;//会员昵称
|
||||
private String name;//会员名称
|
||||
private String phone;//会员手机号
|
||||
private Long levelId;//分销商等级id
|
||||
private String levelName;//等级名称
|
||||
private Long parentId;
|
||||
private Long parentMemberUserId;
|
||||
private String parentMemberNickName;
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.admin.brokerageuser.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 BrokerageUserRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32060")
|
||||
@ExcelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户id", example = "8493")
|
||||
@ExcelProperty("用户id")
|
||||
private Long memberUserId;
|
||||
|
||||
@Schema(description = "分销商等级id", example = "24915")
|
||||
@ExcelProperty("分销商等级id")
|
||||
private Long levelId;
|
||||
|
||||
@Schema(description = "上级用户id", example = "9225")
|
||||
@ExcelProperty("上级用户id")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "数据字典 是否启用")
|
||||
@ExcelProperty(value = "数据字典 是否启用", converter = DictConvert.class)
|
||||
@DictFormat("infra_boolean_string") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer isEnable;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.admin.brokerageuser.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
@Schema(description = "管理后台 - 分销用户新增/修改 Request VO")
|
||||
@Data
|
||||
public class BrokerageUserSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32060")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户id", example = "8493")
|
||||
private Long memberUserId;
|
||||
|
||||
@Schema(description = "分销商等级id", example = "24915")
|
||||
private Long levelId;
|
||||
|
||||
@Schema(description = "上级用户id", example = "9225")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "数据字典 是否启用")
|
||||
private Integer isEnable;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.admin.brokerageuser.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MemberResDo {
|
||||
private Long memberId;
|
||||
private String memberName;
|
||||
}
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.app.brokeragebaseconfig;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokeragebaseconfig.vo.BrokerageBaseconfigPageReqVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokeragebaseconfig.vo.BrokerageBaseconfigRespVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokeragebaseconfig.vo.BrokerageBaseconfigSaveReqVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.app.brokeragebaseconfig.vo.AppBroBaseconfigPageReqVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.app.brokeragebaseconfig.vo.AppBroBaseconfigRespVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.app.brokeragebaseconfig.vo.AppBroBaseconfigSaveReqVO;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragebaseconfig.BrokerageBaseconfigDO;
|
||||
import cn.iocoder.yudao.module.hsfx.service.brokeragebaseconfig.BrokerageBaseconfigService;
|
||||
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.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "APP后台 - 分销配置")
|
||||
@RestController
|
||||
@RequestMapping("/hsfx/brokerage-baseconfig")
|
||||
@Validated
|
||||
public class AppBroBaseconfigController {
|
||||
|
||||
@Resource
|
||||
private BrokerageBaseconfigService brokerageBaseconfigService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建分销配置")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-baseconfig:create')")
|
||||
public CommonResult<Long> createBrokerageBaseconfig(@Valid @RequestBody AppBroBaseconfigSaveReqVO createReqVO) {
|
||||
BrokerageBaseconfigSaveReqVO adminBrokerageBaseconfigSaveReqVO = new BrokerageBaseconfigSaveReqVO();
|
||||
BeanUtils.copyProperties(createReqVO, adminBrokerageBaseconfigSaveReqVO);
|
||||
return success(brokerageBaseconfigService.createBrokerageBaseconfig(adminBrokerageBaseconfigSaveReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新分销配置")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-baseconfig:update')")
|
||||
public CommonResult<Boolean> updateBrokerageBaseconfig(@Valid @RequestBody AppBroBaseconfigSaveReqVO updateReqVO) {
|
||||
BrokerageBaseconfigSaveReqVO brokerageBaseconfigSaveReqVO = new BrokerageBaseconfigSaveReqVO();
|
||||
BeanUtils.copyProperties(updateReqVO, brokerageBaseconfigSaveReqVO);
|
||||
brokerageBaseconfigService.updateBrokerageBaseconfig(brokerageBaseconfigSaveReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除分销配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-baseconfig:delete')")
|
||||
public CommonResult<Boolean> deleteBrokerageBaseconfig(@RequestParam("id") Long id) {
|
||||
brokerageBaseconfigService.deleteBrokerageBaseconfig(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得分销配置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-baseconfig:query')")
|
||||
public CommonResult<AppBroBaseconfigRespVO> getBrokerageBaseconfig(@RequestParam("id") Long id) {
|
||||
BrokerageBaseconfigDO adminBrokerageBaseconfig = brokerageBaseconfigService.getBrokerageBaseconfig(id);
|
||||
if (adminBrokerageBaseconfig == null) {
|
||||
return success(null);
|
||||
}
|
||||
return success(BeanUtils.toBean(adminBrokerageBaseconfig, AppBroBaseconfigRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得分销配置分页")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-baseconfig:query')")
|
||||
public CommonResult<PageResult<AppBroBaseconfigRespVO>> getBrokerageBaseconfigPage(@Valid AppBroBaseconfigPageReqVO pageReqVO) {
|
||||
BrokerageBaseconfigPageReqVO adminBrokerageBaseconfigPageReqVO = new BrokerageBaseconfigPageReqVO();
|
||||
BeanUtils.copyProperties(pageReqVO, adminBrokerageBaseconfigPageReqVO);
|
||||
PageResult<BrokerageBaseconfigDO> pageResult = brokerageBaseconfigService.getBrokerageBaseconfigPage(adminBrokerageBaseconfigPageReqVO);
|
||||
List<AppBroBaseconfigRespVO> appBroBaseconfigRespVOList = new ArrayList<>();
|
||||
PageResult<AppBroBaseconfigRespVO> appPageResult = new PageResult<>();
|
||||
appPageResult.setTotal(pageResult.getTotal());
|
||||
pageResult.getList().forEach(adminBaseConfigDo -> {
|
||||
AppBroBaseconfigRespVO appBroBaseconfigRespVO = new AppBroBaseconfigRespVO();
|
||||
BeanUtils.copyProperties(adminBaseConfigDo, appBroBaseconfigRespVO);
|
||||
appBroBaseconfigRespVOList.add(appBroBaseconfigRespVO);
|
||||
});
|
||||
appPageResult.setList(appBroBaseconfigRespVOList);
|
||||
return success(appPageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出分销配置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-baseconfig:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportBrokerageBaseconfigExcel(@Valid AppBroBaseconfigPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
BrokerageBaseconfigPageReqVO adminBaseconfigPageReqVO = new BrokerageBaseconfigPageReqVO();
|
||||
BeanUtils.copyProperties(pageReqVO, adminBaseconfigPageReqVO);
|
||||
List<BrokerageBaseconfigDO> list = brokerageBaseconfigService.getBrokerageBaseconfigPage(adminBaseconfigPageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "分销配置.xls", "数据", AppBroBaseconfigRespVO.class,
|
||||
BeanUtils.toBean(list, AppBroBaseconfigRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.app.brokeragebaseconfig.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 AppBroBaseconfigPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "基础配置json")
|
||||
private String baseConfigJson;
|
||||
|
||||
@Schema(description = "结算设置配置json")
|
||||
private String settleConfigJson;
|
||||
|
||||
@Schema(description = "文字设置配置json")
|
||||
private String textConfigJson;
|
||||
|
||||
@Schema(description = "业绩中心配置json")
|
||||
private String perforConfigJson;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.app.brokeragebaseconfig.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 AppBroBaseconfigRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1354")
|
||||
@ExcelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "基础配置json")
|
||||
@ExcelProperty("基础配置json")
|
||||
private String baseConfigJson;
|
||||
|
||||
@Schema(description = "结算设置配置json")
|
||||
@ExcelProperty("结算设置配置json")
|
||||
private String settleConfigJson;
|
||||
|
||||
@Schema(description = "文字设置配置json")
|
||||
@ExcelProperty("文字设置配置json")
|
||||
private String textConfigJson;
|
||||
|
||||
@Schema(description = "业绩中心配置json")
|
||||
@ExcelProperty("业绩中心配置json")
|
||||
private String perforConfigJson;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.app.brokeragebaseconfig.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 分销配置新增/修改 Request VO")
|
||||
@Data
|
||||
public class AppBroBaseconfigSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1354")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "基础配置json")
|
||||
private String baseConfigJson;
|
||||
|
||||
@Schema(description = "结算设置配置json")
|
||||
private String settleConfigJson;
|
||||
|
||||
@Schema(description = "文字设置配置json")
|
||||
private String textConfigJson;
|
||||
|
||||
@Schema(description = "业绩中心配置json")
|
||||
private String perforConfigJson;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.app.brokeragelevel;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokeragelevel.vo.BrokerageLevelPageReqVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokeragelevel.vo.BrokerageLevelRespVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokeragelevel.vo.BrokerageLevelSaveReqVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.app.brokeragelevel.vo.AppBroLevelPageReqVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.app.brokeragelevel.vo.AppBroLevelRespVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.app.brokeragelevel.vo.AppBroLevelSaveReqVO;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragelevel.BrokerageLevelDO;
|
||||
import cn.iocoder.yudao.module.hsfx.service.brokeragelevel.BrokerageLevelService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
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.context.annotation.Bean;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
|
||||
@Tag(name = "APP后台 - 分销商等级")
|
||||
@RestController
|
||||
@RequestMapping("/hsfx/brokerage-level")
|
||||
@Validated
|
||||
public class AppBroLevelController {
|
||||
|
||||
@Resource
|
||||
private BrokerageLevelService brokerageLevelService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建分销商等级")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-level:create')")
|
||||
public CommonResult<Long> createBrokerageLevel(@Valid @RequestBody AppBroLevelSaveReqVO createReqVO) {
|
||||
BrokerageLevelSaveReqVO brokerageLevelSaveReqVO = new BrokerageLevelSaveReqVO();
|
||||
BeanUtils.copyProperties(createReqVO, brokerageLevelSaveReqVO);
|
||||
return success(brokerageLevelService.createBrokerageLevel(brokerageLevelSaveReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新分销商等级")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-level:update')")
|
||||
public CommonResult<Boolean> updateBrokerageLevel(@Valid @RequestBody AppBroLevelSaveReqVO updateReqVO) {
|
||||
BrokerageLevelSaveReqVO brokerageLevelUpdateReqVO = new BrokerageLevelSaveReqVO();
|
||||
BeanUtils.copyProperties(updateReqVO, brokerageLevelUpdateReqVO);
|
||||
brokerageLevelService.updateBrokerageLevel(brokerageLevelUpdateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除分销商等级")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-level:delete')")
|
||||
public CommonResult<Boolean> deleteBrokerageLevel(@RequestParam("id") Long id) {
|
||||
brokerageLevelService.deleteBrokerageLevel(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得分销商等级")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-level:query')")
|
||||
public CommonResult<AppBroLevelRespVO> getBrokerageLevel(@RequestParam("id") Long id) {
|
||||
BrokerageLevelDO brokerageLevel = brokerageLevelService.getBrokerageLevel(id);
|
||||
if(brokerageLevel==null){
|
||||
return success(null);
|
||||
}
|
||||
return success(BeanUtils.toBean(brokerageLevel, AppBroLevelRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得分销商等级分页")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-level:query')")
|
||||
public CommonResult<PageResult<AppBroLevelRespVO>> getBrokerageLevelPage(@Valid AppBroLevelPageReqVO pageReqVO) {
|
||||
BrokerageLevelPageReqVO levelPageReqVO = new BrokerageLevelPageReqVO();
|
||||
BeanUtils.copyProperties(pageReqVO, levelPageReqVO);
|
||||
PageResult<BrokerageLevelDO> adminPageResult = brokerageLevelService.getBrokerageLevelPage(levelPageReqVO);
|
||||
PageResult<AppBroLevelRespVO> respVOPageResult = new PageResult<>();
|
||||
respVOPageResult.setTotal(adminPageResult.getTotal());
|
||||
List<AppBroLevelRespVO> appBroLevelRespVOS = new ArrayList<>();
|
||||
adminPageResult.getList().forEach(brokerageLevelDO -> {
|
||||
AppBroLevelRespVO appBroLevelRespVO = new AppBroLevelRespVO();
|
||||
BeanUtils.copyProperties(brokerageLevelDO, appBroLevelRespVO);
|
||||
appBroLevelRespVOS.add(appBroLevelRespVO);
|
||||
});
|
||||
respVOPageResult.setList(appBroLevelRespVOS);
|
||||
return success(respVOPageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出分销商等级 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-level:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportBrokerageLevelExcel(@Valid AppBroLevelPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
BrokerageLevelPageReqVO adminLevelPageReqVO = new BrokerageLevelPageReqVO();
|
||||
List<BrokerageLevelDO> list = brokerageLevelService.getBrokerageLevelPage(adminLevelPageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "分销商等级.xls", "数据", AppBroLevelRespVO.class,
|
||||
BeanUtils.toBean(list, AppBroLevelRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.app.brokeragelevel.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 AppBroLevelPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "等级 默认等级、一级、二级、三级等")
|
||||
private String level;
|
||||
|
||||
@Schema(description = "等级名称")
|
||||
private String levelName;
|
||||
|
||||
@Schema(description = "基础配置json;一级、二级、三级佣金比例、培育奖等")
|
||||
private String baseConfig;
|
||||
|
||||
@Schema(description = "升级策略配置json 升级到此等级需要的条件")
|
||||
private String upgradeConfig;
|
||||
|
||||
@Schema(description = "降级策略配置json 不满足此条件则降级")
|
||||
private String downgradeConfig;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.app.brokeragelevel.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 AppBroLevelRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "23559")
|
||||
@ExcelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "等级 默认等级、一级、二级、三级等")
|
||||
@ExcelProperty("等级 默认等级、一级、二级、三级等")
|
||||
private String level;
|
||||
|
||||
@Schema(description = "等级名称")
|
||||
@ExcelProperty("等级名称")
|
||||
private String levelName;
|
||||
|
||||
@Schema(description = "基础配置json;一级、二级、三级佣金比例、培育奖等")
|
||||
@ExcelProperty("基础配置json;一级、二级、三级佣金比例、培育奖等")
|
||||
private String baseConfig;
|
||||
|
||||
@Schema(description = "升级策略配置json 升级到此等级需要的条件")
|
||||
@ExcelProperty("升级策略配置json 升级到此等级需要的条件")
|
||||
private String upgradeConfig;
|
||||
|
||||
@Schema(description = "降级策略配置json 不满足此条件则降级")
|
||||
@ExcelProperty("降级策略配置json 不满足此条件则降级")
|
||||
private String downgradeConfig;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.app.brokeragelevel.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 分销商等级新增/修改 Request VO")
|
||||
@Data
|
||||
public class AppBroLevelSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "23559")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "等级 默认等级、一级、二级、三级等")
|
||||
private String level;
|
||||
|
||||
@Schema(description = "等级名称")
|
||||
private String levelName;
|
||||
|
||||
@Schema(description = "基础配置json;一级、二级、三级佣金比例、培育奖等")
|
||||
private String baseConfig;
|
||||
|
||||
@Schema(description = "升级策略配置json 升级到此等级需要的条件")
|
||||
private String upgradeConfig;
|
||||
|
||||
@Schema(description = "降级策略配置json 不满足此条件则降级")
|
||||
private String downgradeConfig;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.app.brokeragelevelhistory;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokeragelevelhistory.vo.BrokerageLevelhistoryPageReqVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokeragelevelhistory.vo.BrokerageLevelhistoryRespVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokeragelevelhistory.vo.BrokerageLevelhistorySaveReqVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.app.brokeragelevelhistory.vo.AppBroLevelhisPageReqVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.app.brokeragelevelhistory.vo.AppBroLevelhisRespVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.app.brokeragelevelhistory.vo.AppBroLevelhisSaveReqVO;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragelevelhistory.BrokerageLevelhistoryDO;
|
||||
import cn.iocoder.yudao.module.hsfx.service.brokeragelevelhistory.BrokerageLevelhistoryService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
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.context.annotation.Bean;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
|
||||
@Tag(name = "APP后台 - 等级变更历史记录")
|
||||
@RestController
|
||||
@RequestMapping("/hsfx/brokerage-levelhistory")
|
||||
@Validated
|
||||
public class AppBroLevelhisController {
|
||||
|
||||
@Resource
|
||||
private BrokerageLevelhistoryService brokerageLevelhistoryService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建等级变更历史记录")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-levelhistory:create')")
|
||||
public CommonResult<Long> createBrokerageLevelhistory(@Valid @RequestBody AppBroLevelhisSaveReqVO createReqVO) {
|
||||
BrokerageLevelhistorySaveReqVO adminReqVO = new BrokerageLevelhistorySaveReqVO();
|
||||
BeanUtils.copyProperties(createReqVO, adminReqVO);
|
||||
return success(brokerageLevelhistoryService.createBrokerageLevelhistory(adminReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新等级变更历史记录")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-levelhistory:update')")
|
||||
public CommonResult<Boolean> updateBrokerageLevelhistory(@Valid @RequestBody AppBroLevelhisSaveReqVO updateReqVO) {
|
||||
BrokerageLevelhistorySaveReqVO adminSaveVo = new BrokerageLevelhistorySaveReqVO();
|
||||
BeanUtils.copyProperties(updateReqVO, adminSaveVo);
|
||||
brokerageLevelhistoryService.updateBrokerageLevelhistory(adminSaveVo);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除等级变更历史记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-levelhistory:delete')")
|
||||
public CommonResult<Boolean> deleteBrokerageLevelhistory(@RequestParam("id") Long id) {
|
||||
brokerageLevelhistoryService.deleteBrokerageLevelhistory(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得等级变更历史记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-levelhistory:query')")
|
||||
public CommonResult<AppBroLevelhisRespVO> getBrokerageLevelhistory(@RequestParam("id") Long id) {
|
||||
BrokerageLevelhistoryRespVO adminLevelRespVo = brokerageLevelhistoryService.getBrokerageLevelhistory(id);
|
||||
if (adminLevelRespVo == null) {
|
||||
return success(null);
|
||||
}
|
||||
AppBroLevelhisRespVO appBroLevelhisRespVO = new AppBroLevelhisRespVO();
|
||||
BeanUtils.copyProperties(adminLevelRespVo, appBroLevelhisRespVO);
|
||||
return success(appBroLevelhisRespVO);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得等级变更历史记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-levelhistory:query')")
|
||||
public CommonResult<PageResult<AppBroLevelhisRespVO>> getBrokerageLevelhistoryPage(@Valid AppBroLevelhisPageReqVO pageReqVO) {
|
||||
BrokerageLevelhistoryPageReqVO adminHisPageReqVo = new BrokerageLevelhistoryPageReqVO();
|
||||
BeanUtils.copyProperties(pageReqVO, adminHisPageReqVo);
|
||||
PageResult<BrokerageLevelhistoryRespVO> adminBroLevelhisPage = brokerageLevelhistoryService.getBrokerageLevelhistoryPage(adminHisPageReqVo);
|
||||
PageResult<AppBroLevelhisRespVO> appBroLevelhisRespVOPageResult = new PageResult<>();
|
||||
appBroLevelhisRespVOPageResult.setTotal(adminBroLevelhisPage.getTotal());
|
||||
List<BrokerageLevelhistoryRespVO> adminBroLevelhisPageList = adminBroLevelhisPage.getList();
|
||||
ArrayList<AppBroLevelhisRespVO> appBroLevelhisRespVOS = new ArrayList<>();
|
||||
adminBroLevelhisPageList.forEach(brokerageLevelhistoryRespVO -> {
|
||||
AppBroLevelhisRespVO appBroLevelhisRespVO = new AppBroLevelhisRespVO();
|
||||
BeanUtils.copyProperties(brokerageLevelhistoryRespVO, appBroLevelhisRespVO);
|
||||
appBroLevelhisRespVOS.add(appBroLevelhisRespVO);
|
||||
});
|
||||
appBroLevelhisRespVOPageResult.setList(appBroLevelhisRespVOS);
|
||||
return success(appBroLevelhisRespVOPageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出等级变更历史记录 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-levelhistory:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportBrokerageLevelhistoryExcel(@Valid AppBroLevelhisPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
BrokerageLevelhistoryPageReqVO adminRespVO = new BrokerageLevelhistoryPageReqVO();
|
||||
PageResult<BrokerageLevelhistoryRespVO> adminLevelHisRespVoPage = brokerageLevelhistoryService.getBrokerageLevelhistoryPage(adminRespVO);
|
||||
List<AppBroLevelhisRespVO> list = new ArrayList<>();
|
||||
adminLevelHisRespVoPage.getList().forEach(BrokerageLevelhistoryRespVO -> {
|
||||
AppBroLevelhisRespVO appBroLevelhisRespVO = new AppBroLevelhisRespVO();
|
||||
BeanUtils.copyProperties(BrokerageLevelhistoryRespVO, appBroLevelhisRespVO);
|
||||
list.add(appBroLevelhisRespVO);
|
||||
});
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "等级变更历史记录.xls", "数据", AppBroLevelhisRespVO.class,
|
||||
BeanUtils.toBean(list, AppBroLevelhisRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.app.brokeragelevelhistory.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 AppBroLevelhisPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "分销用户id", example = "29277")
|
||||
private Long brokerageUserId;
|
||||
|
||||
@Schema(description = "初始等级id", example = "28982")
|
||||
private Long initLevelId;
|
||||
|
||||
@Schema(description = "目标(现在)等级id", example = "5160")
|
||||
private Long toLevelId;
|
||||
|
||||
@Schema(description = "变动原因", example = "不满足条件自动降级")
|
||||
private String changeReason;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.app.brokeragelevelhistory.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 AppBroLevelhisRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20579")
|
||||
@ExcelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "分销用户id", example = "29277")
|
||||
@ExcelProperty("分销用户id")
|
||||
private Long brokerageUserId;
|
||||
|
||||
@Schema(description = "初始等级id", example = "28982")
|
||||
@ExcelProperty("初始等级id")
|
||||
private Long initLevelId;
|
||||
|
||||
@Schema(description = "目标(现在)等级id", example = "5160")
|
||||
@ExcelProperty("目标(现在)等级id")
|
||||
private Long toLevelId;
|
||||
|
||||
@Schema(description = "变动原因", example = "不满足条件自动降级")
|
||||
@ExcelProperty("变动原因")
|
||||
private String changeReason;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private String brokerageMemberNickName;//分销用户会员昵称
|
||||
|
||||
private String initLevelName;//初始等级名称
|
||||
|
||||
private String toLevelName;//变动目标等级
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.app.brokeragelevelhistory.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 等级变更历史记录新增/修改 Request VO")
|
||||
@Data
|
||||
public class AppBroLevelhisSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20579")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "分销用户id", example = "29277")
|
||||
private Long brokerageUserId;
|
||||
|
||||
@Schema(description = "初始等级id", example = "28982")
|
||||
private Long initLevelId;
|
||||
|
||||
@Schema(description = "目标(现在)等级id", example = "5160")
|
||||
private Long toLevelId;
|
||||
|
||||
@Schema(description = "变动原因", example = "不满足条件自动降级")
|
||||
private String changeReason;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.app.brokerageuser;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokerageuser.vo.BrokerageUserPageReqVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokerageuser.vo.BrokerageUserPageResVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokerageuser.vo.BrokerageUserSaveReqVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.app.brokerageuser.vo.AppBroUserPageReqVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.app.brokerageuser.vo.AppBroUserPageResVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.app.brokerageuser.vo.AppBroUserRespVO;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.app.brokerageuser.vo.AppBroUserSaveReqVO;
|
||||
import cn.iocoder.yudao.module.hsfx.service.brokerageuser.BrokerageUserService;
|
||||
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.context.annotation.Bean;
|
||||
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.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "APP后台 - 分销用户")
|
||||
@RestController
|
||||
@RequestMapping("/hsfx/brokerage-user")
|
||||
@Validated
|
||||
public class AppBroUserController {
|
||||
|
||||
@Resource
|
||||
private BrokerageUserService brokerageUserService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建分销用户")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-user:create')")
|
||||
public CommonResult<Long> createBrokerageUser(@Valid @RequestBody AppBroUserSaveReqVO createReqVO) {
|
||||
BrokerageUserSaveReqVO broUserSaveReqVO = new BrokerageUserSaveReqVO();
|
||||
BeanUtils.copyProperties(createReqVO, broUserSaveReqVO);
|
||||
return success(brokerageUserService.createBrokerageUser(broUserSaveReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新分销用户")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-user:update')")
|
||||
public CommonResult<Boolean> updateBrokerageUser(@Valid @RequestBody AppBroUserSaveReqVO updateReqVO) {
|
||||
BrokerageUserSaveReqVO broUserSaveReqVO = new BrokerageUserSaveReqVO();
|
||||
BeanUtils.copyProperties(updateReqVO, broUserSaveReqVO);
|
||||
brokerageUserService.updateBrokerageUser(broUserSaveReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除分销用户")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-user:delete')")
|
||||
public CommonResult<Boolean> deleteBrokerageUser(@RequestParam("id") Long id) {
|
||||
brokerageUserService.deleteBrokerageUser(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得分销用户")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-user:query')")
|
||||
public CommonResult<AppBroUserPageResVO> getBrokerageUser(@RequestParam("id") Long id) {
|
||||
BrokerageUserPageResVO brokerageUser = brokerageUserService.getBrokerageUser(id);
|
||||
if(brokerageUser==null){
|
||||
return CommonResult.success(null);
|
||||
}
|
||||
AppBroUserPageResVO appBroUser = new AppBroUserPageResVO();
|
||||
BeanUtils.copyProperties(brokerageUser, appBroUser);
|
||||
return CommonResult.success(appBroUser);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得分销用户分页")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-user:query')")
|
||||
public CommonResult<PageResult<AppBroUserPageResVO>> getBrokerageUserPage(@Valid AppBroUserPageReqVO pageReqVO) {
|
||||
BrokerageUserPageReqVO broUserPageReqVO = new BrokerageUserPageReqVO();
|
||||
BeanUtils.copyProperties(pageReqVO, broUserPageReqVO);
|
||||
PageResult<BrokerageUserPageResVO> brokerageUserPage = brokerageUserService.getBrokerageUserPage(broUserPageReqVO);
|
||||
PageResult<AppBroUserPageResVO> appPageResult = new PageResult<>();
|
||||
appPageResult.setTotal(brokerageUserPage.getTotal());
|
||||
List<BrokerageUserPageResVO> brokerageUserPageList = brokerageUserPage.getList();
|
||||
ArrayList<AppBroUserPageResVO> appBroUserPageResVOList = new ArrayList<>();
|
||||
for (int i = 0; i < brokerageUserPageList.size(); i++) {
|
||||
AppBroUserPageResVO appPageResVO = new AppBroUserPageResVO();
|
||||
BeanUtils.copyProperties(brokerageUserPageList.get(i), appPageResVO);
|
||||
appBroUserPageResVOList.add(appPageResVO);
|
||||
}
|
||||
appPageResult.setList(appBroUserPageResVOList);
|
||||
return success(appPageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出分销用户 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('hsfx:brokerage-user:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportBrokerageUserExcel(@Valid AppBroUserPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
BrokerageUserPageReqVO broUserPageReqVO = new BrokerageUserPageReqVO();
|
||||
BeanUtils.copyProperties(pageReqVO, broUserPageReqVO);
|
||||
List<BrokerageUserPageResVO> pageResVOList = brokerageUserService.getBrokerageUserPage(broUserPageReqVO).getList();
|
||||
|
||||
List<AppBroUserPageResVO> appPageResVOList = new ArrayList<>();
|
||||
for (int i = 0; i < pageResVOList.size(); i++) {
|
||||
AppBroUserPageResVO pageResVO = new AppBroUserPageResVO();
|
||||
BeanUtils.copyProperties(pageResVOList.get(i), pageResVO);
|
||||
appPageResVOList.add(pageResVO);
|
||||
}
|
||||
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "分销用户.xls", "数据", AppBroUserRespVO.class,
|
||||
BeanUtils.toBean(appPageResVOList, AppBroUserRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.app.brokerageuser.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 AppBroUserPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "用户id", example = "8493")
|
||||
private Long memberUserId;
|
||||
|
||||
@Schema(description = "分销商等级id", example = "24915")
|
||||
private Long levelId;
|
||||
|
||||
@Schema(description = "上级用户id", example = "9225")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "数据字典 是否启用")
|
||||
private Integer isEnable;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.app.brokerageuser.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AppBroUserPageResVO {
|
||||
|
||||
private Long id;//分销商id
|
||||
private Long memberUserId;//会员id
|
||||
private String nickName;//会员昵称
|
||||
private String name;//会员名称
|
||||
private String phone;//会员手机号
|
||||
private Long levelId;//分销商等级id
|
||||
private String levelName;//等级名称
|
||||
private Long parentId;
|
||||
private Long parentMemberUserId;
|
||||
private String parentMemberNickName;
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.app.brokerageuser.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
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 AppBroUserRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32060")
|
||||
@ExcelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户id", example = "8493")
|
||||
@ExcelProperty("用户id")
|
||||
private Long memberUserId;
|
||||
|
||||
@Schema(description = "分销商等级id", example = "24915")
|
||||
@ExcelProperty("分销商等级id")
|
||||
private Long levelId;
|
||||
|
||||
@Schema(description = "上级用户id", example = "9225")
|
||||
@ExcelProperty("上级用户id")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "数据字典 是否启用")
|
||||
@ExcelProperty(value = "数据字典 是否启用", converter = DictConvert.class)
|
||||
@DictFormat("infra_boolean_string") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer isEnable;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package cn.iocoder.yudao.module.hsfx.controller.app.brokerageuser.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 分销用户新增/修改 Request VO")
|
||||
@Data
|
||||
public class AppBroUserSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32060")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户id", example = "8493")
|
||||
private Long memberUserId;
|
||||
|
||||
@Schema(description = "分销商等级id", example = "24915")
|
||||
private Long levelId;
|
||||
|
||||
@Schema(description = "上级用户id", example = "9225")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "数据字典 是否启用")
|
||||
private Integer isEnable;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragebaseconfig;
|
||||
|
||||
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;
|
||||
|
||||
import javax.validation.Constraint;
|
||||
|
||||
/**
|
||||
* 分销配置 DO
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@TableName("trade_brokerage_baseconfig")
|
||||
@KeySequence("trade_brokerage_baseconfig_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BrokerageBaseconfigDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 基础配置json
|
||||
*/
|
||||
private String baseConfigJson;
|
||||
/**
|
||||
* 结算设置配置json
|
||||
*/
|
||||
private String settleConfigJson;
|
||||
/**
|
||||
* 文字设置配置json
|
||||
*/
|
||||
private String textConfigJson;
|
||||
/**
|
||||
* 业绩中心配置json
|
||||
*/
|
||||
private String perforConfigJson;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragelevel;
|
||||
|
||||
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 admin
|
||||
*/
|
||||
@TableName("trade_brokerage_level")
|
||||
@KeySequence("trade_brokerage_level_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BrokerageLevelDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 等级 默认等级、一级、二级、三级等
|
||||
*/
|
||||
private String level;
|
||||
/**
|
||||
* 等级名称
|
||||
*/
|
||||
private String levelName;
|
||||
/**
|
||||
* 基础配置json;一级、二级、三级佣金比例、培育奖等
|
||||
*/
|
||||
private String baseConfig;
|
||||
/**
|
||||
* 升级策略配置json 升级到此等级需要的条件
|
||||
*/
|
||||
private String upgradeConfig;
|
||||
/**
|
||||
* 降级策略配置json 不满足此条件则降级
|
||||
*/
|
||||
private String downgradeConfig;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragelevelhistory;
|
||||
|
||||
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 admin
|
||||
*/
|
||||
@TableName("trade_brokerage_levelhistory")
|
||||
@KeySequence("trade_brokerage_levelhistory_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BrokerageLevelhistoryDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 分销用户id
|
||||
*/
|
||||
private Long brokerageUserId;
|
||||
/**
|
||||
* 初始等级id
|
||||
*/
|
||||
private Long initLevelId;
|
||||
/**
|
||||
* 目标(现在)等级id
|
||||
*/
|
||||
private Long toLevelId;
|
||||
/**
|
||||
* 变动原因
|
||||
*/
|
||||
private String changeReason;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package cn.iocoder.yudao.module.hsfx.dal.dataobject.brokerageuser;
|
||||
|
||||
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 admin
|
||||
*/
|
||||
@TableName("trade_brokerage_user")
|
||||
@KeySequence("trade_brokerage_user_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BrokerageUserDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long memberUserId;
|
||||
/**
|
||||
* 分销商等级id
|
||||
*/
|
||||
private Long levelId;
|
||||
/**
|
||||
* 上级用户id
|
||||
*/
|
||||
private Long parentId;
|
||||
/**
|
||||
* 数据字典 是否启用
|
||||
* <p>
|
||||
* 枚举 {@link TODO infra_boolean_string 对应的类}
|
||||
*/
|
||||
private Integer isEnable;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String levelName;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package cn.iocoder.yudao.module.hsfx.dal.mysql.brokeragebaseconfig;
|
||||
|
||||
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.hsfx.dal.dataobject.brokeragebaseconfig.BrokerageBaseconfigDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokeragebaseconfig.vo.*;
|
||||
|
||||
/**
|
||||
* 分销配置 Mapper
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Mapper
|
||||
public interface BrokerageBaseconfigMapper extends BaseMapperX<BrokerageBaseconfigDO> {
|
||||
|
||||
default PageResult<BrokerageBaseconfigDO> selectPage(BrokerageBaseconfigPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<BrokerageBaseconfigDO>()
|
||||
.eqIfPresent(BrokerageBaseconfigDO::getBaseConfigJson, reqVO.getBaseConfigJson())
|
||||
.eqIfPresent(BrokerageBaseconfigDO::getSettleConfigJson, reqVO.getSettleConfigJson())
|
||||
.eqIfPresent(BrokerageBaseconfigDO::getTextConfigJson, reqVO.getTextConfigJson())
|
||||
.eqIfPresent(BrokerageBaseconfigDO::getPerforConfigJson, reqVO.getPerforConfigJson())
|
||||
.betweenIfPresent(BrokerageBaseconfigDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(BrokerageBaseconfigDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package cn.iocoder.yudao.module.hsfx.dal.mysql.brokeragelevel;
|
||||
|
||||
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.hsfx.dal.dataobject.brokeragelevel.BrokerageLevelDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokeragelevel.vo.*;
|
||||
|
||||
/**
|
||||
* 分销商等级 Mapper
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Mapper
|
||||
public interface BrokerageLevelMapper extends BaseMapperX<BrokerageLevelDO> {
|
||||
|
||||
default PageResult<BrokerageLevelDO> selectPage(BrokerageLevelPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<BrokerageLevelDO>()
|
||||
.eqIfPresent(BrokerageLevelDO::getLevel, reqVO.getLevel())
|
||||
.likeIfPresent(BrokerageLevelDO::getLevelName, reqVO.getLevelName())
|
||||
.eqIfPresent(BrokerageLevelDO::getBaseConfig, reqVO.getBaseConfig())
|
||||
.eqIfPresent(BrokerageLevelDO::getUpgradeConfig, reqVO.getUpgradeConfig())
|
||||
.eqIfPresent(BrokerageLevelDO::getDowngradeConfig, reqVO.getDowngradeConfig())
|
||||
.betweenIfPresent(BrokerageLevelDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(BrokerageLevelDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package cn.iocoder.yudao.module.hsfx.dal.mysql.brokeragelevelhistory;
|
||||
|
||||
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.hsfx.dal.dataobject.brokeragelevelhistory.BrokerageLevelhistoryDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokeragelevelhistory.vo.*;
|
||||
|
||||
/**
|
||||
* 等级变更历史记录 Mapper
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Mapper
|
||||
public interface BrokerageLevelhistoryMapper extends BaseMapperX<BrokerageLevelhistoryDO> {
|
||||
|
||||
default PageResult<BrokerageLevelhistoryDO> selectPage(BrokerageLevelhistoryPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<BrokerageLevelhistoryDO>()
|
||||
.eqIfPresent(BrokerageLevelhistoryDO::getBrokerageUserId, reqVO.getBrokerageUserId())
|
||||
.eqIfPresent(BrokerageLevelhistoryDO::getInitLevelId, reqVO.getInitLevelId())
|
||||
.eqIfPresent(BrokerageLevelhistoryDO::getToLevelId, reqVO.getToLevelId())
|
||||
.likeIfPresent(BrokerageLevelhistoryDO::getChangeReason, reqVO.getChangeReason())
|
||||
.betweenIfPresent(BrokerageLevelhistoryDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(BrokerageLevelhistoryDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package cn.iocoder.yudao.module.hsfx.dal.mysql.brokerageuser;
|
||||
|
||||
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.hsfx.dal.dataobject.brokerageuser.BrokerageUserDO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.query.MPJQueryWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokerageuser.vo.*;
|
||||
|
||||
/**
|
||||
* 分销用户 Mapper
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Mapper
|
||||
public interface BrokerageUserMapper extends BaseMapperX<BrokerageUserDO> {
|
||||
|
||||
default PageResult<BrokerageUserDO> selectPage(BrokerageUserPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<BrokerageUserDO>()
|
||||
.eqIfPresent(BrokerageUserDO::getMemberUserId, reqVO.getMemberUserId())
|
||||
.eqIfPresent(BrokerageUserDO::getLevelId, reqVO.getLevelId())
|
||||
.eqIfPresent(BrokerageUserDO::getParentId, reqVO.getParentId())
|
||||
.eqIfPresent(BrokerageUserDO::getIsEnable, reqVO.getIsEnable())
|
||||
.betweenIfPresent(BrokerageUserDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(BrokerageUserDO::getId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package cn.iocoder.yudao.module.hsfx.framework.rpc.config;
|
||||
|
||||
import cn.iocoder.yudao.module.member.api.address.MemberAddressApi;
|
||||
import cn.iocoder.yudao.module.member.api.config.MemberConfigApi;
|
||||
import cn.iocoder.yudao.module.member.api.level.MemberLevelApi;
|
||||
import cn.iocoder.yudao.module.member.api.point.MemberPointApi;
|
||||
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
|
||||
import cn.iocoder.yudao.module.product.api.category.ProductCategoryApi;
|
||||
import cn.iocoder.yudao.module.product.api.comment.ProductCommentApi;
|
||||
import cn.iocoder.yudao.module.product.api.sku.ProductSkuApi;
|
||||
import cn.iocoder.yudao.module.product.api.spu.ProductSpuApi;
|
||||
import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
|
||||
import cn.iocoder.yudao.module.system.api.social.SocialClientApi;
|
||||
import cn.iocoder.yudao.module.system.api.social.SocialUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableFeignClients(clients = {
|
||||
AdminUserApi.class,MemberUserApi.class
|
||||
})
|
||||
public class RpcConfiguration {
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package cn.iocoder.yudao.module.hsfx.service.brokeragebaseconfig;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokeragebaseconfig.vo.*;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragebaseconfig.BrokerageBaseconfigDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 分销配置 Service 接口
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
public interface BrokerageBaseconfigService {
|
||||
|
||||
/**
|
||||
* 创建分销配置
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createBrokerageBaseconfig(@Valid BrokerageBaseconfigSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新分销配置
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateBrokerageBaseconfig(@Valid BrokerageBaseconfigSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除分销配置
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteBrokerageBaseconfig(Long id);
|
||||
|
||||
/**
|
||||
* 获得分销配置
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 分销配置
|
||||
*/
|
||||
BrokerageBaseconfigDO getBrokerageBaseconfig(Long id);
|
||||
|
||||
/**
|
||||
* 获得分销配置分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 分销配置分页
|
||||
*/
|
||||
PageResult<BrokerageBaseconfigDO> getBrokerageBaseconfigPage(BrokerageBaseconfigPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,171 @@
|
|||
package cn.iocoder.yudao.module.hsfx.service.brokeragebaseconfig;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
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.hsfx.controller.admin.brokeragebaseconfig.vo.*;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragebaseconfig.BrokerageBaseconfigDO;
|
||||
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.hsfx.dal.mysql.brokeragebaseconfig.BrokerageBaseconfigMapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.hsfx.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 分销配置 Service 实现类
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BrokerageBaseconfigServiceImpl implements BrokerageBaseconfigService {
|
||||
|
||||
@Resource
|
||||
private BrokerageBaseconfigMapper brokerageBaseconfigMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Long createBrokerageBaseconfig(BrokerageBaseconfigSaveReqVO createReqVO) {
|
||||
//校验格式是否正常
|
||||
validateJson(createReqVO);
|
||||
// 插入
|
||||
BrokerageBaseconfigDO brokerageBaseconfig = BeanUtils.toBean(createReqVO, BrokerageBaseconfigDO.class);
|
||||
brokerageBaseconfig.setDeleted(false);
|
||||
brokerageBaseconfigMapper.insert(brokerageBaseconfig);
|
||||
// 返回
|
||||
return brokerageBaseconfig.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateBrokerageBaseconfig(BrokerageBaseconfigSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateBrokerageBaseconfigExists(updateReqVO.getId());
|
||||
//设置每次只能更新一个字段的值
|
||||
//校验其中基础设置、结算设置、文字设置、业绩中心设置每次只能更新一个字段值
|
||||
// 更新
|
||||
// validateBaseconfigPropertyOne(updateReqVO);
|
||||
|
||||
// BrokerageBaseconfigDO updateObj = BeanUtils.toBean(updateReqVO, BrokerageBaseconfigDO.class);
|
||||
// LambdaUpdateWrapper<BrokerageBaseconfigDO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
// if (updateReqVO.getBaseConfigJson() != null && updateReqVO.getBaseConfigJson() != "") {
|
||||
// lambdaUpdateWrapper.set(BrokerageBaseconfigDO::getBaseConfigJson, updateReqVO.getBaseConfigJson());
|
||||
// }
|
||||
// if (updateReqVO.getPerforConfigJson() != null && updateReqVO.getPerforConfigJson() != "") {
|
||||
// lambdaUpdateWrapper.set(BrokerageBaseconfigDO::getPerforConfigJson, updateReqVO.getPerforConfigJson());
|
||||
// }
|
||||
// if (updateReqVO.getTextConfigJson() != null && updateReqVO.getTextConfigJson() != "") {
|
||||
// lambdaUpdateWrapper.set(BrokerageBaseconfigDO::getTextConfigJson, updateReqVO.getTextConfigJson());
|
||||
// }
|
||||
// if (updateReqVO.getSettleConfigJson() != null && updateReqVO.getSettleConfigJson() != "") {
|
||||
// lambdaUpdateWrapper.set(BrokerageBaseconfigDO::getSettleConfigJson, updateReqVO.getSettleConfigJson());
|
||||
// }
|
||||
// lambdaUpdateWrapper.eq(BrokerageBaseconfigDO::getId, updateReqVO.getId());
|
||||
// brokerageBaseconfigMapper.update(updateObj, lambdaUpdateWrapper);
|
||||
|
||||
//校验格式是否正常
|
||||
validateJson(updateReqVO);
|
||||
//校验属性是否为空
|
||||
validateBrokerageBaseconfigProperties(updateReqVO);
|
||||
BrokerageBaseconfigDO brokerageBaseconfigDO = new BrokerageBaseconfigDO();
|
||||
BeanUtils.copyProperties(updateReqVO, brokerageBaseconfigDO);
|
||||
brokerageBaseconfigMapper.updateById(brokerageBaseconfigDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void deleteBrokerageBaseconfig(Long id) {
|
||||
// 校验存在
|
||||
validateBrokerageBaseconfigExists(id);
|
||||
// 删除
|
||||
brokerageBaseconfigMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BrokerageBaseconfigDO getBrokerageBaseconfig(Long id) {
|
||||
return brokerageBaseconfigMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<BrokerageBaseconfigDO> getBrokerageBaseconfigPage(BrokerageBaseconfigPageReqVO pageReqVO) {
|
||||
return brokerageBaseconfigMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
|
||||
private void validateBrokerageBaseconfigExists(Long id) {
|
||||
if (brokerageBaseconfigMapper.selectById(id) == null) {
|
||||
throw exception(BROKERAGE_BASECONFIG_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
//校验属性是是否存在 JSON格式的属性值,有一个为null都无法存入
|
||||
private void validateBrokerageBaseconfigProperties(BrokerageBaseconfigSaveReqVO baseconfigSaveReqVO) {
|
||||
if (StringUtils.isEmpty(baseconfigSaveReqVO.getBaseConfigJson())) {
|
||||
throw exception(BROKERAGE_BASECONFIG_BASECONFIGJSON_NOTEXISTS);
|
||||
}
|
||||
if (StringUtils.isEmpty(baseconfigSaveReqVO.getSettleConfigJson())) {
|
||||
throw exception(BROKERAGE_BASECONFIG_SETTLECONFIGJSON_NOTEXISTS);
|
||||
}
|
||||
if (StringUtils.isEmpty(baseconfigSaveReqVO.getTextConfigJson())) {
|
||||
throw exception(BROKERAGE_BASECONFIG_TEXTCONFIGJSON_NOTEXISTS);
|
||||
}
|
||||
if (StringUtils.isEmpty(baseconfigSaveReqVO.getPerforConfigJson())) {
|
||||
throw exception(BROKERAGE_BASECONFIG_PREFORCONFIGJSON_NOTEXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
//验证单属性更新 后续看是否需要
|
||||
private void validateBaseconfigPropertyOne(BrokerageBaseconfigSaveReqVO baseconfigSaveReqVO) {
|
||||
int flag = 0;
|
||||
if (baseconfigSaveReqVO.getBaseConfigJson() != null && baseconfigSaveReqVO.getBaseConfigJson() != "") {
|
||||
flag++;
|
||||
}
|
||||
if (baseconfigSaveReqVO.getPerforConfigJson() != null && baseconfigSaveReqVO.getPerforConfigJson() != "") {
|
||||
flag++;
|
||||
}
|
||||
if (baseconfigSaveReqVO.getTextConfigJson() != null && baseconfigSaveReqVO.getTextConfigJson() != "") {
|
||||
flag++;
|
||||
}
|
||||
if (baseconfigSaveReqVO.getSettleConfigJson() != null && baseconfigSaveReqVO.getSettleConfigJson() != "") {
|
||||
flag++;
|
||||
}
|
||||
if (flag > 1) {
|
||||
throw exception(BROKERAGE_BASECONFIG_SINGLE_PROPERTY);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void validateJson(BrokerageBaseconfigSaveReqVO baseconfigSaveReqVO) {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
try {
|
||||
if (baseconfigSaveReqVO.getBaseConfigJson() != null) {
|
||||
objectMapper.readValue(baseconfigSaveReqVO.getBaseConfigJson(), Object.class);
|
||||
}
|
||||
if (baseconfigSaveReqVO.getTextConfigJson() != null) {
|
||||
objectMapper.readValue(baseconfigSaveReqVO.getTextConfigJson(), Object.class);
|
||||
}
|
||||
if (baseconfigSaveReqVO.getSettleConfigJson() != null) {
|
||||
objectMapper.readValue(baseconfigSaveReqVO.getSettleConfigJson(), Object.class);
|
||||
}
|
||||
if (baseconfigSaveReqVO.getPerforConfigJson() != null) {
|
||||
objectMapper.readValue(baseconfigSaveReqVO.getPerforConfigJson(), Object.class);
|
||||
}
|
||||
} catch (JsonProcessingException e) {
|
||||
throw exception(JSON_FORMATCHECK_FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package cn.iocoder.yudao.module.hsfx.service.brokeragelevel;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokeragelevel.vo.*;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragelevel.BrokerageLevelDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 分销商等级 Service 接口
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
public interface BrokerageLevelService {
|
||||
|
||||
/**
|
||||
* 创建分销商等级
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createBrokerageLevel(@Valid BrokerageLevelSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新分销商等级
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateBrokerageLevel(@Valid BrokerageLevelSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除分销商等级
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteBrokerageLevel(Long id);
|
||||
|
||||
/**
|
||||
* 获得分销商等级
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 分销商等级
|
||||
*/
|
||||
BrokerageLevelDO getBrokerageLevel(Long id);
|
||||
|
||||
/**
|
||||
* 获得分销商等级分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 分销商等级分页
|
||||
*/
|
||||
PageResult<BrokerageLevelDO> getBrokerageLevelPage(BrokerageLevelPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,172 @@
|
|||
package cn.iocoder.yudao.module.hsfx.service.brokeragelevel;
|
||||
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragelevelhistory.BrokerageLevelhistoryDO;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.mysql.brokeragelevelhistory.BrokerageLevelhistoryMapper;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
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.hsfx.controller.admin.brokeragelevel.vo.*;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragelevel.BrokerageLevelDO;
|
||||
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.hsfx.dal.mysql.brokeragelevel.BrokerageLevelMapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.hsfx.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 分销商等级 Service 实现类
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BrokerageLevelServiceImpl implements BrokerageLevelService {
|
||||
|
||||
@Resource
|
||||
private BrokerageLevelMapper brokerageLevelMapper;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Long createBrokerageLevel(BrokerageLevelSaveReqVO createReqVO) {
|
||||
//校验必须属性是否为空或空字符串
|
||||
// validateBrokerageLevelNullProperties(createReqVO);
|
||||
//校验分销等级是否存在
|
||||
validateBrokerageLevelExistsByName(createReqVO.getLevelName());
|
||||
|
||||
//校验对应的json属性是否完整
|
||||
validateJson(createReqVO);
|
||||
// 插入
|
||||
BrokerageLevelDO brokerageLevel = BeanUtils.toBean(createReqVO, BrokerageLevelDO.class);
|
||||
brokerageLevel.setDeleted(false);
|
||||
brokerageLevelMapper.insert(brokerageLevel);
|
||||
// 返回
|
||||
return brokerageLevel.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateBrokerageLevel(BrokerageLevelSaveReqVO updateReqVO) {
|
||||
//校验必须属性是否为空或空字符串
|
||||
// validateBrokerageLevelNullProperties(updateReqVO);
|
||||
// 校验更新数据是否存在
|
||||
validateBrokerageLevelExistsById(updateReqVO.getId());
|
||||
validateJson(updateReqVO);
|
||||
//校验分销等级是否存在
|
||||
// validateBrokerageLevelExistsByName(updateReqVO.getLevelName());
|
||||
LambdaQueryWrapper<BrokerageLevelDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(BrokerageLevelDO::getLevelName, updateReqVO.getLevelName());
|
||||
lambdaQueryWrapper.eq(BrokerageLevelDO::getDeleted, 0);
|
||||
BrokerageLevelDO levelDOOne = brokerageLevelMapper.selectOne(lambdaQueryWrapper);
|
||||
if (levelDOOne != null && (levelDOOne.getId() != updateReqVO.getId())) {//名称相同但是id不同
|
||||
throw exception(BROKERAGE_LEVEL_ALREADY_EXISTS);
|
||||
}
|
||||
|
||||
// 更新
|
||||
BrokerageLevelDO updateObj = BeanUtils.toBean(updateReqVO, BrokerageLevelDO.class);
|
||||
brokerageLevelMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void deleteBrokerageLevel(Long id) {
|
||||
// 校验存在
|
||||
validateBrokerageLevelExistsById(id);
|
||||
// 删除
|
||||
brokerageLevelMapper.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BrokerageLevelDO getBrokerageLevel(Long id) {
|
||||
|
||||
BrokerageLevelDO levelDO = brokerageLevelMapper.selectById(id);
|
||||
//json解析获取值
|
||||
// String baseConfig = levelDO.getBaseConfig();
|
||||
// JSONObject baseConfigJson = (JSONObject) JSON.parse(baseConfig);
|
||||
// String module = (String) baseConfigJson.get("module");
|
||||
// System.out.println(module);
|
||||
// System.out.println(baseConfigJson);
|
||||
return levelDO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<BrokerageLevelDO> getBrokerageLevelPage(BrokerageLevelPageReqVO pageReqVO) {
|
||||
return brokerageLevelMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
private void validateBrokerageLevelExistsById(Long id) {
|
||||
if (brokerageLevelMapper.selectById(id) == null) {
|
||||
throw exception(BROKERAGE_LEVEL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void validateBrokerageLevelExistsByName(String levelName) {
|
||||
LambdaQueryWrapper<BrokerageLevelDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(BrokerageLevelDO::getLevelName, levelName);
|
||||
lambdaQueryWrapper.eq(BrokerageLevelDO::getDeleted, 0);
|
||||
if (brokerageLevelMapper.selectOne(lambdaQueryWrapper) != null) {
|
||||
throw exception(BROKERAGE_LEVEL_ALREADY_EXISTS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//校验属性字段为空
|
||||
private void validateBrokerageLevelNullProperties(BrokerageLevelSaveReqVO levelSaveReqVO) {
|
||||
if (levelSaveReqVO.getLevel() == null) {
|
||||
throw exception(BROKERAGE_LEVEL_NOT_EXISTS);
|
||||
}
|
||||
if (levelSaveReqVO.getLevelName() == null) {
|
||||
throw exception(BROKERAGE_LEVEL_LEVELNAME_NOTEXISTS);
|
||||
}
|
||||
|
||||
if (levelSaveReqVO.getBaseConfig() == null) {
|
||||
throw exception(BROKERAGE_LEVEL_BASECONFIG_NOTEXISTS);
|
||||
}
|
||||
|
||||
if (levelSaveReqVO.getUpgradeConfig() == null) {
|
||||
throw exception(BROKERAGE_LEVEL_UPGRADECONFIG_NOTEXISTS);
|
||||
}
|
||||
|
||||
if (levelSaveReqVO.getDowngradeConfig() == null) {
|
||||
throw exception(BROKERAGE_LEVEL_DOWNGRADECONFIG_NOTEXISTS);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void validateJson(BrokerageLevelSaveReqVO levelSaveReqVO) {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
try {
|
||||
if (levelSaveReqVO.getBaseConfig() != null) {
|
||||
objectMapper.readValue(levelSaveReqVO.getBaseConfig(), Object.class);
|
||||
}
|
||||
if (levelSaveReqVO.getUpgradeConfig() != null) {
|
||||
objectMapper.readValue(levelSaveReqVO.getUpgradeConfig(), Object.class);
|
||||
}
|
||||
if (levelSaveReqVO.getDowngradeConfig() != null) {
|
||||
objectMapper.readValue(levelSaveReqVO.getDowngradeConfig(), Object.class);
|
||||
}
|
||||
} catch (JsonProcessingException e) {
|
||||
throw exception(JSON_FORMATCHECK_FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package cn.iocoder.yudao.module.hsfx.service.brokeragelevelhistory;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokeragelevelhistory.vo.*;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragelevelhistory.BrokerageLevelhistoryDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 等级变更历史记录 Service 接口
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
public interface BrokerageLevelhistoryService {
|
||||
|
||||
/**
|
||||
* 创建等级变更历史记录
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createBrokerageLevelhistory(@Valid BrokerageLevelhistorySaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新等级变更历史记录
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateBrokerageLevelhistory(@Valid BrokerageLevelhistorySaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除等级变更历史记录
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteBrokerageLevelhistory(Long id);
|
||||
|
||||
/**
|
||||
* 获得等级变更历史记录
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 等级变更历史记录
|
||||
*/
|
||||
BrokerageLevelhistoryRespVO getBrokerageLevelhistory(Long id);
|
||||
|
||||
/**
|
||||
* 获得等级变更历史记录分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 等级变更历史记录分页
|
||||
*/
|
||||
PageResult<BrokerageLevelhistoryRespVO> getBrokerageLevelhistoryPage(BrokerageLevelhistoryPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,168 @@
|
|||
package cn.iocoder.yudao.module.hsfx.service.brokeragelevelhistory;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragelevel.BrokerageLevelDO;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokerageuser.BrokerageUserDO;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.mysql.brokeragelevel.BrokerageLevelMapper;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.mysql.brokerageuser.BrokerageUserMapper;
|
||||
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
|
||||
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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.hsfx.controller.admin.brokeragelevelhistory.vo.*;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragelevelhistory.BrokerageLevelhistoryDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.hsfx.dal.mysql.brokeragelevelhistory.BrokerageLevelhistoryMapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.hsfx.enums.ErrorCodeConstants.BROKERAGE_LEVELHISTORY_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 等级变更历史记录 Service 实现类
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BrokerageLevelhistoryServiceImpl implements BrokerageLevelhistoryService {
|
||||
|
||||
@Resource
|
||||
private BrokerageLevelhistoryMapper brokerageLevelhistoryMapper;
|
||||
|
||||
@Resource
|
||||
private BrokerageUserMapper brokerageUserMapper;
|
||||
|
||||
@Autowired
|
||||
private MemberUserApi memberUserApi;
|
||||
|
||||
@Autowired
|
||||
private BrokerageLevelMapper levelMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Long createBrokerageLevelhistory(BrokerageLevelhistorySaveReqVO createReqVO) {
|
||||
// 插入
|
||||
BrokerageLevelhistoryDO brokerageLevelhistory = BeanUtils.toBean(createReqVO, BrokerageLevelhistoryDO.class);
|
||||
brokerageLevelhistoryMapper.insert(brokerageLevelhistory);
|
||||
// 返回
|
||||
return brokerageLevelhistory.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateBrokerageLevelhistory(BrokerageLevelhistorySaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateBrokerageLevelhistoryExists(updateReqVO.getId());
|
||||
// 更新
|
||||
BrokerageLevelhistoryDO updateObj = BeanUtils.toBean(updateReqVO, BrokerageLevelhistoryDO.class);
|
||||
brokerageLevelhistoryMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void deleteBrokerageLevelhistory(Long id) {
|
||||
// 校验存在
|
||||
validateBrokerageLevelhistoryExists(id);
|
||||
// 删除
|
||||
brokerageLevelhistoryMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateBrokerageLevelhistoryExists(Long id) {
|
||||
if (brokerageLevelhistoryMapper.selectById(id) == null) {
|
||||
throw exception(BROKERAGE_LEVELHISTORY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BrokerageLevelhistoryRespVO getBrokerageLevelhistory(Long id) {
|
||||
if (brokerageLevelhistoryMapper.selectById(id) == null) {
|
||||
return null;
|
||||
}
|
||||
BrokerageLevelhistoryDO levelhistoryDO = brokerageLevelhistoryMapper.selectById(id);
|
||||
Long brokerageUserId = levelhistoryDO.getBrokerageUserId();
|
||||
BrokerageUserDO brokerageUserDO = brokerageUserMapper.selectById(brokerageUserId);
|
||||
CommonResult<MemberUserRespDTO> memberUserResult = memberUserApi.getUser(brokerageUserDO.getMemberUserId());
|
||||
BrokerageLevelhistoryRespVO respVO = new BrokerageLevelhistoryRespVO();
|
||||
BeanUtils.copyProperties(levelhistoryDO, respVO);
|
||||
if (memberUserResult.getData() != null) {
|
||||
respVO.setBrokerageMemberNickName(memberUserResult.getData().getNickname());
|
||||
}
|
||||
respVO.setBrokerageUserId(brokerageUserId);
|
||||
|
||||
//获取初始等级信息
|
||||
Long initLevelId = levelhistoryDO.getInitLevelId();
|
||||
BrokerageLevelDO initLevelVo = levelMapper.selectById(initLevelId);
|
||||
respVO.setInitLevelId(initLevelId);
|
||||
if (initLevelVo != null) {
|
||||
respVO.setInitLevelName(initLevelVo.getLevelName());
|
||||
}
|
||||
|
||||
//获取目标等级信息
|
||||
Long toLevelId = levelhistoryDO.getToLevelId();
|
||||
BrokerageLevelDO toLevelDO = levelMapper.selectById(toLevelId);
|
||||
respVO.setToLevelId(toLevelId);
|
||||
if (toLevelDO != null) {
|
||||
respVO.setToLevelName(toLevelDO.getLevelName());
|
||||
}
|
||||
|
||||
return respVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<BrokerageLevelhistoryRespVO> getBrokerageLevelhistoryPage(BrokerageLevelhistoryPageReqVO pageReqVO) {
|
||||
PageResult<BrokerageLevelhistoryRespVO> result = new PageResult<>();
|
||||
PageResult<BrokerageLevelhistoryDO> historyDOPageResult = brokerageLevelhistoryMapper.selectPage(pageReqVO);
|
||||
result.setTotal(historyDOPageResult.getTotal());//总量
|
||||
//遍历获取其他信息
|
||||
List<BrokerageLevelhistoryDO> levelhistoryDOList = historyDOPageResult.getList();
|
||||
List<BrokerageLevelhistoryRespVO> respVOList = new ArrayList<BrokerageLevelhistoryRespVO>();
|
||||
for (int i = 0; i < levelhistoryDOList.size(); i++) {
|
||||
//获取会员信息
|
||||
//先获取分销商id 再去查询会员id
|
||||
BrokerageLevelhistoryDO brokerageLevelhistoryDO = levelhistoryDOList.get(i);
|
||||
Long brokerageUserId = brokerageLevelhistoryDO.getBrokerageUserId();
|
||||
BrokerageUserDO brokerageUserDO = brokerageUserMapper.selectById(brokerageUserId);
|
||||
if (brokerageUserDO == null) {
|
||||
continue;
|
||||
}
|
||||
CommonResult<MemberUserRespDTO> memberUserResult = memberUserApi.getUser(brokerageUserDO.getMemberUserId());
|
||||
BrokerageLevelhistoryRespVO respVO = new BrokerageLevelhistoryRespVO();
|
||||
BeanUtils.copyProperties(brokerageLevelhistoryDO, respVO);
|
||||
if (memberUserResult.getData() != null) {
|
||||
respVO.setBrokerageMemberNickName(memberUserResult.getData().getNickname());
|
||||
}
|
||||
respVO.setBrokerageUserId(brokerageUserId);
|
||||
|
||||
//获取初始等级信息
|
||||
Long initLevelId = brokerageLevelhistoryDO.getInitLevelId();
|
||||
BrokerageLevelDO initLevelVo = levelMapper.selectById(initLevelId);
|
||||
respVO.setInitLevelId(initLevelId);
|
||||
if (initLevelVo != null) {
|
||||
respVO.setInitLevelName(initLevelVo.getLevelName());
|
||||
}
|
||||
|
||||
//获取目标等级信息
|
||||
Long toLevelId = brokerageLevelhistoryDO.getToLevelId();
|
||||
BrokerageLevelDO toLevelDO = levelMapper.selectById(toLevelId);
|
||||
respVO.setToLevelId(toLevelId);
|
||||
if (toLevelDO != null) {
|
||||
respVO.setToLevelName(toLevelDO.getLevelName());
|
||||
}
|
||||
respVOList.add(respVO);
|
||||
}
|
||||
|
||||
// return historyDOPageResult;
|
||||
result.setList(respVOList);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package cn.iocoder.yudao.module.hsfx.service.brokerageuser;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.hsfx.controller.admin.brokerageuser.vo.*;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokerageuser.BrokerageUserDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 分销用户 Service 接口
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
public interface BrokerageUserService {
|
||||
|
||||
/**
|
||||
* 创建分销用户
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createBrokerageUser(@Valid BrokerageUserSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新分销用户
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateBrokerageUser(@Valid BrokerageUserSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除分销用户
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteBrokerageUser(Long id);
|
||||
|
||||
/**
|
||||
* 获得分销用户
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 分销用户
|
||||
*/
|
||||
BrokerageUserPageResVO getBrokerageUser(Long id);
|
||||
|
||||
/**
|
||||
* 获得分销用户分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 分销用户分页
|
||||
*/
|
||||
PageResult<BrokerageUserPageResVO> getBrokerageUserPage(BrokerageUserPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,235 @@
|
|||
package cn.iocoder.yudao.module.hsfx.service.brokerageuser;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragelevel.BrokerageLevelDO;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokeragelevelhistory.BrokerageLevelhistoryDO;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.mysql.brokeragelevel.BrokerageLevelMapper;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.mysql.brokeragelevelhistory.BrokerageLevelhistoryMapper;
|
||||
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
|
||||
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import lombok.val;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.checkerframework.checker.units.qual.C;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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.hsfx.controller.admin.brokerageuser.vo.*;
|
||||
import cn.iocoder.yudao.module.hsfx.dal.dataobject.brokerageuser.BrokerageUserDO;
|
||||
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.hsfx.dal.mysql.brokerageuser.BrokerageUserMapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.hsfx.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 分销用户 Service 实现类
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BrokerageUserServiceImpl implements BrokerageUserService {
|
||||
|
||||
@Resource
|
||||
private BrokerageUserMapper brokerageUserMapper;
|
||||
|
||||
@Autowired
|
||||
private BrokerageLevelMapper levelMapper;
|
||||
|
||||
@Autowired
|
||||
private MemberUserApi memberUserApi;
|
||||
|
||||
@Resource
|
||||
private BrokerageLevelhistoryMapper historyMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Long createBrokerageUser(BrokerageUserSaveReqVO createReqVO) {
|
||||
//校验会员是否存在
|
||||
validateMemberUserExists(createReqVO.getMemberUserId());
|
||||
//校验分销等级是否存在
|
||||
validateLevelExists(createReqVO.getLevelId());
|
||||
//校验上级分销商是否存在
|
||||
// BrokerageUserDO parentBrokerageUser = getBrokerageUser(createReqVO.getParentId());
|
||||
BrokerageUserDO parentBrokerageUser = brokerageUserMapper.selectById(createReqVO.getParentId());
|
||||
if (parentBrokerageUser == null) {
|
||||
throw exception(PARENT_BROKERAGE_USER_NOT_EXISTS);
|
||||
}
|
||||
//校验是否已经存在
|
||||
validateBrokerUserExists(createReqVO.getMemberUserId());
|
||||
// 插入
|
||||
BrokerageUserDO brokerageUser = BeanUtils.toBean(createReqVO, BrokerageUserDO.class);
|
||||
brokerageUser.setIsEnable(0);
|
||||
brokerageUser.setDeleted(false);
|
||||
brokerageUserMapper.insert(brokerageUser);
|
||||
// 返回
|
||||
return brokerageUser.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateBrokerageUser(BrokerageUserSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
// validateBrokerageUserExists(updateReqVO.getId());
|
||||
BrokerageUserDO oriUser = brokerageUserMapper.selectById(updateReqVO.getId());
|
||||
if (oriUser == null) {
|
||||
throw exception(BROKERAGE_USER_NOT_EXISTS);
|
||||
}
|
||||
//校验数据库会员id与输入会员id是否一致
|
||||
if (!oriUser.getMemberUserId().equals(updateReqVO.getMemberUserId())) {
|
||||
throw exception(BROKERAGE_USER_MEMBER_MISMATCH);
|
||||
}
|
||||
//校验会员是否存在
|
||||
validateMemberUserExists(updateReqVO.getMemberUserId());
|
||||
//校验等级是否存在
|
||||
validateLevelExists(updateReqVO.getLevelId());
|
||||
//校验上级会员是否存在
|
||||
validateBrokerageUserExists(updateReqVO.getId());
|
||||
|
||||
|
||||
//等级变更记录保存 当两个等级值不一致的时候执行
|
||||
if (oriUser.getLevelId() != updateReqVO.getLevelId()) {
|
||||
BrokerageLevelhistoryDO brokerageLevelhistoryDO = new BrokerageLevelhistoryDO();
|
||||
brokerageLevelhistoryDO.setBrokerageUserId(updateReqVO.getId());//分销商id
|
||||
brokerageLevelhistoryDO.setInitLevelId(oriUser.getLevelId());//初始等级
|
||||
brokerageLevelhistoryDO.setToLevelId(updateReqVO.getLevelId());//目标等级id
|
||||
brokerageLevelhistoryDO.setDeleted(false);
|
||||
historyMapper.insert(brokerageLevelhistoryDO);
|
||||
}
|
||||
// 更新
|
||||
BrokerageUserDO updateObj = BeanUtils.toBean(updateReqVO, BrokerageUserDO.class);
|
||||
brokerageUserMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void deleteBrokerageUser(Long id) {
|
||||
// 校验存在
|
||||
validateBrokerageUserExists(id);
|
||||
// 删除
|
||||
brokerageUserMapper.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BrokerageUserPageResVO getBrokerageUser(Long id) {
|
||||
BrokerageUserDO brokerageUserDO = brokerageUserMapper.selectById(id);
|
||||
//校验存在
|
||||
if (brokerageUserDO == null) {
|
||||
return null;
|
||||
}
|
||||
MPJLambdaWrapper<BrokerageUserDO> wrapper = new MPJLambdaWrapper<>();
|
||||
wrapper.selectAll(BrokerageUserDO.class)
|
||||
.leftJoin(BrokerageLevelDO.class, BrokerageLevelDO::getId, BrokerageUserDO::getLevelId)
|
||||
.select(BrokerageLevelDO::getLevelName)
|
||||
.select(BrokerageLevelDO::getId)
|
||||
.eq(BrokerageUserDO::getId, id);
|
||||
BrokerageUserPageResVO brokerageUserPageResVO = brokerageUserMapper.selectJoinOne(BrokerageUserPageResVO.class, wrapper);
|
||||
BrokerageUserDO parentUserDo = brokerageUserMapper.selectById(brokerageUserPageResVO.getParentId());//上级分销商信息
|
||||
brokerageUserPageResVO.setParentId(parentUserDo.getId());
|
||||
CommonResult<MemberUserRespDTO> parentMemberUserResult = memberUserApi.getUser(parentUserDo.getMemberUserId());
|
||||
if (parentMemberUserResult.getData() != null) {
|
||||
brokerageUserPageResVO.setParentMemberNickName(parentMemberUserResult.getData().getNickname());
|
||||
brokerageUserPageResVO.setParentMemberUserId(parentMemberUserResult.getData().getId());
|
||||
}
|
||||
CommonResult<MemberUserRespDTO> memberUserResult = memberUserApi.getUser(brokerageUserPageResVO.getMemberUserId());
|
||||
if (memberUserResult.getData() != null) {
|
||||
brokerageUserPageResVO.setNickName(memberUserResult.getData().getNickname());
|
||||
brokerageUserPageResVO.setPhone(memberUserResult.getData().getMobile());
|
||||
}
|
||||
return brokerageUserPageResVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<BrokerageUserPageResVO> getBrokerageUserPage(BrokerageUserPageReqVO pageReqVO) {
|
||||
|
||||
Page<BrokerageUserPageResVO> page = new Page(1, 10);
|
||||
MPJLambdaWrapper<BrokerageUserDO> wrapper = new MPJLambdaWrapper<>();
|
||||
wrapper.selectAll(BrokerageUserDO.class)
|
||||
// .select(BrokerageLevelDO::getLevelName)
|
||||
// .select(BrokerageLevelDO::getId)
|
||||
.select(BrokerageLevelDO::getLevelName)
|
||||
.select(BrokerageLevelDO::getId)
|
||||
.leftJoin(BrokerageLevelDO.class, BrokerageLevelDO::getId, BrokerageUserDO::getLevelId);
|
||||
PageResult<BrokerageUserPageResVO> brokerageLevelDOPageResult = brokerageUserMapper.selectJoinPage(new PageParam(), BrokerageUserPageResVO.class, wrapper);
|
||||
List<BrokerageUserPageResVO> list = brokerageLevelDOPageResult.getList();
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
BrokerageUserPageResVO brokerageUserPageResVO = list.get(i);
|
||||
Long parentId = brokerageUserPageResVO.getParentId();
|
||||
BrokerageUserDO brokerageUserDO = brokerageUserMapper.selectById(parentId);
|
||||
brokerageUserPageResVO.setParentMemberUserId(brokerageUserDO.getMemberUserId());
|
||||
list.set(i, brokerageUserPageResVO);
|
||||
}
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
BrokerageUserPageResVO brokerageUserPageResVO = list.get(i);
|
||||
CommonResult<MemberUserRespDTO> memberUserResult = memberUserApi.getUser(brokerageUserPageResVO.getMemberUserId());
|
||||
if (memberUserResult.getData() != null) {
|
||||
brokerageUserPageResVO.setNickName(memberUserResult.getData().getNickname());
|
||||
brokerageUserPageResVO.setPhone(memberUserResult.getData().getMobile());
|
||||
}
|
||||
CommonResult<MemberUserRespDTO> memberParentUserResult = memberUserApi.getUser(brokerageUserPageResVO.getParentMemberUserId());
|
||||
if (memberParentUserResult.getData() != null) {
|
||||
brokerageUserPageResVO.setParentMemberNickName(memberParentUserResult.getData().getNickname());
|
||||
}
|
||||
list.set(i, brokerageUserPageResVO);
|
||||
}
|
||||
brokerageLevelDOPageResult.setList(list);
|
||||
return brokerageLevelDOPageResult;
|
||||
}
|
||||
|
||||
|
||||
//校验分销用户是否存在
|
||||
private void validateBrokerageUserExists(Long id) {
|
||||
if (brokerageUserMapper.selectById(id) == null) {
|
||||
throw exception(BROKERAGE_USER_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
//校验会员是否存在
|
||||
private void validateMemberUserExists(Long memberUserId) {
|
||||
CommonResult<MemberUserRespDTO> userResult = memberUserApi.getUser(memberUserId);
|
||||
System.out.println(userResult);
|
||||
if (userResult.getData() == null) {
|
||||
throw exception(MEMBER_USER_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
//校验分销等级是否存在
|
||||
private void validateLevelExists(Long levelId) {
|
||||
BrokerageLevelDO levelDO = levelMapper.selectById(levelId);
|
||||
if (levelDO == null) {
|
||||
throw exception(BROKERAGE_LEVEL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateBrokerUserExists(Long memberUserId) {
|
||||
LambdaQueryWrapper<BrokerageUserDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(BrokerageUserDO::getMemberUserId, memberUserId);
|
||||
BrokerageUserDO brokerageUserDO = brokerageUserMapper.selectOne(lambdaQueryWrapper);
|
||||
if (brokerageUserDO != null) {
|
||||
throw exception(BROKERAGE_USER_ALREADY_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateBrokerageUserUnique() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -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.hsfx.dal.mysql.brokeragebaseconfig.BrokerageBaseconfigMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 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.hsfx.dal.mysql.brokeragelevel.BrokerageLevelMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 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.hsfx.dal.mysql.brokeragelevelhistory.BrokerageLevelhistoryMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?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.hsfx.dal.mysql.brokerageuser.BrokerageUserMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue