From b6c035cc26355f9325285d5e47a3454a36d9cf67 Mon Sep 17 00:00:00 2001 From: twy <2301620162@qq.com> Date: Thu, 13 Jul 2023 18:52:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E7=9A=84=E5=AE=9E=E7=8E=B0=E5=8F=8A=E9=83=A8=E5=88=86=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E6=A8=A1=E6=9D=BF=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/V2023071300001_wx_c_author.sql | 33 ++++++++++++++ .../migration/V2023071300002_wx_c_avatar.sql | 35 +++++++++++++++ .../V2023071300003_wx_c_user_basic_info2.sql | 32 +++++++++++++ .../migration/V2023071300004_wx_c_voice.sql | 34 ++++++++++++++ .../V2023071300005_wx_c_voice_local.sql | 31 +++++++++++++ .../V2023071300006_wx_c_voice_style.sql | 33 ++++++++++++++ .../com/iformall/domain/po/WxCVideoTable.java | 45 +++++++++++++++++++ .../com/iformall/mapper/WxCVideoMapper.java | 9 ++++ .../com/iformall/service/WxCVideoService.java | 9 ++++ .../service/impl/WxCVideoServiceImpl.java | 18 ++++++++ .../main/resources/mapper/WxCVideoMapper.tld | 27 +++++++++++ 11 files changed, 306 insertions(+) create mode 100644 suimangAdmin/src/main/resources/db/migration/V2023071300001_wx_c_author.sql create mode 100644 suimangAdmin/src/main/resources/db/migration/V2023071300002_wx_c_avatar.sql create mode 100644 suimangAdmin/src/main/resources/db/migration/V2023071300003_wx_c_user_basic_info2.sql create mode 100644 suimangAdmin/src/main/resources/db/migration/V2023071300004_wx_c_voice.sql create mode 100644 suimangAdmin/src/main/resources/db/migration/V2023071300005_wx_c_voice_local.sql create mode 100644 suimangAdmin/src/main/resources/db/migration/V2023071300006_wx_c_voice_style.sql create mode 100644 suimangService/src/main/java/com/iformall/domain/po/WxCVideoTable.java create mode 100644 suimangService/src/main/java/com/iformall/mapper/WxCVideoMapper.java create mode 100644 suimangService/src/main/java/com/iformall/service/WxCVideoService.java create mode 100644 suimangService/src/main/java/com/iformall/service/impl/WxCVideoServiceImpl.java create mode 100644 suimangService/src/main/resources/mapper/WxCVideoMapper.tld diff --git a/suimangAdmin/src/main/resources/db/migration/V2023071300001_wx_c_author.sql b/suimangAdmin/src/main/resources/db/migration/V2023071300001_wx_c_author.sql new file mode 100644 index 0000000..f4edb5a --- /dev/null +++ b/suimangAdmin/src/main/resources/db/migration/V2023071300001_wx_c_author.sql @@ -0,0 +1,33 @@ +/* + Navicat Premium Data Transfer + + Source Server : photo + Source Server Type : MySQL + Source Server Version : 80026 (8.0.26) + Source Host : 182.92.151.30:3306 + Source Schema : mallink_suimang_test + + Target Server Type : MySQL + Target Server Version : 80026 (8.0.26) + File Encoding : 65001 + + Date: 13/07/2023 18:41:44 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for wx_c_author +-- ---------------------------- +DROP TABLE IF EXISTS `wx_c_author`; +CREATE TABLE `wx_c_author` ( + `id` int NOT NULL COMMENT '用户id', + `user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '用户名', + `type` int NULL DEFAULT NULL COMMENT '权限类型数字人0声纹1', + `resource_id` int NULL DEFAULT NULL COMMENT '对应资源id(数字人id or 声纹id)', + `expire_time` datetime NULL DEFAULT NULL COMMENT '资源权限到期时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/suimangAdmin/src/main/resources/db/migration/V2023071300002_wx_c_avatar.sql b/suimangAdmin/src/main/resources/db/migration/V2023071300002_wx_c_avatar.sql new file mode 100644 index 0000000..5cda66f --- /dev/null +++ b/suimangAdmin/src/main/resources/db/migration/V2023071300002_wx_c_avatar.sql @@ -0,0 +1,35 @@ +/* + Navicat Premium Data Transfer + + Source Server : photo + Source Server Type : MySQL + Source Server Version : 80026 (8.0.26) + Source Host : 182.92.151.30:3306 + Source Schema : mallink_suimang_test + + Target Server Type : MySQL + Target Server Version : 80026 (8.0.26) + File Encoding : 65001 + + Date: 13/07/2023 18:41:55 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for wx_c_avatar +-- ---------------------------- +DROP TABLE IF EXISTS `wx_c_avatar`; +CREATE TABLE `wx_c_avatar` ( + `id` int NOT NULL COMMENT '数字人id', + `class` int NULL DEFAULT NULL COMMENT '共享0定制1', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '数字人名称', + `image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '数字人图像', + `demo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '数字人视频样例', + `model` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '数字人视频模板文件', + `preinfo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '数字人预处理文件', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/suimangAdmin/src/main/resources/db/migration/V2023071300003_wx_c_user_basic_info2.sql b/suimangAdmin/src/main/resources/db/migration/V2023071300003_wx_c_user_basic_info2.sql new file mode 100644 index 0000000..f814ab7 --- /dev/null +++ b/suimangAdmin/src/main/resources/db/migration/V2023071300003_wx_c_user_basic_info2.sql @@ -0,0 +1,32 @@ +/* + Navicat Premium Data Transfer + + Source Server : photo + Source Server Type : MySQL + Source Server Version : 80026 (8.0.26) + Source Host : 182.92.151.30:3306 + Source Schema : mallink_suimang_test + + Target Server Type : MySQL + Target Server Version : 80026 (8.0.26) + File Encoding : 65001 + + Date: 13/07/2023 18:42:07 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for wx_c_user_basic_info2 +-- ---------------------------- +DROP TABLE IF EXISTS `wx_c_user_basic_info2`; +CREATE TABLE `wx_c_user_basic_info2` ( + `id` bigint NOT NULL, + `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, + `version` int NULL DEFAULT NULL, + `expire_time` datetime NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/suimangAdmin/src/main/resources/db/migration/V2023071300004_wx_c_voice.sql b/suimangAdmin/src/main/resources/db/migration/V2023071300004_wx_c_voice.sql new file mode 100644 index 0000000..7982da6 --- /dev/null +++ b/suimangAdmin/src/main/resources/db/migration/V2023071300004_wx_c_voice.sql @@ -0,0 +1,34 @@ +/* + Navicat Premium Data Transfer + + Source Server : photo + Source Server Type : MySQL + Source Server Version : 80026 (8.0.26) + Source Host : 182.92.151.30:3306 + Source Schema : mallink_suimang_test + + Target Server Type : MySQL + Target Server Version : 80026 (8.0.26) + File Encoding : 65001 + + Date: 13/07/2023 18:42:24 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for wx_c_voice +-- ---------------------------- +DROP TABLE IF EXISTS `wx_c_voice`; +CREATE TABLE `wx_c_voice` ( + `id` int NOT NULL COMMENT '声纹id', + `localel_id` int NULL DEFAULT NULL COMMENT '地区id', + `voice_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '声纹名称', + `display_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '声纹显示名称', + `gender` int NULL DEFAULT NULL COMMENT '男1女0', + `class` int NULL DEFAULT NULL COMMENT '共享0定制1', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/suimangAdmin/src/main/resources/db/migration/V2023071300005_wx_c_voice_local.sql b/suimangAdmin/src/main/resources/db/migration/V2023071300005_wx_c_voice_local.sql new file mode 100644 index 0000000..ebb6c90 --- /dev/null +++ b/suimangAdmin/src/main/resources/db/migration/V2023071300005_wx_c_voice_local.sql @@ -0,0 +1,31 @@ +/* + Navicat Premium Data Transfer + + Source Server : photo + Source Server Type : MySQL + Source Server Version : 80026 (8.0.26) + Source Host : 182.92.151.30:3306 + Source Schema : mallink_suimang_test + + Target Server Type : MySQL + Target Server Version : 80026 (8.0.26) + File Encoding : 65001 + + Date: 13/07/2023 18:42:33 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for wx_c_voice_local +-- ---------------------------- +DROP TABLE IF EXISTS `wx_c_voice_local`; +CREATE TABLE `wx_c_voice_local` ( + `id` int NOT NULL COMMENT '地区id', + `local_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '地区名称', + `display_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '地区名称显示', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/suimangAdmin/src/main/resources/db/migration/V2023071300006_wx_c_voice_style.sql b/suimangAdmin/src/main/resources/db/migration/V2023071300006_wx_c_voice_style.sql new file mode 100644 index 0000000..66636c5 --- /dev/null +++ b/suimangAdmin/src/main/resources/db/migration/V2023071300006_wx_c_voice_style.sql @@ -0,0 +1,33 @@ +/* + Navicat Premium Data Transfer + + Source Server : photo + Source Server Type : MySQL + Source Server Version : 80026 (8.0.26) + Source Host : 182.92.151.30:3306 + Source Schema : mallink_suimang_test + + Target Server Type : MySQL + Target Server Version : 80026 (8.0.26) + File Encoding : 65001 + + Date: 13/07/2023 18:42:38 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for wx_c_voice_style +-- ---------------------------- +DROP TABLE IF EXISTS `wx_c_voice_style`; +CREATE TABLE `wx_c_voice_style` ( + `id` int NOT NULL COMMENT '风格', + `voice_id` int NULL DEFAULT NULL COMMENT '声纹id', + `style_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '风格名称', + `display_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '风格显示名称', + `style_demo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '样例视频', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/suimangService/src/main/java/com/iformall/domain/po/WxCVideoTable.java b/suimangService/src/main/java/com/iformall/domain/po/WxCVideoTable.java new file mode 100644 index 0000000..9714bc2 --- /dev/null +++ b/suimangService/src/main/java/com/iformall/domain/po/WxCVideoTable.java @@ -0,0 +1,45 @@ +package com.iformall.domain.po; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.iformall.domain.po.base.TenantEntityWithoutFinalTenantId; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.util.ArrayList; +import java.util.Date; + +@TableName(value = "wx_c_avatar") +@Data +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +public class WxCVideoTable extends TenantEntityWithoutFinalTenantId { + + @TableField(exist = false) + private String userName; + + @TableField(exist = false) + private String currentTime; + + @TableField(exist = false) + private ArrayList authorList; + + @io.swagger.annotations.ApiModelProperty(value="数字人id",name="id") + private int id; + @io.swagger.annotations.ApiModelProperty(value="数字人名称",name="name") + private String name; + + @TableField(exist = false) + @io.swagger.annotations.ApiModelProperty(value="权限过期时间",name="expire_time") + private Date expireTime; + + @io.swagger.annotations.ApiModelProperty(value="数字人封面图片链接",name="image") + private String image; + @io.swagger.annotations.ApiModelProperty(value="数字人样例视频链接",name="demo") + private String demo; + @io.swagger.annotations.ApiModelProperty(value="数字人模板预处理信息文件链接",name="preInfo") + private String preinfo; + +} diff --git a/suimangService/src/main/java/com/iformall/mapper/WxCVideoMapper.java b/suimangService/src/main/java/com/iformall/mapper/WxCVideoMapper.java new file mode 100644 index 0000000..d42055d --- /dev/null +++ b/suimangService/src/main/java/com/iformall/mapper/WxCVideoMapper.java @@ -0,0 +1,9 @@ +package com.iformall.mapper; + +import com.iformall.common.CommonMapper; +import com.iformall.domain.po.WxCUserTags; +import com.iformall.domain.po.WxCVideoTable; + +public interface WxCVideoMapper extends CommonMapper { + WxCVideoTable findByUserName(String username); +} diff --git a/suimangService/src/main/java/com/iformall/service/WxCVideoService.java b/suimangService/src/main/java/com/iformall/service/WxCVideoService.java new file mode 100644 index 0000000..bc84755 --- /dev/null +++ b/suimangService/src/main/java/com/iformall/service/WxCVideoService.java @@ -0,0 +1,9 @@ +package com.iformall.service; + +import com.iformall.domain.po.WxCVideoTable; + +public interface WxCVideoService { + + + WxCVideoTable findByUserName(String username); +} diff --git a/suimangService/src/main/java/com/iformall/service/impl/WxCVideoServiceImpl.java b/suimangService/src/main/java/com/iformall/service/impl/WxCVideoServiceImpl.java new file mode 100644 index 0000000..70ee842 --- /dev/null +++ b/suimangService/src/main/java/com/iformall/service/impl/WxCVideoServiceImpl.java @@ -0,0 +1,18 @@ +package com.iformall.service.impl; + +import com.iformall.domain.po.WxCVideoTable; +import com.iformall.mapper.WxCVideoMapper; +import com.iformall.service.WxCVideoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class WxCVideoServiceImpl implements WxCVideoService { + @Autowired + WxCVideoMapper wxCVideoMapper; + @Override + public WxCVideoTable findByUserName(String username) { + WxCVideoTable TemplateVideo = wxCVideoMapper.findByUserName(username); + return TemplateVideo; + } +} diff --git a/suimangService/src/main/resources/mapper/WxCVideoMapper.tld b/suimangService/src/main/resources/mapper/WxCVideoMapper.tld new file mode 100644 index 0000000..15c674c --- /dev/null +++ b/suimangService/src/main/resources/mapper/WxCVideoMapper.tld @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file From 2b8e4a9ae24dbf038913d44262fd998130f6fafd Mon Sep 17 00:00:00 2001 From: twy <2301620162@qq.com> Date: Tue, 18 Jul 2023 12:26:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=85=A7=E6=92=AD=E7=99=BB=E5=85=A5?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V2023071300003_wx_c_user_basic_info2.sql | 32 -------- suimangCApi/pom.xml | 2 + .../iformall/controller/VideoController.java | 7 +- .../controller/WxUserGrantController.java | 28 +++---- .../com/iformall/domain/po/WxCVideoTable.java | 7 +- .../mapper/WxCUserBasicInfoMapper.java | 4 +- .../com/iformall/mapper/WxCVideoMapper.java | 7 +- .../service/WxCUserBasicInfoService.java | 4 +- .../impl/WxCUserBasicInfoServiceImpl.java | 24 +++--- .../service/impl/WxCVideoServiceImpl.java | 76 ++++++++++++++++++- .../mapper/WxCUserBasicInfoMapper.xml | 12 +-- .../main/resources/mapper/WxCVideoMapper.tld | 27 ------- .../main/resources/mapper/WxCVideoMapper.xml | 27 +++++++ 13 files changed, 153 insertions(+), 104 deletions(-) delete mode 100644 suimangAdmin/src/main/resources/db/migration/V2023071300003_wx_c_user_basic_info2.sql delete mode 100644 suimangService/src/main/resources/mapper/WxCVideoMapper.tld create mode 100644 suimangService/src/main/resources/mapper/WxCVideoMapper.xml diff --git a/suimangAdmin/src/main/resources/db/migration/V2023071300003_wx_c_user_basic_info2.sql b/suimangAdmin/src/main/resources/db/migration/V2023071300003_wx_c_user_basic_info2.sql deleted file mode 100644 index f814ab7..0000000 --- a/suimangAdmin/src/main/resources/db/migration/V2023071300003_wx_c_user_basic_info2.sql +++ /dev/null @@ -1,32 +0,0 @@ -/* - Navicat Premium Data Transfer - - Source Server : photo - Source Server Type : MySQL - Source Server Version : 80026 (8.0.26) - Source Host : 182.92.151.30:3306 - Source Schema : mallink_suimang_test - - Target Server Type : MySQL - Target Server Version : 80026 (8.0.26) - File Encoding : 65001 - - Date: 13/07/2023 18:42:07 -*/ - -SET NAMES utf8mb4; -SET FOREIGN_KEY_CHECKS = 0; - --- ---------------------------- --- Table structure for wx_c_user_basic_info2 --- ---------------------------- -DROP TABLE IF EXISTS `wx_c_user_basic_info2`; -CREATE TABLE `wx_c_user_basic_info2` ( - `id` bigint NOT NULL, - `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, - `version` int NULL DEFAULT NULL, - `expire_time` datetime NULL DEFAULT NULL, - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; - -SET FOREIGN_KEY_CHECKS = 1; diff --git a/suimangCApi/pom.xml b/suimangCApi/pom.xml index b702bc6..80e424b 100644 --- a/suimangCApi/pom.xml +++ b/suimangCApi/pom.xml @@ -168,5 +168,7 @@ + + \ No newline at end of file diff --git a/suimangCApi/src/main/java/com/iformall/controller/VideoController.java b/suimangCApi/src/main/java/com/iformall/controller/VideoController.java index 8b1d88f..74210f7 100644 --- a/suimangCApi/src/main/java/com/iformall/controller/VideoController.java +++ b/suimangCApi/src/main/java/com/iformall/controller/VideoController.java @@ -23,7 +23,7 @@ import java.util.Map; * @author gongbiao */ @RestController -@RequestMapping("api/video") +@RequestMapping("/api/video") public class VideoController extends BaseController { private Logger logger = LoggerFactory.getLogger(this.getClass()); @@ -32,8 +32,9 @@ public class VideoController extends BaseController { @Autowired String videoType; + @Autowired - WxCVideoService wxCVideoService; + private WxCVideoService wxCVideoService; /** * 上传视频 @@ -133,7 +134,7 @@ public class VideoController extends BaseController { public WxCVideoTable avatarList(@RequestBody Map params){ String username = params.get("username"); WxCVideoTable TemplateVideo = wxCVideoService.findByUserName(username); - return null; + return TemplateVideo; } } diff --git a/suimangCApi/src/main/java/com/iformall/controller/WxUserGrantController.java b/suimangCApi/src/main/java/com/iformall/controller/WxUserGrantController.java index e0ee82f..3e95aef 100644 --- a/suimangCApi/src/main/java/com/iformall/controller/WxUserGrantController.java +++ b/suimangCApi/src/main/java/com/iformall/controller/WxUserGrantController.java @@ -85,6 +85,10 @@ public class WxUserGrantController extends BaseController { @Autowired WxMallService mallService; + @Autowired + WxCLiveUserBasicInfoService wxCLiveUserBasicInfoService; + + @Autowired private QrCodeService qrCodeService; @@ -139,7 +143,6 @@ public class WxUserGrantController extends BaseController { if(StringUtils.isBlank(code)){ return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "请输入验证码"); } - String key = Constant.captchaPrev + ":" + ipAddr; String code1 = RedisCacheUtils.getCacheString(redisTemplate, key); if(StringUtils.isBlank(code1)){ @@ -148,13 +151,11 @@ public class WxUserGrantController extends BaseController { if(!code1.equals(code)){ return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "验证码不正确"); } - String phone = map.get("username"); String password = map.get("password"); if(StringUtils.isBlank(phone) || StringUtils.isBlank(password)){ return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "手机号或密码为空"); } - WxCUserBasicInfo basicInfo = wxCUserBasicInfoService.findInfoByPhone(getTenantInfo(), phone); if(basicInfo == null){ return new ResultData(ErrorCode.USER_IS_EMPTY); @@ -165,32 +166,33 @@ public class WxUserGrantController extends BaseController { if(!encryptPassword.equals(basicInfo.getPassword())){ return new ResultData(ErrorCode.USER_PASSWD_ERR.getCode(), "手机号或密码错误"); } + int status = Integer.parseInt(map.get("status")); if (status==0){ - basicInfo =wxCUserBasicInfoService.getById1(basicInfo.getId()); - if (basicInfo.getCode()!=null && !map.get("Mcode").equals(basicInfo.getCode())){ - return new ResultData(ErrorCode.USER_ALREADY_LOGIN.getCode(),"用户已在其他设备登录"); - }if (basicInfo.getCode()==null){ - wxCUserBasicInfoService.updateCode(basicInfo.getId(),map.get("Mcode")); + WxCUserBasicInfo basicLiveInfo =wxCLiveUserBasicInfoService.getById(basicInfo.getId()); + if (basicLiveInfo.getCode()!=null && !map.get("Mcode").equals(basicLiveInfo.getCode())){ + return new ResultData(ErrorCode.USER_ALREADY_LOGIN.getCode(),"用户已在其他设备登录"); + }if (basicLiveInfo.getCode()==null){ + wxCLiveUserBasicInfoService.updateCode(basicInfo.getId(),map.get("Mcode")); } } if (status==-1){ - wxCUserBasicInfoService.updateCode(basicInfo.getId(),null); + wxCLiveUserBasicInfoService.updateCode(basicInfo.getId(),null); basicInfo.setStatus(-2); return new ResultData(ErrorCode.USER_CANCEL_MCODE.getCode(),"设备已注销"); } - basicInfo =wxCUserBasicInfoService.getById1(basicInfo.getId()); wxCUserBasicInfoService.handleLoginUser(basicInfo); + WxCUserBasicInfo basicLiveInfo =wxCLiveUserBasicInfoService.getById(basicInfo.getId()); Map resultMap = new HashMap(); // resultMap.put("phone", basicInfo.getPhone()); Map data = new HashMap(); data.put("status",basicInfo.getStatus()); - data.put("version",basicInfo.getVersion()); + data.put("version",basicLiveInfo.getVersion()); data.put("current_time",new Date(System.currentTimeMillis()/1000)); - data.put("expire_time",basicInfo.getExpireTime().getTime()/1000); + data.put("expire_time",basicLiveInfo.getExpireTime().getTime()/1000); Map info = new HashMap(); info.put("log_id",basicInfo.getId()); info.put("username",basicInfo.getPhone()); @@ -199,7 +201,7 @@ public class WxUserGrantController extends BaseController { resultMap.put("info",info); - // resultMap.put("expire_time", basicInfo.getExpireTime()); + // resultMap.put("expire_time", basicInfo.getExpireTime()); return new ResultData(resultMap); } diff --git a/suimangService/src/main/java/com/iformall/domain/po/WxCVideoTable.java b/suimangService/src/main/java/com/iformall/domain/po/WxCVideoTable.java index 9714bc2..000f2ea 100644 --- a/suimangService/src/main/java/com/iformall/domain/po/WxCVideoTable.java +++ b/suimangService/src/main/java/com/iformall/domain/po/WxCVideoTable.java @@ -11,7 +11,7 @@ import lombok.ToString; import java.util.ArrayList; import java.util.Date; -@TableName(value = "wx_c_avatar") +@TableName(value ="wx_c_avatar") @Data @ToString(callSuper = true) @EqualsAndHashCode(callSuper = true) @@ -26,6 +26,8 @@ public class WxCVideoTable extends TenantEntityWithoutFinalTenantId { @TableField(exist = false) private ArrayList authorList; + //public class Author extends TenantEntityWithoutFinalTenantId{ + @io.swagger.annotations.ApiModelProperty(value="数字人id",name="id") private int id; @io.swagger.annotations.ApiModelProperty(value="数字人名称",name="name") @@ -40,6 +42,7 @@ public class WxCVideoTable extends TenantEntityWithoutFinalTenantId { @io.swagger.annotations.ApiModelProperty(value="数字人样例视频链接",name="demo") private String demo; @io.swagger.annotations.ApiModelProperty(value="数字人模板预处理信息文件链接",name="preInfo") - private String preinfo; + private String preInfo; + // } } diff --git a/suimangService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java b/suimangService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java index 4d526c3..7c6b85f 100644 --- a/suimangService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java +++ b/suimangService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java @@ -66,8 +66,8 @@ public interface WxCUserBasicInfoMapper extends CommonMapper { + + WxCVideoTable findByUserName(@Param("username") String username); -public interface WxCVideoMapper extends CommonMapper { - WxCVideoTable findByUserName(String username); } diff --git a/suimangService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java b/suimangService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java index a2db33a..29ed2ee 100644 --- a/suimangService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java +++ b/suimangService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java @@ -201,9 +201,9 @@ public interface WxCUserBasicInfoService { void updUserInfo(WxCUserBasicInfo cUser, Long memberId); - WxCUserBasicInfo getById1(Long id); +// WxCUserBasicInfo getById1(Long id); - void updateCode(Long id, String mcode); + // void updateCode(Long id, String mcode); } diff --git a/suimangService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java b/suimangService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java index 22fdcbb..83df171 100644 --- a/suimangService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java +++ b/suimangService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java @@ -629,7 +629,8 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc @Override public PageInfo listAsPage(WxCUserBasicInfo record, Integer pageIndex, Integer pageSize) { - return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserBasicInfoMapper.findList(record)); + return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo( + () -> wxCUserBasicInfoMapper.findList(record)); } @Override @@ -666,7 +667,8 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc WxCUserBasicInfo basicQ = new WxCUserBasicInfo(); basicQ.setFinalTenantId(tenantEntity.getFinalTenantId()); basicQ.setPhone(phone); - List basicInfos = wxCUserBasicInfoMapper.selectList(new QueryWrapper(basicQ)); + List basicInfos = wxCUserBasicInfoMapper.selectList( + new QueryWrapper(basicQ)); if (basicInfos != null && basicInfos.size() > 0) { WxCUserBasicInfo wxCUserBasicInfo = basicInfos.get(0); if (wxCUserBasicInfo.getPoins() != null) { @@ -953,16 +955,16 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc update(info); } - @Override - public WxCUserBasicInfo getById1(Long id) { - return wxCUserBasicInfoMapper.selectById1(id); - } - - @Override - public void updateCode(Long id, String mcode) { +// @Override +// public WxCUserBasicInfo getById1(Long id) { +// return wxCUserBasicInfoMapper.selectById1(id); +// } - wxCUserBasicInfoMapper.updateCode(id,mcode); - } +// @Override +// public void updateCode(Long id, String mcode) { +// +// wxCUserBasicInfoMapper.updateCode(id,mcode); +// } @Override diff --git a/suimangService/src/main/java/com/iformall/service/impl/WxCVideoServiceImpl.java b/suimangService/src/main/java/com/iformall/service/impl/WxCVideoServiceImpl.java index 70ee842..5dabc33 100644 --- a/suimangService/src/main/java/com/iformall/service/impl/WxCVideoServiceImpl.java +++ b/suimangService/src/main/java/com/iformall/service/impl/WxCVideoServiceImpl.java @@ -1,13 +1,33 @@ package com.iformall.service.impl; +import cn.afterturn.easypoi.handler.inter.IExcelExportServer; +import com.iformall.domain.po.WxCUserBasicInfo; import com.iformall.domain.po.WxCVideoTable; +import com.iformall.domain.vo.WxCUserBasicInfoVo; +import com.iformall.mapper.WxCUserBasicInfoMapper; import com.iformall.mapper.WxCVideoMapper; +import com.iformall.service.WxCUserTagsService; import com.iformall.service.WxCVideoService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + @Service -public class WxCVideoServiceImpl implements WxCVideoService { +public class WxCVideoServiceImpl implements WxCVideoService,IExcelExportServer { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Autowired + WxCUserBasicInfoMapper wxCUserBasicInfoMapper; + + @Autowired + WxCUserTagsService wxCUserTagsService; + @Autowired WxCVideoMapper wxCVideoMapper; @Override @@ -15,4 +35,58 @@ public class WxCVideoServiceImpl implements WxCVideoService { WxCVideoTable TemplateVideo = wxCVideoMapper.findByUserName(username); return TemplateVideo; } + + @Override + public List selectListForExcelExport(Object queryParams, int page) { + WxCUserBasicInfo basicInfo = (WxCUserBasicInfo) queryParams; + List list = new ArrayList(); + basicInfo.setBegin((page-1)*20000); + basicInfo.setLimit(20000); + + list = wxCUserBasicInfoMapper.findVoList(basicInfo); + if (null == list || list.size() <= 0 ) { + return null; + } + +// List userIds = list.stream().map(cc -> cc.getId()).collect(Collectors.toList()); +// if (null != userIds && userIds.size() > 0 ) { +// WxCreditHistory chaddq = new WxCreditHistory(); +// chaddq.setUserIdList(userIds); +// chaddq.setTenantId(tenantInfo.getFinalTenantId()); +// chaddq.setStartTime(basicInfo.getCreditStartTime()); +// chaddq.setEndTime(basicInfo.getCreditEndTime()); +// List chadds = creditHistoryMapper.findAddList(chaddq); +// Map chaddMap = new HashMap<>(); +// if(null != chadds){ +// chaddMap = chadds.stream().collect(Collectors.toMap(WxCreditHistory::getCUserId, WxCreditHistory::getCreditNum)); +// } +// +// WxCreditHistory chlesq = new WxCreditHistory(); +// chlesq.setUserIdList(userIds); +// chlesq.setTenantId(tenantInfo.getFinalTenantId()); +// chlesq.setStartTime(basicInfo.getCreditStartTime()); +// chlesq.setEndTime(basicInfo.getCreditEndTime()); +// List chless = creditHistoryMapper.findLesList(chlesq); +// Map chlesMap = new HashMap<>(); +// if(null != chless){ +// chlesMap = chless.stream().collect(Collectors.toMap(WxCreditHistory::getCUserId, WxCreditHistory::getCreditNum)); +// } + + //处理会员标签 + List tagIds = list.stream().map(cc -> cc.getTagId()).collect(Collectors.toList()); + Map tagIdName = wxCUserTagsService.findIdTagNames(basicInfo.getFinalTenantId(),tagIds); + list.stream().forEach(u->{ +// u.setAddCredit(finalChaddMap.get(u.getId())); +// u.setLesCredit(finalChlesMap.get(u.getId())); + u.setTagNames(tagIdName.get(u.getTagId())); + }); +// +// } + if (null != list && list.size() > 0 ) { + List retList = new ArrayList(); + retList.addAll(list); + return retList; + } + return null; + } } diff --git a/suimangService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml b/suimangService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml index 22e9275..872783b 100644 --- a/suimangService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml +++ b/suimangService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml @@ -138,11 +138,7 @@ from wx_c_user_basic_info wcubi where wcubi.id =#{id} - + - + - - - - - \ No newline at end of file diff --git a/suimangService/src/main/resources/mapper/WxCVideoMapper.xml b/suimangService/src/main/resources/mapper/WxCVideoMapper.xml new file mode 100644 index 0000000..2ab2ea5 --- /dev/null +++ b/suimangService/src/main/resources/mapper/WxCVideoMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file