| @@ -450,6 +450,8 @@ public class WxUserGrantController extends BaseController { | |||
| //慧影注册送金币 | |||
| projectFactory.getProjectService(EnumProject.PROJECT_2.getCode()).handleAfterRegeister(basicInfo); | |||
| //慧播初始化用户模板和时长 | |||
| projectFactory.getProjectService(EnumProject.PROJECT_1.getCode()).handleAfterRegeister(basicInfo); | |||
| return new ResultData(); | |||
| // } else { | |||
| // return new ResultData(ErrorCode.MSG_VERIFY_CODE_NOT_FOUND); | |||
| @@ -4,5 +4,8 @@ public class SysConfigConstant { | |||
| public static final String vierfy_seconds_key="vierfySeconds"; | |||
| public static final String default_merchant_b_user = "defaultMerchantBUserId"; | |||
| public static final String hb_avatar_init_ids = "hbAvatarInitIds"; | |||
| public static final String hb_voice_init_ids = "hbVoiceInitIds"; | |||
| public static final String hb_regeister_days_expired = "hbRegeisterDaysExpired"; | |||
| } | |||
| @@ -0,0 +1,28 @@ | |||
| package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import java.util.Date; | |||
| @TableName(value = "wx_c_author") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxCAuthor extends BaseEntity { | |||
| private Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="userId") | |||
| private Long userId; | |||
| @io.swagger.annotations.ApiModelProperty(value="电话",name="userName") | |||
| private String userName; | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumWxCAuthorType",name="type") | |||
| private Integer type; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="resourceId") | |||
| private Long resourceId; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="expireTime") | |||
| private Date expireTime; | |||
| } | |||
| @@ -0,0 +1,40 @@ | |||
| package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import java.util.Date; | |||
| @TableName(value = "wx_c_avatar") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxCAvatar extends BaseEntity { | |||
| private Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumClassType",name="klass") | |||
| private Integer klass; | |||
| @io.swagger.annotations.ApiModelProperty(value="数字人名称",name="name") | |||
| private String name; | |||
| @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="model") | |||
| private String model; | |||
| @io.swagger.annotations.ApiModelProperty(value="数字人预处理文件",name="preinfo") | |||
| private String preinfo; | |||
| @io.swagger.annotations.ApiModelProperty(value="模板文件地址",name="modelPath") | |||
| private String modelPath; | |||
| @io.swagger.annotations.ApiModelProperty(value="模板文件地址",name="preinfoPath") | |||
| private String preinfoPath; | |||
| @io.swagger.annotations.ApiModelProperty(value="模板文件地址",name="modelMd5") | |||
| private String modelMd5; | |||
| @io.swagger.annotations.ApiModelProperty(value="模板文件地址",name="preinfoMd5") | |||
| private String preinfoMd5; | |||
| @io.swagger.annotations.ApiModelProperty(value="模板文件地址",name="mask") | |||
| private String mask; | |||
| } | |||
| @@ -0,0 +1,24 @@ | |||
| package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import java.util.Date; | |||
| @TableName(value = "wx_c_user_live_basic_info") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxCUserLiveBasicInfo extends BaseEntity { | |||
| private Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="code") | |||
| private String code; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="version") | |||
| private Integer version = 2; | |||
| @io.swagger.annotations.ApiModelProperty(value="过期时间",name="expireTime") | |||
| private Date expireTime; | |||
| } | |||
| @@ -0,0 +1,34 @@ | |||
| package com.iformall.enums.sm; | |||
| /** | |||
| * 数字人模板 | |||
| */ | |||
| public enum EnumWxCAuthorType { | |||
| AVATAR(0, "数字人模板"), | |||
| VOICE(1, "声音"); | |||
| public static EnumWxCAuthorType getEnum(Integer code) { | |||
| for (EnumWxCAuthorType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumWxCAuthorType(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,15 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxCAuthor; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| public interface WxCAuthorMapper extends CommonMapper<WxCAuthor, String> { | |||
| List<WxCAuthor> findList(WxCAuthor wxCAuthor); | |||
| void deleteByUserId(@Param(value = "userId")Long userId); | |||
| } | |||
| @@ -0,0 +1,11 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxCAvatar; | |||
| import java.util.List; | |||
| public interface WxCAvatarMapper extends CommonMapper<WxCAvatar, String> { | |||
| List<WxCAvatar> findList(WxCAvatar wxCAvatar); | |||
| } | |||
| @@ -0,0 +1,19 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.dto.WxCUserBasicInfoDto; | |||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||
| import com.iformall.domain.po.WxCUserLiveBasicInfo; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.CUserBaseVo; | |||
| import com.iformall.domain.vo.UserCountVo; | |||
| import com.iformall.domain.vo.WxCUserBasicInfoVo; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| public interface WxCUserLiveBasicInfoMapper extends CommonMapper<WxCUserLiveBasicInfo, String> { | |||
| WxCUserLiveBasicInfo findById(@Param(value = "id")Long id); | |||
| } | |||
| @@ -0,0 +1,12 @@ | |||
| package com.iformall.service; | |||
| import java.util.Date; | |||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||
| public interface WxCUserLiveBasicInfoService { | |||
| public void regeister(WxCUserBasicInfo wxCUserBasicInfo) ; | |||
| } | |||
| @@ -0,0 +1,102 @@ | |||
| package com.iformall.service.impl; | |||
| import com.iformall.common.SysConfigConstant; | |||
| import com.iformall.domain.po.SysConfig; | |||
| import com.iformall.domain.po.WxCAuthor; | |||
| import com.iformall.domain.po.WxCAvatar; | |||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||
| import com.iformall.domain.po.WxCUserLiveBasicInfo; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.sm.VoiceLanguage; | |||
| import com.iformall.enums.sm.EnumWxCAuthorType; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.DateUtils; | |||
| import java.util.ArrayList; | |||
| import java.util.Arrays; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.context.annotation.Lazy; | |||
| import org.springframework.stereotype.Service; | |||
| @Service | |||
| public class WxCUserLiveBasicInfoServiceImpl implements WxCUserLiveBasicInfoService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxCUserLiveBasicInfoMapper wxCUserLiveBasicInfoMapper; | |||
| @Autowired | |||
| WxCAuthorMapper wxCAuthorMapper; | |||
| @Autowired | |||
| WxCAvatarMapper wxCAvatarMapper; | |||
| @Lazy | |||
| @Autowired | |||
| SysConfigService sysConfigService; | |||
| @Autowired | |||
| VoiceLanguageMapper voiceLanguageMapper; | |||
| @Override | |||
| public void regeister(WxCUserBasicInfo wxCUserBasicInfo) { | |||
| SysConfig rconfig = sysConfigService.getByKey(SysConfigConstant.hb_regeister_days_expired, new TenantEntity()); | |||
| Date expireTime = DateUtils.getTimeAfterDays(Integer.parseInt(rconfig.getConfigItemValue()),new Date()); | |||
| WxCUserLiveBasicInfo liveBasicInfo = wxCUserLiveBasicInfoMapper.findById(wxCUserBasicInfo.getId()); | |||
| if (null == liveBasicInfo) { | |||
| liveBasicInfo = new WxCUserLiveBasicInfo(); | |||
| liveBasicInfo.setId(wxCUserBasicInfo.getId()); | |||
| liveBasicInfo.setExpireTime(expireTime); | |||
| wxCUserLiveBasicInfoMapper.insert(liveBasicInfo); | |||
| } | |||
| //分配模板 | |||
| wxCAuthorMapper.deleteByUserId(wxCUserBasicInfo.getId()); | |||
| WxCAvatar aq = new WxCAvatar(); | |||
| SysConfig config = sysConfigService.getByKey(SysConfigConstant.hb_avatar_init_ids, new TenantEntity()); | |||
| String aids = config.getConfigItemValue(); | |||
| String[] _as = aids.split(","); | |||
| List<Long> ass = new ArrayList<Long>(); | |||
| for (String _a : _as) { | |||
| ass.add(Long.parseLong(_a)); | |||
| } | |||
| aq.setIds(ass); | |||
| List<WxCAvatar> alist = wxCAvatarMapper.findList(aq); | |||
| for (WxCAvatar a : alist) { | |||
| WxCAuthor author = new WxCAuthor(); | |||
| author.setUserId(wxCUserBasicInfo.getId()); | |||
| author.setUserName(wxCUserBasicInfo.getPhone()); | |||
| author.setType(EnumWxCAuthorType.AVATAR.getCode()); | |||
| author.setResourceId(a.getId()); | |||
| author.setExpireTime(expireTime); | |||
| wxCAuthorMapper.insert(author); | |||
| } | |||
| SysConfig vconfig = sysConfigService.getByKey(SysConfigConstant.hb_voice_init_ids, new TenantEntity()); | |||
| String vids = vconfig.getConfigItemValue(); | |||
| String[] _vs = vids.split(","); | |||
| List<Long> vss = new ArrayList<Long>(); | |||
| for (String _v : _vs) { | |||
| vss.add(Long.parseLong(_v)); | |||
| } | |||
| VoiceLanguage vq = new VoiceLanguage(); | |||
| vq.setIds(vss); | |||
| List<VoiceLanguage> vlist = voiceLanguageMapper.findList(vq); | |||
| for (VoiceLanguage v : vlist) { | |||
| WxCAuthor author = new WxCAuthor(); | |||
| author.setUserId(wxCUserBasicInfo.getId()); | |||
| author.setUserName(wxCUserBasicInfo.getPhone()); | |||
| author.setType(EnumWxCAuthorType.VOICE.getCode()); | |||
| author.setResourceId(v.getId()); | |||
| author.setExpireTime(expireTime); | |||
| wxCAuthorMapper.insert(author); | |||
| } | |||
| } | |||
| } | |||
| @@ -1,15 +1,20 @@ | |||
| package com.iformall.service.project.service.impl; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.iformall.domain.po.Product; | |||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||
| import com.iformall.service.WxCUserLiveBasicInfoService; | |||
| import com.iformall.service.project.entity.CreateBilling; | |||
| import com.iformall.service.project.service.ProjectService; | |||
| //慧播 | |||
| @Service | |||
| public class HBProjectService extends BaseProjectService implements ProjectService{ | |||
| @Autowired | |||
| WxCUserLiveBasicInfoService wxCUserLiveBasicInfoService; | |||
| @Override | |||
| public Object getPayProductExtroInfo(Product product) { | |||
| @@ -35,8 +40,7 @@ public class HBProjectService extends BaseProjectService implements ProjectServi | |||
| @Override | |||
| public void handleAfterRegeister(WxCUserBasicInfo cUser) { | |||
| // TODO Auto-generated method stub | |||
| wxCUserLiveBasicInfoService.regeister(cUser); | |||
| } | |||
| @@ -0,0 +1,51 @@ | |||
| <?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.WxCAuthorMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCAuthor"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="user_id" jdbcType="BIGINT" property="userId"/> | |||
| <result column="user_name" jdbcType="VARCHAR" property="userName"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="resource_id" jdbcType="BIGINT" property="resourceId"/> | |||
| <result column="expire_time" jdbcType="TIMESTAMP" property="expireTime"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| id,user_id,user_name,type,resource_id,expire_time | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1=1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != userId "> | |||
| and `user_id` = #{userId} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxCAuthor" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns"/> | |||
| from wx_c_author | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <delete id="deleteByUserId" parameterType="java.util.HashMap"> | |||
| delete from wx_c_author where user_id = #{userId} | |||
| </delete> | |||
| </mapper> | |||
| @@ -0,0 +1,52 @@ | |||
| <?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.WxCAvatarMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCAvatar"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="class" jdbcType="INTEGER" property="klass"/> | |||
| <result column="name" jdbcType="VARCHAR" property="name"/> | |||
| <result column="image" jdbcType="VARCHAR" property="image"/> | |||
| <result column="demo" jdbcType="VARCHAR" property="demo"/> | |||
| <result column="model" jdbcType="VARCHAR" property="model"/> | |||
| <result column="preinfo" jdbcType="VARCHAR" property="preinfo"/> | |||
| <result column="model_path" jdbcType="VARCHAR" property="modelPath"/> | |||
| <result column="preinfo_path" jdbcType="VARCHAR" property="preinfoPath"/> | |||
| <result column="model_md5" jdbcType="VARCHAR" property="modelMd5"/> | |||
| <result column="preinfo_md5" jdbcType="VARCHAR" property="preinfoMd5"/> | |||
| <result column="mask" jdbcType="VARCHAR" property="mask"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| id,class,name,image,demo,model,preinfo,model_path,preinfo_path,model_md5,preinfo_md5,mask | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1=1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != klass "> | |||
| and `class` = #{klass} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxCAvatar" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns"/> | |||
| from wx_c_avatar | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| </mapper> | |||
| @@ -0,0 +1,39 @@ | |||
| <?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.WxCUserLiveBasicInfoMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCUserLiveBasicInfo"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="code" jdbcType="VARCHAR" property="code"/> | |||
| <result column="version" jdbcType="INTEGER" property="version"/> | |||
| <result column="expire_time" jdbcType="TIMESTAMP" property="expireTime"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| id,code,version,expire_time | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1=1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findById" parameterType="java.util.HashMap" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns"/> | |||
| from wx_c_user_live_basic_info where id =#{id} | |||
| </select> | |||
| </mapper> | |||