diff --git a/DB/version4.2.4to4.2.5.sql b/DB/version4.2.4to4.2.5.sql index 079c51061..41561d4f5 100644 --- a/DB/version4.2.4to4.2.5.sql +++ b/DB/version4.2.4to4.2.5.sql @@ -1,3 +1,10 @@ +/**增加店铺发货信息**/ +ALTER TABLE li_store_detail ADD `sales_consignor_address_id` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发货地址id'; +ALTER TABLE li_store_detail ADD `sales_consignor_address_path` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发货地址名称'; +ALTER TABLE li_store_detail ADD `sales_consignor_detail` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发货详细地址'; +ALTER TABLE li_store_detail ADD `sales_consignor_mobile` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发货人手机'; +ALTER TABLE li_store_detail ADD `sales_consignor_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发货人姓名'; + /**增加电子面单店铺信息**/ ALTER TABLE `li_store_logistics` ADD `customer_name` varchar(255) DEFAULT NULL COMMENT '客户代码'; ALTER TABLE `li_store_logistics` ADD `customer_pwd` varchar(255) DEFAULT NULL COMMENT '客户密码'; @@ -8,3 +15,244 @@ ALTER TABLE `li_store_logistics` ADD `face_sheet_flag` bit(1) DEFAULT NULL COMME ALTER TABLE `li_store_logistics` ADD `pay_type` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '支付方式'; ALTER TABLE `li_store_logistics` ADD `exp_type` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '快递类型'; +/** 店铺--默认页面是否开启**/ +ALTER TABLE li_store ADD page_show bit(1) DEFAULT NULL COMMENT '默认页面是否开启'; + +/** 创建店员表 **/ +/* + Navicat Premium Data Transfer + + Source Server : lilishop + Source Server Type : MySQL + Source Server Version : 80025 + Source Host : 192.168.0.116:3306 + Source Schema : zhimai1 + + Target Server Type : MySQL + Target Server Version : 80025 + File Encoding : 65001 + + Date: 03/03/2022 19:30:20 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for li_clerk +-- ---------------------------- +DROP TABLE IF EXISTS `li_clerk`; +CREATE TABLE `li_clerk` ( + `id` bigint NOT NULL COMMENT 'ID', + `create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间', + `delete_flag` bit(1) NULL DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除', + `update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime(6) NULL DEFAULT NULL COMMENT '更新时间', + `clerk_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '店员名称', + `member_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '会员id', + `store_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '店铺id', + `department_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '部门id', + `role_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '角色', + `shopkeeper` bit(1) NULL DEFAULT NULL COMMENT '是否是店主', + `is_super` bit(1) NULL DEFAULT NULL COMMENT '是否是超级管理员 超级管理员/普通管理员', + `status` bit(1) NULL DEFAULT NULL COMMENT '状态', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; + + +/** 店员角色**/ +/* + Navicat Premium Data Transfer + + Source Server : lilishop + Source Server Type : MySQL + Source Server Version : 80025 + Source Host : 192.168.0.116:3306 + Source Schema : zhimai1 + + Target Server Type : MySQL + Target Server Version : 80025 + File Encoding : 65001 + + Date: 03/03/2022 19:30:39 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for li_clerk_role +-- ---------------------------- +DROP TABLE IF EXISTS `li_clerk_role`; +CREATE TABLE `li_clerk_role` ( + `id` bigint NOT NULL COMMENT 'ID', + `clerk_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '店员唯一id', + `role_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '角色唯一id', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; + + +/** 店铺部门 **/ +/* + Navicat Premium Data Transfer + + Source Server : lilishop + Source Server Type : MySQL + Source Server Version : 80025 + Source Host : 192.168.0.116:3306 + Source Schema : zhimai1 + + Target Server Type : MySQL + Target Server Version : 80025 + File Encoding : 65001 + + Date: 03/03/2022 19:31:39 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for li_store_department +-- ---------------------------- +DROP TABLE IF EXISTS `li_store_department`; +CREATE TABLE `li_store_department` ( + `id` bigint NOT NULL COMMENT 'ID', + `create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间', + `delete_flag` bit(1) NULL DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除', + `update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime(6) NULL DEFAULT NULL COMMENT '更新时间', + `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '部门名称', + `store_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '店铺id', + `parent_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '父id', + `sort_order` decimal(20, 2) NULL DEFAULT NULL COMMENT '排序值', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; + +/** 部门角色关联 **/ +/* + Navicat Premium Data Transfer + + Source Server : lilishop + Source Server Type : MySQL + Source Server Version : 80025 + Source Host : 192.168.0.116:3306 + Source Schema : zhimai1 + + Target Server Type : MySQL + Target Server Version : 80025 + File Encoding : 65001 + + Date: 03/03/2022 19:32:01 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for li_store_department_role +-- ---------------------------- +DROP TABLE IF EXISTS `li_store_department_role`; +CREATE TABLE `li_store_department_role` ( + `id` bigint NOT NULL COMMENT 'ID', + `create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间', + `delete_flag` bit(1) NULL DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除', + `update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime(6) NULL DEFAULT NULL COMMENT '更新时间', + `role_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '角色id', + `department_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '部门id', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; + +/**店铺角色菜单**/ +/* + Navicat Premium Data Transfer + + Source Server : lilishop + Source Server Type : MySQL + Source Server Version : 80025 + Source Host : 192.168.0.116:3306 + Source Schema : zhimai1 + + Target Server Type : MySQL + Target Server Version : 80025 + File Encoding : 65001 + + Date: 03/03/2022 19:34:42 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for li_store_menu_role +-- ---------------------------- +DROP TABLE IF EXISTS `li_store_menu_role`; +CREATE TABLE `li_store_menu_role` ( + `id` bigint NOT NULL COMMENT 'ID', + `create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间', + `delete_flag` bit(1) NULL DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除', + `update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime(6) NULL DEFAULT NULL COMMENT '更新时间', + `role_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '角色id', + `menu_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '菜单', + `store_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '店铺id', + `is_super` bit(1) NULL DEFAULT NULL COMMENT '是否拥有操作数据权限,为否则只有查看权限', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; + + +/**店铺角色**/ + /* + Navicat Premium Data Transfer + + Source Server : lilishop + Source Server Type : MySQL + Source Server Version : 80025 + Source Host : 192.168.0.116:3306 + Source Schema : zhimai1 + + Target Server Type : MySQL + Target Server Version : 80025 + File Encoding : 65001 + + Date: 03/03/2022 19:32:59 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for li_store_role +-- ---------------------------- +DROP TABLE IF EXISTS `li_store_role`; +CREATE TABLE `li_store_role` ( + `id` bigint NOT NULL COMMENT 'ID', + `create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间', + `delete_flag` bit(1) NULL DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除', + `update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime(6) NULL DEFAULT NULL COMMENT '更新时间', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '角色名称', + `store_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '店铺id', + `default_role` bit(1) NULL DEFAULT NULL COMMENT '是否为注册默认角色', + `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = DYNAMIC; + +SET FOREIGN_KEY_CHECKS = 1; + diff --git a/config/application.yml b/config/application.yml index acb8ac31d..f534ca281 100644 --- a/config/application.yml +++ b/config/application.yml @@ -29,8 +29,8 @@ spring: type: redis # Redis redis: - host: 101.43.251.145 - port: 6379 + host: 192.168.0.108 + port: 30379 password: lilishop lettuce: pool: @@ -60,7 +60,7 @@ spring: default-datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://101.43.251.145:3306/clerk?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai + url: jdbc:mysql://192.168.0.108:30306/clerk?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai username: root password: lilishop maxActive: 50 @@ -119,7 +119,8 @@ ignored: - /store/passport/login/refresh/** - /common/common/slider/** - /common/common/sms/** - - /common/common/site + - /common/common/logo + - /buyer/promotion/kanjiaGoods - /buyer/payment/cashier/** - /buyer/other/pageData/** - /buyer/other/article/** @@ -255,7 +256,7 @@ lili: # jwt 细节设定 jwt-setting: # token过期时间(分钟) - tokenExpireTime: 30 + tokenExpireTime: 300000 # 使用Spring @Cacheable注解失效时间 cache: @@ -269,7 +270,7 @@ lili: data: elasticsearch: cluster-name: elasticsearch - cluster-nodes: 101.43.251.145:9200 + cluster-nodes: 192.168.0.108:30920 index: number-of-replicas: 0 number-of-shards: 3 @@ -277,10 +278,10 @@ lili: schema: http # account: # username: elastic - # password: LiLiShopES + # password: uE41Dc3m9A52L2omQPV148jG logstash: - server: 101.43.251.145:4560 + server: 192.168.0.108:30560 rocketmq: promotion-topic: lili_promotion_topic promotion-group: lili_promotion_group @@ -301,7 +302,7 @@ lili: after-sale-topic: lili_after_sale_topic after-sale-group: lili_after_sale_group rocketmq: - name-server: 101.43.251.145:9876 + name-server: 192.168.0.108:30876 isVIPChannel: false producer: group: lili_group @@ -310,7 +311,7 @@ rocketmq: xxl: job: admin: - addresses: http://101.43.251.145:9001/xxl-job-admin + addresses: http://192.168.0.108:30001/xxl-job-admin executor: appname: xxl-job-executor-lilishop address: diff --git a/framework/src/main/java/cn/lili/modules/member/entity/dos/Clerk.java b/framework/src/main/java/cn/lili/modules/member/entity/dos/Clerk.java index 4e12e56b7..fc9f8b013 100644 --- a/framework/src/main/java/cn/lili/modules/member/entity/dos/Clerk.java +++ b/framework/src/main/java/cn/lili/modules/member/entity/dos/Clerk.java @@ -2,6 +2,7 @@ package cn.lili.modules.member.entity.dos; import cn.hutool.core.text.CharSequenceUtil; import cn.lili.modules.member.entity.dto.ClerkAddDTO; +import cn.lili.modules.store.entity.dos.Store; import cn.lili.mybatis.BaseEntity; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; @@ -67,4 +68,14 @@ public class Clerk extends BaseEntity { this.clerkName = clerkAddDTO.getUsername(); } + + + public Clerk(Store store){ + this.memberId = store.getMemberId(); + this.storeId = store.getId(); + this.clerkName = store.getMemberName(); + this.setShopkeeper(true); + this.setIsSuper(true); + this.setStatus(true); + } } diff --git a/framework/src/main/java/cn/lili/modules/store/service/StoreService.java b/framework/src/main/java/cn/lili/modules/store/service/StoreService.java index 28693e534..6e5e39abf 100644 --- a/framework/src/main/java/cn/lili/modules/store/service/StoreService.java +++ b/framework/src/main/java/cn/lili/modules/store/service/StoreService.java @@ -116,4 +116,6 @@ public interface StoreService extends IService { * @param collectionDTO 收藏信息 */ void updateStoreCollectionNum(CollectionDTO collectionDTO); + + void storeToClerk(); } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreServiceImpl.java b/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreServiceImpl.java index f6c5d8b22..44c9e8903 100644 --- a/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreServiceImpl.java @@ -11,6 +11,7 @@ import cn.lili.common.security.context.UserContext; import cn.lili.common.utils.BeanUtil; import cn.lili.common.vo.PageVO; import cn.lili.modules.goods.service.GoodsService; +import cn.lili.modules.member.entity.dos.Clerk; import cn.lili.modules.member.entity.dos.Member; import cn.lili.modules.member.entity.dto.ClerkAddDTO; import cn.lili.modules.member.entity.dto.CollectionDTO; @@ -36,6 +37,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; import java.util.Optional; @@ -70,7 +73,6 @@ public class StoreServiceImpl extends ServiceImpl implements @Autowired private StoreDetailService storeDetailService; - @Autowired private Cache cache; @@ -313,6 +315,18 @@ public class StoreServiceImpl extends ServiceImpl implements baseMapper.updateCollection(collectionDTO.getId(), collectionDTO.getNum()); } + @Override + public void storeToClerk() { + //清空店铺信息方便重新导入不会有重复数据 + clerkService.remove(new LambdaQueryWrapper().eq(Clerk::getShopkeeper,true)); + List clerkList = new ArrayList<>(); + //遍历已开启的店铺 + for (Store store : this.list(new LambdaQueryWrapper().eq(Store::getDeleteFlag,false).eq(Store::getStoreDisable,StoreStatusEnum.OPEN.name()))) { + clerkList.add(new Clerk(store)); + } + clerkService.saveBatch(clerkList); + } + /** * 获取当前登录操作的店铺 * diff --git a/manager-api/src/main/java/cn/lili/controller/store/StoreManagerController.java b/manager-api/src/main/java/cn/lili/controller/store/StoreManagerController.java index ae4b8c73b..0262010e3 100644 --- a/manager-api/src/main/java/cn/lili/controller/store/StoreManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/store/StoreManagerController.java @@ -126,4 +126,11 @@ public class StoreManagerController { } return ResultUtil.data(null); } + + @ApiOperation(value = "将所有店铺导入店员表") + @PostMapping("store/to/clerk") + public ResultMessage storeToClerk(){ + this.storeService.storeToClerk(); + return ResultUtil.success(); + } } diff --git a/seller-api/src/main/java/cn/lili/controller/goods/GoodsImportController.java b/seller-api/src/main/java/cn/lili/controller/goods/GoodsImportController.java index afbfb93bf..517751aee 100644 --- a/seller-api/src/main/java/cn/lili/controller/goods/GoodsImportController.java +++ b/seller-api/src/main/java/cn/lili/controller/goods/GoodsImportController.java @@ -6,12 +6,11 @@ import cn.lili.common.enums.ResultUtil; import cn.lili.common.exception.ServiceException; import cn.lili.common.vo.ResultMessage; import cn.lili.modules.goods.service.GoodsImportService; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; @@ -20,6 +19,9 @@ import javax.servlet.http.HttpServletResponse; * @author chc * @since 2022/6/2114:46 */ +@Api(tags = "商品导入") +@RestController +@RequestMapping("/store/goods/import") public class GoodsImportController { @Autowired private GoodsImportService goodsImportService;