diff --git a/suimangCApi/src/main/java/com/iformall/controller/PhotoSpeakVideoController.java b/suimangCApi/src/main/java/com/iformall/controller/PhotoSpeakVideoController.java index d88a4cc..944befd 100644 --- a/suimangCApi/src/main/java/com/iformall/controller/PhotoSpeakVideoController.java +++ b/suimangCApi/src/main/java/com/iformall/controller/PhotoSpeakVideoController.java @@ -178,8 +178,8 @@ public class PhotoSpeakVideoController extends BaseController { return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"视频已生成完成"); } - PhotoSpeakVideo videoUpd = new PhotoSpeakVideo(); - videoUpd.setId(record.getId()); +// PhotoSpeakVideo videoUpd = new PhotoSpeakVideo(); +// videoUpd.setId(record.getId()); if (mouldVideo.getPersonPhotoId() == null) { return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未查询到人物照片"); @@ -187,19 +187,13 @@ public class PhotoSpeakVideoController extends BaseController { if(StringUtils.isBlank(mouldVideo.getPersonPhotoUrl())){ return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未查询到人物照片地址"); } - videoUpd.setPersonPhotoId(mouldVideo.getPersonPhotoId()); - videoUpd.setPersonPhotoUrl(mouldVideo.getPersonPhotoUrl()); Integer voiceFrom = mouldVideo.getVoiceFrom(); - videoUpd.setVoiceFrom(voiceFrom); if(EnumVoiceFrom.FROM_MOULD.getCode().equals(voiceFrom)){ String voiceMouldSmId = null; try{ JSONObject personMouldObject = JSONObject.parseObject(mouldVideo.getVoiceMouldSm()); voiceMouldSmId = personMouldObject.getString("mouldSmId"); - videoUpd.setVoiceMouldSm(voiceMouldSmId); - videoUpd.setPaperwork(mouldVideo.getPaperwork()); - videoUpd.setVoiceMouldSm(mouldVideo.getVoiceMouldSm()); }catch(Exception e){ logger.info(e.getMessage()); } @@ -221,7 +215,7 @@ public class PhotoSpeakVideoController extends BaseController { if(StringUtils.isBlank(voiceMaterialUrl)){ return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未找到上传声音文件"); } - videoUpd.setVoiceMaterialUrl(voiceMaterialUrl); + mouldVideo.setVoiceMaterialUrl(voiceMaterialUrl); // videoUpd.setVideoTime(String.valueOf(voiceMaterial.getTime())); } else if (EnumVoiceFrom.MUSIC.getCode().equals(voiceFrom)) { Long musicId = mouldVideo.getMusicId(); @@ -235,7 +229,7 @@ public class PhotoSpeakVideoController extends BaseController { if(musicInfo.getTime() == null){ return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"音乐时长为空"); } - videoUpd.setVoiceMaterialUrl(musicInfo.getUrl()); + mouldVideo.setVoiceMaterialUrl(musicInfo.getUrl()); // videoUpd.setVideoTime(String.valueOf(musicInfo.getTime())); } else { return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"声音数据异常"); @@ -247,7 +241,8 @@ public class PhotoSpeakVideoController extends BaseController { mouldVideoUpd.setCreateVideoDate(new Date()); photoSpeakVideoService.saveOrUpdate(mouldVideoUpd); - photoSpeakVideoService.createVideo(videoUpd); + + photoSpeakVideoService.createVideo(mouldVideo); return new ResultData(); } diff --git a/suimangCApi/src/main/resources/application-dev.yml b/suimangCApi/src/main/resources/application-dev.yml index 8ea2189..9a8269a 100644 --- a/suimangCApi/src/main/resources/application-dev.yml +++ b/suimangCApi/src/main/resources/application-dev.yml @@ -189,7 +189,7 @@ logging: path: ./logs/c photo: - url: http://111.198.0.15:22299 + url: http://nas.pucao.cn:2002 hy_url: http://111.198.0.15:22288 talk: http://111.198.0.15:22266 callbackUrl: https://phototest.metavatar.cc/C diff --git a/suimangSchedule/src/main/resources/application-dev.yml b/suimangSchedule/src/main/resources/application-dev.yml index 4f6d56f..f6541b0 100644 --- a/suimangSchedule/src/main/resources/application-dev.yml +++ b/suimangSchedule/src/main/resources/application-dev.yml @@ -192,7 +192,7 @@ logging: path: ./logs/s photo: - url: http://111.198.0.15:22299 + url: http://nas.pucao.cn:2002 hy_url: http://111.198.0.15:22288 talk: http://111.198.0.15:22266 callbackUrl: https://phototest.metavatar.cc/C \ No newline at end of file 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 fdf259f..1c9cc4f 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 @@ -220,38 +220,38 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { Integer voiceFrom = photoSpeakVideo.getVoiceFrom(); String voiceMaterialUrl = photoSpeakVideo.getVoiceMaterialUrl(); -// if (photoSpeakVideo.getSubtitleEnabled()==1){ -//// //开启字幕 查询字幕列表 -// Map reSubtitle = new HashMap(); -// Map params = new HashMap(); -// JSONObject subtitle = JSON.parseObject(photoSpeakVideo.getSubtitleParams()); -// params.put("Fontname",(subtitle.get("Fontname")==null?"宋体":subtitle.get("Fontname"))); -// params.put("Fontsize",(subtitle.get("Fontsize")==null? 25:subtitle.get("Fontsize"))); -// params.put("PrimaryColour",(subtitle.get("PrimaryColour")==null?"&Hffffff":subtitle.get("PrimaryColour"))); -// params.put("SecondaryColour",(subtitle.get("SecondaryColour")==null?"BBGGRR":subtitle.get("SecondaryColour"))); -// params.put("OutlineColour",(subtitle.get("OutlineColour")==null?"BBGGRR":subtitle.get("OutlineColour"))); -// params.put("BackColour",(subtitle.get("BackColour")==null?"&H0000ff":subtitle.get("BackColour"))); -// params.put("Bold",(subtitle.get("Bold")==null? -1:subtitle.get("Bold"))); -// params.put("Italic",(subtitle.get("Italic")==null? 0:subtitle.get("Italic"))); -// params.put("Underline",(subtitle.get("Underline")==null? 0:subtitle.get("Underline"))); -// params.put("Strikeout",(subtitle.get("Strikeout")==null? 0:subtitle.get("Strikeout"))); -// params.put("ScaleX",(subtitle.get("ScaleX")==null? 100:subtitle.get("ScaleX"))); -// params.put("ScaleY",(subtitle.get("ScaleY")==null? 100:subtitle.get("ScaleY"))); -// params.put("Spacing",(subtitle.get("Spacing")==null? 0:subtitle.get("Spacing"))); -// params.put("Angle",(subtitle.get("Angle")==null? 15:subtitle.get("Angle"))); -// params.put("BorderStyle",(subtitle.get("BorderStyle")==null?"1":subtitle.get("BorderStyle"))); -// params.put("Outline",(subtitle.get("Outline")==null? 20:subtitle.get("Outline"))); -// params.put("Shadow",(subtitle.get("Shadow")==null? 12:subtitle.get("Shadow"))); -// params.put("Alignment",(subtitle.get("Alignment")==null? 1:subtitle.get("Alignment"))); -// params.put("MarginL",(subtitle.get("MarginL")==null? 100:subtitle.get("MarginL"))); -// params.put("MarginR",(subtitle.get("MarginR")==null? 100:subtitle.get("MarginR"))); -// params.put("MarginV",(subtitle.get("MarginV")==null? 100:subtitle.get("MarginV"))); -// subtitle.put("enabled",1); -// subtitle.put("text",photoSpeakVideo.getPaperwork()); -// subtitle.put("params",params); -// param.setSubtitle_params(subtitle); -// -// } + if (photoSpeakVideo.getSubtitleEnabled()==1){ +// //开启字幕 查询字幕列表 + Map reSubtitle = new HashMap(); + Map params = new HashMap(); + JSONObject subtitle = JSON.parseObject(photoSpeakVideo.getSubtitleParams()); + params.put("Fontname",(subtitle.get("Fontname")==null?"宋体":subtitle.get("Fontname"))); + params.put("Fontsize",(subtitle.get("Fontsize")==null? 25:subtitle.get("Fontsize"))); + params.put("PrimaryColour",(subtitle.get("PrimaryColour")==null?"&Hffffff":subtitle.get("PrimaryColour"))); + params.put("SecondaryColour",(subtitle.get("SecondaryColour")==null?"BBGGRR":subtitle.get("SecondaryColour"))); + params.put("OutlineColour",(subtitle.get("OutlineColour")==null?"BBGGRR":subtitle.get("OutlineColour"))); + params.put("BackColour",(subtitle.get("BackColour")==null?"&H0000ff":subtitle.get("BackColour"))); + params.put("Bold",(subtitle.get("Bold")==null? -1:subtitle.get("Bold"))); + params.put("Italic",(subtitle.get("Italic")==null? 0:subtitle.get("Italic"))); + params.put("Underline",(subtitle.get("Underline")==null? 0:subtitle.get("Underline"))); + params.put("Strikeout",(subtitle.get("Strikeout")==null? 0:subtitle.get("Strikeout"))); + params.put("ScaleX",(subtitle.get("ScaleX")==null? 100:subtitle.get("ScaleX"))); + params.put("ScaleY",(subtitle.get("ScaleY")==null? 100:subtitle.get("ScaleY"))); + params.put("Spacing",(subtitle.get("Spacing")==null? 0:subtitle.get("Spacing"))); + params.put("Angle",(subtitle.get("Angle")==null? 15:subtitle.get("Angle"))); + params.put("BorderStyle",(subtitle.get("BorderStyle")==null?"1":subtitle.get("BorderStyle"))); + params.put("Outline",(subtitle.get("Outline")==null? 20:subtitle.get("Outline"))); + params.put("Shadow",(subtitle.get("Shadow")==null? 12:subtitle.get("Shadow"))); + params.put("Alignment",(subtitle.get("Alignment")==null? 1:subtitle.get("Alignment"))); + params.put("MarginL",(subtitle.get("MarginL")==null? 100:subtitle.get("MarginL"))); + params.put("MarginR",(subtitle.get("MarginR")==null? 100:subtitle.get("MarginR"))); + params.put("MarginV",(subtitle.get("MarginV")==null? 100:subtitle.get("MarginV"))); + subtitle.put("enabled",1); + subtitle.put("text",photoSpeakVideo.getPaperwork()); + subtitle.put("params",params); + param.setSubtitle_params(subtitle); + + } // List videoMapperList = photoSpeakVideoMapper.findList(speakVideoUpd); // for (PhotoSpeakVideo speakVideo : videoMapperList) { // if (speakVideo.getSubtitleEnabled()==1){