From 7181e8a62e903afac5b421a4a7aa58157440fb65 Mon Sep 17 00:00:00 2001 From: lrh <1585126058@qq.com> Date: Thu, 29 Jun 2023 17:09:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B6=85=E5=88=86=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V202306291619_voice_info.sql | 5 ++++- .../java/com/iformall/schedule/PhotoSpeakSchedule.java | 8 +++++--- .../com/iformall/domain/po/sm/PhotoSpeakVideo.java | 2 ++ .../service/sm/impl/PhotoSpeakVideoServiceImpl.java | 1 + .../iformall/service/sm/impl/VoiceInfoServiceImpl.java | 2 +- .../main/resources/mapper/PhotoSpeakVideoMapper.xml | 10 ++++++++-- 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/suimangAdmin/src/main/resources/db/migration/V202306291619_voice_info.sql b/suimangAdmin/src/main/resources/db/migration/V202306291619_voice_info.sql index 8f70769..11fb029 100644 --- a/suimangAdmin/src/main/resources/db/migration/V202306291619_voice_info.sql +++ b/suimangAdmin/src/main/resources/db/migration/V202306291619_voice_info.sql @@ -2,4 +2,7 @@ ALTER TABLE `mallink_suimang_test`.`photo_speak_video` ADD COLUMN `video_hy_status` smallint NULL COMMENT '视频超分状态' AFTER `video_status`; ALTER TABLE `mallink_suimang_test`.`voice_info` - ADD COLUMN `age_type` smallint NULL COMMENT '年纪类型 EnumAgeType' AFTER `sex`; \ No newline at end of file + ADD COLUMN `age_type` smallint NULL COMMENT '年纪类型 EnumAgeType' AFTER `sex`; + +ALTER TABLE `mallink_suimang_test`.`photo_speak_video` + ADD COLUMN `is_hy` smallint NULL DEFAULT 0 COMMENT '是否超分(1、是,2、否)' AFTER `video_hy_status`, \ No newline at end of file diff --git a/suimangSchedule/src/main/java/com/iformall/schedule/PhotoSpeakSchedule.java b/suimangSchedule/src/main/java/com/iformall/schedule/PhotoSpeakSchedule.java index a7d01f8..2319e96 100644 --- a/suimangSchedule/src/main/java/com/iformall/schedule/PhotoSpeakSchedule.java +++ b/suimangSchedule/src/main/java/com/iformall/schedule/PhotoSpeakSchedule.java @@ -144,15 +144,17 @@ public class PhotoSpeakSchedule { @Scheduled(cron = "0 20/30 * * * *?") // 每半小时检查一次 public void photoSpeakCreateHySchedule() { PhotoSpeakVideo videoUpd = new PhotoSpeakVideo(); - videoUpd.setVideoStartDate(DateUtils.getHourDateBefore(2,new Date())); + videoUpd.setVideoStartDate(DateUtils.getHourDateBefore(2, new Date())); videoUpd.setVideoHyStatus(EnumVideoStatus.fail.getCode()); List list = photoSpeakVideoService.findList(videoUpd); if (list != null && list.size() > 0) { for (PhotoSpeakVideo video : list) { try { - photoSpeakVideoService.videoHy(video,false); + if (StringUtils.isNotEmpty(video.getSaveDir())) { + photoSpeakVideoService.videoHy(video, false); + } } catch (Exception e) { - logger.error("TtCouponVideoSchedule error.couponVideoSchedule:"+video.getId(),e); + logger.error("TtCouponVideoSchedule error.couponVideoSchedule:" + video.getId(), e); } } } diff --git a/suimangService/src/main/java/com/iformall/domain/po/sm/PhotoSpeakVideo.java b/suimangService/src/main/java/com/iformall/domain/po/sm/PhotoSpeakVideo.java index 9491f82..145604c 100644 --- a/suimangService/src/main/java/com/iformall/domain/po/sm/PhotoSpeakVideo.java +++ b/suimangService/src/main/java/com/iformall/domain/po/sm/PhotoSpeakVideo.java @@ -156,5 +156,7 @@ public class PhotoSpeakVideo extends TenantEntity { private String saveDir; private Integer videoHyStatus; + + private Integer isHy;//是否超分(1、是,0、否) } diff --git a/suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java b/suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java index 9e1cb6b..1a659d2 100644 --- a/suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java +++ b/suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java @@ -499,6 +499,7 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { if(result.isSuccess()){ speakVideo.setVideoHyStatus(EnumVideoStatus.success.getCode()); speakVideo.setVideoMsg("超分视频生成成功"); + speakVideo.setIsHy(EnumYesOrNo.YES.getCode()); this.updateById(speakVideo); this.uploadHyVideo(speakVideo); diff --git a/suimangService/src/main/java/com/iformall/service/sm/impl/VoiceInfoServiceImpl.java b/suimangService/src/main/java/com/iformall/service/sm/impl/VoiceInfoServiceImpl.java index 5453578..283cc21 100644 --- a/suimangService/src/main/java/com/iformall/service/sm/impl/VoiceInfoServiceImpl.java +++ b/suimangService/src/main/java/com/iformall/service/sm/impl/VoiceInfoServiceImpl.java @@ -31,7 +31,7 @@ public class VoiceInfoServiceImpl implements VoiceInfoService { @Override public List chooseType(Long id) { - List voiceInfos = voiceMapper.selectList(new LambdaQueryWrapper().eq(VoiceInfo::getLanguageId, id).orderByAsc(VoiceInfo::getDisplayName).select(VoiceInfo::getId, VoiceInfo::getDisplayName, VoiceInfo::getStyleList,VoiceInfo::getSex)); + List voiceInfos = voiceMapper.selectList(new LambdaQueryWrapper().eq(VoiceInfo::getLanguageId, id).orderByAsc(VoiceInfo::getDisplayName).select(VoiceInfo::getId, VoiceInfo::getDisplayName, VoiceInfo::getStyleList,VoiceInfo::getSex,VoiceInfo::getAgeType)); voiceInfos.forEach(x -> { if (StringUtils.isNotEmpty(x.getStyleList())) { List strings = JSON.parseArray(x.getStyleList(), String.class); diff --git a/suimangService/src/main/resources/mapper/PhotoSpeakVideoMapper.xml b/suimangService/src/main/resources/mapper/PhotoSpeakVideoMapper.xml index 661a8ae..b286548 100644 --- a/suimangService/src/main/resources/mapper/PhotoSpeakVideoMapper.xml +++ b/suimangService/src/main/resources/mapper/PhotoSpeakVideoMapper.xml @@ -27,6 +27,11 @@ + + + + + @@ -35,7 +40,8 @@ `id`, `tenant_id`, `parent_tenant_id`, `user_id`, `person_photo_id`, `person_photo_url`, `voice_from`, `voice_mould_id`, `voice_mould_sm`, `paperwork`, `voice_material_id`, `voice_material_url`, - `title`, `cover_img`, `remark`, `video_id`, `video_path`, `video_play_url`, `video_time`, `video_size`, `video_status`, `video_msg`, `create_video_date`, `create_date`, `update_date` + `title`, `cover_img`, `remark`, `video_id`, `video_path`, `video_play_url`, `video_time`, `video_size`, `video_status`, `video_msg`, `create_video_date`, `create_date`, `update_date`, + `is_hy`,`video_hy_status`,`music_id`,`save_dir` @@ -119,7 +125,7 @@ `id`, `paperwork`, `title`, `cover_img`, `remark`, `video_id`, `video_path`, `video_play_url`, `video_time`, `video_size`, `video_status`,`video_msg`, - `create_video_date`, `create_date`, `update_date` + `create_video_date`, `create_date`, `update_date`,`is_hy` from photo_speak_video