Commit 84198cec authored by zhengyi's avatar zhengyi

Merge branch 'dev' into order-update

# Conflicts:
#	yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/enums/ErrorCodeConstants.java
#	yudao-server/src/main/resources/i18n/messages.properties
#	yudao-server/src/main/resources/i18n/messages_en.properties
#	yudao-server/src/main/resources/i18n/messages_zh.properties
parents 4112dae5 4cb5480a
......@@ -37,6 +37,8 @@
<module>yudao-module-wealth</module>
<!-- 发货管理 -->
<module>yudao-module-shipment</module>
<!-- 礼品管理 -->
<module>yudao-module-reward</module>
</modules>
<name>${project.artifactId}</name>
......
/*
Navicat Premium Data Transfer
Source Server : jiedao-uat
Source Server Type : MySQL
Source Server Version : 80031 (8.0.31)
Source Host : 159.75.224.138:2297
Source Schema : jiedao
Target Server Type : MySQL
Target Server Version : 80031 (8.0.31)
File Encoding : 65001
Date: 15/08/2024 11:03:15
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for member_user_address
-- ----------------------------
DROP TABLE IF EXISTS `member_user_address`;
CREATE TABLE `member_user_address` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
`member_id` bigint NOT NULL COMMENT '会员id',
`is_default` tinyint NULL DEFAULT NULL COMMENT '是否默认地址',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '收货人姓名',
`area_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '区号',
`phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '收货人手机',
`address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '详细地址',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`creator` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
`updater` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '会员收货地址表' ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;
/*
Navicat Premium Data Transfer
Source Server : jiedao-uat
Source Server Type : MySQL
Source Server Version : 80031 (8.0.31)
Source Host : 159.75.224.138:2297
Source Schema : jiedao
Target Server Type : MySQL
Target Server Version : 80031 (8.0.31)
File Encoding : 65001
Date: 15/08/2024 11:03:24
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for member_user_level_config
-- ----------------------------
DROP TABLE IF EXISTS `member_user_level_config`;
CREATE TABLE `member_user_level_config` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '名称',
`lower_count` int NOT NULL COMMENT '起始分数',
`upper_count` int NOT NULL COMMENT '截止分数',
`icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '图标',
`creator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`updater` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人',
`update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '会员等级配置表' ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;
/*
Navicat Premium Data Transfer
Source Server : jiedao-uat
Source Server Type : MySQL
Source Server Version : 80031 (8.0.31)
Source Host : 159.75.224.138:2297
Source Schema : jiedao
Target Server Type : MySQL
Target Server Version : 80031 (8.0.31)
File Encoding : 65001
Date: 15/08/2024 11:03:34
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for member_user_score
-- ----------------------------
DROP TABLE IF EXISTS `member_user_score`;
CREATE TABLE `member_user_score` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
`member_id` bigint NOT NULL COMMENT '会员id',
`hold_score` int NOT NULL DEFAULT 0 COMMENT '持有积分',
`used_score` int NOT NULL DEFAULT 0 COMMENT '已使用积分',
`expired_score` int NOT NULL DEFAULT 0 COMMENT '过期积分',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`creator` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
`updater` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 19 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '会员积分表' ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;
/*
Navicat Premium Data Transfer
Source Server : jiedao-uat
Source Server Type : MySQL
Source Server Version : 80031 (8.0.31)
Source Host : 159.75.224.138:2297
Source Schema : jiedao
Target Server Type : MySQL
Target Server Version : 80031 (8.0.31)
File Encoding : 65001
Date: 15/08/2024 11:03:47
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for member_user_score_detail
-- ----------------------------
DROP TABLE IF EXISTS `member_user_score_detail`;
CREATE TABLE `member_user_score_detail` (
`id` bigint NOT NULL COMMENT '主键',
`member_id` bigint NOT NULL COMMENT '会员id',
`score_count` int NOT NULL DEFAULT 0 COMMENT '积分数量',
`status` int NOT NULL COMMENT '积分状态 ',
`remain_count` int NOT NULL COMMENT '剩余积分',
`expire_time` datetime NULL DEFAULT NULL COMMENT '积分过期时间',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`creator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
`updater` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
`deleted` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除',
`ext_param` json NULL COMMENT '扩展字段',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '会员积分详情表' ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;
/*
Navicat Premium Data Transfer
Source Server : jiedao-uat
Source Server Type : MySQL
Source Server Version : 80031 (8.0.31)
Source Host : 159.75.224.138:2297
Source Schema : jiedao
Target Server Type : MySQL
Target Server Version : 80031 (8.0.31)
File Encoding : 65001
Date: 15/08/2024 11:03:55
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for member_user_score_detail_releation
-- ----------------------------
DROP TABLE IF EXISTS `member_user_score_detail_releation`;
CREATE TABLE `member_user_score_detail_releation` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
`releation_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '关联id',
`source_type` int NOT NULL COMMENT '积分来源',
`detail_id` bigint NOT NULL COMMENT '积分明细id',
`score_count` int NOT NULL COMMENT '积分数量',
`status` int NOT NULL COMMENT '关系状态 1有效2无效',
`creator` varchar(255) CHARACTER SET tis620 COLLATE tis620_thai_ci NULL DEFAULT NULL COMMENT '创建人',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`updater` varchar(255) CHARACTER SET tis620 COLLATE tis620_thai_ci NULL DEFAULT NULL COMMENT '更新人',
`update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 23 CHARACTER SET = tis620 COLLATE = tis620_thai_ci COMMENT = '会员积分详情关联表' ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;
/*
Navicat Premium Data Transfer
Source Server : jiedao-uat
Source Server Type : MySQL
Source Server Version : 80031 (8.0.31)
Source Host : 159.75.224.138:2297
Source Schema : jiedao
Target Server Type : MySQL
Target Server Version : 80031 (8.0.31)
File Encoding : 65001
Date: 15/08/2024 11:04:03
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for member_user_score_log
-- ----------------------------
DROP TABLE IF EXISTS `member_user_score_log`;
CREATE TABLE `member_user_score_log` (
`id` bigint NOT NULL COMMENT '主键',
`member_id` bigint NOT NULL COMMENT '会员id',
`score_count` int UNSIGNED NOT NULL COMMENT '积分数量',
`operate_type` int NOT NULL COMMENT '操作类型 1增加2减少',
`source_type` int NOT NULL COMMENT '积分来源',
`rule_id` int NULL DEFAULT NULL COMMENT '积分规则id',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`ext_param` json NULL COMMENT '扩展参数',
`creator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
`updater` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
`deleted` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除',
`update_time` datetime NULL DEFAULT NULL,
`unique_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '唯一键幂等',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `unique_id`(`unique_id` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '会员积分日志表' ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;
SET FOREIGN_KEY_CHECKS=0;
ALTER TABLE `jiedao`.`member_user` ADD COLUMN `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '会员编号' AFTER `id`;
ALTER TABLE `jiedao`.`member_user` ADD COLUMN `country` int NULL DEFAULT NULL COMMENT '国家' AFTER `control_password`;
ALTER TABLE `jiedao`.`member_user` ADD COLUMN `city` int NULL DEFAULT NULL COMMENT '城市' AFTER `country`;
ALTER TABLE `jiedao`.`member_user` ADD COLUMN `referral_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '推荐码' AFTER `open_id`;
ALTER TABLE `jiedao`.`member_user` ADD COLUMN `register_platform` int NULL DEFAULT 0 COMMENT '注册平台' AFTER `referral_code`;
ALTER TABLE `jiedao`.`member_user` ADD UNIQUE INDEX `code`(`code` ASC) USING BTREE;
SET FOREIGN_KEY_CHECKS=1;
\ No newline at end of file
/*
Navicat Premium Data Transfer
Source Server : jiedao-uat
Source Server Type : MySQL
Source Server Version : 80031 (8.0.31)
Source Host : 159.75.224.138:2297
Source Schema : jiedao
Target Server Type : MySQL
Target Server Version : 80031 (8.0.31)
File Encoding : 65001
Date: 15/08/2024 11:04:17
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for score_rule
-- ----------------------------
DROP TABLE IF EXISTS `score_rule`;
CREATE TABLE `score_rule` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
`type` int NOT NULL COMMENT '指标类型',
`title_zh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '规则标题中文',
`title_en` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '规则标题英文',
`desc_zh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '规则说明中文',
`desc_en` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '规则说明英文',
`cover_image_zh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '封面图中文',
`cover_image_en` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '封面图英文',
`get_score_once` int NOT NULL DEFAULT 0 COMMENT '单次获取积分数',
`max_score_total` int NOT NULL DEFAULT 0 COMMENT '累积最高积分',
`start_time` datetime NOT NULL COMMENT '活动开始时间',
`end_time` datetime NOT NULL COMMENT '活动结束时间',
`score_period` int NOT NULL COMMENT '积分有效期',
`order_num` int NOT NULL COMMENT '排序值',
`push_activity` tinyint NOT NULL DEFAULT 0 COMMENT '是否推送',
`show_platform` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '展示平台',
`status` int NOT NULL COMMENT '活动状态',
`extra` json NULL COMMENT '扩展字段',
`create_time` datetime NOT NULL COMMENT '创建时间',
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
`update_time` datetime NOT NULL COMMENT '更新时间',
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 42 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;
/*
Navicat Premium Data Transfer
Source Server : jiedao-uat
Source Server Type : MySQL
Source Server Version : 80031 (8.0.31)
Source Host : 159.75.224.138:2297
Source Schema : jiedao
Target Server Type : MySQL
Target Server Version : 80031 (8.0.31)
File Encoding : 65001
Date: 15/08/2024 11:04:36
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for ecw_reward
-- ----------------------------
DROP TABLE IF EXISTS `ecw_reward`;
CREATE TABLE `ecw_reward` (
`id` bigint NOT NULL AUTO_INCREMENT,
`code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '礼品ID',
`title_zh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '中文名称',
`title_en` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '英文名称',
`title_fr` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '法文名称',
`img_zh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '中文礼品图片',
`img_en` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '英文礼品图片',
`img_fr` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '法文礼品图片',
`points_require` int NOT NULL COMMENT '兑换所需积分',
`node_id` int NOT NULL COMMENT '兑换网点',
`exchange_count` int NULL DEFAULT 0 COMMENT '已兑换次数',
`quantity_remain` int NOT NULL COMMENT '剩余数量',
`start_time` datetime NULL DEFAULT NULL COMMENT '活动开始时间',
`end_time` datetime NULL DEFAULT NULL COMMENT '活动结束时间',
`pick_method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '领取方式(1上门领取,2包邮到家,3邮寄到付)',
`allow_count` int NOT NULL COMMENT '允许兑换次数',
`remark_zh` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '中文备注',
`remark_en` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '英文备注',
`remark_fr` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '法文备注',
`status` int NOT NULL DEFAULT 0 COMMENT '礼品状态(1已启用,2未启用,3已关闭,4已过期)',
`create_time` datetime NOT NULL COMMENT '创建时间',
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
`update_time` datetime NOT NULL COMMENT '更新时间',
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `unique_code`(`code` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 38 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '礼品' ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;
/*
Navicat Premium Data Transfer
Source Server : jiedao-uat
Source Server Type : MySQL
Source Server Version : 80031 (8.0.31)
Source Host : 159.75.224.138:2297
Source Schema : jiedao
Target Server Type : MySQL
Target Server Version : 80031 (8.0.31)
File Encoding : 65001
Date: 15/08/2024 11:17:08
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for ecw_reward_redeem
-- ----------------------------
DROP TABLE IF EXISTS `ecw_reward_redeem`;
CREATE TABLE `ecw_reward_redeem` (
`id` bigint NOT NULL COMMENT '主键',
`member_id` bigint NOT NULL COMMENT '会员id',
`reward_id` bigint NOT NULL COMMENT '礼品id',
`status` int NULL DEFAULT NULL COMMENT '兑换状态',
`score_count` int NOT NULL COMMENT '积分数量',
`reward_count` int NOT NULL COMMENT '兑换数量',
`redeem_type` int NOT NULL COMMENT '兑换方式',
`entrance` int NOT NULL COMMENT '兑换入口',
`expenses` decimal(10, 2) NULL DEFAULT NULL COMMENT '费用',
`currency` int NULL DEFAULT NULL COMMENT '费用币种',
`recipient_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '收件人姓名',
`recipient_phone_num` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '收件人电话',
`recipient_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '收件人地址',
`redeemer` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '兑换人',
`redemption_time` datetime NULL DEFAULT NULL COMMENT '兑换时间',
`courier_company` int NULL DEFAULT NULL COMMENT '快递公司',
`express_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '快递单号',
`express_date` datetime NULL DEFAULT NULL COMMENT '快递日期',
`express_sender` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '快递寄出人',
`annex` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '上传附件',
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`creator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
`updater` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
`deleted` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除',
`verify_user` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '核销人',
`verify_time` datetime NULL DEFAULT NULL COMMENT '核销时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;
This diff is collapsed.
......@@ -149,4 +149,22 @@ public class DateUtils {
public static String formatDateTime(Date date) {
return null == date ? "" : DateUtil.format(date, FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND);
}
public static Date getNextNDayStart(Date date, int days) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, days);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTime();
}
public static Date addDays(Date date ,int days) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, days);
return calendar.getTime();
}
}
......@@ -32,4 +32,5 @@ public interface DictDataFrameworkService {
*/
List<DictDataRespDTO> listDictDatasFromCache(String type);
DictDataRespDTO parseDictDataFromCacheWithMultiLang(String type, String multiLangLabel);
}
......@@ -25,4 +25,8 @@ public class DictFrameworkUtils {
return service.parseDictDataFromCache(type, label);
}
public static DictDataRespDTO parseDictDataFromCacheWithMultiLang(String type, String multiLangLabel) {
return service.parseDictDataFromCacheWithMultiLang(type, multiLangLabel);
}
}
......@@ -6,8 +6,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import sun.util.locale.BaseLocale;
import sun.util.locale.LocaleUtils;
import java.io.IOException;
import java.util.Locale;
......@@ -44,6 +42,21 @@ public class I18nMessage {
}
}
/**
* 获取一条语言配置信息
*
* @param message 配置信息属性名,eg: api.response.code.user.signUp
* @return
*/
public static String getMessage(String message, Object... arg) {
Locale locale = LocaleContextHolder.getLocale();
try {
return accessor.getMessage(message, arg, locale);
} catch (Exception e) {
return message;
}
}
/**
* 获取一条语言配置信息
* TODO 此方法暂时只支持中英文国际化,如需更多,待优化
......
......@@ -4,7 +4,6 @@ import cn.iocoder.yudao.framework.redis.helper.RedisDistributedLock;
import cn.iocoder.yudao.framework.redis.helper.RedisHelper;
import cn.iocoder.yudao.framework.redis.helper.RedisLockTemplate;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
......
......@@ -1409,4 +1409,8 @@ public class RedisHelper {
public boolean execute(DefaultRedisScript<Boolean> defaultRedisScript, List<String> keys, Object... args) {
return operations.execute(defaultRedisScript, keys, args);
}
public Long execute4Long(DefaultRedisScript<Long> defaultRedisScript, List<String> keys, Object... args) {
return operations.execute(defaultRedisScript, keys, args);
}
}
\ No newline at end of file
package cn.iocoder.yudao.framework.snowflake.config;
import cn.hutool.core.lang.generator.SnowflakeGenerator;
import cn.iocoder.yudao.framework.redis.config.YudaoRedisAutoConfiguration;
import cn.iocoder.yudao.framework.redis.helper.RedisHelper;
import io.micrometer.core.instrument.util.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.annotation.Resource;
import java.net.InetAddress;
import java.net.UnknownHostException;
/**
* @author zhaobiyan
*/
@Slf4j
@Configuration
@AutoConfigureAfter(YudaoRedisAutoConfiguration.class)
public class SnowFlakeConfiguration {
@Resource
private RedisHelper redisHelper;
@Bean
public SnowflakeGenerator snowflakeGenerator() throws UnknownHostException {
String hostAddress = InetAddress.getLocalHost().getHostAddress();
log.info("snow flask configuration, host address:{}", hostAddress);
String workId = redisHelper.get("snowflake:work:id:" + hostAddress);
if (StringUtils.isBlank(workId)) {
Long nextWorkId = redisHelper.incrBy("incr:work:id", 1);
redisHelper.set("snowflake:work:id:" + hostAddress, String.valueOf(nextWorkId));
workId = String.valueOf(nextWorkId);
}
return new SnowflakeGenerator(Long.parseLong(workId), 0);
}
}
......@@ -25,4 +25,5 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
cn.iocoder.yudao.framework.pay.config.YudaoPayAutoConfiguration,\
cn.iocoder.yudao.framework.customizer.CustomizationAutoConfiguration,\
cn.iocoder.yudao.framework.i18n.config.LocaleAutoConfiguration,\
cn.iocoder.yudao.framework.limiter.RedisLimiterConfiguration
cn.iocoder.yudao.framework.limiter.RedisLimiterConfiguration,\
cn.iocoder.yudao.framework.snowflake.config.SnowFlakeConfiguration
package cn.iocoder.yudao.framework.apollo.core.event;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
* 订单起运事件
*
* @author zhangfeng
*/
@Data
@AllArgsConstructor
public class OrderInShippingEvent {
private Long orderId;
private String orderNo;
}
package cn.iocoder.yudao.framework.apollo.core.event.export;
import lombok.Data;
import java.util.List;
@Data
public class MemberScoreDetailExpireEvent {
private List<Long> detailIds;
}
package cn.iocoder.yudao.framework.apollo.core.event.export;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class RewardRedeemRecordExportEvent {
/**
* 操作用户
*/
private Long userId = 0L;
/**
* 端口
*/
private Integer userType = 2;
/**
* 请求参数
*/
private String requestParams;
/**
* 国际化语言值,默认0中文, 具体取值I18nMessage.getLang()
*/
private Integer lang = 0;
/**
* 文件名称
*/
private String fileName;
/**
* 文件路径
*/
private String path;
/**
* 下载地址
*/
private String url;
/**
* 执行结果
*/
private String result;
@ApiModelProperty(value = "文件ID")
private Long fileId;
}
......@@ -88,4 +88,13 @@ public class CustomerExportReqDTO {
private List<Integer> marketType;
private int deptId ;
@ApiModelProperty(value = "会员编号")
private String memberCode;
@ApiModelProperty(value = "会员名称")
private String memberName;
@ApiModelProperty(value = "会员手机")
private String memberMobile;
@ApiModelProperty(value = "会员区号")
private String memberAreaCode;
}
......@@ -92,4 +92,12 @@ public class CustomerPageReqDTO extends PageParam {
@ApiModelProperty(value = "是否潜在客户")
private Boolean isPotential;
@ApiModelProperty(value = "会员编号")
private String memberCode;
@ApiModelProperty(value = "会员名称")
private String memberName;
@ApiModelProperty(value = "会员手机")
private String memberMobile;
@ApiModelProperty(value = "会员区号")
private String memberAreaCode;
}
......@@ -50,4 +50,13 @@ public class IndirectCustomerPageReqDTO {
* 客户来源
*/
private List<Integer> source;
@ApiModelProperty(value = "会员编号")
private String memberCode;
@ApiModelProperty(value = "会员名称")
private String memberName;
@ApiModelProperty(value = "会员手机")
private String memberMobile;
@ApiModelProperty(value = "会员区号")
private String memberAreaCode;
}
......@@ -72,6 +72,7 @@
c.social as default_social,
c.email as default_email,
c.social_number as default_social_number,
c.userid as contact_member_id,
su.nickname as customer_service_name,
su.dept_id as dept_id
from ecw_customer a
......@@ -83,7 +84,7 @@
left join ecw_customer_credit credit
on contact.credit_level = credit.id
left join ecw_country ec on contact.country = ec.id
left join member_user mu on contact.contact_member_id = mu.id
WHERE 1=1 AND contact.deleted = 0
......@@ -113,6 +114,7 @@
c.social as default_social,
c.email as default_email,
c.social_number as default_social_number,
c.userid as contact_member_id,
su.nickname as customer_service_name,
su.dept_id as dept_id
from ecw_customer a
......@@ -124,7 +126,7 @@
left join ecw_customer_credit credit
on contact.credit_level = credit.id
left join ecw_country ec on contact.country = ec.id
left join member_user mu on contact.contact_member_id = mu.id
WHERE 1=1 AND contact.deleted = 0
......@@ -154,6 +156,7 @@
c.social as default_social,
c.email as default_email,
c.social_number as default_social_number,
c.userid as contact_member_id,
su.nickname as customer_service_name,
su.dept_id as dept_id
from ecw_customer a
......@@ -165,7 +168,7 @@
left join ecw_customer_credit credit
on contact.credit_level = credit.id
left join ecw_country ec on contact.country = ec.id
left join member_user mu on contact.contact_member_id = mu.id
WHERE 1=1 AND contact.deleted = 0
......@@ -190,6 +193,7 @@
c.social as default_social,
c.email as default_email,
c.social_number as default_social_number,
c.userid as contact_member_id,
su.nickname as customer_service_name,
su.dept_id as dept_id
from ecw_customer a
......@@ -201,7 +205,7 @@
left join ecw_customer_credit credit
on contact.credit_level = credit.id
left join ecw_country ec on contact.country = ec.id
left join member_user mu on contact.contact_member_id = mu.id
WHERE 1=1 AND contact.deleted = 0
......@@ -394,6 +398,19 @@
</foreach>
</if>
</if>
<!-- 会员信息 -->
<if test="query.memberCode != null and query.memberCode != '' ">
AND mu.code like concat('%',#{query.memberCode},'%')
</if>
<if test="query.memberName != null and query.memberName != '' ">
AND mu.nickname like concat('%',#{query.memberName},'%')
</if>
<if test="query.memberMobile != null and query.memberMobile != '' ">
AND mu.mobile like concat('%',#{query.memberMobile},'%')
</if>
<if test="query.memberAreaCode != null and query.memberAreaCode != '' ">
AND mu.area_code like concat('%',#{query.memberAreaCode},'%')
</if>
</sql>
<select id="getMyCustomerExcelVoList"
resultType="cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO">
......@@ -447,6 +464,7 @@
c.social as default_social,
c.email as default_email,
c.social_number as default_social_number,
c.userid as contact_member_id,
su.nickname as customer_service_name,
su.dept_id as dept_id
from ecw_customer a
......@@ -458,7 +476,7 @@
left join ecw_customer_credit credit
on contact.credit_level = credit.id
left join ecw_country ec on contact.country = ec.id
left join member_user mu on contact.contact_member_id = mu.id
WHERE 1=1 AND contact.deleted = 0
<include refid="myCustomerQuery"/>
......@@ -660,6 +678,19 @@
</foreach>
</if>
</if>
<!-- 会员信息 -->
<if test="query.memberCode != null and query.memberCode != '' ">
AND mu.code like concat('%',#{query.memberCode},'%')
</if>
<if test="query.memberName != null and query.memberName != '' ">
AND mu.nickname like concat('%',#{query.memberName},'%')
</if>
<if test="query.memberMobile != null and query.memberMobile != '' ">
AND mu.mobile like concat('%',#{query.memberMobile},'%')
</if>
<if test="query.memberAreaCode != null and query.memberAreaCode != '' ">
AND mu.area_code like concat('%',#{query.memberAreaCode},'%')
</if>
</sql>
<select id="searchCustomer" resultType="cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO">
select contact.*,
......@@ -1394,6 +1425,7 @@
c.social as default_social,
c.email as default_email,
c.social_number as default_social_number,
c.userid as contact_member_id,
su.nickname as customer_service_name,
su.dept_id as dept_id
from ecw_customer a
......@@ -1405,7 +1437,7 @@
left join ecw_customer_credit credit
on contact.credit_level = credit.id
left join ecw_country ec on contact.country = ec.id
left join member_user mu on contact.contact_member_id = mu.id
WHERE 1=1 AND contact.deleted = 0
......@@ -1428,6 +1460,7 @@
c.social as default_social,
c.email as default_email,
c.social_number as default_social_number,
c.userid as contact_member_id,
su.nickname as customer_service_name,
su.dept_id as dept_id
from ecw_customer a
......@@ -1439,7 +1472,7 @@
left join ecw_customer_credit credit
on contact.credit_level = credit.id
left join ecw_country ec on contact.country = ec.id
left join member_user mu on contact.contact_member_id = mu.id
WHERE 1=1 AND contact.deleted = 0
......@@ -1503,6 +1536,7 @@
c.social as default_social,
c.email as default_email,
c.social_number as default_social_number,
c.userid as contact_member_id,
su.nickname as customer_service_name,
su.dept_id as dept_id
from ecw_customer a
......@@ -1515,7 +1549,7 @@
on contact.credit_level = credit.id
left join ecw_country ec on contact.country = ec.id
left join member_user mu on contact.contact_member_id = mu.id
WHERE 1=1 AND contact.deleted = 0 AND contact.enter_open_sea_time is NOT NULL
<include refid="myCustomerQuery"/>
......@@ -1538,6 +1572,7 @@
c.social as default_social,
c.email as default_email,
c.social_number as default_social_number,
c.userid as contact_member_id,
su.nickname as customer_service_name,
su.dept_id as dept_id
from ecw_customer a
......@@ -1550,7 +1585,7 @@
on contact.credit_level = credit.id
left join ecw_country ec on contact.country = ec.id
left join member_user mu on contact.contact_member_id = mu.id
WHERE 1=1 AND contact.deleted = 0 AND contact.enter_open_sea_time is NOT NULL
<include refid="myCustomerQuery"/>
</select>
......@@ -1610,6 +1645,7 @@
c.social as default_social,
c.email as default_email,
c.social_number as default_social_number,
c.userid as contact_member_id,
su.nickname as customer_service_name,
su.dept_id as dept_id
from ecw_customer a
......@@ -1621,7 +1657,7 @@
left join ecw_customer_credit credit
on contact.credit_level = credit.id
left join ecw_country ec on contact.country = ec.id
left join member_user mu on contact.contact_member_id = mu.id
WHERE 1=1 AND contact.deleted = 0
<if test="deptId != null and deptId>0">
......@@ -1647,6 +1683,7 @@
c.social as default_social,
c.email as default_email,
c.social_number as default_social_number,
c.userid as contact_member_id,
su.nickname as customer_service_name,
su.dept_id as dept_id
from ecw_customer a
......@@ -1658,7 +1695,7 @@
left join ecw_customer_credit credit
on contact.credit_level = credit.id
left join ecw_country ec on contact.country = ec.id
left join member_user mu on contact.contact_member_id = mu.id
WHERE 1=1 AND contact.deleted = 0
<if test="deptId != null and deptId>0">
......
......@@ -49,12 +49,18 @@
concat( c.area_code, c.phone_new, '' ) AS default_contact_phone,
c.email AS default_email,
agent.NAME AS agent_customer_name,
su.nickname AS customer_service_name
su.nickname AS customer_service_name,
mu.code as member_code,
mu.nickname as member_nickname,
mu.mobile as member_mobile,
mu.area_code as member_area_code
FROM
ecw_indirect_customer a
LEFT JOIN ecw_indirect_customer_contacts c ON a.id = c.customer_id
LEFT JOIN ecw_customer agent ON a.agent_customer_id = agent.id
LEFT JOIN system_user su ON a.customer_service = su.id
left join ecw_customer_contacts ecc on agent.id = ecc.customer_id
left join member_user mu on ecc.userid = mu.id
WHERE
c.is_default = 1 AND a.deleted = 0
AND c.deleted = 0
......@@ -150,7 +156,19 @@
</foreach>
</if>
</if>
<!-- 会员信息 -->
<if test="query.memberCode != null and query.memberCode != '' ">
AND contact.member_code like concat('%',#{query.memberCode},'%')
</if>
<if test="query.memberName != null and query.memberName != '' ">
AND contact.member_nickname like concat('%',#{query.memberName},'%')
</if>
<if test="query.memberMobile != null and query.memberMobile != '' ">
AND contact.member_mobile like concat('%',#{query.memberMobile},'%')
</if>
<if test="query.memberAreaCode != null and query.memberAreaCode != '' ">
AND contact.member_area_code like concat('%',#{query.memberAreaCode},'%')
</if>
</sql>
<select id="getOpenSeaCustomerPageReqCount" resultType="java.lang.Long"
parameterType="cn.iocoder.yudao.module.customer.dto.indirectCustomer.IndirectCustomerPageReqDTO">
......@@ -164,12 +182,18 @@
concat( c.area_code, c.phone_new, '' ) AS default_contact_phone,
c.email AS default_email,
agent.NAME AS agent_customer_name,
su.nickname AS customer_service_name
su.nickname AS customer_service_name,
mu.code as member_code,
mu.nickname as member_nickname,
mu.mobile as member_mobile,
mu.area_code as member_area_code
FROM
ecw_indirect_customer a
LEFT JOIN ecw_indirect_customer_contacts c ON a.id = c.customer_id
LEFT JOIN ecw_customer agent ON a.agent_customer_id = agent.id
LEFT JOIN system_user su ON a.customer_service = su.id
left join ecw_customer_contacts ecc on agent.id = ecc.customer_id
left join member_user mu on ecc.userid = mu.id
WHERE
c.is_default = 1 AND a.deleted = 0
AND c.deleted = 0
......@@ -190,12 +214,18 @@
concat( c.area_code, c.phone_new, '' ) AS default_contact_phone,
c.email AS default_email,
agent.NAME AS agent_customer_name,
su.nickname AS customer_service_name
su.nickname AS customer_service_name,
mu.code as member_code,
mu.nickname as member_nickname,
mu.mobile as member_mobile,
mu.area_code as member_area_code
FROM
ecw_indirect_customer a
LEFT JOIN ecw_indirect_customer_contacts c ON a.id = c.customer_id
LEFT JOIN ecw_customer agent ON a.agent_customer_id = agent.id
LEFT JOIN system_user su ON a.customer_service = su.id
left join ecw_customer_contacts ecc on agent.id = ecc.customer_id
left join member_user mu on ecc.userid = mu.id
WHERE
c.is_default = 1 AND a.deleted = 0
AND c.deleted = 0
......
......@@ -123,7 +123,9 @@ public interface WarehouseMapper extends BaseMapperX<WarehouseDO> {
@Select({
"SELECT w.*, ",
"r1.title_zh as guojiaName,",
"r2.title_zh as shiName ",
"r1.title_en as guojiaNameEn,",
"r2.title_zh as shiName, ",
"r2.title_en as shiNameEn ",
"FROM ecw_warehouse w ",
"LEFT JOIN ecw_region r1 ",
"ON w.guojia = r1.id ",
......
......@@ -9,8 +9,10 @@ import java.util.List;
public class WarehouseTreeRegionVO extends WarehouseRespVO{
private String guojiaName ;
private String guojiaNameEn ;
private String shiName;
private String shiNameEn;
private Long pid ;
......
......@@ -6,6 +6,7 @@ import java.math.BigDecimal;
@Data
public class CurrencyRespDTO {
private Integer id;
/**
* 中文名称
*/
......
package cn.iocoder.yudao.module.ecw.api.express;
import cn.iocoder.yudao.module.ecw.api.express.dto.ExpressRespDTO;
import java.util.List;
public interface ExpressApi {
List<ExpressRespDTO> getAllExpress();
}
package cn.iocoder.yudao.module.ecw.api.express.dto;
import lombok.Data;
@Data
public class ExpressRespDTO {
private Long id;
/**
* 快递公司名称
*/
private String companyName;
}
package cn.iocoder.yudao.module.ecw.api.node;
import cn.iocoder.yudao.module.ecw.api.node.dto.NodeRespDTO;
import cn.iocoder.yudao.module.ecw.api.node.dto.NodeTreeRegionDTO;
import java.util.List;
public interface NodeApi {
List<NodeRespDTO> getNodesByCity(Long cityId,Long countryId);
List<NodeTreeRegionDTO> getNodeTreeRegion();
NodeRespDTO getNodesById(Long id);
}
package cn.iocoder.yudao.module.ecw.api.node.dto;
import lombok.Data;
@Data
public class NodeRespDTO {
private Long id;
/**
* 站点编号
*/
private String number;
/**
* 国家
*/
private Long guojia;
/**
* 国家中文
*/
private String guojiaZh;
/**
* 国家英文
*/
private String guojiaEn;
/**
* 市
*/
private Long shi;
/**
* 市中文
*/
private String shiZh;
/**
* 市英文
*/
private String shiEn;
/**
* 中文标题
*/
private String titleZh;
/**
* 英文标题
*/
private String titleEn;
}
package cn.iocoder.yudao.module.ecw.api.node.dto;
import lombok.Data;
@Data
public class NodeTreeRegionDTO {
/**
* 国家id
*/
private Long countryId;
/**
* 国家中文
*/
private String countryZh;
/**
* 国家英文
*/
private String countryEn;
/**
* 城市id
*/
private Long cityId;
/**
* 城市中文
*/
private String cityZh;
/**
* 城市英文
*/
private String cityEn;
/**
* 网点id
*/
private Long nodeId;
/**
* 网点中文
*/
private String nodeZh;
/**
* 网点英文
*/
private String nodeEn;
}
package cn.iocoder.yudao.module.ecw.controller.admin.currency.vo;
package cn.iocoder.yudao.module.ecw.api.vo;
import lombok.*;
import java.math.BigDecimal;
import java.util.*;
import io.swagger.annotations.*;
......
package cn.iocoder.yudao.module.ecw.controller.admin.currency.vo;
import cn.iocoder.yudao.module.ecw.api.vo.CurrencyBaseVO;
import lombok.*;
import io.swagger.annotations.*;
......
package cn.iocoder.yudao.module.ecw.controller.admin.currency.vo;
import cn.iocoder.yudao.module.ecw.api.vo.CurrencyBaseVO;
import lombok.*;
import io.swagger.annotations.*;
......
package cn.iocoder.yudao.module.ecw.controller.admin.currency.vo;
import cn.iocoder.yudao.module.ecw.api.vo.CurrencyBaseVO;
import lombok.*;
import io.swagger.annotations.*;
import javax.validation.constraints.*;
......
......@@ -4,7 +4,9 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.*;
......@@ -17,11 +19,13 @@ import java.util.stream.Collectors;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.ecw.controller.admin.node.vo.*;
......@@ -83,6 +87,13 @@ public class NodeController {
return success(NodeConvert.INSTANCE.convertList(list));
}
@GetMapping("/list-all-simple")
@ApiOperation(value = "获得服务网点精简信息列表", notes = "主要用于前端的下拉选项")
public CommonResult<List<NodeSimpleRespVO>> getNodeListAllSimple() {
List<NodeDO> list = nodeService.getNodeList();
return success(NodeConvert.INSTANCE.convertListSimple(list));
}
@GetMapping("/page")
@ApiOperation("获得服务网点分页")
// @PreAuthorize("@ss.hasPermission('ecw:node:query')")
......@@ -93,12 +104,18 @@ public class NodeController {
return success(NodeConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/get-node-tree-region")
@ApiOperation("获得网点树状列表")
public CommonResult<List<NodeTreeRegionSimpleVO>> getNodeTreeRegion() {
return success(nodeService.getNodeTreeRegion());
}
@GetMapping("/export-excel")
@ApiOperation("导出服务网点 Excel")
@PreAuthorize("@ss.hasPermission('ecw:node:export')")
@OperateLog(type = EXPORT)
public void exportNodeExcel(@Valid NodeExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
HttpServletResponse response) throws IOException {
List<NodeDO> list = nodeService.getNodeList(exportReqVO);
matchUser(list);
......@@ -113,13 +130,13 @@ public class NodeController {
.filter(t -> t.getAdminId() != null)
.map(NodeDO::getAdminId)
.collect(Collectors.toList());
if(CollectionUtil.isEmpty(userIdList)) return;
if (CollectionUtil.isEmpty(userIdList)) return;
List<AdminUserRespDTO> userList = adminUserApi.getUsers(userIdList);
Map<Long, String> userNameMap = userList.stream()
.collect(Collectors.toMap(AdminUserRespDTO::getId, AdminUserRespDTO::getNickname, (v1,v2)->v2));
.collect(Collectors.toMap(AdminUserRespDTO::getId, AdminUserRespDTO::getNickname, (v1, v2) -> v2));
nodeList.forEach(t -> {
Long adminId = t.getAdminId();
if(adminId != null && userNameMap.containsKey(adminId)) {
if (adminId != null && userNameMap.containsKey(adminId)) {
t.setAdminName(userNameMap.get(adminId));
}
});
......
package cn.iocoder.yudao.module.ecw.controller.admin.node.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
@ApiModel("网点精简信息 Response VO")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class NodeSimpleRespVO {
@ApiModelProperty(value = "", required = true)
private Long id;
@ApiModelProperty(value = "中文标题")
private String titleZh;
@ApiModelProperty(value = "英文标题")
private String titleEn;
}
package cn.iocoder.yudao.module.ecw.controller.admin.node.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
import java.util.Objects;
@Data
public class NodeTreeRegionSimpleVO {
@ApiModelProperty("国家id")
private Long id;
@ApiModelProperty("国家中文名")
private String labelZh;
@ApiModelProperty("国家英文名")
private String labelEn;
@ApiModelProperty("城市")
private List<NodeCity> children;
@Data
public static class NodeCity {
@ApiModelProperty("城市id")
private Long id;
@ApiModelProperty("城市中文名")
private String labelZh;
@ApiModelProperty("城市英文名")
private String labelEn;
@ApiModelProperty("网点")
private List<Node> children;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NodeCity that = (NodeCity) o;
return Objects.equals(id, that.id);
}
@Override
public int hashCode() {
return Objects.hashCode(id);
}
}
@Data
public static class Node {
@ApiModelProperty("网点id")
private Long id;
@ApiModelProperty("网点中文名")
private String labelZh;
@ApiModelProperty("网点英文名")
private String labelEn;
}
}
......@@ -208,4 +208,13 @@ public class RegionController {
return pNode;
}
@GetMapping("/getCityListByParent")
@ApiOperation("根据父节点获取城市列表")
public CommonResult<List<RegionRespVO>> getCityListByParent(@RequestParam("id") Long parentId) {
if (parentId == null) {
return CommonResult.success(Collections.emptyList());
}
List<RegionDO> cityList = regionService.getCityListByParentId(parentId);
return success(RegionConvert.INSTANCE.convertList(cityList));
}
}
......@@ -4,6 +4,7 @@ import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.ecw.api.express.dto.ExpressRespDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import cn.iocoder.yudao.module.ecw.controller.admin.express.vo.*;
......@@ -31,4 +32,5 @@ public interface ExpressConvert {
List<ExpressExcelVO> convertList02(List<ExpressDO> list);
List<ExpressRespDTO> convert2DTO(List<ExpressDO> list);
}
......@@ -27,6 +27,8 @@ public interface NodeConvert {
List<NodeRespVO> convertList(List<NodeDO> list);
List<NodeSimpleRespVO> convertListSimple(List<NodeDO> list);
PageResult<NodeRespVO> convertPage(PageResult<NodeDO> page);
List<NodeExcelVO> convertList02(List<NodeDO> list);
......
......@@ -5,6 +5,7 @@ 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.ecw.api.node.dto.NodeTreeRegionDTO;
import cn.iocoder.yudao.module.ecw.dal.dataobject.node.NodeDO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
......@@ -81,4 +82,5 @@ public interface NodeMapper extends BaseMapperX<NodeDO> {
.orderByDesc(NodeDO::getId));
}
List<NodeTreeRegionDTO> getNodeTreeRegionList();
}
......@@ -102,4 +102,5 @@ public interface RegionMapper extends BaseMapperX<RegionDO> {
List<RegionDO> getImportExportCountryList();
List<RegionDO> getCityListByParentId(@Param("parentId") Long parentId);
}
package cn.iocoder.yudao.module.ecw.service.api;
import cn.iocoder.yudao.module.ecw.api.express.ExpressApi;
import cn.iocoder.yudao.module.ecw.api.express.dto.ExpressRespDTO;
import cn.iocoder.yudao.module.ecw.convert.express.ExpressConvert;
import cn.iocoder.yudao.module.ecw.dal.dataobject.express.ExpressDO;
import cn.iocoder.yudao.module.ecw.service.express.ExpressService;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
@Component
public class ExpressApiImpl implements ExpressApi {
@Resource
private ExpressService expressService;
@Override
public List<ExpressRespDTO> getAllExpress() {
List<ExpressDO> list = expressService.list();
return ExpressConvert.INSTANCE.convert2DTO(list);
}
}
package cn.iocoder.yudao.module.ecw.service.api;
import cn.iocoder.yudao.module.ecw.api.node.NodeApi;
import cn.iocoder.yudao.module.ecw.api.node.dto.NodeRespDTO;
import cn.iocoder.yudao.module.ecw.api.node.dto.NodeTreeRegionDTO;
import cn.iocoder.yudao.module.ecw.dal.dataobject.node.NodeDO;
import cn.iocoder.yudao.module.ecw.dal.dataobject.region.RegionDO;
import cn.iocoder.yudao.module.ecw.dal.mysql.node.NodeMapper;
import cn.iocoder.yudao.module.ecw.service.region.RegionService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Service
public class NodeApiImpl implements NodeApi {
@Resource
private NodeMapper nodeMapper;
@Resource
private RegionService regionService;
@Override
public List<NodeRespDTO> getNodesByCity(Long cityId, Long countryId) {
List<NodeDO> city = null;
if (cityId != null) {
city = nodeMapper.selectList("shi", cityId);
} else if (countryId != null) {
city = nodeMapper.selectList("guojia", countryId);
}
if (city != null && !city.isEmpty()) {
ArrayList<NodeRespDTO> nodeRespDTOS = new ArrayList<>();
for (NodeDO nodeDO : city) {
NodeRespDTO nodeRespDTO = new NodeRespDTO();
BeanUtils.copyProperties(nodeDO, nodeRespDTO);
nodeRespDTOS.add(nodeRespDTO);
}
return nodeRespDTOS;
}
return null;
}
@Override
public List<NodeTreeRegionDTO> getNodeTreeRegion() {
return nodeMapper.getNodeTreeRegionList();
}
@Override
public NodeRespDTO getNodesById(Long id) {
NodeDO nodeDO = nodeMapper.selectById(id);
if (nodeDO != null) {
NodeRespDTO nodeRespDTO = new NodeRespDTO();
BeanUtils.copyProperties(nodeDO, nodeRespDTO);
RegionDO regionCountry = regionService.getRegion(nodeRespDTO.getGuojia());
nodeRespDTO.setGuojiaZh(regionCountry.getTitleZh());
nodeRespDTO.setGuojiaEn(regionCountry.getTitleEn());
RegionDO regionCity = regionService.getRegion(nodeRespDTO.getShi());
nodeRespDTO.setShiZh(regionCity.getTitleZh());
nodeRespDTO.setShiEn(regionCity.getTitleEn());
return nodeRespDTO;
}
return null;
}
}
......@@ -67,4 +67,5 @@ public interface ExpressService {
*/
List<ExpressDO> getExpressList(ExpressExportReqVO exportReqVO);
List<ExpressDO> list();
}
package cn.iocoder.yudao.module.ecw.service.express;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
......@@ -79,4 +81,11 @@ public class ExpressServiceImpl implements ExpressService {
return expressMapper.selectList(exportReqVO);
}
@Override
public List<ExpressDO> list() {
LambdaQueryWrapper<ExpressDO> wrapper = Wrappers.lambdaQuery();
wrapper.eq(ExpressDO::getDeleted, 0);
return expressMapper.selectList(wrapper);
}
}
......@@ -51,6 +51,13 @@ public interface NodeService {
*/
List<NodeDO> getNodeList(Collection<Long> ids);
/**
* 获得服务网点列表
*
* @return 所有服务网点列表
*/
List<NodeDO> getNodeList();
/**
* 获得服务网点分页
*
......@@ -69,4 +76,5 @@ public interface NodeService {
*/
List<NodeDO> getNodeList(NodeExportReqVO exportReqVO);
List<NodeTreeRegionSimpleVO> getNodeTreeRegion();
}
package cn.iocoder.yudao.module.ecw.service.node;
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.yudao.module.ecw.api.node.dto.NodeTreeRegionDTO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
......@@ -71,6 +72,11 @@ public class NodeServiceImpl implements NodeService {
return nodeMapper.selectBatchIds(ids);
}
@Override
public List<NodeDO> getNodeList() {
return nodeMapper.selectList();
}
@Override
public PageResult<NodeDO> getNodePage(NodePageReqVO pageReqVO) {
return nodeMapper.selectPage(pageReqVO);
......@@ -81,6 +87,60 @@ public class NodeServiceImpl implements NodeService {
return nodeMapper.selectList(exportReqVO);
}
@Override
public List<NodeTreeRegionSimpleVO> getNodeTreeRegion() {
List<NodeTreeRegionDTO> nodeList = nodeMapper.getNodeTreeRegionList();
Map<Long, NodeTreeRegionSimpleVO> countryMap = new LinkedHashMap<>();
Map<Long, Map<Long, NodeTreeRegionSimpleVO.NodeCity>> cityMap = new LinkedHashMap<>();
for (NodeTreeRegionDTO dto : nodeList) {
Long countryId = dto.getCountryId();
String countryZh = dto.getCountryZh();
String countryEn = dto.getCountryEn();
Long cityId = dto.getCityId();
String cityZh = dto.getCityZh();
String cityEn = dto.getCityEn();
Long nodeId = dto.getNodeId();
String nodeZh = dto.getNodeZh();
String nodeEn = dto.getNodeEn();
// 处理国家
NodeTreeRegionSimpleVO countryVO = countryMap.computeIfAbsent(countryId, id -> {
NodeTreeRegionSimpleVO vo = new NodeTreeRegionSimpleVO();
vo.setId(id);
vo.setLabelZh(countryZh.trim());
vo.setLabelEn(countryEn);
vo.setChildren(new ArrayList<>());
return vo;
});
// 处理城市
Map<Long, NodeTreeRegionSimpleVO.NodeCity> cities = cityMap.computeIfAbsent(countryId, k -> new LinkedHashMap<>());
NodeTreeRegionSimpleVO.NodeCity cityVO = cities.computeIfAbsent(cityId, id -> {
NodeTreeRegionSimpleVO.NodeCity city = new NodeTreeRegionSimpleVO.NodeCity();
city.setId(id);
city.setLabelZh(cityZh.trim());
city.setLabelEn(cityEn);
city.setChildren(new ArrayList<>());
return city;
});
// 处理网点
NodeTreeRegionSimpleVO.Node node = new NodeTreeRegionSimpleVO.Node();
node.setId(nodeId);
node.setLabelZh(nodeZh);
node.setLabelEn(nodeEn);
cityVO.getChildren().add(node);
if (!countryVO.getChildren().contains(cityVO)) {
countryVO.getChildren().add(cityVO);
}
}
return new ArrayList<>(countryMap.values());
}
@Override
public PageResult<NodeDO> getNodePageList(NodePageReqVO pageReqVO) {
IPage<NodeDO> mpPage = MyBatisUtils.buildPage(pageReqVO);
......
......@@ -90,5 +90,5 @@ public interface RegionService {
List<RegionDO> getImportExportCountryList();
List<RegionDO> getCityListByParentId(Long parentId);
}
......@@ -144,4 +144,9 @@ public class RegionServiceImpl implements RegionService {
public List<RegionDO> getImportExportCountryList() {
return regionMapper.getImportExportCountryList();
}
@Override
public List<RegionDO> getCityListByParentId(Long parentId) {
return regionMapper.getCityListByParentId(parentId);
}
}
......@@ -32,6 +32,26 @@
order by node.aorder desc
</select>
<select id="getNodeTreeRegionList" resultType="cn.iocoder.yudao.module.ecw.api.node.dto.NodeTreeRegionDTO">
SELECT
n.guojia AS countryId,
c.title_zh AS countryZh,
c.title_en AS countryEn,
n.shi AS cityId,
p.title_zh AS cityZh,
p.title_en AS cityEn,
n.id AS nodeId,
n.title_zh AS nodeZh,
n.title_en AS nodeEn
FROM
ecw_node n
LEFT JOIN
ecw_region c ON n.guojia = c.id
LEFT JOIN
ecw_region p ON n.shi = p.id
ORDER BY
n.guojia, n.shi, n.id;
</select>
</mapper>
......@@ -68,4 +68,13 @@
and b.status = 0
and b.type in (1, 3)
</select>
<select id="getCityListByParentId" resultType="cn.iocoder.yudao.module.ecw.dal.dataobject.region.RegionDO">
select b.* from ecw_region a
left join ecw_region b on a.id = b.parent_id
where a.parent_id = #{parentId}
AND a.deleted = 0
and b.deleted = 0
and a.status = 0
and b.status = 0
</select>
</mapper>
......@@ -14,6 +14,7 @@ public interface ErrorCodeConstants {
ErrorCode CONFIG_KEY_DUPLICATE = new ErrorCode(1001000002, "参数配置 key 重复");
ErrorCode CONFIG_CAN_NOT_DELETE_SYSTEM_TYPE = new ErrorCode(1001000003, "不能删除类型为系统内置的参数配置");
ErrorCode CONFIG_GET_VALUE_ERROR_IF_SENSITIVE = new ErrorCode(1001000004, "不允许获取敏感配置到前端");
ErrorCode GET_LOCK_FAILED = new ErrorCode(1001000005, "get.lock.failed");
// ========== 定时任务 1001001000 ==========
ErrorCode JOB_NOT_EXISTS = new ErrorCode(1001001000, "定时任务不存在");
......
package cn.iocoder.yudao.module.member.api;
import cn.iocoder.yudao.module.member.enums.ScoreRuleTypeEnum;
/**
* @author zhangfeng
*/
public interface ScoreProducerApi {
void sendOderMessage(ScoreRuleTypeEnum scoreRuleType, Long orderId, String orderNo);
void sendRecommendMessage(ScoreRuleTypeEnum scoreRuleType, Long userId, String referralCode);
void sendRegisterMessage(ScoreRuleTypeEnum scoreRuleType, Long userId, String userNameZh, String userNameEn, String phone, Integer registerPlatform);
}
package cn.iocoder.yudao.module.member.api.score;
import cn.iocoder.yudao.module.member.api.score.dto.MemberUserScoreBatchOperateReqDTO;
import cn.iocoder.yudao.module.member.api.score.dto.MemberUserScoreOperateReqDTO;
import cn.iocoder.yudao.module.member.api.score.dto.MemberUserScoreOperateRespDTO;
import cn.iocoder.yudao.module.member.api.score.dto.ReleationScoreExpireInfoDTO;
import cn.iocoder.yudao.module.member.enums.ScoreSourceTypeEnum;
import java.util.List;
public interface MemberUserScoreApi {
MemberUserScoreOperateRespDTO operateScore(MemberUserScoreOperateReqDTO req);
List<MemberUserScoreOperateRespDTO> batchOperateScore(MemberUserScoreBatchOperateReqDTO req);
List<ReleationScoreExpireInfoDTO> getScoreExpireInfo(String releation, ScoreSourceTypeEnum scoreSourceTypeEnum);
}
package cn.iocoder.yudao.module.member.api.score.dto;
import cn.iocoder.yudao.module.member.enums.ScoreOperateTypeEnum;
import cn.iocoder.yudao.module.member.enums.ScoreSourceTypeEnum;
import lombok.Builder;
import lombok.Data;
import lombok.ToString;
import java.util.List;
import java.util.Map;
@Data
@Builder
@ToString
public class MemberUserScoreBatchOperateReqDTO {
/**
* 会员id
*/
private List<Long> memberIds;
/**
* 积分数量
*/
private Integer scoreCount;
/**
* 积分来源
*/
private ScoreSourceTypeEnum sourceType;
/**
* 人工操作时必传,其他来源不需要传
*/
private ScoreOperateTypeEnum operateType;
/**
* 积分规则id
*/
private Long ruleId;
/**
* 积分过期时间
*/
private Integer expireDays;
/**
* 扩展参数
*/
private Map<String, Object> extParam;
private String uniqueId;
}
package cn.iocoder.yudao.module.member.api.score.dto;
import cn.iocoder.yudao.module.member.enums.ScoreOperateTypeEnum;
import cn.iocoder.yudao.module.member.enums.ScoreSourceTypeEnum;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
public class MemberUserScoreDetailUpdateReqDto {
private Long memberId;
private Integer scoreCount;
private ScoreOperateTypeEnum operateType;
private ScoreSourceTypeEnum sourceType;
private Long scoreLogId;
private Integer expireDays;
private String releationId;
}
package cn.iocoder.yudao.module.member.api.score.dto;
import cn.iocoder.yudao.module.member.enums.ScoreOperateTypeEnum;
import cn.iocoder.yudao.module.member.enums.ScoreSourceTypeEnum;
import lombok.Builder;
import lombok.Data;
import lombok.ToString;
import java.util.Map;
@Data
@Builder
@ToString
public class MemberUserScoreOperateReqDTO {
/**
* 唯一键 增加积分时必须,做幂等判断使用
*/
private String uniqueId;
/**
* 会员id
*/
private Long memberId;
/**
* 积分数量
*/
private Integer scoreCount;
/**
* 积分来源
*/
private ScoreSourceTypeEnum sourceType;
/**
* 人工操作时必传,其他来源不需要传
*/
private ScoreOperateTypeEnum operateType;
/**
* 若操作的积分后续存在回退逻辑时必传, 目前存在 礼品兑换后, 兑换取消,扣除积分的回退
*/
private String releationId;
/**
* 积分规则id
*/
private Long ruleId;
/**
* 积分过期时间
*/
private Integer expireDays;
/**
* 扩展参数
*/
private Map<String, Object> extParam;
}
package cn.iocoder.yudao.module.member.api.score.dto;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
public class MemberUserScoreOperateRespDTO {
private boolean success;
private int code;
private MemberUserScoreOperateReqDTO reqDTO;
public static MemberUserScoreOperateRespDTO success(MemberUserScoreOperateReqDTO req){
return MemberUserScoreOperateRespDTO.builder().success(true).code(200).reqDTO(req).build();
}
}
package cn.iocoder.yudao.module.member.api.score.dto;
import cn.iocoder.yudao.module.member.enums.ScoreOperateTypeEnum;
import cn.iocoder.yudao.module.member.enums.ScoreSourceTypeEnum;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
public class MemberUserScoreUpdateReqDTO {
private Long memberId;
private Integer scoreCount;
private ScoreOperateTypeEnum operateType;
private ScoreSourceTypeEnum sourceType;
}
package cn.iocoder.yudao.module.member.api.score.dto;
import lombok.Data;
import java.util.Date;
@Data
public class ReleationScoreExpireInfoDTO {
private Long detailId;
private Date expireDate;
private Integer scoreCount;
}
......@@ -46,4 +46,9 @@ public class UserRespDTO {
*/
private String controlPassword;
private Integer holdScore;
private Integer country;
private Integer city;
}
package cn.iocoder.yudao.module.member.api.user.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("管理后台 - 会员信息 VO")
public class MemberUserVo {
@ApiModelProperty(value = "会员信息")
private Long id;
private String name;
}
......@@ -40,4 +40,34 @@ public interface ErrorCodeConstants {
ErrorCode EMAIL_CODE_ERROR = new ErrorCode(1004007004, "验证码错误");
ErrorCode MEMBER_ID_IS_NULL = new ErrorCode(1004008001, "member.id.is.null");
ErrorCode SCORE_COUNT_ERROR = new ErrorCode(1004008002, "score.count.error");
ErrorCode MEMBER_SCORE_NOT_ENOUGH = new ErrorCode(1004008003, "member.score.not.enough");
ErrorCode REVERSE_SOURCE_NO_RELEATION_ID = new ErrorCode(1004008004, "reverse.source.no.releation.id");
ErrorCode LEVEL_BOUND_RANGE_ERROR = new ErrorCode(1004008005, "level.bound.range.error");
ErrorCode LEVEL_BOUND_RANGE_CONFLICT = new ErrorCode(1004008006, "level.bound.range.conflict");
ErrorCode SOURCE_TYPE_IS_NULL = new ErrorCode(1004008007, "source.type.is.null");
ErrorCode SCORE_OPERATE_MUST_HAVE_UNIQUE_ID = new ErrorCode(1004008008, "score.operate.must.have.unique.id");
ErrorCode SCORE_OPERATE_IDEMPOTENT_ERROR = new ErrorCode(1004008009, "score.operate.idempotent.error");
ErrorCode SCORE_RULE_NOT_EXISTS = new ErrorCode(1004008010, "score.rule.not.exists");
ErrorCode SCORE_RULE_DELETE_ERROR = new ErrorCode(1004008011, "score.rule.delete.error");
ErrorCode SCORE_RULE_UPDATE_ERROR = new ErrorCode(1004008012, "score.rule.update.error");
ErrorCode SCORE_RULE_STATUS_ERROR = new ErrorCode(1004008014, "score.rule.status.error");
ErrorCode SCORE_RULE_STATUS_NOT_ENABLE = new ErrorCode(1004008015, "score.rule.status.not.enable");
ErrorCode SCORE_RULE_UNIQUE_CHECK_ERROR = new ErrorCode(1004008016, "score.rule.unique.check.error");
ErrorCode SCORE_RULE_TRANSPORT_TYPE_ERROR = new ErrorCode(1004008017, "score.rule.transport.type.error");
ErrorCode SCORE_RULE_TIME_ERROR = new ErrorCode(1004008018, "score.rule.time.error");
ErrorCode SCORE_RULE_PERIOD_ERROR = new ErrorCode(1004008019, "score.rule.period.error");
ErrorCode ORDERV_SCORE_RULE_ERROR = new ErrorCode(1004008020, "orderv.score.rule.error");
ErrorCode SCORE_RULE_SHARE_STATUS_ERROR = new ErrorCode(1004008021, "score.rule.share.status.error");
ErrorCode SCORE_RULE_EXTRA_ERROR = new ErrorCode(1004008022, "score.rule.extra.error");
ErrorCode SCORE_RULE_RECEIVE_ADDRESS_ERROR = new ErrorCode(1004008023, "score.rule.receive.address.error");
ErrorCode SCORE_RULE_ORDERENTRY_ERROR = new ErrorCode(1004008024, "score.rule.orderentry.error");
ErrorCode SCORE_RULE_FIRST_ORDER_ERROR = new ErrorCode(1004008025, "score.rule.first.order.error");
ErrorCode USER_ADDRESS_NOT_EXISTS = new ErrorCode(1004008026, "user.address.not.exists");
ErrorCode USER_ADDRESS_FIELD_ERROR = new ErrorCode(1004008027, "user.address.field.error");
}
package cn.iocoder.yudao.module.member.enums;
public enum MemberScoreDetailReleationStatueEnum {
AVAILABLE(1, "有效"),
NOT_AVAILABLE(2, "失效")
;
private final int value;
private final String name;
MemberScoreDetailReleationStatueEnum(int value, String name) {
this.value = value;
this.name = name;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
}
package cn.iocoder.yudao.module.member.enums;
public enum MemberScoreStatueEnum {
AVAILABLE(1, "可用"),
PART_AVAILABLE(2, "部分可用"),
NOT_AVAILABLE(3, "不可用")
;
private final int value;
private final String name;
MemberScoreStatueEnum(int value, String name) {
this.value = value;
this.name = name;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
}
package cn.iocoder.yudao.module.member.enums;
public enum MemberUserScoreTypeEnum {
HOLD_SCORE(1, "持有积分"),
EXPIRED_SCORE(2, "过期积分"),
INVALID_SCORE(3, "已失效积分")
;
private final int value;
private final String name;
MemberUserScoreTypeEnum(int value, String name) {
this.value = value;
this.name = name;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
}
package cn.iocoder.yudao.module.member.enums;
public enum PlatformTypeEnum {
BACKEND(1, "后台"),
APP(2, "APP"),
WEB(3, "WEB");
private final int value;
private final String name;
PlatformTypeEnum(int value, String name) {
this.value = value;
this.name = name;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
}
package cn.iocoder.yudao.module.member.enums;
public enum RelationSymbolEnum {
GT(1, "大于"),
EQ(2, "等于"),
LT(3, "小于");
private final int value;
private final String name;
RelationSymbolEnum(int value, String name) {
this.value = value;
this.name = name;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
}
\ No newline at end of file
package cn.iocoder.yudao.module.member.enums;
import java.util.stream.Stream;
public enum ScoreOperateTypeEnum {
ADD(1, "增加"),
REDUCE(2, "减少");
private final int value;
private final String name;
ScoreOperateTypeEnum(int value, String name) {
this.value = value;
this.name = name;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
public static ScoreOperateTypeEnum parseByValue(int value) {
return Stream.of(values()).filter(e -> e.getValue() == value).findAny().orElse(null);
}
}
package cn.iocoder.yudao.module.member.enums;
public enum ScoreRuleStatusEnum {
ENABLED(1, "已启用"),
DISABLED(2, "未启用"),
CLOSED(3, "已关闭"),
EXPIRED(4, "已过期");
private final int value;
private final String name;
ScoreRuleStatusEnum(int value, String name) {
this.value = value;
this.name = name;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
}
package cn.iocoder.yudao.module.member.enums;
public enum ScoreRuleTypeEnum {
ORDER_V(1, "订单V值"),
REGISTER(2, "注册"),
RECOMMEND(3, "推荐"),
SHARE(4, "分享活动");
private final int value;
private final String name;
ScoreRuleTypeEnum(int value, String name) {
this.value = value;
this.name = name;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
}
package cn.iocoder.yudao.module.member.enums;
import com.google.common.collect.Sets;
import java.util.Set;
import java.util.stream.Stream;
public enum ScoreSourceTypeEnum {
MANUAL_OPERATE(1, "人工操作", null, null),
EXCHANGE_REWARD(2, "兑换礼品", ScoreOperateTypeEnum.REDUCE, null),
SYSTEM_EXPIRED(3, "系统失效", ScoreOperateTypeEnum.REDUCE, null),
EXCHANGE_REWARD_CANCEL(4, "兑换礼品撤销", ScoreOperateTypeEnum.ADD, EXCHANGE_REWARD),
ORDER_V(5, "订单V值", ScoreOperateTypeEnum.ADD, null),
REGISTER(6, "注册", ScoreOperateTypeEnum.ADD, null),
RECOMMEND(7, "推荐", ScoreOperateTypeEnum.ADD, null),
SHARE(8, "分享活动", ScoreOperateTypeEnum.ADD, null);
private final int value;
private final String name;
private final ScoreOperateTypeEnum operateType;
private final ScoreSourceTypeEnum reverseSource;
ScoreSourceTypeEnum(int value, String name, ScoreOperateTypeEnum operateType, ScoreSourceTypeEnum reverseSource) {
this.value = value;
this.name = name;
this.operateType = operateType;
this.reverseSource = reverseSource;
}
public int getValue() {
return value;
}
public ScoreSourceTypeEnum getReverseSource() {
return reverseSource;
}
public String getName() {
return name;
}
public ScoreOperateTypeEnum getOperateType() {
return operateType;
}
public static Set<ScoreSourceTypeEnum> getInvalidScoreStatusSourceType() {
return Sets.newHashSet(MANUAL_OPERATE, SYSTEM_EXPIRED);
}
public static ScoreSourceTypeEnum parseByValue(int value) {
return Stream.of(values()).filter(e -> e.getValue() == value).findAny().orElse(null);
}
}
package cn.iocoder.yudao.module.member.enums;
import java.util.stream.Stream;
public enum TransportTypeEnum {
OCEAN_LCL(1, "海运拼柜"),
SPECIAL_LINE_AIR_FREIGHT(3, "专线空运");
private final int value;
private final String name;
TransportTypeEnum(int value, String name) {
this.value = value;
this.name = name;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
public static TransportTypeEnum parseByValue(int value) {
return Stream.of(values()).filter(e -> e.getValue() == value).findAny().orElse(null);
}
}
package cn.iocoder.yudao.module.member.enums;
public enum YesOrNoTypeEnum {
YES,
NO;
}
......@@ -41,8 +41,28 @@
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-system-impl</artifactId>
<version>1.6.1-snapshot</version>
<version>${revision}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-depository-core</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-order-api</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-customer-core</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-reward-api</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
</project>
package cn.iocoder.yudao.module.member.controller.admin.job;
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* 会员编号刷新任务
* @author zhaobiyan
*/
@Component
@Slf4j
public class MemberCodeFlushTask implements JobHandler {
@Resource
private MemberUserService userService;
@Override
public String execute(String param) throws Exception {
userService.historyCodeFlush();
return "success";
}
}
package cn.iocoder.yudao.module.member.controller.admin.job;
import cn.hutool.json.JSONArray;
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.module.member.api.score.MemberUserScoreApi;
import cn.iocoder.yudao.module.member.api.score.dto.MemberUserScoreOperateReqDTO;
import cn.iocoder.yudao.module.member.dal.dataobject.scoreDetail.MemberUserScoreDetailDO;
import cn.iocoder.yudao.module.member.enums.MemberScoreStatueEnum;
import cn.iocoder.yudao.module.member.enums.ScoreSourceTypeEnum;
import cn.iocoder.yudao.module.member.service.scoreDetail.MemberUserScoreDetailService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 会员积分过期定时任务
*/
@Component
@Slf4j
public class MemberUserScoreExpireTask implements JobHandler {
/**
* 会员积分的过期时间为每日的0点整
* 任务每天0点整运行,扫描当天0点过期的积分进行状态修改
* @param param 参数
* @return
* @throws Exception
*/
@Resource
private MemberUserScoreDetailService scoreDetailService;
@Resource
private MemberUserScoreApi memberUserScoreApi;
@Override
public String execute(String param) throws Exception {
log.info("member user score expire task running");
LambdaQueryWrapper<MemberUserScoreDetailDO> wrapper = Wrappers.lambdaQuery();
wrapper.in(MemberUserScoreDetailDO::getStatus, Lists.newArrayList(MemberScoreStatueEnum.AVAILABLE.getValue(),
MemberScoreStatueEnum.PART_AVAILABLE.getValue()));
wrapper.le(MemberUserScoreDetailDO::getExpireTime, DateUtils.getNextNDayStart(new Date(), 0));
wrapper.orderByAsc(MemberUserScoreDetailDO::getCreateTime);
List<MemberUserScoreDetailDO> todoList = scoreDetailService.list(wrapper);
log.info("member user score expire task, to expire record count :{}", todoList.size());
if (CollectionUtils.isEmpty(todoList)) {
return "success";
}
for (MemberUserScoreDetailDO memberUserScoreDetailDO : todoList) {
try {
log.info("score expire, score detail id :{}", memberUserScoreDetailDO.getId());
JSONArray logIds = memberUserScoreDetailDO.getExtParamByKey(MemberUserScoreDetailDO.MemberUserScoreDetailExtKey.LOG_IDS);
Map<String, Object> extParam = new HashMap<>();
extParam.put("scoreLogIds", logIds.toList(Long.class));
memberUserScoreApi.operateScore(MemberUserScoreOperateReqDTO.builder()
.memberId(memberUserScoreDetailDO.getMemberId())
.scoreCount(memberUserScoreDetailDO.getRemainCount())
.sourceType(ScoreSourceTypeEnum.SYSTEM_EXPIRED)
.uniqueId(memberUserScoreDetailDO.getId() + "_" + System.currentTimeMillis())
.extParam(extParam)
.build());
} catch (Exception e) {
log.error("member user score expire exception, data:{}", memberUserScoreDetailDO, e);
}
}
log.info("member user score expire task finished");
return "success";
}
}
package cn.iocoder.yudao.module.member.controller.admin.level;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.service.level.MemberUserLevelConfigService;
import cn.iocoder.yudao.module.member.vo.userLevel.MemberUserLevelConfigBaseRespVO;
import cn.iocoder.yudao.module.member.vo.userLevel.MemberUserLevelConfigReqVO;
import cn.iocoder.yudao.module.member.vo.userLevel.MemberUserLevelConfigUpdateVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Validated
@RestController
@Api(tags = "管理后台 - 会员等级配置")
@RequestMapping("/member/user-level")
public class MemberUserLevelConfigController {
private final MemberUserLevelConfigService userLevelConfigService;
public MemberUserLevelConfigController(MemberUserLevelConfigService userLevelConfigService) {
this.userLevelConfigService = userLevelConfigService;
}
@PostMapping("/page")
@ApiOperation("列表")
public CommonResult<PageResult<MemberUserLevelConfigBaseRespVO>> getLevelPage(@Valid @RequestBody MemberUserLevelConfigReqVO query) {
return success(userLevelConfigService.getLevelPage(query));
}
@PostMapping("/delete")
@ApiOperation("删除")
public CommonResult<Boolean> delete(@Valid @RequestBody List<Long> ids) {
return success(userLevelConfigService.delete(ids));
}
@PostMapping("/add")
@ApiOperation("新增")
public CommonResult<Boolean> add(@Valid @RequestBody MemberUserLevelConfigUpdateVO query) {
return success(userLevelConfigService.add(query));
}
@PostMapping("/update")
@ApiOperation("编辑")
public CommonResult<Boolean> update(@Valid @RequestBody MemberUserLevelConfigUpdateVO query) {
return success(userLevelConfigService.updateLevel(query));
}
}
package cn.iocoder.yudao.module.member.controller.admin.scoreRule;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.util.ExcelUtils;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.member.api.ScoreProducerApi;
import cn.iocoder.yudao.module.member.convert.scoreRule.ScoreRuleConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.scoreRule.ScoreRuleDO;
import cn.iocoder.yudao.module.member.enums.ScoreRuleTypeEnum;
import cn.iocoder.yudao.module.member.service.scoreRule.ScoreRuleService;
import cn.iocoder.yudao.module.member.vo.scoreRule.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.context.ApplicationContext;
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 javax.validation.constraints.NotNull;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
@Validated
@RestController
@Api(tags = "管理后台 - 积分规则")
@RequestMapping("/member/score-rule")
public class ScoreRuleController {
@Resource
private ScoreRuleService scoreRuleService;
@Resource
private ApplicationContext applicationContext;
@Resource
private ScoreProducerApi scoreProducerApi;
@PostMapping("/create")
@ApiOperation("创建积分规则")
@Idempotent(timeout = 3)
@PreAuthorize("@ss.hasPermission('member:score-rule:create')")
public CommonResult<Long> createScoreRule(@Valid @RequestBody ScoreRuleCreateReqVO createReqVO) {
return success(scoreRuleService.createScoreRule(createReqVO));
}
@PostMapping("/update")
@ApiOperation("更新积分规则")
@PreAuthorize("@ss.hasPermission('member:score-rule:update')")
public CommonResult<Boolean> updateScoreRule(@Valid @RequestBody ScoreRuleUpdateReqVO updateReqVO) {
scoreRuleService.updateScoreRule(updateReqVO);
return success(true);
}
@PostMapping("/delete")
@ApiOperation("删除积分规则")
@PreAuthorize("@ss.hasPermission('member:score-rule:delete')")
public CommonResult<Boolean> deleteScoreRule(@Valid @RequestBody IdReqVo idReqVo) {
scoreRuleService.deleteScoreRule(idReqVo.getId());
return success(true);
}
@PostMapping("/get")
@ApiOperation("获得积分规则详情")
@PreAuthorize("@ss.hasPermission('member:score-rule:query')")
public CommonResult<ScoreRuleBackDetailVO> getScoreRule(@Valid @RequestBody IdReqVo idReqVo) {
ScoreRuleBackDetailVO scoreRuleBackDetailVO = scoreRuleService.getScoreRule(idReqVo.getId());
return success(scoreRuleBackDetailVO);
}
@PostMapping("/list")
@ApiOperation("获得积分规则列表")
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
@PreAuthorize("@ss.hasPermission('member:score-rule:query')")
public CommonResult<List<ScoreRuleBackVO>> getScoreRuleList(@NotNull @RequestParam Collection<Long> ids) {
List<ScoreRuleBackVO> list = scoreRuleService.getScoreRuleList(ids);
return success(list);
}
@PostMapping("/page")
@ApiOperation("获得积分规则分页")
@PreAuthorize("@ss.hasPermission('member:score-rule:query')")
public CommonResult<PageResult<ScoreRuleBackVO>> getScoreRulePage(@Valid @RequestBody ScoreRuleQueryVO query, PageVO page) {
PageResult<ScoreRuleBackVO> pageResult = scoreRuleService.getScoreRulePage(query, page);
return success(pageResult);
}
@PostMapping("/status")
@ApiOperation("启用关闭")
@PreAuthorize("@ss.hasPermission('member:score-rule:update')")
public CommonResult<Boolean> updateStatus(@Valid @RequestBody ScoreRuleStatusReqVO scoreRuleStatusReqVO) {
scoreRuleService.updateStatus(scoreRuleStatusReqVO);
return success(true);
}
@PostMapping("/copy")
@ApiOperation("复制规则")
@Idempotent(timeout = 3)
@PreAuthorize("@ss.hasPermission('member:score-rule:create')")
public CommonResult<Long> copyScoreRule(@Valid @RequestBody IdReqVo idReqVo) {
return success(scoreRuleService.copyScoreRule(idReqVo.getId()));
}
@PostMapping("/delay")
@ApiOperation("延期规则")
@PreAuthorize("@ss.hasPermission('member:score-rule:update')")
public CommonResult<Boolean> delayScoreRule(@Valid @RequestBody ScoreDelayReqVO scoreDelayReqVO) {
scoreRuleService.delayScoreRule(scoreDelayReqVO);
return success(true);
}
@GetMapping("/warehouse-tree-region-list")
@ApiOperation("获得目的国、目的城市、目的仓列表")
public CommonResult<List<WarehouseTreeRegionSimpleVO>> warehouseTreeRegionList() {
List<WarehouseTreeRegionSimpleVO> list = scoreRuleService.getWarehouseTreeRegionListSimple();
return success(list);
}
@GetMapping("/test-score-rule")
@ApiOperation("测试订单V值触发")
public CommonResult<Void> testScoreRule(@RequestParam Long orderId, @RequestParam String orderNo) {
//applicationContext.publishEvent(new OrderInShippingEvent(orderId, orderNo));
scoreProducerApi.sendOderMessage(ScoreRuleTypeEnum.ORDER_V, orderId <= 0 ? null : orderId, orderNo);
return success(null);
}
@GetMapping("/export-excel")
@ApiOperation("导出积分规则Excel")
@PreAuthorize("@ss.hasPermission('member:score-rule:export')")
@OperateLog(type = EXPORT)
public void exportScoreRuleExcel(@Valid ScoreRuleQueryVO query,
HttpServletResponse response) throws IOException {
List<ScoreRuleDO> list = scoreRuleService.getScoreRuleList(query);
// 导出 Excel
List<ScoreRuleBackVO> datas = ScoreRuleConvert.INSTANCE.convertList(list);
ExcelUtils.write(response, "积分规则.xls", "数据", ScoreRuleBackVO.class, datas);
}
}
......@@ -27,6 +27,7 @@ import cn.iocoder.yudao.module.member.dal.dataobject.userEnterpriseAuth.UserEnte
import cn.iocoder.yudao.module.member.dal.dataobject.userOperationLog.UserOperationLogDO;
import cn.iocoder.yudao.module.member.enums.ErrorCodeConstants;
import cn.iocoder.yudao.module.member.enums.UserAuditStatusEnum;
import cn.iocoder.yudao.module.member.service.level.MemberUserLevelConfigService;
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
import cn.iocoder.yudao.module.member.service.userCardAuth.UserCardAuthService;
import cn.iocoder.yudao.module.member.service.userEnterpriseAuth.UserEnterpriseAuthService;
......@@ -35,7 +36,10 @@ import cn.iocoder.yudao.module.member.vo.userCardAuth.UserCardAuthBackVO;
import cn.iocoder.yudao.module.member.vo.userCardAuth.UserCardAuthCreateReqVO;
import cn.iocoder.yudao.module.member.vo.userEnterpriseAuth.UserEnterpriseAuthBackVO;
import cn.iocoder.yudao.module.member.vo.userEnterpriseAuth.UserEnterpriseAuthCreateReqVO;
import cn.iocoder.yudao.module.member.vo.userLevel.MemberUserLevelConfigBaseRespVO;
import cn.iocoder.yudao.module.member.vo.userLevel.MemberUserScoreLevelVO;
import cn.iocoder.yudao.module.member.vo.userOperationLog.UserOperationLogBackVO;
import com.alibaba.excel.util.CollectionUtils;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
......@@ -94,6 +98,9 @@ public class MemberUserController {
@Resource
private PasswordEncoder passwordEncoder;
@Resource
private MemberUserLevelConfigService memberUserLevelConfigService;
@GetMapping("/member-user-list")
@ApiOperation("获得会员帐号列表-下拉列表使用")
......@@ -135,6 +142,16 @@ public class MemberUserController {
if (passwordEncoder.matches("88888888", user.getPassword())) {
userBackVO.setIsSimplePassword(Boolean.TRUE);
}
MemberUserLevelConfigBaseRespVO userScoreLevelVO = memberUserLevelConfigService.getLevelByCount(user.getTotalScore());
MemberUserScoreLevelVO scoreLevelVO = MemberUserScoreLevelVO.builder().memberId(user.getId())
.memberCode(user.getMemberCode())
.holdScore(user.getHoldScore())
.expiredScore(user.getExpiredScore())
.usedScore(user.getUsedScore())
.levelIcon(userScoreLevelVO.getIcon())
.levelName(userScoreLevelVO.getName())
.build();
userBackVO.setUserScoreLevelInfo(scoreLevelVO);
userBackVO.setPassword(null);
userBackVO.setBackLetterImg(null);
return success(userBackVO);
......@@ -459,5 +476,10 @@ public class MemberUserController {
return success(null);
}
@PutMapping("/memberCode/flush")
@ApiOperation("刷新历史会员编码")
public CommonResult<String> memberCodeFlush() {
userService.historyCodeFlush();
return success(null);
}
}
package cn.iocoder.yudao.module.member.controller.admin.user.vo;
import cn.iocoder.yudao.module.member.vo.userLevel.MemberUserScoreLevelVO;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
......@@ -233,4 +234,26 @@ public class UserBackVO {
@ApiModelProperty(value = "是否简单密码", example = "false")
private Boolean isSimplePassword = Boolean.FALSE;
/**
* 客户编码
*/
@ApiModelProperty(value = "客户编码")
private String customerCode;
/**
* 客户编码
*/
@ApiModelProperty(value = "客户id")
private Long customerId;
@ApiModelProperty(value = "会员编码")
private String memberCode;
@ApiModelProperty(value = "会员积分信息")
private MemberUserScoreLevelVO userScoreLevelInfo;
@ApiModelProperty(value = "会员国家中文")
private String countryTitleZh;
@ApiModelProperty(value = "会员国家英文")
private String countryTitleEn;
@ApiModelProperty(value = "会员城市中文")
private String cityTitleZh;
@ApiModelProperty(value = "会员国家英文")
private String cityTitleEn;
}
......@@ -31,5 +31,8 @@ public class UserQueryVO {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "创建结束时间")
private Date endCreateTime;
@ApiModelProperty(value = "客户编码")
private String customerCode;
@ApiModelProperty(value = "会员编码")
private String memberCode;
}
package cn.iocoder.yudao.module.member.controller.admin.userScore;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.module.member.api.score.MemberUserScoreApiImpl;
import cn.iocoder.yudao.module.member.api.score.dto.MemberUserScoreBatchOperateReqDTO;
import cn.iocoder.yudao.module.member.api.score.dto.MemberUserScoreOperateRespDTO;
import cn.iocoder.yudao.module.member.enums.ScoreOperateTypeEnum;
import cn.iocoder.yudao.module.member.enums.ScoreSourceTypeEnum;
import cn.iocoder.yudao.module.member.service.score.MemberUserScoreService;
import cn.iocoder.yudao.module.member.vo.memberUserScore.MemberUserScoreBackVO;
import cn.iocoder.yudao.module.member.vo.memberUserScore.MemberUserScoreOperateQueryVO;
import cn.iocoder.yudao.module.member.vo.memberUserScore.MemberUserScoreQueryVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Validated
@RestController
@Api(tags = "管理后台 - 会员积分")
@RequestMapping("/member/user-score")
public class MemberUserScoreController {
@Resource
private MemberUserScoreService userScoreService;
@Resource
private MemberUserScoreApiImpl scoreApi;
@PostMapping("/page")
@ApiOperation("获得会员积分分页")
@PreAuthorize("@ss.hasPermission('member:user-score:query')")
public CommonResult<PageResult<MemberUserScoreBackVO>> getUserScorePage(@Valid @RequestBody MemberUserScoreQueryVO query) {
PageResult<MemberUserScoreBackVO> pageResult = userScoreService.getUserScorePage(query);
return success(pageResult);
}
@PostMapping("/operate")
@ApiOperation("操作积分")
@Idempotent(timeout = 5)
@PreAuthorize("@ss.hasPermission('member:user-score:operate')")
public CommonResult<Boolean> operate(@Valid @RequestBody MemberUserScoreOperateQueryVO query) {
Map<String,Object> extParam = new HashMap<>();
extParam.put("comment", query.getComment());
List<MemberUserScoreOperateRespDTO> memberUserScoreOperateRespDTOS = scoreApi.batchOperateScore(MemberUserScoreBatchOperateReqDTO.builder()
.memberIds(query.getMemberIds())
.scoreCount(query.getScoreCount())
.operateType(ScoreOperateTypeEnum.parseByValue(query.getOperateType()))
.sourceType(ScoreSourceTypeEnum.MANUAL_OPERATE)
.extParam(extParam)
.uniqueId(String.valueOf(System.currentTimeMillis()))
.build());
return success(null);
}
}
package cn.iocoder.yudao.module.member.controller.admin.userScoreLog;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.service.scoreLog.MemberUserScoreLogService;
import cn.iocoder.yudao.module.member.vo.memberUserScoreLog.MemberUserScoreLogBackVO;
import cn.iocoder.yudao.module.member.vo.memberUserScoreLog.MemberUserScoreLogQueryVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Validated
@RestController
@Api(tags = "管理后台 - 会员积分记录")
@RequestMapping("/member/user-score-log")
public class MemberUserScoreLogController {
@Resource
private MemberUserScoreLogService memberUserScoreLogService;
@PostMapping("/page")
@ApiOperation("获得积分记录分页")
@PreAuthorize("@ss.hasPermission('member:user-score-log:query')")
public CommonResult<PageResult<MemberUserScoreLogBackVO>> page(@Valid @RequestBody MemberUserScoreLogQueryVO query) {
PageResult<MemberUserScoreLogBackVO> pageResult = memberUserScoreLogService.getPage(query);
return success(pageResult);
}
}
package cn.iocoder.yudao.module.member.controller.app.address;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.module.member.convert.address.UserAddressConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.address.UserAddressDO;
import cn.iocoder.yudao.module.member.service.address.UserAddressService;
import cn.iocoder.yudao.module.member.vo.address.UserAddressBackVO;
import cn.iocoder.yudao.module.member.vo.address.UserAddressCreateReqVO;
import cn.iocoder.yudao.module.member.vo.address.UserAddressUpdateReqVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Validated
@RestController
@Api(tags = "用户 APP - 会员收货地址")
@RequestMapping("/member/user-address")
public class UserAddressController {
@Resource
private UserAddressService userAddressService;
@PostMapping("/create")
@ApiOperation("创建会员收货地址")
@Idempotent(timeout = 5)
//@PreAuthenticated
public CommonResult<Long> createUserAddress(@Valid @RequestBody UserAddressCreateReqVO createReqVO) {
return success(userAddressService.createUserAddress(createReqVO));
}
@PostMapping("/update")
@ApiOperation("更新会员收货地址")
//@PreAuthenticated
public CommonResult<Boolean> updateUserAddress(@Valid @RequestBody UserAddressUpdateReqVO updateReqVO) {
userAddressService.updateUserAddress(updateReqVO);
return success(true);
}
@PostMapping("/delete")
@ApiOperation("删除会员收货地址")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
//@PreAuthenticated
public CommonResult<Boolean> deleteUserAddress(@RequestParam("id") Long id) {
userAddressService.deleteUserAddress(id);
return success(true);
}
@GetMapping("/get")
@ApiOperation("根据id获得会员收货地址")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
//@PreAuthenticated
public CommonResult<UserAddressBackVO> getUserAddress(@RequestParam("id") Long id) {
UserAddressDO userAddress = userAddressService.getUserAddress(id);
return success(UserAddressConvert.INSTANCE.convert(userAddress));
}
@GetMapping("/member/list")
@ApiOperation("获得会员收货地址列表")
@ApiImplicitParam(name = "id", value = "会员id", required = true, example = "1024", dataTypeClass = Long.class)
//@PreAuthenticated
public CommonResult<List<UserAddressBackVO>> getUserAddressList(@RequestParam("id") Long memberId) {
List<UserAddressDO> list = userAddressService.getUserAddressListByMemberId(memberId);
return success(UserAddressConvert.INSTANCE.convertList(list));
}
//@GetMapping("/list")
//@ApiOperation("获得会员收货地址列表")
//@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
////@PreAuthenticated
//public CommonResult<List<UserAddressBackVO>> getUserAddressList(@RequestParam("ids") Collection<Long> ids) {
// List<UserAddressDO> list = userAddressService.getUserAddressList(ids);
// return success(UserAddressConvert.INSTANCE.convertList(list));
//}
//@GetMapping("/page")
//@ApiOperation("获得会员收货地址分页")
//@PreAuthenticated
//public CommonResult<PageResult<UserAddressBackVO>> getUserAddressPage(@Valid UserAddressQueryVO query, PageVO page) {
// PageResult<UserAddressDO> pageResult = userAddressService.getUserAddressPage(query, page);
// return success(UserAddressConvert.INSTANCE.convertPage(pageResult));
//}
//@GetMapping("/export-excel")
//@ApiOperation("导出会员收货地址 Excel")
//@PreAuthenticated
//@OperateLog(type = EXPORT)
//public void exportUserAddressExcel(@Valid UserAddressQueryVO query,
// HttpServletResponse response) throws IOException {
// List<UserAddressDO> list = userAddressService.getUserAddressList(query);
// // 导出 Excel
// List<UserAddressBackVO> datas = UserAddressConvert.INSTANCE.convertList(list);
// ExcelUtils.write(response, "会员收货地址.xls", "数据", UserAddressBackVO.class, datas);
//}
}
......@@ -43,4 +43,9 @@ public class AppAuthRegReqVO {
@ApiModelProperty(value = "英文名称", required = false, example = "+86")
private String englishName;
@ApiModelProperty(value = "推荐码", required = false)
private String referralCode;
@ApiModelProperty(value = "注册平台(2APP,3WEB)", required = true)
private Integer registerPlatform;
}
......@@ -34,4 +34,7 @@ public class AppAuthSmsLoginReqVO {
@Pattern(regexp = "^[0-9]+$", message = "{app.auth.captcha.pattern}")
private String code;
@ApiModelProperty(value = "登录平台(2APP,3WEB)", required = true, example = "1")
private Integer loginPlatform;
}
package cn.iocoder.yudao.module.member.controller.app.scoreRule;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.module.member.api.ScoreProducerApi;
import cn.iocoder.yudao.module.member.controller.app.scoreRule.vo.AppScoreRuleBackDetailVO;
import cn.iocoder.yudao.module.member.controller.app.scoreRule.vo.AppScoreRuleListBackVO;
import cn.iocoder.yudao.module.member.controller.app.scoreRule.vo.AppScoreRuleListReqVO;
import cn.iocoder.yudao.module.member.service.scoreRule.ScoreRuleService;
import cn.iocoder.yudao.module.member.vo.scoreRule.IdReqVo;
import cn.iocoder.yudao.module.member.vo.scoreRule.ScoreRuleBackVO;
import cn.iocoder.yudao.module.member.vo.scoreRule.ScoreRuleQueryVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.context.ApplicationContext;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Validated
@RestController
@Api(tags = "客户端 - 积分规则")
@RequestMapping("/member/score-rule")
public class AppScoreRuleController {
@Resource
private ScoreRuleService scoreRuleService;
@Resource
private ApplicationContext applicationContext;
@Resource
private ScoreProducerApi scoreProducerApi;
@PostMapping("/get")
@ApiOperation("客户端获得积分规则详情")
public CommonResult<AppScoreRuleBackDetailVO> getScoreRule(@Valid @RequestBody IdReqVo idReqVo) {
AppScoreRuleBackDetailVO scoreRuleBackDetailVO = scoreRuleService.appGetScoreRule(idReqVo.getId());
return success(scoreRuleBackDetailVO);
}
@PostMapping("/list")
@ApiOperation("客户端获得积分规则列表")
public CommonResult<List<AppScoreRuleListBackVO>> getScoreRuleList(@Valid @RequestBody AppScoreRuleListReqVO reqVO) {
List<AppScoreRuleListBackVO> list = scoreRuleService.appGetScoreRuleList(reqVO);
return success(list);
}
//@PostMapping("/page")
//@ApiOperation("获得积分规则分页")
//public CommonResult<PageResult<ScoreRuleBackVO>> getScoreRulePage(@Valid @RequestBody ScoreRuleQueryVO query, PageVO page) {
// PageResult<ScoreRuleBackVO> pageResult = scoreRuleService.getScoreRulePage(query, page);
// return success(pageResult);
//}
}
package cn.iocoder.yudao.module.member.controller.app.scoreRule.vo;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel("客户端 - 积分规则详细信息 Response VO")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AppScoreRuleBackDetailVO extends AppScoreRuleListBackVO {
@ApiModelProperty(value = "单次获取积分数")
private Integer getScoreOnce;
@ApiModelProperty(value = "累积最高积分")
private Integer maxScoreTotal;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "活动开始时间")
private Date startTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "活动结束时间")
private Date endTime;
@ApiModelProperty(value = "积分有效期")
private Integer scorePeriod;
}
package cn.iocoder.yudao.module.member.controller.app.scoreRule.vo;
import cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleOrderVExtraVO;
import cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleShareExtraVO;
import cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRulerRecommendExtraVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 积分规则 resp VO
*
* @author 系统管理员
*/
@Data
@ApiModel("客户端 - 积分规则列表 Response VO")
public class AppScoreRuleListBackVO {
@ApiModelProperty(value = "主键", required = true)
private Long id;
@ApiModelProperty(value = "指标类型", required = true)
private Integer type;
@ApiModelProperty(value = "指标类型中文")
private String typeZh;
@ApiModelProperty(value = "指标类型英文")
private String typeEn;
@ApiModelProperty(value = "规则标题中文", required = true)
private String titleZh;
@ApiModelProperty(value = "规则标题英文", required = true)
private String titleEn;
@ApiModelProperty(value = "规则说明中文", required = true)
private String descZh;
@ApiModelProperty(value = "规则说明英文", required = true)
private String descEn;
@ApiModelProperty(value = "封面图中文")
private String coverImageZh;
@ApiModelProperty(value = "封面图英文")
private String coverImageEn;
@ApiModelProperty(value = "推荐扩展字段")
private ScoreRulerRecommendExtraVO extraRecommend;
@ApiModelProperty(value = "分享扩展字段")
private ScoreRuleShareExtraVO extraShare;
@ApiModelProperty(value = "订单V值扩展字段")
private ScoreRuleOrderVExtraVO extraOrderV;
}
package cn.iocoder.yudao.module.member.controller.app.scoreRule.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 积分规则 req VO
* @author 系统管理员
*/
@Data
@ApiModel("客户端 - 积分规则列表 req VO")
public class AppScoreRuleListReqVO {
@ApiModelProperty(value = "平台入口(2APP,3WEB)", required = true)
@NotNull(message = "平台入口不能为空")
private Integer platform;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment