@@ -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; |
@@ -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; |
@@ -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; |
@@ -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; |
@@ -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; |
@@ -168,5 +168,7 @@ | |||||
</configuration> | </configuration> | ||||
</plugin> | </plugin> | ||||
</plugins> | </plugins> | ||||
</build> | </build> | ||||
</project> | </project> |
@@ -23,7 +23,7 @@ import java.util.Map; | |||||
* @author gongbiao | * @author gongbiao | ||||
*/ | */ | ||||
@RestController | @RestController | ||||
@RequestMapping("api/video") | |||||
@RequestMapping("/api/video") | |||||
public class VideoController extends BaseController { | public class VideoController extends BaseController { | ||||
private Logger logger = LoggerFactory.getLogger(this.getClass()); | private Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
@@ -32,8 +32,9 @@ public class VideoController extends BaseController { | |||||
@Autowired | @Autowired | ||||
String videoType; | String videoType; | ||||
@Autowired | @Autowired | ||||
WxCVideoService wxCVideoService; | |||||
private WxCVideoService wxCVideoService; | |||||
/** | /** | ||||
* 上传视频 | * 上传视频 | ||||
@@ -133,7 +134,7 @@ public class VideoController extends BaseController { | |||||
public WxCVideoTable avatarList(@RequestBody Map<String, String> params){ | public WxCVideoTable avatarList(@RequestBody Map<String, String> params){ | ||||
String username = params.get("username"); | String username = params.get("username"); | ||||
WxCVideoTable TemplateVideo = wxCVideoService.findByUserName(username); | WxCVideoTable TemplateVideo = wxCVideoService.findByUserName(username); | ||||
return null; | |||||
return TemplateVideo; | |||||
} | } | ||||
} | } |
@@ -85,6 +85,10 @@ public class WxUserGrantController extends BaseController { | |||||
@Autowired | @Autowired | ||||
WxMallService mallService; | WxMallService mallService; | ||||
@Autowired | |||||
WxCLiveUserBasicInfoService wxCLiveUserBasicInfoService; | |||||
@Autowired | @Autowired | ||||
private QrCodeService qrCodeService; | private QrCodeService qrCodeService; | ||||
@@ -139,7 +143,6 @@ public class WxUserGrantController extends BaseController { | |||||
if(StringUtils.isBlank(code)){ | if(StringUtils.isBlank(code)){ | ||||
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "请输入验证码"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "请输入验证码"); | ||||
} | } | ||||
String key = Constant.captchaPrev + ":" + ipAddr; | String key = Constant.captchaPrev + ":" + ipAddr; | ||||
String code1 = RedisCacheUtils.getCacheString(redisTemplate, key); | String code1 = RedisCacheUtils.getCacheString(redisTemplate, key); | ||||
if(StringUtils.isBlank(code1)){ | if(StringUtils.isBlank(code1)){ | ||||
@@ -148,13 +151,11 @@ public class WxUserGrantController extends BaseController { | |||||
if(!code1.equals(code)){ | if(!code1.equals(code)){ | ||||
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "验证码不正确"); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "验证码不正确"); | ||||
} | } | ||||
String phone = map.get("username"); | String phone = map.get("username"); | ||||
String password = map.get("password"); | String password = map.get("password"); | ||||
if(StringUtils.isBlank(phone) || StringUtils.isBlank(password)){ | if(StringUtils.isBlank(phone) || StringUtils.isBlank(password)){ | ||||
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "手机号或密码为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "手机号或密码为空"); | ||||
} | } | ||||
WxCUserBasicInfo basicInfo = wxCUserBasicInfoService.findInfoByPhone(getTenantInfo(), phone); | WxCUserBasicInfo basicInfo = wxCUserBasicInfoService.findInfoByPhone(getTenantInfo(), phone); | ||||
if(basicInfo == null){ | if(basicInfo == null){ | ||||
return new ResultData(ErrorCode.USER_IS_EMPTY); | return new ResultData(ErrorCode.USER_IS_EMPTY); | ||||
@@ -165,32 +166,33 @@ public class WxUserGrantController extends BaseController { | |||||
if(!encryptPassword.equals(basicInfo.getPassword())){ | if(!encryptPassword.equals(basicInfo.getPassword())){ | ||||
return new ResultData(ErrorCode.USER_PASSWD_ERR.getCode(), "手机号或密码错误"); | return new ResultData(ErrorCode.USER_PASSWD_ERR.getCode(), "手机号或密码错误"); | ||||
} | } | ||||
int status = Integer.parseInt(map.get("status")); | int status = Integer.parseInt(map.get("status")); | ||||
if (status==0){ | 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){ | if (status==-1){ | ||||
wxCUserBasicInfoService.updateCode(basicInfo.getId(),null); | |||||
wxCLiveUserBasicInfoService.updateCode(basicInfo.getId(),null); | |||||
basicInfo.setStatus(-2); | basicInfo.setStatus(-2); | ||||
return new ResultData(ErrorCode.USER_CANCEL_MCODE.getCode(),"设备已注销"); | return new ResultData(ErrorCode.USER_CANCEL_MCODE.getCode(),"设备已注销"); | ||||
} | } | ||||
basicInfo =wxCUserBasicInfoService.getById1(basicInfo.getId()); | |||||
wxCUserBasicInfoService.handleLoginUser(basicInfo); | wxCUserBasicInfoService.handleLoginUser(basicInfo); | ||||
WxCUserBasicInfo basicLiveInfo =wxCLiveUserBasicInfoService.getById(basicInfo.getId()); | |||||
Map<String,Object> resultMap = new HashMap(); | Map<String,Object> resultMap = new HashMap(); | ||||
// resultMap.put("phone", basicInfo.getPhone()); | // resultMap.put("phone", basicInfo.getPhone()); | ||||
Map<String,Object> data = new HashMap(); | Map<String,Object> data = new HashMap(); | ||||
data.put("status",basicInfo.getStatus()); | 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("current_time",new Date(System.currentTimeMillis()/1000)); | ||||
data.put("expire_time",basicInfo.getExpireTime().getTime()/1000); | |||||
data.put("expire_time",basicLiveInfo.getExpireTime().getTime()/1000); | |||||
Map<String,Object> info = new HashMap(); | Map<String,Object> info = new HashMap(); | ||||
info.put("log_id",basicInfo.getId()); | info.put("log_id",basicInfo.getId()); | ||||
info.put("username",basicInfo.getPhone()); | info.put("username",basicInfo.getPhone()); | ||||
@@ -199,7 +201,7 @@ public class WxUserGrantController extends BaseController { | |||||
resultMap.put("info",info); | resultMap.put("info",info); | ||||
// resultMap.put("expire_time", basicInfo.getExpireTime()); | |||||
// resultMap.put("expire_time", basicInfo.getExpireTime()); | |||||
return new ResultData(resultMap); | return new ResultData(resultMap); | ||||
} | } | ||||
@@ -0,0 +1,48 @@ | |||||
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<WxCVideoTable> authorList; | |||||
//public class Author extends TenantEntityWithoutFinalTenantId{ | |||||
@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; | |||||
// } | |||||
} |
@@ -66,8 +66,8 @@ public interface WxCUserBasicInfoMapper extends CommonMapper<WxCUserBasicInfo, S | |||||
long getTotalCreditAmount(@Param("tenantId")String tenantId, @Param("finalTenantId")String finalTenantId); | long getTotalCreditAmount(@Param("tenantId")String tenantId, @Param("finalTenantId")String finalTenantId); | ||||
WxCUserBasicInfo selectById1(Long id); | |||||
//WxCUserBasicInfo selectById1(Long id); | |||||
void updateCode(Long id, String mcode); | |||||
//void updateCode(Long id, String mcode); | |||||
} | } | ||||
@@ -0,0 +1,12 @@ | |||||
package com.iformall.mapper; | |||||
import com.iformall.common.CommonMapper; | |||||
import com.iformall.domain.po.WxCUserTags; | |||||
import com.iformall.domain.po.WxCVideoTable; | |||||
import org.apache.ibatis.annotations.Param; | |||||
public interface WxCVideoMapper extends CommonMapper<WxCVideoTable, String> { | |||||
WxCVideoTable findByUserName(@Param("username") String username); | |||||
} |
@@ -201,9 +201,9 @@ public interface WxCUserBasicInfoService { | |||||
void updUserInfo(WxCUserBasicInfo cUser, Long memberId); | 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); | |||||
} | } | ||||
@@ -0,0 +1,9 @@ | |||||
package com.iformall.service; | |||||
import com.iformall.domain.po.WxCVideoTable; | |||||
public interface WxCVideoService { | |||||
WxCVideoTable findByUserName(String username); | |||||
} |
@@ -629,7 +629,8 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc | |||||
@Override | @Override | ||||
public PageInfo<WxCUserBasicInfo> listAsPage(WxCUserBasicInfo record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxCUserBasicInfo> 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 | @Override | ||||
@@ -666,7 +667,8 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc | |||||
WxCUserBasicInfo basicQ = new WxCUserBasicInfo(); | WxCUserBasicInfo basicQ = new WxCUserBasicInfo(); | ||||
basicQ.setFinalTenantId(tenantEntity.getFinalTenantId()); | basicQ.setFinalTenantId(tenantEntity.getFinalTenantId()); | ||||
basicQ.setPhone(phone); | basicQ.setPhone(phone); | ||||
List<WxCUserBasicInfo> basicInfos = wxCUserBasicInfoMapper.selectList(new QueryWrapper(basicQ)); | |||||
List<WxCUserBasicInfo> basicInfos = wxCUserBasicInfoMapper.selectList( | |||||
new QueryWrapper(basicQ)); | |||||
if (basicInfos != null && basicInfos.size() > 0) { | if (basicInfos != null && basicInfos.size() > 0) { | ||||
WxCUserBasicInfo wxCUserBasicInfo = basicInfos.get(0); | WxCUserBasicInfo wxCUserBasicInfo = basicInfos.get(0); | ||||
if (wxCUserBasicInfo.getPoins() != null) { | if (wxCUserBasicInfo.getPoins() != null) { | ||||
@@ -953,16 +955,16 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc | |||||
update(info); | 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 | @Override | ||||
@@ -0,0 +1,92 @@ | |||||
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,IExcelExportServer { | |||||
private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
@Autowired | |||||
WxCUserBasicInfoMapper wxCUserBasicInfoMapper; | |||||
@Autowired | |||||
WxCUserTagsService wxCUserTagsService; | |||||
@Autowired | |||||
WxCVideoMapper wxCVideoMapper; | |||||
@Override | |||||
public WxCVideoTable findByUserName(String username) { | |||||
WxCVideoTable TemplateVideo = wxCVideoMapper.findByUserName(username); | |||||
return TemplateVideo; | |||||
} | |||||
@Override | |||||
public List<Object> selectListForExcelExport(Object queryParams, int page) { | |||||
WxCUserBasicInfo basicInfo = (WxCUserBasicInfo) queryParams; | |||||
List<WxCUserBasicInfoVo> list = new ArrayList<WxCUserBasicInfoVo>(); | |||||
basicInfo.setBegin((page-1)*20000); | |||||
basicInfo.setLimit(20000); | |||||
list = wxCUserBasicInfoMapper.findVoList(basicInfo); | |||||
if (null == list || list.size() <= 0 ) { | |||||
return null; | |||||
} | |||||
// List<Long> 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<WxCreditHistory> chadds = creditHistoryMapper.findAddList(chaddq); | |||||
// Map<Long, Integer> 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<WxCreditHistory> chless = creditHistoryMapper.findLesList(chlesq); | |||||
// Map<Long, Integer> chlesMap = new HashMap<>(); | |||||
// if(null != chless){ | |||||
// chlesMap = chless.stream().collect(Collectors.toMap(WxCreditHistory::getCUserId, WxCreditHistory::getCreditNum)); | |||||
// } | |||||
//处理会员标签 | |||||
List<Long> tagIds = list.stream().map(cc -> cc.getTagId()).collect(Collectors.toList()); | |||||
Map<Long, String> 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<Object> retList = new ArrayList<Object>(); | |||||
retList.addAll(list); | |||||
return retList; | |||||
} | |||||
return null; | |||||
} | |||||
} |
@@ -138,11 +138,7 @@ | |||||
from wx_c_user_basic_info wcubi | from wx_c_user_basic_info wcubi | ||||
where wcubi.id =#{id} | where wcubi.id =#{id} | ||||
</select> | </select> | ||||
<select id="selectById1" parameterType="java.util.HashMap" resultMap="BaseResultMap"> | |||||
select <include refid="allColumns1"/> | |||||
from wx_c_user_basic_info2 wcubi1 join wx_c_user_basic_info wcubi | |||||
on wcubi.id =#{id} | |||||
</select> | |||||
<select id="findList" parameterType="com.iformall.domain.po.WxCUserBasicInfo" resultMap="BaseResultMap"> | <select id="findList" parameterType="com.iformall.domain.po.WxCUserBasicInfo" resultMap="BaseResultMap"> | ||||
select | select | ||||
@@ -162,7 +158,7 @@ | |||||
</foreach> | </foreach> | ||||
</if> | </if> | ||||
</select> | </select> | ||||
<select id="findIdList" parameterType="com.iformall.domain.po.WxCUserBasicInfo" resultType="Long"> | <select id="findIdList" parameterType="com.iformall.domain.po.WxCUserBasicInfo" resultType="Long"> | ||||
select id | select id | ||||
from wx_c_user_basic_info wcubi | from wx_c_user_basic_info wcubi | ||||
@@ -587,7 +583,5 @@ | |||||
<update id="cuserOldToNew" statementType="CALLABLE" > | <update id="cuserOldToNew" statementType="CALLABLE" > | ||||
{call cuser_old_to_new(#{oldCuserId},#{newCuserId},#{tableIndex},#{finalTableIndex})} | {call cuser_old_to_new(#{oldCuserId},#{newCuserId},#{tableIndex},#{finalTableIndex})} | ||||
</update> | </update> | ||||
<update id="updateCode"> | |||||
update wx_c_user_basic_info2 set code = #{mcode} where id = #{id} | |||||
</update> | |||||
</mapper> | </mapper> |
@@ -0,0 +1,27 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
<mapper namespace="com.iformall.mapper.WxCVideoMapper"> | |||||
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCVideoTable"> | |||||
<id column="id" jdbcType="INTEGER" property="id"/> | |||||
<result column="user_name" jdbcType="VARCHAR" property="userName"/> | |||||
<result column="name" jdbcType="VARCHAR" property="name"/> | |||||
<result column="image" jdbcType="VARCHAR" property="image"/> | |||||
<result column="demo" jdbcType="INTEGER" property="demo"/> | |||||
<result column="preinfo" jdbcType="VARCHAR" property="preInfo"/> | |||||
<result column="expire_time" jdbcType="VARCHAR" property="expireTime"/> | |||||
</resultMap> | |||||
<select id="findByUserName" parameterType="java.util.HashMap" resultMap="BaseResultMap"> | |||||
SELECT | |||||
wca.user_name,expire_time,wcav.id,wcav.name,wcav.image,wcav.model,wcav.preinfo | |||||
from wx_c_author wca | |||||
left join | |||||
wx_c_avatar wcav | |||||
on wcav.id =wca.resource_id where | |||||
wca.resource_id in | |||||
(select wca.resource_id from wx_c_author wca | |||||
WHERE wca.user_name = #{username} AND wca.type = 0 ) | |||||
</select> | |||||
</mapper> |