Commit ebb459b3 authored by 332784038@qq.com's avatar 332784038@qq.com

Merge branch 'dev' into release

parents a301bb57 9a492f87
......@@ -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;
......@@ -70,5 +70,5 @@ alter table `ecw_order`
update ecw_order o left join ecw_customer c on c.id = o.customer_id set o.yeji_type = IFNULL(c.is_new, 1);
-- 2027-08-07 仓库路线新增落款信息和图章名称
alter table ecw_warehouse_line add column lk_left varchar(600) COMMENT '左侧落款',add column lk_right varchar(600) COMMENT '右侧落款',add column tz_name varchar(255) COMMENT '图章名称';
alter table ecw_warehouse_line add column lk_left varchar(600) DEFAULT NULL COMMENT '左侧落款',add column lk_right varchar(600) DEFAULT NULL COMMENT '右侧落款',add column tz_name varchar(255) DEFAULT NULL COMMENT '图章名称';
-- 2024-08-24 订单控货现在参数控货订单锁定天数
alter table `ecw_order`
add column `lock_consignee_day` int default 0 COMMENT '锁定收货人天数';
alter table `ecw_order`
add column `lock_consignee_time` datetime default NULL COMMENT '放货锁定收货人到期时间';
alter table `ecw_order`
add column `is_limit_update_consignee` bit default 0 COMMENT '是否限制修改收获人';
\ No newline at end of file
-- ----------------------------
-- Table structure for ecw_customer_competitor
-- ----------------------------
DROP TABLE IF EXISTS `ecw_customer_competitor`;
CREATE TABLE `ecw_customer_competitor` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`name` varchar(512) NOT NULL COMMENT '名称',
`creator` varchar(32) NOT NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime NOT NULL COMMENT '创建时间',
`updater` varchar(32) DEFAULT '' COMMENT '更新者',
`update_time` datetime NOT NULL COMMENT '更新时间',
`deleted` bit DEFAULT false COMMENT '是否删除',
PRIMARY KEY (`id`),
KEY (`create_time`)
) COMMENT='客户竞争对手表';
-- 添加新字段
alter table `ecw_customer` add column `first_deal_time` datetime default null COMMENT '首次成交时间';
alter table `ecw_customer` add column `get_method` Integer default null COMMENT '获取方式';
alter table `ecw_customer` add column `create_from` Integer default null COMMENT '创建入口';
alter table `ecw_customer` add column `customer_service_confirmed_time` datetime default null COMMENT '确认接收时间';
alter table `ecw_customer` add column `busi_country_ids` varchar(100) default null COMMENT '业务国家ids';
alter table `ecw_customer` add column `roles` varchar(100) default null COMMENT '客户角色';
alter table `ecw_customer` add column `competitor_ids` varchar(100) default null COMMENT '竞争对手ids';
alter table `ecw_customer` add column `weight_yearly` decimal(15, 2) DEFAULT 0 COMMENT '年度发货量';
alter table `ecw_customer` add column `num_yearly` int DEFAULT 0 COMMENT '年度发货次数';
alter table `ecw_customer` add column `default_billing` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否默认开票';
-- 更新表
alter table `ecw_customer`
change column `pickup_point` `pickup_points` varchar(100) DEFAULT NULL COMMENT '常用提货网点ids';
alter table `ecw_customer`
change column `product_id` `product_ids` varchar(300) DEFAULT NULL COMMENT '主营产品ids';
-- 更新客户角色
update ecw_customer set roles = '2' where FIND_IN_SET(2, type) != 0 or FIND_IN_SET(3, type) != 0;
-- 添加新字段
alter table `ecw_customer` add column `no_consignee` bit(1) NOT NULL DEFAULT b'0' COMMENT '控货无收货人';
alter table `ecw_customer` add column `default_pay` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否默认付款';
-- 添加新字段
alter table `ecw_warehouse` add column `rent_free_days` int DEFAULT NULL COMMENT '仓库免租期';
alter table `ecw_warehouse` add column `lock_recipient_days` int DEFAULT NULL COMMENT '锁定收货人天数';
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;
}
......@@ -92,8 +92,9 @@ public enum WorkFlowEmus {
FINANCE_COMMISSION_PAYMENT_APPROVE_NO("finance_commission_payment_approve_no", "财务审核-佣金付款单反审核"),
FINANCE_COMMISSION_PAYMENT_WRITE_OFF("finance_commission_payment_write_off", "财务审核-佣金付款单核销审核"),
FINANCE_COMMISSION_PAYMENT_WRITE_OFF_NO("finance_commission_payment_write_off_no", "财务审核-佣金付款单反核销审核"),
SHIPMENT_LINE_WEIGHT_ALLOW_OVER("shipment_line_weight_allow_over", "出货审批-允许超出线路重量上限审核"),
ORDER_OVERSEAS_WAREHOUSE_CHANGE("order_overseas_warehouse_change", "订单审批-海外仓修改申请"),
ORDER_CONSIGNEE_LIMIT_CHANGE("order_consignee_limit_change", "订单审批-收货人限制修改申请"),
;
private String key;
private String value;
......
package cn.iocoder.yudao.module.bpm.service.order.listener;
import cn.iocoder.yudao.module.bpm.enums.WorkFlowEmus;
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEvent;
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
import cn.iocoder.yudao.module.order.service.orderCargoControl.OrderCargoControlService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Component
@Slf4j
public class BmpOrderModelChangeResultListener extends BpmProcessInstanceResultEventListener {
@Resource
OrderCargoControlService orderCargoControlService;
@Override
protected String getProcessDefinitionKey() {
return WorkFlowEmus.ORDER_OVERSEAS_WAREHOUSE_CHANGE.getKey();
}
@Override
protected void onEvent(BpmProcessInstanceResultEvent event) {
log.info("----------------------控货订单海外仓修改审核----------------------,{},{}" + event.getBusinessKey(), event.getResult());
orderCargoControlService.approvalOrderCargoControl(event.getBusinessKey(), event.getResult());
}
}
package cn.iocoder.yudao.module.bpm.service.shipment.listener;
import cn.iocoder.yudao.module.bpm.enums.WorkFlowEmus;
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEvent;
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
import cn.iocoder.yudao.module.order.service.orderCargoControl.OrderCargoControlService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Component
@Slf4j
public class BmpChangeReleaseGoodsLimitResultListener extends BpmProcessInstanceResultEventListener {
@Resource
OrderCargoControlService orderCargoControlService;
@Override
protected String getProcessDefinitionKey() {
return WorkFlowEmus.ORDER_CONSIGNEE_LIMIT_CHANGE.getKey();
}
@Override
protected void onEvent(BpmProcessInstanceResultEvent event) {
log.info("----------------------变更放货限制回调----------------------,{},{}" + event.getBusinessKey(), event.getResult());
orderCargoControlService.approvalOrderCargoControl(event.getBusinessKey(), event.getResult());
}
}
package cn.iocoder.yudao.module.customer.convert.customerCompetitor;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import cn.iocoder.yudao.module.customer.vo.customerCompetitor.*;
import cn.iocoder.yudao.module.customer.dal.dataobject.customerCompetitor.CustomerCompetitorDO;
/**
* 客户竞争对手 Convert
* @author yanghao
*/
@Mapper
public interface CustomerCompetitorConvert {
/*****转换MapStruct*****/
CustomerCompetitorConvert INSTANCE = Mappers.getMapper(CustomerCompetitorConvert.class);
/***
* 创建VO转实体
* @param bean
* @return
*/
CustomerCompetitorDO convert(CustomerCompetitorCreateReqVO bean);
/***
* 修改VO转实体
* @param bean
* @return
*/
CustomerCompetitorDO convert(CustomerCompetitorUpdateReqVO bean);
/***
* 实体转返回VO
* @param bean
* @return
*/
CustomerCompetitorBackVO convert(CustomerCompetitorDO bean);
/***
* 实体列表转返回VO列表
* @param list
* @return
*/
List<CustomerCompetitorBackVO> convertList(List<CustomerCompetitorDO> list);
/***
* 实体分页转返回分页
* @param page
* @return
*/
PageResult<CustomerCompetitorBackVO> convertPage(PageResult<CustomerCompetitorDO> page);
}
......@@ -109,11 +109,11 @@ public class CustomerDO extends BaseDO {
/**
* 产品id
*/
private Long productId;
private String productIds;
/**
* 常用提货网点
*/
private Long pickupPoint;
private String pickupPoints;
/**
* 关联会员账号
*/
......@@ -366,6 +366,69 @@ public class CustomerDO extends BaseDO {
@ApiModelProperty("延期申请次数")
private int delayApprovalNum ;
// ======== 20240821 add start
/**
* 首次成交时间
*/
private Date firstDealTime;
/**
* 获取方式
* <p>
* 枚举 {@link TODO customer_get_method 字典}
*/
private Integer getMethod;
/**
* 创建入口
* <p>
* 枚举 {@link TODO customer_create_from 字典}
*/
private Integer createFrom;
/**
* 归属时间
*/
private Date customerServiceConfirmedTime;
/**
* 客户角色
* <p>
* 枚举 {@link TODO customer_role 字典}
*/
private String roles;
/**
* 业务国家 逗号分隔
*/
private String busiCountryIds;
/**
* 竞争对手ID, 关联 customer_competitor 表主键
*/
private String competitorIds;
/**
* 年度发货量
*/
private BigDecimal weightYearly;
/**
* 年度发货次数
*/
private Integer numYearly;
/**
* 默认开票,1-是,0-否
*/
private Boolean defaultBilling;
// ======== 20240821 add end
/**
* vip等级-中文
*/
......
package cn.iocoder.yudao.module.customer.dal.dataobject.customerCompetitor;
import lombok.*;
import java.util.*;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 客户竞争对手 DO
*
* @author yanghao
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("ecw_customer_competitor")
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class CustomerCompetitorDO extends BaseDO {
/**
* 主键ID
*/
@TableId
private Long id;
/**
* 名称
*/
private String name;
}
......@@ -75,10 +75,19 @@ public interface CustomerMapper extends BaseMapperX<CustomerDO> {
"",
"pt.title_zh as product_type_name_zh, pt.title_en as product_type_name_en,",
"",
"p.title_zh as product_name_zh, p.title_en as product_name_en,",
"(SELECT GROUP_CONCAT(title_zh) FROM ecw_product p WHERE FIND_IN_SET(p.id,(SELECT product_ids FROM ecw_customer WHERE id=c.id))) AS product_name_zh, ",
"(SELECT GROUP_CONCAT(title_en) FROM ecw_product p WHERE FIND_IN_SET(p.id,(SELECT product_ids FROM ecw_customer WHERE id=c.id))) AS product_name_en, ",
"",
"c.pickup_point,",
"n.title_zh as pickup_point_name_zh, n.title_en as pickup_point_name_en,",
"(SELECT GROUP_CONCAT(title_zh) FROM ecw_node n WHERE FIND_IN_SET(n.id,(SELECT pickup_points FROM ecw_customer WHERE id=c.id))) AS pickup_point_name_zh,",
"(SELECT GROUP_CONCAT(title_en) FROM ecw_node n WHERE FIND_IN_SET(n.id,(SELECT pickup_points FROM ecw_customer WHERE id=c.id))) AS pickup_point_name_en,",
"",
"(SELECT GROUP_CONCAT(name_zh) FROM ecw_country ct WHERE FIND_IN_SET(ct.id,(SELECT busi_country_ids FROM ecw_customer WHERE id=c.id))) AS busi_country_name_zh,",
"(SELECT GROUP_CONCAT(name_en) FROM ecw_country ct WHERE FIND_IN_SET(ct.id,(SELECT busi_country_ids FROM ecw_customer WHERE id=c.id))) AS busi_country_name_en,",
"",
"(SELECT GROUP_CONCAT(name) FROM ecw_customer_competitor ccp WHERE FIND_IN_SET(ccp.id,(SELECT competitor_ids FROM ecw_customer WHERE id=c.id))) AS competitor_names,",
"",
"uc.nickname as creator_name,",
"uu.nickname as updater_name,",
"",
"c.customer_service,",
"u.nickname as customer_service_name",
......@@ -88,9 +97,9 @@ public interface CustomerMapper extends BaseMapperX<CustomerDO> {
"left join ecw_customer_credit cc on c.credit_level = cc.id",
"left join ecw_country country on c.country = country.id",
"left join ecw_product_type pt on c.product_type = pt.id",
"left join ecw_product p on c.product_id = p.id",
"left join ecw_node n on c.pickup_point = n.id",
"left join system_user u on c.customer_service = u.id",
"left join system_user uc on c.creator = uc.id",
"left join system_user uu on c.updater = uu.id",
"where c.id = #{id}",
"</script>"
})
......
package cn.iocoder.yudao.module.customer.dal.mysql.customerCompetitor;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery;
import cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper;
import cn.iocoder.yudao.module.customer.dal.dataobject.customerCompetitor.CustomerCompetitorDO;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.customer.vo.customerCompetitor.*;
/**
* 客户竞争对手 Mapper
* @author yanghao
*/
@Mapper
public interface CustomerCompetitorMapper extends AbstractMapper<CustomerCompetitorDO> {
@Override
default PageResult<CustomerCompetitorDO> selectPage(PageVO page, Object object) {
if (object instanceof CustomerCompetitorQueryVO) {
CustomerCompetitorQueryVO vo = (CustomerCompetitorQueryVO)object;
return selectPage(page, new LambdaQuery<CustomerCompetitorDO>()
.likeIfPresent(CustomerCompetitorDO::getName, vo.getName())
.betweenIfPresent(CustomerCompetitorDO::getCreateTime, vo.getBeginCreateTime(), vo.getEndCreateTime())
.orderByDesc(CustomerCompetitorDO::getId));
}
return null;
}
@Override
default List<CustomerCompetitorDO> selectList(Object object) {
if (object instanceof CustomerCompetitorQueryVO) {
CustomerCompetitorQueryVO vo = (CustomerCompetitorQueryVO)object;
return selectList(new LambdaQuery<CustomerCompetitorDO>()
.likeIfPresent(CustomerCompetitorDO::getName, vo.getName())
.betweenIfPresent(CustomerCompetitorDO::getCreateTime, vo.getBeginCreateTime(), vo.getEndCreateTime())
.orderByDesc(CustomerCompetitorDO::getId));
}
return null;
}
}
......@@ -68,6 +68,8 @@ public interface CustomerContactsMapper extends BaseMapperX<CustomerContactsDO>
"c.id as customer_id, ",
"c.name as customer_name, ",
"c.name_en as customer_name_en, ",
"c.default_pay as default_pay, ",
"c.no_consignee as no_consignee, ",
"cc.* , ",
"cc.id as customer_contacts_id, ",
"cc.name as contacts_name, ",
......@@ -108,6 +110,8 @@ public interface CustomerContactsMapper extends BaseMapperX<CustomerContactsDO>
"c.id as customer_id, ",
"c.name as customer_name, ",
"c.name_en as customer_name_en, ",
"c.default_pay as default_pay, ",
"c.no_consignee as no_consignee, ",
"cc.* , ",
"cc.id as customer_contacts_id, ",
"cc.name as contacts_name, ",
......
......@@ -84,5 +84,12 @@ public class CustomerContactsDto {
private Boolean isInOpenSea;
@ApiModelProperty(value = "控货无收货人,1-是,0-否")
private Boolean noConsignee;
@ApiModelProperty(value = "默认付款,1-是,0-否")
private Boolean defaultPay;
}
......@@ -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;
}
......@@ -29,4 +29,8 @@ public interface ErrorCodeConstants {
ErrorCode BANK_NOT_EXISTS = new ErrorCode(1005001010, "客户银行账户不存在");
ErrorCode COMPETITOR_NOT_EXISTS = new ErrorCode(1005001011, "客户竞争对手不存在");
ErrorCode COMPETITOR_EXISTS = new ErrorCode(1005001012, "竞争对手名称已存在");
}
package cn.iocoder.yudao.module.customer.service.api;
import cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO;
import cn.iocoder.yudao.module.customer.dal.dataobject.customerContacts.CustomerContactsDO;
import cn.iocoder.yudao.module.customer.service.customer.CustomerService;
import cn.iocoder.yudao.module.customer.service.customerContacts.CustomerContactsService;
......@@ -7,8 +8,10 @@ import cn.iocoder.yudao.module.customer.vo.customer.customerContacts.CustomerCon
import cn.iocoder.yudao.module.customer.vo.customer.vo.CustomerCreateReqVO;
import cn.iocoder.yudao.module.ecw.api.customer.CustomerApi;
import cn.iocoder.yudao.module.ecw.dal.dataobject.country.CountryDO;
import cn.iocoder.yudao.module.ecw.enums.CustomerCreateFromEnum;
import cn.iocoder.yudao.module.ecw.enums.CustomerStatusEnum;
import cn.iocoder.yudao.module.ecw.service.country.CountryService;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
......@@ -84,6 +87,9 @@ public class CustomerApiImpl implements CustomerApi {
customerCreateReqVO.setCustomerOperateLogRemark("会员注册关联创建客户. 会员id:" + memberUserId + "; 电话:" + phone);
// app创建
customerCreateReqVO.setCreateFrom(CustomerCreateFromEnum.APP_REGISTER.getValue());
customerService.createCustomer(customerCreateReqVO);
}
......@@ -98,4 +104,12 @@ public class CustomerApiImpl implements CustomerApi {
public void approvalCustomerTransfer(String approveId, Integer result) {
customerService.approvalCustomerTransfer(approveId, result);
}
@Override
public void fillFirstDealTimeIfNull(Long customerId, Date firstDealTime) {
customerService.update(new LambdaUpdateWrapper<CustomerDO>()
.set(CustomerDO::getFirstDealTime, firstDealTime)
.isNull(CustomerDO::getFirstDealTime)
.eq(CustomerDO::getId, customerId));
}
}
......@@ -64,9 +64,7 @@ import cn.iocoder.yudao.module.customer.vo.customerBank.CustomerBankUpdateReqVO;
import cn.iocoder.yudao.module.customer.vo.customerDetail.CustomerOrderBackPageVO;
import cn.iocoder.yudao.module.customer.vo.customerOperateLog.CustomerOperateLogCreateReqVO;
import cn.iocoder.yudao.module.ecw.dal.dataobject.country.CountryDO;
import cn.iocoder.yudao.module.ecw.enums.CustomerOperateTypeEnum;
import cn.iocoder.yudao.module.ecw.enums.CustomerStatusEnum;
import cn.iocoder.yudao.module.ecw.enums.ErrorCodeConstants;
import cn.iocoder.yudao.module.ecw.enums.*;
import cn.iocoder.yudao.module.ecw.service.country.CountryService;
import cn.iocoder.yudao.module.ecw.service.internalMessage.InternalMessageService;
import cn.iocoder.yudao.module.ecw.service.paramValid.ParamValidatorService;
......@@ -210,8 +208,8 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
customerService = consignorCustomerDO.getCustomerService();
// 待分配。 若是发货人为代理和同行时,订单的收货人不同步到待分配客户
boolean isProxyConsignor = StringUtils.isNotEmpty(consignorCustomerDO.getType())
&& (consignorCustomerDO.getType().contains("2") || consignorCustomerDO.getType().contains("3"));
boolean isProxyConsignor = StringUtils.isNotEmpty(consignorCustomerDO.getRoles())
&& (consignorCustomerDO.getRoles().contains("2") || consignorCustomerDO.getRoles().contains("3"));
if (isProxyConsignor) {
log.info("若是发货人为代理和同行时,订单的收货人不同步到待分配客户");
return null;
......@@ -262,6 +260,8 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
customerCreateReqVO.setCustomerOperateLogRemark("管理端创建收货人时关联创建客户,进待分配列表");
customerCreateReqVO.setCustomerOperateLogOrderNo(orderNo);
customerCreateReqVO.setCreateFrom(CustomerCreateFromEnum.APP_CONSIGNOR.getValue());
Long customerId = this.createCustomer(customerCreateReqVO);
List<CustomerContactsDO> customerContactsDOS =
......@@ -319,6 +319,11 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
// 设置跟进客户经理
customer.setCustomerService(WebFrameworkUtils.getLoginUserId());
// 获取方式:自主创建
customer.setGetMethod(CustomerGetMethodEnum.CREATE.getValue());
// 归属时间:当前时间
customer.setCustomerServiceConfirmedTime(new Date());
boolean isFcl = isFcl(customer);
......@@ -532,6 +537,11 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
if (customerOld.getCustomerServiceAssignedTime() == null) {
customerNew.setCustomerServiceAssignedTime(now);
}
// 获取方式:分配/移交接收
customerNew.setGetMethod(CustomerGetMethodEnum.ASSIGN.getValue());
//老的归属时间为空,就设置归属时间
customerNew.setCustomerServiceConfirmedTime(now);
//设置预计进行公海池时间
//海运整柜 不掉入公海
if (isFcl) {
......
package cn.iocoder.yudao.module.customer.service.customerCompetitor;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.framework.mybatis.core.service.IService;
import cn.iocoder.yudao.module.customer.vo.customerCompetitor.*;
import cn.iocoder.yudao.module.customer.dal.dataobject.customerCompetitor.CustomerCompetitorDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
/**
* 客户竞争对手 Service 接口
*
* @author yanghao
*/
public interface CustomerCompetitorService extends IService<CustomerCompetitorDO> {
/**
* 创建客户竞争对手
* @param createReqVO 创建信息
* @return 编号
*/
Long createCompetitor(@Valid CustomerCompetitorCreateReqVO createReqVO);
/**
* 更新客户竞争对手
* @param updateReqVO 更新信息
*/
void updateCompetitor(@Valid CustomerCompetitorUpdateReqVO updateReqVO);
/**
* 删除客户竞争对手
* @param id 编号
*/
void deleteCompetitor(Long id);
/**
* 获得客户竞争对手
* @param id 编号
* @return 客户竞争对手
*/
CustomerCompetitorDO getCompetitor(Long id);
/**
* 获得客户竞争对手列表
* @param ids 编号
* @return 客户竞争对手列表
*/
List<CustomerCompetitorDO> getCompetitorList(Collection<Long> ids);
List<CustomerCompetitorDO> getCompetitorList();
/**
* 获得客户竞争对手分页
* @param page 分页查询
* @param query 查询
* @return 客户竞争对手分页
*/
PageResult<CustomerCompetitorDO> getCompetitorPage(CustomerCompetitorQueryVO query, PageVO page);
/**
* 获得客户竞争对手列表, 用于 Excel 导出
* @param query 查询
* @return 客户竞争对手列表
*/
List<CustomerCompetitorDO> getCompetitorList(CustomerCompetitorQueryVO query);
}
package cn.iocoder.yudao.module.customer.service.customerCompetitor;
import java.util.*;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.framework.mybatis.core.service.AbstractService;
import cn.iocoder.yudao.module.customer.vo.customerCompetitor.*;
import cn.iocoder.yudao.module.customer.dal.dataobject.customerCompetitor.CustomerCompetitorDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.customer.convert.customerCompetitor.CustomerCompetitorConvert;
import cn.iocoder.yudao.module.customer.dal.mysql.customerCompetitor.CustomerCompetitorMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.customer.enums.ErrorCodeConstants.*;
/**
* 客户竞争对手 Service 实现类
*
* @author yanghao
*/
@Service
@Validated
public class CustomerCompetitorServiceImpl extends AbstractService<CustomerCompetitorMapper, CustomerCompetitorDO> implements CustomerCompetitorService {
@Resource
private CustomerCompetitorMapper competitorMapper;
@Override
public Long createCompetitor(CustomerCompetitorCreateReqVO createReqVO) {
// 校验存在
Long count = competitorMapper.selectCount("name", createReqVO.getName());
if (count != 0) {
throw exception(COMPETITOR_EXISTS);
}
// 插入
CustomerCompetitorDO competitor = CustomerCompetitorConvert.INSTANCE.convert(createReqVO);
competitorMapper.insert(competitor);
// 返回
return competitor.getId();
}
@Override
public void updateCompetitor(CustomerCompetitorUpdateReqVO updateReqVO) {
// 校验存在
this.validateCompetitorExists(updateReqVO.getId());
// 更新
CustomerCompetitorDO updateObj = CustomerCompetitorConvert.INSTANCE.convert(updateReqVO);
competitorMapper.updateById(updateObj);
}
@Override
public void deleteCompetitor(Long id) {
// 校验存在
this.validateCompetitorExists(id);
// 删除
competitorMapper.deleteById(id);
}
private void validateCompetitorExists(Long id) {
if (competitorMapper.selectById(id) == null) {
throw exception(COMPETITOR_NOT_EXISTS);
}
}
@Override
public CustomerCompetitorDO getCompetitor(Long id) {
return competitorMapper.selectById(id);
}
@Override
public List<CustomerCompetitorDO> getCompetitorList(Collection<Long> ids) {
return competitorMapper.selectBatchIds(ids);
}
@Override
public List<CustomerCompetitorDO> getCompetitorList() {
return competitorMapper.selectList();
}
@Override
public PageResult<CustomerCompetitorDO> getCompetitorPage(CustomerCompetitorQueryVO query, PageVO page) {
return competitorMapper.selectPage(page, query);
}
@Override
public List<CustomerCompetitorDO> getCompetitorList(CustomerCompetitorQueryVO query) {
return competitorMapper.selectList(query);
}
}
......@@ -37,11 +37,14 @@ public class CustomeDetailServiceImpl implements CustomerDetailService {
}
@Override
public PageResult<CustomerOfferBackVo> getCustomerOfferPage(Long customerId, PageParam pageParam) {
public PageResult<CustomerOfferBackVo> getCustomerOfferPage(CustomerOfferQueryVo offerQueryVo, PageParam pageParam) {
IPage<CustomerOfferBackVo> mpPage = MyBatisUtils.buildPage(pageParam);
QueryWrapperX queryWrapper = new QueryWrapperX();
queryWrapper.eq("t.deleted", 0);
queryWrapper.eq("t.relation_id", customerId);
queryWrapper.eq("t.relation_id", offerQueryVo.getCustomerId());
queryWrapper.inIfPresent("dst.guojia", offerQueryVo.getDestCountryId());
queryWrapper.inIfPresent("dst.shi", offerQueryVo.getObjectiveId());
queryWrapper.inIfPresent("dst.id", offerQueryVo.getDestWarehouseId());
customerDetailMapper.selectCustomerOfferPage(mpPage, queryWrapper);
return PageResult.of(mpPage);
}
......
......@@ -22,11 +22,11 @@ public interface CustomerDetailService {
/**
* 获得客户报价分页
*
* @param customerId 客户ID
* @param offerQueryVo 客户ID
* @param pageParam 分页参数
* @return 客户级别分页
*/
PageResult<CustomerOfferBackVo> getCustomerOfferPage(Long customerId, PageParam pageParam);
PageResult<CustomerOfferBackVo> getCustomerOfferPage(CustomerOfferQueryVo offerQueryVo, PageParam pageParam);
/**
* 根据运输方式得到订单总数
......
......@@ -46,11 +46,11 @@ public class CustomerCreateReqVO extends CustomerBaseVO {
@ApiModelProperty(value = "产品类型id")
private Long productType;
@ApiModelProperty(value = "产品id")
private Long productId;
@ApiModelProperty(value = "产品ids")
private String productIds;
@ApiModelProperty(value = "常用提货网点id")
private Long pickupPoint;
@ApiModelProperty(value = "常用提货网点ids")
private String pickupPoints;
@ApiModelProperty(value = "关联会员账号id")
private Long memberId;
......@@ -153,6 +153,51 @@ public class CustomerCreateReqVO extends CustomerBaseVO {
@ApiModelProperty(value = "客户银行账户", notes = "参见CustomerBankCreateReqVO")
private List<CustomerBankCreateReqVO> customerBanks;
// ======== 20240821 add start
/**
* 客户角色
* <p>
* 枚举 {@link TODO customer_role 字典}
*/
@ApiModelProperty(value = "客户角色")
private String roles;
/**
* 业务国家 逗号分隔
*/
@ApiModelProperty(value = "业务国家ids")
private String busiCountryIds;
/**
* 竞争对手IDs, 关联 customer_competitor 表主键
*/
@ApiModelProperty(value = "竞争对手IDs")
private String competitorIds;
/**
* 年度发货量
*/
@ApiModelProperty(value = "年度发货量")
private BigDecimal weightYearly;
/**
* 年度发货次数
*/
@ApiModelProperty(value = "年度发货次数")
private Integer numYearly;
/**
* 默认开票,1-是,0-否
*/
@ApiModelProperty(value = "默认开票,1-是,0-否")
private Boolean defaultBilling;
// ======== 20240821 add end
/**
......@@ -173,6 +218,10 @@ public class CustomerCreateReqVO extends CustomerBaseVO {
private String customerOperateLogOrderNo;
@JsonIgnore
private Integer createFrom;
/**
* 是否被订单收货人同步的
......
......@@ -63,11 +63,11 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
@ApiModelProperty(value = "产品类型id")
private Long productType;
@ApiModelProperty(value = "产品id")
private Long productId;
@ApiModelProperty(value = "产品ids")
private String productIds;
@ApiModelProperty(value = "常用提货网点id")
private Long pickupPoint;
@ApiModelProperty(value = "常用提货网点ids")
private String pickupPoints;
@ApiModelProperty(value = "关联会员账号id")
private Long memberId;
......@@ -96,9 +96,17 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
//客户创建日期格式化
//@JsonFormat(value = "创建时间", example = "1652017501000")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY,
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND,
timezone = TIME_ZONE_DEFAULT)
private Date createTime;
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND,
timezone = TIME_ZONE_DEFAULT)
private Date updateTime;
@ApiModelProperty(value = "创建人名称")
private String creatorName;
@ApiModelProperty(value = "更新人名称")
private String updaterName;
//--------发票信息
......@@ -182,6 +190,50 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
private List<CustomerBankBackVO> customerBankBackVOList;
// ======== 20240821 add start
/**
* 客户角色
* <p>
* 枚举 {@link TODO customer_role 字典}
*/
@ApiModelProperty(value = "客户角色")
private String roles;
/**
* 业务国家 逗号分隔
*/
@ApiModelProperty(value = "业务国家ids")
private String busiCountryIds;
/**
* 竞争对手IDs, 关联 customer_competitor 表主键
*/
@ApiModelProperty(value = "竞争对手IDs")
private String competitorIds;
/**
* 年度发货量
*/
@ApiModelProperty(value = "年度发货量")
private BigDecimal weightYearly;
/**
* 年度发货次数
*/
@ApiModelProperty(value = "年度发货次数")
private Integer numYearly;
/**
* 默认开票,1-是,0-否
*/
@ApiModelProperty(value = "默认开票,1-是,0-否")
private Boolean defaultBilling;
// ======== 20240821 add end
@ApiModelProperty(value = "国家中文名称")
private String countryNameZh;
......@@ -204,6 +256,22 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
@ApiModelProperty(value = "常用提货点英文名称")
private String pickupPointNameEn;
@ApiModelProperty(value = "业务国家中文名称")
private String busiCountryNameZh;
@ApiModelProperty(value = "业务国家英文名称")
private String busiCountryNameEn;
/**
* 竞争对手IDs, 关联 customer_competitor 表主键
*/
@ApiModelProperty(value = "竞争对手名称")
private String competitorNames;
@ApiModelProperty(value = "付款人姓名")
private String payerName;
......
......@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
......@@ -97,4 +98,99 @@ public class CustomerRespVO extends CustomerBaseVO {
@ApiModelProperty(value = "是否被接收")
private Boolean isCustomerServiceConfirmed;
/**
* 业务国家 逗号分隔
*/
@ApiModelProperty(value = "业务国家 逗号分隔")
private String busiCountryIds;
/**
* 常用提货网点
*/
@ApiModelProperty(value = "常用提货网点")
private String pickupPoints;
/**
* 竞争对手ID, 关联 customer_competitor 表主键
*/
@ApiModelProperty(value = "竞争对手ID")
private String competitorIds;
/**
* 竞争对手名称,多个以逗号分隔 可直接展示
*/
@ApiModelProperty(value = "竞争对手名称,多个以逗号分隔 可直接展示")
private String competitorNames;
/**
* 年度发货量
*/
@ApiModelProperty(value = "年度发货量")
private BigDecimal weightYearly;
/**
* 年度发货次数
*/
@ApiModelProperty(value = "年度发货次数")
private Integer numYearly;
/**
* 到仓确认
*/
@ApiModelProperty(value = "到仓确认 1-是,0-否")
private Integer arrivalConfirm;
/**
* 控货无收货人,1-是,0-否
*/
@ApiModelProperty(value = "控货无收货人,1-是,0-否")
private Boolean noConsignee ;
/**
* 默认付款,1-是,0-否
*/
@ApiModelProperty(value = "默认付款,1-是,0-否")
private Boolean defaultPay ;
/**
* 归属时间
*/
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "归属时间")
private Date customerServiceConfirmedTime;
/**
* 首次成交时间
*/
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "首次成交时间")
private Date firstDealTime;
/**
* 获取方式
* <p>
* 枚举 {@link TODO customer_get_method 字典}
*/
@ApiModelProperty(value = "获取方式 customer_get_method 字典")
private Integer getMethod;
@ApiModelProperty(value = "创建人")
private String creator;
@ApiModelProperty(value = "创建人姓名")
private String createUsername;
/**
* 最后更新时间
*/
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "最后更新时间")
private Date updateTime;
}
......@@ -53,11 +53,11 @@ public class CustomerUpdateReqVO extends CustomerBaseVO {
@ApiModelProperty(value = "产品类型")
private Long productType;
@ApiModelProperty(value = "产品id")
private Long productId;
@ApiModelProperty(value = "产品ids")
private String productIds;
@ApiModelProperty(value = "常用提货网点")
private Long pickupPoint;
@ApiModelProperty(value = "常用提货网点ids")
private String pickupPoints;
@ApiModelProperty(value = "关联会员账号")
private Long memberId;
......@@ -181,4 +181,49 @@ public class CustomerUpdateReqVO extends CustomerBaseVO {
@ApiModelProperty(value = "是否潜在客户")
private Boolean isPotential = false;
// ======== 20240821 add start
/**
* 客户角色
* <p>
* 枚举 {@link TODO customer_role 字典}
*/
@ApiModelProperty(value = "客户角色")
private String roles;
/**
* 业务国家 逗号分隔
*/
@ApiModelProperty(value = "业务国家ids")
private String busiCountryIds;
/**
* 竞争对手IDs, 关联 customer_competitor 表主键
*/
@ApiModelProperty(value = "竞争对手IDs")
private String competitorIds;
/**
* 年度发货量
*/
@ApiModelProperty(value = "年度发货量")
private BigDecimal weightYearly;
/**
* 年度发货次数
*/
@ApiModelProperty(value = "年度发货次数")
private Integer numYearly;
/**
* 默认开票,1-是,0-否
*/
@ApiModelProperty(value = "默认开票,1-是,0-否")
private Boolean defaultBilling;
// ======== 20240821 add end
}
package cn.iocoder.yudao.module.customer.vo.customerCompetitor;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import com.alibaba.excel.annotation.ExcelProperty;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* 客户竞争对手 Response VO
* @author yanghao
*/
@Data
@ApiModel("管理后台 - 客户竞争对手 Response VO")
public class CustomerCompetitorBackVO {
@ExcelProperty("主键ID")
@ApiModelProperty(value = "主键ID", required = true)
private Long id;
@ExcelProperty("名称")
@ApiModelProperty(value = "名称", required = true)
private String name;
@ExcelProperty("创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "创建时间", required = true)
private Date createTime;
}
package cn.iocoder.yudao.module.customer.vo.customerCompetitor;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import javax.validation.constraints.*;
/**
* 客户竞争对手 Base VO,提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
*/
@Data
public class CustomerCompetitorBaseVO {
@ApiModelProperty(value = "名称", required = true)
@NotNull(message = "名称不能为空")
private String name;
}
package cn.iocoder.yudao.module.customer.vo.customerCompetitor;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import javax.validation.constraints.*;
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel("管理后台 - 客户竞争对手创建 Request VO")
public class CustomerCompetitorCreateReqVO extends CustomerCompetitorBaseVO {
}
package cn.iocoder.yudao.module.customer.vo.customerCompetitor;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
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
@ApiModel("管理后台 - 客户竞争对手查询 VO")
public class CustomerCompetitorQueryVO {
@ApiModelProperty(value = "名称")
private String name;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始创建时间")
private Date beginCreateTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束创建时间")
private Date endCreateTime;
}
package cn.iocoder.yudao.module.customer.vo.customerCompetitor;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import javax.validation.constraints.*;
@ApiModel("管理后台 - 客户竞争对手更新 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class CustomerCompetitorUpdateReqVO extends CustomerCompetitorBaseVO {
@ApiModelProperty(value = "主键ID", required = true)
@NotNull(message = "主键ID不能为空")
private Long id;
}
package cn.iocoder.yudao.module.customer.vo.customerDetail;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -8,10 +9,14 @@ import lombok.Data;
import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ApiModel("管理后台 - 客户基本信息客户报价 Response VO")
@Data
public class CustomerOfferBackVo {
@ApiModelProperty(value = "报价单ID")
private String offerId;
@ApiModelProperty(value = "报价单号")
private String number;
......@@ -21,6 +26,7 @@ public class CustomerOfferBackVo {
@ApiModelProperty(value = "客户名称")
private String consignorName;
@ApiModelProperty(value = "目的地中文")
private String objectiveName;
......@@ -30,10 +36,44 @@ public class CustomerOfferBackVo {
@ApiModelProperty(value = "取消报价:0,特价审批中:1,草稿:2, 需求确认:3,赢单:4,输单:5,报价完成:6 跟进中:7")
private Integer status;
@ApiModelProperty(value = "业务员名称")
@ApiModelProperty(value = "业务员名称-客户经理")
private String businessManagerName;
@ApiModelProperty(value = "预计结束时间")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private Date stopTime;
@ApiModelProperty(value = "创建时间", required = true)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date createTime;
@ExcelProperty("价格有效期开始")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private Date startTime;
@ExcelProperty("价格有效期结束")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private Date endTime;
@ExcelProperty("重要程度")
private Integer importance;
@ApiModelProperty(value = "联系人名称")
private String relationName;
@ApiModelProperty(value = "联系人区号")
private String relationAreaCode;
@ApiModelProperty(value = "联系人手机号")
private String relationPhone;
// 线路相关
@ExcelProperty("始发仓库id")
private Long startWarehouseId;
@ExcelProperty("目的仓库id")
private Long destWarehouseId;
@ExcelProperty("运输方式")
private String transportType;
}
package cn.iocoder.yudao.module.customer.vo.customerDetail;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@ApiModel("管理后台 - 客户基本信息报价查询 Request VO")
@Data
public class CustomerOfferQueryVo {
@ApiModelProperty(value = "客户id")
private Long customerId;
@ApiModelProperty(value = "目的国id")
private List<Long> destCountryId ;
@ApiModelProperty(value = "目的地id")
private List<Long> objectiveId;
@ApiModelProperty(value = "目的仓ID")
private List<Long> destWarehouseId;
}
......@@ -13,17 +13,24 @@
</select>
<select id="selectCustomerOfferPage"
resultType="cn.iocoder.yudao.module.customer.vo.customerDetail.CustomerOfferBackVo">
select t.number as number,
select t.offer_id, t.number as number,
t.order_no as order_no,
s.title_zh as objective_name,
s.title_en as objective_name_en,
t.status as status,
t.stop_time as stop_time,
u.nickname as business_manager_name
u.nickname as business_manager_name,
t.create_time, t.start_time, t.end_time, t.importance,
cc.name as relation_name, cc.area_code as relation_area_code, cc.phone_new as relation_phone,
line.start_warehouse_id, line.dest_warehouse_id, line.transport_type
from ecw_offer t
left join ecw_region s
on t.objective_id = s.id
left join ecw_region s on t.objective_id = s.id
left join system_user u on t.follow_up_salesman_id = u.id
left join ecw_customer_contacts cc on (t.relation = 1 and cc.id = t.consignor_id) or (t.relation = 2 and cc.id = t.consignee_id)
left join ecw_warehouse_line line on t.line_id = line.id
left join ecw_warehouse dst on line.dest_warehouse_id = dst.id
${ew.customSqlSegment}
</select>
<select id="selectCustomerFollowPage"
......
......@@ -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
......
......@@ -50,6 +50,7 @@ import cn.iocoder.yudao.module.customer.vo.customerBank.CustomerBankBackVO;
import cn.iocoder.yudao.module.customer.vo.customerBank.CustomerBankQueryVO;
import cn.iocoder.yudao.module.ecw.api.paramValid.ParamValidatorApi;
import cn.iocoder.yudao.module.ecw.enums.CustomerContactsDefaultEnum;
import cn.iocoder.yudao.module.ecw.enums.CustomerCreateFromEnum;
import cn.iocoder.yudao.module.ecw.enums.CustomerOperateTypeEnum;
import cn.iocoder.yudao.module.ecw.enums.ErrorCodeConstants;
import cn.iocoder.yudao.module.ecw.service.busiPwd.BusiPwdService;
......@@ -239,6 +240,9 @@ public class CustomerController {
}
}
// 后台创建
createReqVO.setCreateFrom(CustomerCreateFromEnum.BACKEND.getValue());
return success(customerService.createCustomer(createReqVO));
}
......
package cn.iocoder.yudao.module.customer.controller.admin.customerCompetitor;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
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.*;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
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.customer.vo.customerCompetitor.*;
import cn.iocoder.yudao.module.customer.dal.dataobject.customerCompetitor.CustomerCompetitorDO;
import cn.iocoder.yudao.module.customer.convert.customerCompetitor.CustomerCompetitorConvert;
import cn.iocoder.yudao.module.customer.service.customerCompetitor.CustomerCompetitorService;
@Validated
@RestController
@Api(tags = "管理后台 - 客户竞争对手")
@RequestMapping("/customer/competitor")
public class CustomerCompetitorController {
@Resource
private CustomerCompetitorService competitorService;
@PostMapping("/create")
@ApiOperation("创建客户竞争对手")
// @PreAuthorize("@ss.hasPermission('customer:competitor:create')")
public CommonResult<Long> createCompetitor(@Valid @RequestBody CustomerCompetitorCreateReqVO createReqVO) {
return success(competitorService.createCompetitor(createReqVO));
}
// @PutMapping("/update")
// @ApiOperation("更新客户竞争对手")
// @PreAuthorize("@ss.hasPermission('customer:competitor:update')")
// public CommonResult<Boolean> updateCompetitor(@Valid @RequestBody CustomerCompetitorUpdateReqVO updateReqVO) {
// competitorService.updateCompetitor(updateReqVO);
// return success(true);
// }
//
// @DeleteMapping("/delete")
// @ApiOperation("删除客户竞争对手")
// @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
// @PreAuthorize("@ss.hasPermission('customer:competitor:delete')")
// public CommonResult<Boolean> deleteCompetitor(@RequestParam("id") Long id) {
// competitorService.deleteCompetitor(id);
// return success(true);
// }
//
// @GetMapping("/get")
// @ApiOperation("获得客户竞争对手")
// @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
// @PreAuthorize("@ss.hasPermission('customer:competitor:query')")
// public CommonResult<CustomerCompetitorBackVO> getCompetitor(@RequestParam("id") Long id) {
// CustomerCompetitorDO competitor = competitorService.getCompetitor(id);
// return success(CustomerCompetitorConvert.INSTANCE.convert(competitor));
// }
@GetMapping("/list")
@ApiOperation("获得客户竞争对手列表")
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
// @PreAuthorize("@ss.hasPermission('customer:competitor:query')")
public CommonResult<List<CustomerCompetitorBackVO>> getCompetitorList(@RequestParam("ids") Collection<Long> ids) {
List<CustomerCompetitorDO> list = competitorService.getCompetitorList(ids);
return success(CustomerCompetitorConvert.INSTANCE.convertList(list));
}
@GetMapping("/listAll")
@ApiOperation("获得所有客户竞争对手列表")
// @PreAuthorize("@ss.hasPermission('customer:competitor:query')")
public CommonResult<List<CustomerCompetitorBackVO>> getCompetitorListAll() {
List<CustomerCompetitorDO> list = competitorService.getCompetitorList();
return success(CustomerCompetitorConvert.INSTANCE.convertList(list));
}
// @GetMapping("/page")
// @ApiOperation("获得客户竞争对手分页")
// @PreAuthorize("@ss.hasPermission('customer:competitor:query')")
// public CommonResult<PageResult<CustomerCompetitorBackVO>> getCompetitorPage(@Valid CustomerCompetitorQueryVO query, PageVO page) {
// PageResult<CustomerCompetitorDO> pageResult = competitorService.getCompetitorPage(query, page);
// return success(CustomerCompetitorConvert.INSTANCE.convertPage(pageResult));
// }
// @GetMapping("/export-excel")
// @ApiOperation("导出客户竞争对手 Excel")
// @PreAuthorize("@ss.hasPermission('customer:competitor:export')")
// @OperateLog(type = EXPORT)
// public void exportCompetitorExcel(@Valid CustomerCompetitorQueryVO query,
// HttpServletResponse response) throws IOException {
// List<CustomerCompetitorDO> list = competitorService.getCompetitorList(query);
// // 导出 Excel
// List<CustomerCompetitorBackVO> datas = CustomerCompetitorConvert.INSTANCE.convertList(list);
// ExcelUtils.write(response, "客户竞争对手.xls", "数据", CustomerCompetitorBackVO.class, datas);
// }
}
......@@ -11,3 +11,12 @@ GET {{baseUrl}}/customer/detail/infoList/creditScoreStatistic?customerId=34831
Authorization: Bearer {{token}}
tenant-id: {{adminTenentId}}
Content-Type: application/json
### 客户报价
GET {{baseUrl}}/customer/detail/infoList/offerPage?pageNo=1&pageSize=10&total=0&customerId=12925
Authorization: Bearer {{token}}
tenant-id: {{adminTenentId}}
Content-Type: application/json
\ No newline at end of file
......@@ -48,9 +48,9 @@ public class CustomerDetailController {
@GetMapping("/offerPage")
@ApiOperation("获取报价分页")
public CommonResult<PageResult<CustomerOfferBackVo>> getOfferPage(@RequestParam("customerId") Long customerId, PageParam page) {
public CommonResult<PageResult<CustomerOfferBackVo>> getOfferPage(CustomerOfferQueryVo offerQueryVo, PageParam page) {
PageResult<CustomerOfferBackVo> pageResult =
customerDetailService.getCustomerOfferPage(customerId, page);
customerDetailService.getCustomerOfferPage(offerQueryVo, page);
return success(pageResult);
}
......
......@@ -72,6 +72,8 @@ public interface WarehouseLineMapper extends BaseMapperX<WarehouseLineDO> {
"ew_start_country.title_zh as start_country_title_zh,",
"ew_start_country.title_en as start_country_title_en,",
"ew_start.volume as start_volume,",
"ew_start.rent_free_days as start_rent_free_days,",
"ew_start.lock_recipient_days as start_lock_recipient_days,",
"ew_start.address_zh as start_address_zh,",
"ew_start.address_en as start_address_en,",
"ew_start.head as start_head,",
......@@ -85,6 +87,8 @@ public interface WarehouseLineMapper extends BaseMapperX<WarehouseLineDO> {
"ew_dest_country.title_zh as dest_country_title_zh,",
"ew_dest_country.title_en as dest_country_title_en,",
"ew_dest.volume as dest_volume,",
"ew_dest.rent_free_days as dest_rent_free_days,",
"ew_dest.lock_recipient_days as dest_lock_recipient_days,",
"ew_dest.address_zh as dest_address_zh,",
"ew_dest.address_en as dest_address_en,",
"ew_dest.head as dest_head,",
......
......@@ -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 ",
......
......@@ -35,6 +35,12 @@ public class LogisticsInfoDto {
@ApiModelProperty(value = "始发地仓库容量")
private String startVolume;
@ApiModelProperty(value = "始发地仓库免租期")
private Integer startRentFreeDays;
@ApiModelProperty(value = "始发地锁定收货人天数")
private Integer startLockRecipientDays;
@ApiModelProperty(value = "始发地仓库仓库地址")
private String startAddressZh;
......@@ -73,6 +79,12 @@ public class LogisticsInfoDto {
@ApiModelProperty(value = "目的地仓库容量")
private String destVolume;
@ApiModelProperty(value = "目的地仓库免租期")
private Integer destRentFreeDays;
@ApiModelProperty(value = "目的地锁定收货人天数")
private Integer destLockRecipientDays;
@ApiModelProperty(value = "目的地仓库仓库地址")
private String destAddressZh;
......
......@@ -15,6 +15,8 @@ public class WarehouseLineSearchVO {
private Long destCityId;
/**目的地城市*/
private Long destCountryId;
/**目的仓*/
private Long destWarehouseId;
/**渠道id*/
private Long channelId;
......
......@@ -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 ;
......
......@@ -52,6 +52,9 @@
<if test="params.destCountryId != null and params.destCountryId != 0">
and ew_dest.guojia = #{params.destCountryId}
</if>
<if test="params.destWarehouseId != null and params.destWarehouseId != 0">
and ewl.dest_warehouse_id = #{params.destWarehouseId}
</if>
<if test="params.lineId != null and params.lineId != 0">
and ewl.id = #{params.lineId}
</if>
......
......@@ -6,6 +6,7 @@ import java.math.BigDecimal;
@Data
public class CurrencyRespDTO {
private Integer id;
/**
* 中文名称
*/
......
package cn.iocoder.yudao.module.ecw.api.customer;
import java.util.Date;
public interface CustomerApi {
void associateCustomerAuto(String areaCode, String phone, Long userId, String newName);
void approvalCustomerDelay(String approveId, Integer result);
void approvalCustomerTransfer(String approveId, Integer result);
void fillFirstDealTimeIfNull(Long customerId, Date firstDealTime);
}
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.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
/**
* 客户创建入口类型枚举
*/
@AllArgsConstructor
@Getter
public enum CustomerCreateFromEnum {
//1、导入 2、后台用户创建 3、APP注册 4、发货人创建
IMPORT(1, "导入"),
BACKEND(2, "后台用户创建"),
APP_REGISTER(3, "APP注册"),
APP_CONSIGNOR(4, "APP发货人创建");
;
/**
* 类型
*/
private final Integer value;
/**
* 类型名
*/
private final String name;
public static String getNameByValue(Integer value) {
return Arrays.stream(CustomerCreateFromEnum.values()).filter(t -> t.getValue().equals(value)).map(CustomerCreateFromEnum::getName).findFirst().orElse("");
}
public static CustomerCreateFromEnum get(Integer value) {
return Arrays.stream(CustomerCreateFromEnum.values()).filter(t -> t.getValue().equals(value)).findFirst().orElse(null);
}
}
package cn.iocoder.yudao.module.ecw.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
/**
* 客户获取方式类型枚举
*/
@AllArgsConstructor
@Getter
public enum CustomerGetMethodEnum {
CREATE(1, "自主创建"),
ASSIGN(2, "分配/移交接收"),
CATCH(3, "公海捞取");
;
/**
* 类型
*/
private final Integer value;
/**
* 类型名
*/
private final String name;
public static String getNameByValue(Integer value) {
return Arrays.stream(CustomerGetMethodEnum.values()).filter(t -> t.getValue().equals(value)).map(CustomerGetMethodEnum::getName).findFirst().orElse("");
}
public static CustomerGetMethodEnum get(Integer value) {
return Arrays.stream(CustomerGetMethodEnum.values()).filter(t -> t.getValue().equals(value)).findFirst().orElse(null);
}
}
package cn.iocoder.yudao.module.ecw.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
/**
* 客户角色类型枚举
*/
@AllArgsConstructor
@Getter
public enum CustomerRoleEnum {
//0、CO 1、工程商 2、代理 6、集运
C0(0, "C0"),
CONTRACTOR(1, "工程商"),
PROXY(2, "代理"),
CONSOLIDATOR(6, "集运");
;
/**
* 类型
*/
private final Integer value;
/**
* 类型名
*/
private final String name;
public static String getNameByValue(Integer value) {
return Arrays.stream(CustomerRoleEnum.values()).filter(t -> t.getValue().equals(value)).map(CustomerRoleEnum::getName).findFirst().orElse("");
}
public static CustomerRoleEnum get(Integer value) {
return Arrays.stream(CustomerRoleEnum.values()).filter(t -> t.getValue().equals(value)).findFirst().orElse(null);
}
}
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,6 +104,12 @@ 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')")
......@@ -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);
}
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