diff --git a/suimangAdmin/src/main/java/com/iformall/schedule/VideoSchedule.java b/suimangAdmin/src/main/java/com/iformall/schedule/VideoSchedule.java index bd18403..b15ad81 100644 --- a/suimangAdmin/src/main/java/com/iformall/schedule/VideoSchedule.java +++ b/suimangAdmin/src/main/java/com/iformall/schedule/VideoSchedule.java @@ -39,7 +39,7 @@ public class VideoSchedule { /** * 生成视频 */ - @Scheduled(cron = "0 20/30 * * * *?") // 每小时检查一次 + @Scheduled(cron = "0 20/30 * * * *?") // 每半小时检查一次 public void userVideoCreateSchedule() { UserMouldVideo userVideo = new UserMouldVideo(); userVideo.setVideoStartDate(DateUtils.getHourDateBefore(2,new Date())); @@ -60,9 +60,9 @@ public class VideoSchedule { /** * 上传阿里云 */ - @Scheduled(cron = "0 */30 * * * *?") // 每小时检查一次 + @Scheduled(cron = "0 */30 * * * *?") // 每半小时检查一次 public void userVideoUploadSchedule() { - List videos = userMouldVideoService.getVideoIdNullList(); + List videos = userMouldVideoService.getNotUploadList(); if (videos != null && videos.size() > 0) { for (UserMouldVideo video : videos) { try { @@ -77,9 +77,9 @@ public class VideoSchedule { /** * 获取时长和大小 */ - @Scheduled(cron = "0 15/30 * * * *?") // 每小时检查一次 + @Scheduled(cron = "0 15/30 * * * *?") // 每半小时检查一次 public void userVideoDetailSchedule() { - List videos = userMouldVideoService.getVideoSizeNullList(); + List videos = userMouldVideoService.getUpLoadIngList(); if (videos != null && videos.size() > 0) { for (UserMouldVideo video : videos) { try { @@ -89,6 +89,7 @@ public class VideoSchedule { && !"0.0".equals(videoDetail.getDuration())) { video.setVideoTime(videoDetail.getDuration()); video.setVideoSize(videoDetail.getSize()); + video.setVideoStatus(EnumVideoStatus.upload_success.getCode()); userMouldVideoService.updateById(video); } } catch (Exception e) { diff --git a/suimangCApi/src/main/java/com/iformall/controller/UserMouldVideoController.java b/suimangCApi/src/main/java/com/iformall/controller/UserMouldVideoController.java index 2ac7923..fa4b8d0 100644 --- a/suimangCApi/src/main/java/com/iformall/controller/UserMouldVideoController.java +++ b/suimangCApi/src/main/java/com/iformall/controller/UserMouldVideoController.java @@ -74,19 +74,10 @@ public class UserMouldVideoController extends BaseController { if(mouldVideo == null || !mouldVideo.getUserId().equals(getMemberId())){ return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到用户数据"); } - if(mouldVideo.getPersonMouldId() != null){ - mouldVideo.setPersonMould(mouldPatchService.getDetailById(mouldVideo.getPersonMouldId())); - } - if(mouldVideo.getVoiceMouldId() != null){ - mouldVideo.setVoiceMould(mouldPatchService.getDetailById(mouldVideo.getVoiceMouldId())); - } - if(mouldVideo.getBackgroundMouldId() != null){ - mouldVideo.setBackgroundMould(mouldPatchService.getDetailById(mouldVideo.getBackgroundMouldId())); - } return new ResultData(mouldVideo); } - @ApiOperation("根据id查询接口") + @ApiOperation("根据id删除接口") @GetMapping("/del") @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) public ResultData del(Long id) { diff --git a/suimangService/src/main/java/com/iformall/domain/po/sm/UserMouldVideo.java b/suimangService/src/main/java/com/iformall/domain/po/sm/UserMouldVideo.java index 36b1952..c01f1bd 100644 --- a/suimangService/src/main/java/com/iformall/domain/po/sm/UserMouldVideo.java +++ b/suimangService/src/main/java/com/iformall/domain/po/sm/UserMouldVideo.java @@ -44,30 +44,82 @@ public class UserMouldVideo extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value="用户Id",name="userId") private Long userId; - @io.swagger.annotations.ApiModelProperty(value="EnumMouldVideoType",name="type") - private Integer type; + @io.swagger.annotations.ApiModelProperty(value="EnumVideoType",name="videoType") + private Integer videoType; @io.swagger.annotations.ApiModelProperty(value="人物模板ID",name="personMouldId") private Long personMouldId; - @io.swagger.annotations.ApiModelProperty(value="人物模板smId",name="personMouldSmId") - private String personMouldSmId; + /** + * { + * "id":, + * "videoType":, + * "title":, + * "mouldSmId":, + * "material": + * } + */ + @io.swagger.annotations.ApiModelProperty(value="人物模板",name="personMouldSm") + private String personMouldSm; @TableField(exist = false) - private MouldPatch personMould; + private PersonMould personMould; + @TableField(exist = false) + private List voiceMouldIds; @io.swagger.annotations.ApiModelProperty(value="声音模板ID",name="voiceMouldId") private Long voiceMouldId; - @io.swagger.annotations.ApiModelProperty(value="声音模板smId",name="voiceMouldSmId") - private String voiceMouldSmId; + /** + * { + * "title":, + * "languages":, + * "mouldSmId":, + * "personId":, + * "personType":, + * "speakId":, + * "speakType": + * } + */ + @io.swagger.annotations.ApiModelProperty(value="声音模板",name="voiceMouldSm") + private String voiceMouldSm; @TableField(exist = false) - private MouldPatch voiceMould; + private VoiceMould voiceMould; @io.swagger.annotations.ApiModelProperty(value="文案",name="paperwork") private String paperwork; - @io.swagger.annotations.ApiModelProperty(value="背景模板ID",name="backgroundMouldId") - private Long backgroundMouldId; - @io.swagger.annotations.ApiModelProperty(value="背景模板smId",name="backgroundMouldSmId") - private String backgroundMouldSmId; + @io.swagger.annotations.ApiModelProperty(value="EnumLanguages",name="languages") + private Integer languages; + @io.swagger.annotations.ApiModelProperty(value="背景模板ID",name="backgroundId") + private Long backgroundId; + /** + * { + * "id":, + * "title":, + * "material": + * } + */ + @io.swagger.annotations.ApiModelProperty(value="背景模板",name="backgroundSm") + private String backgroundSm; @TableField(exist = false) - private MouldPatch backgroundMould; + private MaterialMould backgroundMould; + + /** + * List + */ + @io.swagger.annotations.ApiModelProperty(value="素材",name="materialIds") + private String materialIds; + /** + * [{ + * "id":, + * "type":, + * "material":, + * "x":, + * "y":, + * "z":, + * "w":, + * "h": + * },... + * ] + */ + @io.swagger.annotations.ApiModelProperty(value="素材层级",name="materialAllJson") + private String materialAllJson; @io.swagger.annotations.ApiModelProperty(value="名称",name="title") private String title; @@ -106,5 +158,7 @@ public class UserMouldVideo extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") private Date updateDate; + @TableField(exist = false) + private List videoStatuss; } diff --git a/suimangService/src/main/java/com/iformall/domain/po/sm/VoiceMould.java b/suimangService/src/main/java/com/iformall/domain/po/sm/VoiceMould.java index 75a4638..91b2b00 100644 --- a/suimangService/src/main/java/com/iformall/domain/po/sm/VoiceMould.java +++ b/suimangService/src/main/java/com/iformall/domain/po/sm/VoiceMould.java @@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName; import com.iformall.common.SortColumn; import com.iformall.domain.po.base.TenantEntity; import com.iformall.enums.EnumAgeType; -import com.iformall.enums.EnumPersonaType; +import com.iformall.enums.EnumPersonType; import com.iformall.enums.EnumSex; import com.iformall.enums.EnumSpeakType; import lombok.Data; @@ -132,16 +132,16 @@ public class VoiceMould extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value="EnumVoiceType",name="voiceType") private Integer voiceType; - @io.swagger.annotations.ApiModelProperty(value="EnumPersonaType",name="personaType") - private Integer personaType; + @io.swagger.annotations.ApiModelProperty(value="EnumPersonType",name="personaType") + private Integer personType; @TableField(exist = false) - private String personaTypeStr; + private String personTypeStr; public String getPersonaTypeStr(){ - EnumPersonaType anEnum = EnumPersonaType.getEnum(this.personaType); + EnumPersonType anEnum = EnumPersonType.getEnum(this.personType); if(anEnum != null){ - personaTypeStr = anEnum.getMessage(); + personTypeStr = anEnum.getMessage(); } - return personaTypeStr; + return personTypeStr; } @io.swagger.annotations.ApiModelProperty(value="EnumSpeakType",name="speakType") @@ -149,7 +149,7 @@ public class VoiceMould extends TenantEntity { @TableField(exist = false) private String speakTypeStr; public String getSpeakTypeStr(){ - EnumSpeakType anEnum = EnumSpeakType.getEnum(this.personaType); + EnumSpeakType anEnum = EnumSpeakType.getEnum(this.speakType); if(anEnum != null){ speakTypeStr = anEnum.getMessage(); } diff --git a/suimangService/src/main/java/com/iformall/enums/EnumPersonaType.java b/suimangService/src/main/java/com/iformall/enums/EnumPersonType.java similarity index 92% rename from suimangService/src/main/java/com/iformall/enums/EnumPersonaType.java rename to suimangService/src/main/java/com/iformall/enums/EnumPersonType.java index 3d6fcc5..a63ac57 100644 --- a/suimangService/src/main/java/com/iformall/enums/EnumPersonaType.java +++ b/suimangService/src/main/java/com/iformall/enums/EnumPersonType.java @@ -1,6 +1,6 @@ package com.iformall.enums; -public enum EnumPersonaType { +public enum EnumPersonType { /** * | Boy | 角色风格 | 男孩 | 声音模仿男孩 | * | Girl | 角色风格 | 女孩 | 声音模仿女孩 | @@ -25,8 +25,8 @@ public enum EnumPersonaType { YoungAdultMale(8,"男青年","YoungAdultMale"), ; - public static EnumPersonaType getEnum(Integer code) { - for (EnumPersonaType value : values()) { + public static EnumPersonType getEnum(Integer code) { + for (EnumPersonType value : values()) { if (value.getCode().equals(code)) { return value; } @@ -34,7 +34,7 @@ public enum EnumPersonaType { return null; } - private EnumPersonaType(Integer code, String message, String type) { + private EnumPersonType(Integer code, String message, String type) { this.code = code; this.message = message; this.type = type; diff --git a/suimangService/src/main/java/com/iformall/enums/EnumVideoStatus.java b/suimangService/src/main/java/com/iformall/enums/EnumVideoStatus.java index a6dd8ed..868a5a8 100644 --- a/suimangService/src/main/java/com/iformall/enums/EnumVideoStatus.java +++ b/suimangService/src/main/java/com/iformall/enums/EnumVideoStatus.java @@ -11,8 +11,12 @@ public enum EnumVideoStatus { draft(0, "草稿"), ing(1, "生成视频中"), - success(2, "生成视频成功"), + success(2,"生成视频成功"), fail(3, "生成视频失败"), + upload_ing(4,"上传视频中"), + upload_success(5,"上传视频成功"), + upload_fail(6,"上传视频失败") + ; public static EnumVideoStatus getEnum(Integer code) { diff --git a/suimangService/src/main/java/com/iformall/enums/EnumVoiceType.java b/suimangService/src/main/java/com/iformall/enums/EnumVoiceType.java index 513db69..6ca8cc9 100644 --- a/suimangService/src/main/java/com/iformall/enums/EnumVoiceType.java +++ b/suimangService/src/main/java/com/iformall/enums/EnumVoiceType.java @@ -6,7 +6,7 @@ package com.iformall.enums; public enum EnumVoiceType { default_0(0, "默认"), - persona(1,"角色风格"), + person(1,"角色风格"), speak(2, "说话风格"), ; diff --git a/suimangService/src/main/java/com/iformall/mapper/UserMouldVideoMapper.java b/suimangService/src/main/java/com/iformall/mapper/UserMouldVideoMapper.java index 2cabee1..85346b9 100644 --- a/suimangService/src/main/java/com/iformall/mapper/UserMouldVideoMapper.java +++ b/suimangService/src/main/java/com/iformall/mapper/UserMouldVideoMapper.java @@ -21,7 +21,6 @@ public interface UserMouldVideoMapper extends CommonMapper UserMouldVideo findVideo(@Param("id")Long id); - List getVideoIdNullList(); + List getSortList(UserMouldVideo record); - List getVideoSizeNullList(); } diff --git a/suimangService/src/main/java/com/iformall/service/sm/UserMouldVideoService.java b/suimangService/src/main/java/com/iformall/service/sm/UserMouldVideoService.java index e3cba32..1714118 100644 --- a/suimangService/src/main/java/com/iformall/service/sm/UserMouldVideoService.java +++ b/suimangService/src/main/java/com/iformall/service/sm/UserMouldVideoService.java @@ -51,9 +51,9 @@ public interface UserMouldVideoService { UserMouldVideo findVideo(Long id); - List getVideoIdNullList(); + List getNotUploadList(); - List getVideoSizeNullList(); + List getUpLoadIngList(); int updateById(UserMouldVideo video); diff --git a/suimangService/src/main/java/com/iformall/service/sm/impl/UserMouldVideoServiceImpl.java b/suimangService/src/main/java/com/iformall/service/sm/impl/UserMouldVideoServiceImpl.java index f85bfb9..7a24d72 100644 --- a/suimangService/src/main/java/com/iformall/service/sm/impl/UserMouldVideoServiceImpl.java +++ b/suimangService/src/main/java/com/iformall/service/sm/impl/UserMouldVideoServiceImpl.java @@ -1,13 +1,24 @@ package com.iformall.service.sm.impl; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import com.iformall.common.ErrorCode; import com.iformall.common.IdWorker; import com.iformall.common.ResultData; +import com.iformall.domain.po.sm.MaterialMould; +import com.iformall.domain.po.sm.PersonMould; import com.iformall.domain.po.sm.UserMouldVideo; +import com.iformall.domain.po.sm.VoiceMould; +import com.iformall.enums.EnumMouldPatchType; import com.iformall.enums.EnumVideoStatus; +import com.iformall.enums.EnumVoiceType; import com.iformall.mapper.UserMouldVideoMapper; +import com.iformall.service.sm.MaterialMouldService; +import com.iformall.service.sm.PersonMouldService; import com.iformall.service.sm.UserMouldVideoService; +import com.iformall.service.sm.VoiceMouldService; import com.iformall.sm.AiVideoHelper; import com.iformall.sm.AiVideoResult; import com.iformall.video.VideoFactory; @@ -21,6 +32,7 @@ import org.springframework.scheduling.annotation.AsyncResult; import org.springframework.stereotype.Service; import java.net.URL; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.concurrent.Future; @@ -33,6 +45,15 @@ public class UserMouldVideoServiceImpl implements UserMouldVideoService { @Autowired UserMouldVideoMapper userMouldVideoMapper; + @Autowired + PersonMouldService personMouldService; + + @Autowired + VoiceMouldService voiceMouldService; + + @Autowired + MaterialMouldService materialMouldService; + @Autowired VideoFactory videoFactory; @@ -62,6 +83,90 @@ public class UserMouldVideoServiceImpl implements UserMouldVideoService { @Override public ResultData saveOrUpdate(UserMouldVideo record) { + if(record.getPersonMouldId() != null){ + PersonMould personMould = personMouldService.getById(record.getPersonMouldId()); + if(personMould == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未查询到人物模板信息"); + } + record.setVideoType(personMould.getVideoType()); + JSONObject personMouldObject = new JSONObject(); + personMouldObject.put("id",personMould.getId()); + personMouldObject.put("videoType",personMould.getVideoType()); + personMouldObject.put("title",personMould.getTitle()); + personMouldObject.put("mouldSmId",personMould.getMouldSmId()); + personMouldObject.put("material",personMould.getMaterial()); + record.setPersonMouldSm(personMouldObject.toJSONString()); + } + if(record.getVoiceMouldIds() != null && !record.getVoiceMouldIds().isEmpty()){ + if(record.getVoiceMouldIds().size() > 1){ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"暂不支持声音模板交叉选择"); + } + Long voiceMouldId = record.getVoiceMouldIds().get(0); + VoiceMould voiceMould = voiceMouldService.getById(voiceMouldId); + if(voiceMould == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未查询到声音模板信息"); + } + record.setLanguages(voiceMould.getLanguages()); + if(voiceMould.getParentId().equals(0L)){ + record.setVoiceMouldId(voiceMould.getId()); + }else{ + record.setVoiceMouldId(voiceMould.getParentId()); + } + JSONObject voiceMouldObject = new JSONObject(); + voiceMouldObject.put("title",voiceMould.getTitle()); + voiceMouldObject.put("languages",voiceMould.getLanguages()); + voiceMouldObject.put("mouldSmId",voiceMould.getMouldSmId()); + voiceMouldObject.put("personId",0l); + voiceMouldObject.put("personType",0); + voiceMouldObject.put("speakId",0l); + voiceMouldObject.put("speakType",0); + if(EnumVoiceType.person.getCode().equals(voiceMould.getVoiceType())){ + voiceMouldObject.put("personId",voiceMould.getId()); + voiceMouldObject.put("personType",voiceMould.getPersonType()); + }else if(EnumVoiceType.speak.getCode().equals(voiceMould.getVoiceType())){ + voiceMouldObject.put("speakId",voiceMould.getId()); + voiceMouldObject.put("speakType",voiceMould.getPersonType()); + } + record.setVoiceMouldSm(voiceMouldObject.toJSONString()); + } + if(record.getBackgroundId() != null){ + MaterialMould background = materialMouldService.getById(record.getBackgroundId()); + if(background == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未查询到背景信息"); + } + JSONObject backgroundObject = new JSONObject(); + backgroundObject.put("id",background.getId()); + backgroundObject.put("title",background.getTitle()); + backgroundObject.put("material",background.getMaterial()); + record.setVoiceMouldSm(backgroundObject.toJSONString()); + } + if(StringUtils.isNotBlank(record.getMaterialAllJson())){ + logger.info("MaterialAllJson--->>" + record.getMaterialAllJson()); + try{ + List materialIds = new ArrayList<>(); + JSONArray materialAllArray = JSONArray.parseArray(record.getMaterialAllJson()); + if(materialAllArray != null && !materialAllArray.isEmpty()){ + for(int i = 0;i < materialAllArray.size();i++) { + JSONObject jsonObject = materialAllArray.getJSONObject(i); + Long id = jsonObject.getLong("id"); + Integer type = jsonObject.getInteger("type"); + if(EnumMouldPatchType.material_mould.getCode().equals(type)){ + materialIds.add(id); + } + String material = jsonObject.getString("material"); + Integer x = jsonObject.getInteger("x"); + Integer y = jsonObject.getInteger("y"); + Integer z = jsonObject.getInteger("z"); + Integer w = jsonObject.getInteger("w"); + Integer h = jsonObject.getInteger("h"); + } + } + record.setMaterialIds(JSONArray.toJSONString(materialIds)); + }catch(Exception e){ + e.printStackTrace(); + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"素材层级数据错误"); + } + } Date now = new Date(); if (record.getId() == null) { @@ -86,35 +191,64 @@ public class UserMouldVideoServiceImpl implements UserMouldVideoService { @Async @Override public Future createVideo(UserMouldVideo mouldVideo) { + boolean isCreate = false; + String msg = ""; UserMouldVideo videoUpd = new UserMouldVideo(); videoUpd.setId(mouldVideo.getId()); - if(StringUtils.isBlank(mouldVideo.getPersonMouldSmId())){ + String personMouldSmId = null; + if(mouldVideo.getPersonMouldId() == null){ + msg = "未选择人物模板"; + }else{ + try{ + JSONObject personMouldObject = JSONObject.parseObject(mouldVideo.getPersonMouldSm()); + personMouldSmId = personMouldObject.getString("mouldSmId"); + }catch(Exception e){ + msg = "参数错误,未找到人物模板数据"; + } + } + if(StringUtils.isBlank(personMouldSmId)){ videoUpd.setVideoStatus(EnumVideoStatus.fail.getCode()); - videoUpd.setVideoMsg("未找到人物模板数据"); + videoUpd.setVideoMsg(msg); this.saveOrUpdate(videoUpd); return new AsyncResult<>(0); } - if(StringUtils.isBlank(mouldVideo.getPaperwork())){ + String voiceMouldSmId = null; + if(mouldVideo.getVoiceMouldId() == null){ + msg = "未选择声音模板"; + }else{ + try{ + JSONObject personMouldObject = JSONObject.parseObject(mouldVideo.getVoiceMouldSm()); + voiceMouldSmId = personMouldObject.getString("mouldSmId"); + }catch(Exception e){ + msg = "参数错误,未找到声音模板数据"; + } + } + if(StringUtils.isBlank(voiceMouldSmId)){ videoUpd.setVideoStatus(EnumVideoStatus.fail.getCode()); - videoUpd.setVideoMsg("未填写视频文案"); + videoUpd.setVideoMsg(msg); + this.saveOrUpdate(videoUpd); + return new AsyncResult<>(0); + } + + String paperwork = mouldVideo.getPaperwork(); + if(StringUtils.isBlank(paperwork)){ + videoUpd.setVideoStatus(EnumVideoStatus.fail.getCode()); + videoUpd.setVideoMsg("未填写视频文案数据"); this.saveOrUpdate(videoUpd); return new AsyncResult<>(0); } try{ - AiVideoResult video = AiVideoHelper.createVideo(mouldVideo.getPersonMouldSmId(), mouldVideo.getVoiceMouldSmId(), mouldVideo.getPaperwork()); + AiVideoResult video = AiVideoHelper.createVideo(personMouldSmId, voiceMouldSmId, paperwork); if(video.isSuccess()){ videoUpd.setVideoPath(video.getUrl()); videoUpd.setVideoTime(video.getDuration()+""); videoUpd.setVideoStatus(EnumVideoStatus.success.getCode()); - videoUpd.setVideoMsg(video.getMsg()); + videoUpd.setVideoMsg("success"); videoUpd.setCreateVideoDate(new Date()); this.saveOrUpdate(videoUpd); - - videoUpd.setTitle(mouldVideo.getTitle()); - this.uploadVideo(videoUpd); return new AsyncResult<>(1); } videoUpd.setVideoStatus(EnumVideoStatus.fail.getCode()); @@ -135,13 +269,14 @@ public class UserMouldVideoServiceImpl implements UserMouldVideoService { @Override public void uploadVideo(UserMouldVideo mouldVideo){ if(EnumVideoStatus.success.getCode().equals(mouldVideo.getVideoStatus()) - && StringUtils.isBlank(mouldVideo.getVideoId())){ + || EnumVideoStatus.upload_fail.getCode().equals(mouldVideo.getVideoStatus())){ String url = mouldVideo.getVideoPathUri() + mouldVideo.getVideoPath(); VideUploadResult result = videoFactory.getExcutor(videoType).uploadVideoPath(mouldVideo.getTitle(), url); if(result.isSuccess()){ UserMouldVideo videoUpd = new UserMouldVideo(); videoUpd.setId(mouldVideo.getId()); videoUpd.setVideoId(result.getVideoId()); + videoUpd.setVideoStatus(EnumVideoStatus.upload_ing.getCode()); this.saveOrUpdate(videoUpd); } } @@ -153,13 +288,20 @@ public class UserMouldVideoServiceImpl implements UserMouldVideoService { } @Override - public List getVideoIdNullList() { - return userMouldVideoMapper.getVideoIdNullList(); + public List getNotUploadList() { + UserMouldVideo umVideoQ = new UserMouldVideo(); + List videoStatuss = new ArrayList<>(); + videoStatuss.add(EnumVideoStatus.success.getCode()); + videoStatuss.add(EnumVideoStatus.upload_fail.getCode()); + umVideoQ.setVideoStatuss(videoStatuss); + return userMouldVideoMapper.getSortList(umVideoQ); } @Override - public List getVideoSizeNullList() { - return userMouldVideoMapper.getVideoSizeNullList(); + public List getUpLoadIngList() { + UserMouldVideo umVideoQ = new UserMouldVideo(); + umVideoQ.setVideoStatus(EnumVideoStatus.upload_ing.getCode()); + return userMouldVideoMapper.getSortList(umVideoQ); } @Override diff --git a/suimangService/src/main/resources/mapper/UserMouldVideoMapper.xml b/suimangService/src/main/resources/mapper/UserMouldVideoMapper.xml index 8cc83bc..10d0afd 100644 --- a/suimangService/src/main/resources/mapper/UserMouldVideoMapper.xml +++ b/suimangService/src/main/resources/mapper/UserMouldVideoMapper.xml @@ -6,14 +6,17 @@ - + - + - + + - - + + + + @@ -30,8 +33,8 @@ - `id`, `tenant_id`, `parent_tenant_id`, `user_id`, `type`, - `person_mould_id`, `person_mould_sm_id`, `voice_mould_id`, `voice_mould_sm_id`, `paperwork`, `background_mould_id`, `background_mould_sm_id`, + `id`, `tenant_id`, `parent_tenant_id`, `user_id`, `video_type`, + `person_mould_id`, `person_mould_sm`, `voice_mould_id`, `voice_mould_sm`, `languages`, `paperwork`, `background_id`, `background_sm`,`material_ids`,`material_all_json`, `title`, `cover_img`, `remark`, `video_id`, `video_path`, `video_time`, `video_size`, `video_status`, `video_msg`, `create_video_date`, `create_date`, `update_date` @@ -53,8 +56,8 @@ and `user_id` = #{userId} - - and `type` = #{type} + + and `video_type` = #{videoType} @@ -66,7 +69,7 @@ - and `background_mould_id` = #{backgroundMouldId} + and `background_id` = #{backgroundId} @@ -91,6 +94,13 @@ and create_video_date < #{videoEndDate} + + and video_status in + + #{videoStatusItem} + + + and id in @@ -114,7 +124,7 @@ select - `video_id`, `video_path`, `video_time`, `video_size`, `video_status`, `video_msg` + `video_type`,`video_id`, `video_path`, `video_time`, `video_size`, `video_status`, `video_msg` from user_mould_video where `id` = #{id} - select id,title,video_id,video_path,video_status from user_mould_video - where `is_del` = 0 - and video_path is not null and video_path != '' - and (video_id is null or video_id = '') + - diff --git a/suimangService/src/main/resources/mapper/VoiceMouldMapper.xml b/suimangService/src/main/resources/mapper/VoiceMouldMapper.xml index 1bf8cf0..605d9a7 100644 --- a/suimangService/src/main/resources/mapper/VoiceMouldMapper.xml +++ b/suimangService/src/main/resources/mapper/VoiceMouldMapper.xml @@ -23,7 +23,7 @@ - + @@ -35,7 +35,7 @@ `id`, `tenant_id`, `parent_tenant_id`, `parent_id`, `count_sub`, `cover_img`, `cover_picture`, `detail_picture`, `title`, `sub_title`, `sex`, `age_type`, `languages`, `scene_sign`, `sale_price`, `price`, - `send_type`, `detail`, `remark`, `mould_sm_id`,`voice_type`,`persona_type`,`speak_type`, `example_video_id`, `status`, `puton_date`, `create_date`, `update_date` + `send_type`, `detail`, `remark`, `mould_sm_id`,`voice_type`,`person_type`,`speak_type`, `example_video_id`, `status`, `puton_date`, `create_date`, `update_date` @@ -104,8 +104,8 @@ and `voice_type` = #{voiceType} - - and `persona_type` = #{personaType} + + and `person_type` = #{personType} @@ -144,7 +144,7 @@ select `id`, `parent_tenant_id`, `parent_id`, `cover_img`, `cover_picture`, `title`, `sub_title`, `sex`, `age_type`, `languages`, `scene_sign`, `sale_price`, `price`, - `send_type`, `mould_sm_id`,`voice_type`,`persona_type`,`speak_type`, `status`,`example_video_id`, `create_date`, `update_date` + `send_type`, `mould_sm_id`,`voice_type`,`person_type`,`speak_type`, `status`,`example_video_id`, `create_date`, `update_date` from voice_mould