| @@ -1,13 +1,20 @@ | |||||
| package com.iformall.controller.sm; | package com.iformall.controller.sm; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.R; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||||
| import com.iformall.domain.po.base.BaseEntity; | import com.iformall.domain.po.base.BaseEntity; | ||||
| import com.iformall.domain.po.sm.PersonMould; | import com.iformall.domain.po.sm.PersonMould; | ||||
| import com.iformall.domain.po.sm.ServiceInfo; | import com.iformall.domain.po.sm.ServiceInfo; | ||||
| import com.iformall.domain.po.sm.ServicePersonMould; | |||||
| import com.iformall.domain.po.sm.UserPersonMould; | |||||
| import com.iformall.enums.EnumaMouldPatchStatus; | import com.iformall.enums.EnumaMouldPatchStatus; | ||||
| import com.iformall.exception.BizException; | |||||
| import com.iformall.service.WxCUserBasicInfoService; | |||||
| import com.iformall.service.sm.PersonMouldService; | import com.iformall.service.sm.PersonMouldService; | ||||
| import com.iformall.service.sm.ServiceInfoService; | import com.iformall.service.sm.ServiceInfoService; | ||||
| @@ -16,8 +23,10 @@ import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import java.util.ArrayList; | |||||
| import java.util.List; | import java.util.List; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -35,6 +44,9 @@ public class PersonMouldController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private ServiceInfoService serviceInfoService; | private ServiceInfoService serviceInfoService; | ||||
| @Autowired | |||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("alList") | @GetMapping("alList") | ||||
| @@ -83,4 +95,76 @@ public class PersonMouldController extends BaseController { | |||||
| final PageInfo<PersonMould> page = personMouldService.listAsPage(pm, pageNum, pageSize); | final PageInfo<PersonMould> page = personMouldService.listAsPage(pm, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("用户分页列表接口") | |||||
| @GetMapping("userMouldList") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData userMouldList(@ModelAttribute PersonMould record, Integer pageNum, Integer pageSize) { | |||||
| if (null == record) { | |||||
| record = new PersonMould(); | |||||
| } | |||||
| if (StringUtils.isNotBlank(record.getPhone())) { | |||||
| List<Long> cUserIds = wxCUserBasicInfoService.findIdsListByPhone(null, record.getPhone()); | |||||
| if (null == cUserIds || cUserIds.size() <= 0 ) { | |||||
| record.setId(-1L); | |||||
| }else { | |||||
| List<Long> mids = personMouldService.getUserMouldIds(cUserIds); | |||||
| if (null == mids || mids.size() <= 0 ) { | |||||
| record.setId(-1L); | |||||
| }else { | |||||
| record.setIds(mids); | |||||
| } | |||||
| } | |||||
| } | |||||
| if(record.getVideoType() != null && record.getVideoType().intValue() == -1){ | |||||
| record.setVideoType(null); | |||||
| } | |||||
| if(record.getSex() != null && record.getSex().intValue() == -1){ | |||||
| record.setSex(null); | |||||
| } | |||||
| record.setStatus(EnumaMouldPatchStatus.put_on.getCode()); | |||||
| record.setSortColumns(BaseEntity.SortField.UpdateDate_DESC); | |||||
| final PageInfo<PersonMould> page = personMouldService.listAsPage(record, pageNum, pageSize); | |||||
| if (null != page && null != page.getList() && page.getList().size() > 0 ) { | |||||
| for (int i = 0 ; i < page.getList().size(); i++) { | |||||
| PersonMould pm = page.getList().get(i); | |||||
| List<Long> cuserIds = personMouldService.getCUserIds(pm.getId()); | |||||
| if (null != cuserIds && cuserIds.size() > 0) { | |||||
| WxCUserBasicInfo u = new WxCUserBasicInfo(); | |||||
| u.setIds(cuserIds); | |||||
| pm.setWxCUserBasicInfoList(wxCUserBasicInfoService.findList(u)); | |||||
| } | |||||
| } | |||||
| } | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("用户模板编码分页列表接口") | |||||
| @GetMapping("userPersonMouldIdList") | |||||
| public ResultData userPersonMouldIdList(Long cUserId) { | |||||
| if (null == cUserId) { | |||||
| throw new BizException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),cUserId+"不为空"); | |||||
| } | |||||
| List<Long> uids = new ArrayList<Long>(); | |||||
| uids.add(cUserId); | |||||
| List<Long> mouldIds = personMouldService.getUserMouldIds(uids); | |||||
| return new ResultData(mouldIds); | |||||
| } | |||||
| @ApiOperation("设置用户关联模板") | |||||
| @PostMapping("/associatedUserMoulds") | |||||
| public ResultData associatedUserMoulds(@RequestBody UserPersonMould spm) { | |||||
| if (null == spm.getMouldIds() || spm.getMouldIds().size() <= 0 ) { | |||||
| throw new BizException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"请选择模板"); | |||||
| } | |||||
| if (null == spm.getCUserId() ) { | |||||
| throw new BizException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"请选择用户"); | |||||
| } | |||||
| personMouldService.associatedUserMoulds(spm.getMouldIds(), spm.getCUserId()); | |||||
| return new ResultData(); | |||||
| } | |||||
| } | } | ||||
| @@ -0,0 +1,131 @@ | |||||
| package com.iformall.controller.sm; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||||
| import com.iformall.domain.po.base.BaseEntity; | |||||
| import com.iformall.domain.po.sm.PersonMould; | |||||
| import com.iformall.domain.po.sm.UserMouldVideo; | |||||
| import com.iformall.domain.po.sm.UserPersonMould; | |||||
| import com.iformall.domain.po.sm.UserVoiceLanguage; | |||||
| import com.iformall.domain.po.sm.VoiceLanguage; | |||||
| import com.iformall.domain.po.sm.VoiceMould; | |||||
| import com.iformall.enums.*; | |||||
| import com.iformall.exception.BizException; | |||||
| import com.iformall.language.LanguageDetect; | |||||
| import com.iformall.service.WxCUserBasicInfoService; | |||||
| import com.iformall.service.WxCVoiceService; | |||||
| import com.iformall.service.sm.*; | |||||
| import com.iformall.sm.AiPreviewParam; | |||||
| import com.iformall.smsdk.SmPreviewVideoDTO; | |||||
| import com.iformall.smsdk.SmSdkUtils; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import java.util.ArrayList; | |||||
| import java.util.HashMap; | |||||
| import java.util.List; | |||||
| @RestController | |||||
| @RequestMapping("voiceMould") | |||||
| @Api(description = "模板接口") | |||||
| public class VoiceMouldController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private VoiceLanguageService voiceLanguageService; | |||||
| @Autowired | |||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("alList") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute VoiceLanguage record, Integer pageNum, Integer pageSize) { | |||||
| if (record == null) record = new VoiceLanguage(); | |||||
| record.setSortColumns(BaseEntity.SortField.UpdateDate_DESC); | |||||
| record.setIsDel(EnumYesOrNo.NO.getCode()); | |||||
| final PageInfo<VoiceLanguage> page = voiceLanguageService.listAsPage(record, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("用户声纹编码列表接口") | |||||
| @GetMapping("userVoiceIdList") | |||||
| public ResultData userVoiceIdList(Long cUserId) { | |||||
| if (null == cUserId) { | |||||
| throw new BizException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),cUserId+"不为空"); | |||||
| } | |||||
| List<Long> uids = new ArrayList<Long>(); | |||||
| uids.add(cUserId); | |||||
| List<Long> voiceIds = voiceLanguageService.getUserVoiceIdList(uids); | |||||
| return new ResultData(voiceIds); | |||||
| } | |||||
| @ApiOperation("设置用户关联模板") | |||||
| @PostMapping("/associatedUserVoices") | |||||
| public ResultData associatedUserVoices(@RequestBody UserVoiceLanguage uvl) { | |||||
| if (null == uvl.getVoiceLanguageIdList() || uvl.getVoiceLanguageIdList().size() <= 0 ) { | |||||
| throw new BizException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"请选择声纹"); | |||||
| } | |||||
| if (null == uvl.getCUserId() ) { | |||||
| throw new BizException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"请选择用户"); | |||||
| } | |||||
| voiceLanguageService.associatedUserVoices(uvl.getVoiceLanguageIdList(), uvl.getCUserId()); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("用户分页列表接口") | |||||
| @GetMapping("userVoiceList") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData userVoiceList(@ModelAttribute VoiceLanguage record, Integer pageNum, Integer pageSize) { | |||||
| if (null == record) { | |||||
| record = new VoiceLanguage(); | |||||
| } | |||||
| if (StringUtils.isNotBlank(record.getPhone())) { | |||||
| List<Long> cUserIds = wxCUserBasicInfoService.findIdsListByPhone(null, record.getPhone()); | |||||
| if (null == cUserIds || cUserIds.size() <= 0 ) { | |||||
| record.setId(-1L); | |||||
| }else { | |||||
| List<Long> mids = voiceLanguageService.getUserVoiceIdList(cUserIds); | |||||
| if (null == mids || mids.size() <= 0 ) { | |||||
| record.setId(-1L); | |||||
| }else { | |||||
| record.setIds(mids); | |||||
| } | |||||
| } | |||||
| } | |||||
| record.setIsDel(EnumYesOrNo.NO.getCode()); | |||||
| record.setSortColumns(BaseEntity.SortField.UpdateDate_DESC); | |||||
| final PageInfo<VoiceLanguage> page = voiceLanguageService.listAsPage(record, pageNum, pageSize); | |||||
| if (null != page && null != page.getList() && page.getList().size() > 0 ) { | |||||
| for (int i = 0 ; i < page.getList().size(); i++) { | |||||
| VoiceLanguage pm = page.getList().get(i); | |||||
| List<Long> cuserIds = voiceLanguageService.getCUserIds(pm.getId()); | |||||
| if (null != cuserIds && cuserIds.size() > 0) { | |||||
| WxCUserBasicInfo u = new WxCUserBasicInfo(); | |||||
| u.setIds(cuserIds); | |||||
| pm.setWxCUserBasicInfoList(wxCUserBasicInfoService.findList(u)); | |||||
| } | |||||
| } | |||||
| } | |||||
| return new ResultData(page); | |||||
| } | |||||
| } | |||||
| @@ -210,6 +210,27 @@ public class UserMouldVideoController extends BaseController { | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| /** | |||||
| * 校验 | |||||
| * | |||||
| * @param record | |||||
| * @return {@link ResultData} | |||||
| */ | |||||
| @ApiOperation("慧影项目生成视频") | |||||
| @GetMapping("/checkVideo") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData checkVideo(Long id) { | |||||
| if(id == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| UserMouldVideo mouldVideo = userMouldVideoService.getById(id); | |||||
| if(mouldVideo == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"id无效"); | |||||
| } | |||||
| //TODO 校验 | |||||
| return new ResultData(); | |||||
| } | |||||
| // @AuthIgnore | // @AuthIgnore | ||||
| // @ApiOperation("生成视频") | // @ApiOperation("生成视频") | ||||
| @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | import com.baomidou.mybatisplus.annotation.TableField; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import com.iformall.common.SortColumn; | import com.iformall.common.SortColumn; | ||||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| @@ -107,6 +108,8 @@ public class PersonMould extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="模板第三方Id",name="mouldSmId") | @io.swagger.annotations.ApiModelProperty(value="模板第三方Id",name="mouldSmId") | ||||
| private String mouldSmId; | private String mouldSmId; | ||||
| @TableField(exist = false) | |||||
| private String mouldSmIdLike; | |||||
| @io.swagger.annotations.ApiModelProperty(value="素材",name="material") | @io.swagger.annotations.ApiModelProperty(value="素材",name="material") | ||||
| private String material; | private String material; | ||||
| @@ -137,6 +140,15 @@ public class PersonMould extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Long cuserId; | private Long cuserId; | ||||
| @TableField(exist = false) | |||||
| private String phone; | |||||
| @TableField(exist = false) | |||||
| private Integer onlyCustomizedQuery = 0; | |||||
| @TableField(exist = false) | |||||
| private List<WxCUserBasicInfo> wxCUserBasicInfoList; | |||||
| public String getSalePriceStr() { | public String getSalePriceStr() { | ||||
| if(salePrice!=null) { | if(salePrice!=null) { | ||||
| @@ -29,4 +29,6 @@ public class UserPersonMould extends BaseEntity { | |||||
| private Date updateDate; | private Date updateDate; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private List<Long> cuserIds; | private List<Long> cuserIds; | ||||
| @TableField(exist = false) | |||||
| private List<Long> mouldIds; | |||||
| } | } | ||||
| @@ -29,4 +29,6 @@ public class UserVoiceLanguage extends BaseEntity { | |||||
| private Date updateDate; | private Date updateDate; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private List<Long> cuserIds; | private List<Long> cuserIds; | ||||
| @TableField(exist = false) | |||||
| private List<Long> voiceLanguageIdList; | |||||
| } | } | ||||
| @@ -3,6 +3,7 @@ package com.iformall.domain.po.sm; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | import com.baomidou.mybatisplus.annotation.TableField; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| @@ -69,7 +70,16 @@ public class VoiceLanguage extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private List<Long> customizedVocideIds; | private List<Long> customizedVocideIds; | ||||
| @TableField(exist = false) | |||||
| private Integer onlyCustomizedQuery = 0; | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Long cUserId; | private Long cUserId; | ||||
| @TableField(exist = false) | |||||
| private String phone; | |||||
| @TableField(exist = false) | |||||
| private List<WxCUserBasicInfo> wxCUserBasicInfoList; | |||||
| } | } | ||||
| @@ -10,6 +10,8 @@ public interface UserPersonMouldMapper extends CommonMapper<UserPersonMould, Lon | |||||
| List<Long> findMouldIdList(UserPersonMould record); | List<Long> findMouldIdList(UserPersonMould record); | ||||
| List<Long> findCUserIdList(UserPersonMould record); | |||||
| void deleteByCuserId(@Param("cUserId") Long cUserId); | void deleteByCuserId(@Param("cUserId") Long cUserId); | ||||
| void saveBatch(@Param("list") List<UserPersonMould> list); | void saveBatch(@Param("list") List<UserPersonMould> list); | ||||
| @@ -10,6 +10,8 @@ public interface UserVoiceLanguageMapper extends CommonMapper<UserVoiceLanguage, | |||||
| List<Long> findVoiceIdList(UserVoiceLanguage record); | List<Long> findVoiceIdList(UserVoiceLanguage record); | ||||
| List<Long> findCUserIdList(UserVoiceLanguage record); | |||||
| void deleteByCuserId(@Param("cUserId") Long cUserId); | void deleteByCuserId(@Param("cUserId") Long cUserId); | ||||
| void saveBatch(@Param("list") List<UserVoiceLanguage> list); | void saveBatch(@Param("list") List<UserVoiceLanguage> list); | ||||
| @@ -208,5 +208,9 @@ public interface WxCUserBasicInfoService { | |||||
| void reducePoints(Long id,String finalTenantId,Integer reducePoints); | void reducePoints(Long id,String finalTenantId,Integer reducePoints); | ||||
| void addPoints(Long id,String finalTenantId,Integer addPoints); | void addPoints(Long id,String finalTenantId,Integer addPoints); | ||||
| List<Long> findIdsListByPhone(String finalTenantId,String phone); | |||||
| List<WxCUserBasicInfo> findList(WxCUserBasicInfo basicInfo); | |||||
| } | } | ||||
| @@ -1550,5 +1550,17 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc | |||||
| public void addPoints(Long id, String finalTenantId, Integer addPoints) { | public void addPoints(Long id, String finalTenantId, Integer addPoints) { | ||||
| wxCUserBasicInfoMapper.addPoints(id, finalTenantId, addPoints); | wxCUserBasicInfoMapper.addPoints(id, finalTenantId, addPoints); | ||||
| } | } | ||||
| @Override | |||||
| public List<Long> findIdsListByPhone(String finalTenantId, String phone) { | |||||
| WxCUserBasicInfo user = new WxCUserBasicInfo(); | |||||
| user.setPhone(phone); | |||||
| return wxCUserBasicInfoMapper.findIdList(user); | |||||
| } | |||||
| @Override | |||||
| public List<WxCUserBasicInfo> findList(WxCUserBasicInfo basicInfo) { | |||||
| return wxCUserBasicInfoMapper.findList(basicInfo); | |||||
| } | |||||
| } | } | ||||
| @@ -47,5 +47,11 @@ public interface PersonMouldService { | |||||
| //接入商的模板编号 | //接入商的模板编号 | ||||
| List<Long> getServiceMouldIds(Long serviceId); | List<Long> getServiceMouldIds(Long serviceId); | ||||
| List<Long> getUserMouldIds(List<Long> userIds); | |||||
| List<Long> getCUserIds(Long personMouldId); | |||||
| void associatedUserMoulds(List<Long> mouldIds, Long cUserId); | |||||
| } | } | ||||
| @@ -1,15 +1,23 @@ | |||||
| package com.iformall.service.sm; | package com.iformall.service.sm; | ||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.domain.po.sm.PersonMould; | |||||
| import com.iformall.domain.po.sm.VoiceLanguage; | import com.iformall.domain.po.sm.VoiceLanguage; | ||||
| import java.util.List; | import java.util.List; | ||||
| public interface VoiceLanguageService { | public interface VoiceLanguageService { | ||||
| PageInfo<VoiceLanguage> listAsPage(VoiceLanguage record, Integer pageIndex, Integer pageSize); | |||||
| List<VoiceLanguage> voiceTotal(VoiceLanguage voiceLanguage); | List<VoiceLanguage> voiceTotal(VoiceLanguage voiceLanguage); | ||||
| VoiceLanguage getLanguage(String paperwork); | VoiceLanguage getLanguage(String paperwork); | ||||
| List<VoiceLanguage> listVoiceLanguage(String chineseName); | List<VoiceLanguage> listVoiceLanguage(String chineseName); | ||||
| List<Long> getUserVoiceIdList(List<Long> cUserIds); | |||||
| void associatedUserVoices(List<Long> voicesIds, Long cUserId); | |||||
| List<Long> getCUserIds(Long voiceId); | |||||
| } | } | ||||
| @@ -146,4 +146,36 @@ public class PersonMouldServiceImpl implements PersonMouldService { | |||||
| return servicePersonMouldMapper.findMouldIdList(spm); | return servicePersonMouldMapper.findMouldIdList(spm); | ||||
| } | } | ||||
| @Override | |||||
| public List<Long> getUserMouldIds(List<Long> userIds) { | |||||
| UserPersonMould upm = new UserPersonMould(); | |||||
| upm.setCuserIds(userIds); | |||||
| return userPersonMouldMapper.findMouldIdList(null); | |||||
| } | |||||
| @Override | |||||
| public List<Long> getCUserIds(Long personMouldId) { | |||||
| UserPersonMould upm = new UserPersonMould(); | |||||
| upm.setPersonMouldId(personMouldId); | |||||
| return userPersonMouldMapper.findCUserIdList(upm); | |||||
| } | |||||
| @Override | |||||
| public void associatedUserMoulds(List<Long> mouldIds, Long cUserId) { | |||||
| userPersonMouldMapper.deleteByCuserId(cUserId); | |||||
| if (null != mouldIds && mouldIds.size() > 0 ) { | |||||
| List<UserPersonMould> upmlist = new ArrayList<UserPersonMould>(); | |||||
| for (int i = 0 ; i < mouldIds.size() ; i ++) { | |||||
| UserPersonMould upm = new UserPersonMould(); | |||||
| upm.setId(IdWorker.get().nextId()); | |||||
| upm.setCUserId(cUserId); | |||||
| upm.setPersonMouldId(mouldIds.get(i)); | |||||
| upm.setCreateDate(new Date()); | |||||
| upm.setUpdateDate(new Date()); | |||||
| upmlist.add(upm); | |||||
| } | |||||
| userPersonMouldMapper.saveBatch(upmlist); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -2,8 +2,12 @@ package com.iformall.service.sm.impl; | |||||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
| import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.google.common.collect.Lists; | import com.google.common.collect.Lists; | ||||
| import com.iformall.common.IdWorker; | |||||
| import com.iformall.constant.LanguageEnums; | import com.iformall.constant.LanguageEnums; | ||||
| import com.iformall.domain.po.sm.UserPersonMould; | |||||
| import com.iformall.domain.po.sm.UserVoiceLanguage; | import com.iformall.domain.po.sm.UserVoiceLanguage; | ||||
| import com.iformall.domain.po.sm.VoiceLanguage; | import com.iformall.domain.po.sm.VoiceLanguage; | ||||
| import com.iformall.language.LanguageDetect; | import com.iformall.language.LanguageDetect; | ||||
| @@ -18,6 +22,7 @@ import org.springframework.stereotype.Service; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.Collections; | import java.util.Collections; | ||||
| import java.util.Date; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Optional; | import java.util.Optional; | ||||
| @@ -29,6 +34,11 @@ public class VoiceLanguageServiceImpl implements VoiceLanguageService { | |||||
| @Autowired | @Autowired | ||||
| private UserVoiceLanguageMapper userVoiceLanguageMapper; | private UserVoiceLanguageMapper userVoiceLanguageMapper; | ||||
| @Override | |||||
| public PageInfo<VoiceLanguage> listAsPage(VoiceLanguage record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> voiceLanguageMapper.findList(record)); | |||||
| } | |||||
| @Override | @Override | ||||
| public List<VoiceLanguage> voiceTotal(VoiceLanguage voiceLanguage) { | public List<VoiceLanguage> voiceTotal(VoiceLanguage voiceLanguage) { | ||||
| @@ -80,4 +90,38 @@ public class VoiceLanguageServiceImpl implements VoiceLanguageService { | |||||
| .orderByAsc(VoiceLanguage::getLocal)); | .orderByAsc(VoiceLanguage::getLocal)); | ||||
| return CollectionUtils.isEmpty(languages) ? Collections.emptyList() : languages; | return CollectionUtils.isEmpty(languages) ? Collections.emptyList() : languages; | ||||
| } | } | ||||
| @Override | |||||
| public List<Long> getUserVoiceIdList(List<Long> cUserIds) { | |||||
| UserVoiceLanguage vl = new UserVoiceLanguage(); | |||||
| vl.setCuserIds(cUserIds); | |||||
| return userVoiceLanguageMapper.findVoiceIdList(vl); | |||||
| } | |||||
| @Override | |||||
| public void associatedUserVoices(List<Long> voicesIds, Long cUserId) { | |||||
| userVoiceLanguageMapper.deleteByCuserId(cUserId); | |||||
| if (null != voicesIds && voicesIds.size() > 0 ) { | |||||
| List<UserVoiceLanguage> upmlist = new ArrayList<UserVoiceLanguage>(); | |||||
| for (int i = 0 ; i < voicesIds.size() ; i ++) { | |||||
| UserVoiceLanguage upm = new UserVoiceLanguage(); | |||||
| upm.setId(IdWorker.get().nextId()); | |||||
| upm.setCUserId(cUserId); | |||||
| upm.setVoiceLanguageId(voicesIds.get(i)); | |||||
| upm.setCreateDate(new Date()); | |||||
| upm.setUpdateDate(new Date()); | |||||
| upmlist.add(upm); | |||||
| } | |||||
| userVoiceLanguageMapper.saveBatch(upmlist); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public List<Long> getCUserIds(Long voiceId) { | |||||
| UserVoiceLanguage vl = new UserVoiceLanguage(); | |||||
| vl.setVoiceLanguageId(voiceId); | |||||
| return userVoiceLanguageMapper.findCUserIdList(vl); | |||||
| } | |||||
| } | } | ||||
| @@ -64,6 +64,10 @@ | |||||
| <if test=" null != subTitle "> | <if test=" null != subTitle "> | ||||
| and `sub_title` like concat('%', #{subTitle},'%') | and `sub_title` like concat('%', #{subTitle},'%') | ||||
| </if> | </if> | ||||
| <if test=" null != mouldSmIdLike "> | |||||
| and `mould_sm_id` like concat('%', #{mouldSmIdLike},'%') | |||||
| </if> | |||||
| <if test=" null != sex "> | <if test=" null != sex "> | ||||
| and `sex` = #{sex} | and `sex` = #{sex} | ||||
| @@ -115,6 +119,10 @@ | |||||
| <if test=" 0 == customizedQuery"> | <if test=" 0 == customizedQuery"> | ||||
| and customized = 0 | and customized = 0 | ||||
| </if> | </if> | ||||
| <if test=" 1 == onlyCustomizedQuery"> | |||||
| and customized = 1 | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| @@ -32,7 +32,22 @@ | |||||
| <select id="findMouldIdList" parameterType="com.iformall.domain.po.sm.UserPersonMould" resultType="Long"> | <select id="findMouldIdList" parameterType="com.iformall.domain.po.sm.UserPersonMould" resultType="Long"> | ||||
| select person_mould_id | select person_mould_id | ||||
| from user_person_mould where c_user_id = #{cUserId} | |||||
| from user_person_mould | |||||
| <if test=" null != cUserId "> | |||||
| where c_user_id = #{cUserId} | |||||
| </if> | |||||
| <if test=" null != cuserIds "> | |||||
| where c_user_id in | |||||
| <foreach collection="cuserIds" index="index" item="uidItem" open="(" separator="," close=")"> | |||||
| #{uidItem} | |||||
| </foreach> | |||||
| </if> | |||||
| </select> | |||||
| <select id="findCUserIdList" parameterType="com.iformall.domain.po.sm.UserPersonMould" resultType="Long"> | |||||
| select c_user_id | |||||
| from user_person_mould | |||||
| where person_mould_id = #{personMouldId} | |||||
| </select> | </select> | ||||
| <delete id = "deleteByCuserId"> | <delete id = "deleteByCuserId"> | ||||
| @@ -32,7 +32,24 @@ | |||||
| <select id="findVoiceIdList" parameterType="com.iformall.domain.po.sm.UserVoiceLanguage" resultType="Long"> | <select id="findVoiceIdList" parameterType="com.iformall.domain.po.sm.UserVoiceLanguage" resultType="Long"> | ||||
| select voice_language_id | select voice_language_id | ||||
| from user_voice_language where c_user_id = #{cUserId} | |||||
| from user_voice_language | |||||
| <if test=" null != cUserId "> | |||||
| where c_user_id = #{cUserId} | |||||
| </if> | |||||
| <if test=" null != cuserIds "> | |||||
| where c_user_id in | |||||
| <foreach collection="cuserIds" index="index" item="uidItem" open="(" separator="," close=")"> | |||||
| #{uidItem} | |||||
| </foreach> | |||||
| </if> | |||||
| </select> | |||||
| <select id="findCUserIdList" parameterType="com.iformall.domain.po.sm.UserVoiceLanguage" resultType="Long"> | |||||
| select c_user_id | |||||
| from user_voice_language | |||||
| where voice_language_id = #{voiceLanguageId} | |||||
| </select> | </select> | ||||
| <delete id = "deleteByCuserId"> | <delete id = "deleteByCuserId"> | ||||
| @@ -51,6 +51,10 @@ | |||||
| <if test=" 0 == customizedQuery"> | <if test=" 0 == customizedQuery"> | ||||
| and customized = 0 | and customized = 0 | ||||
| </if> | </if> | ||||
| <if test=" 1 == onlyCustomizedQuery"> | |||||
| and customized = 1 | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||