瀏覽代碼

//bug

private_deployment
xhxu 1 年之前
父節點
當前提交
481924845c
共有 3 個文件被更改,包括 58 次插入8 次删除
  1. +16
    -3
      suimangService/src/main/java/com/iformall/domain/po/sm/UserMouldVideo.java
  2. +41
    -5
      suimangService/src/main/java/com/iformall/service/sm/impl/UserMouldVideoServiceImpl.java
  3. +1
    -0
      suimangService/src/main/resources/mapper/UserMouldVideoMapper.xml

+ 16
- 3
suimangService/src/main/java/com/iformall/domain/po/sm/UserMouldVideo.java 查看文件

@@ -54,13 +54,26 @@ public class UserMouldVideo extends TenantEntity {
* "videoType":,
* "title":,
* "mouldSmId":,
* "material":,
* "backgroundId:,
* "backgroundMaterial":
* "material":
* }
*/
@io.swagger.annotations.ApiModelProperty(value="人物模板",name="personMouldSm")
private String personMouldSm;

/**
* {
* "id":,
* "type":,
* "material":,
* "x":,
* "y":,
* "z":,
* "w":,
* "h":
* }
*/
@io.swagger.annotations.ApiModelProperty(value="人物模板",name="personJson")
private String personJson;
@TableField(exist = false)
private PersonMould personMould;



+ 41
- 5
suimangService/src/main/java/com/iformall/service/sm/impl/UserMouldVideoServiceImpl.java 查看文件

@@ -13,6 +13,7 @@ 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.EnumVideoType;
import com.iformall.enums.EnumVoiceType;
import com.iformall.mapper.UserMouldVideoMapper;
import com.iformall.service.sm.MaterialMouldService;
@@ -95,9 +96,44 @@ public class UserMouldVideoServiceImpl implements UserMouldVideoService {
personMouldObject.put("title",personMould.getTitle());
personMouldObject.put("mouldSmId",personMould.getMouldSmId());
personMouldObject.put("material",personMould.getMaterial());
personMouldObject.put("backgroundId",personMould.getBackgroundId());
personMouldObject.put("backgroundMaterial",personMould.getBackgroundMaterial());
record.setPersonMouldSm(personMouldObject.toJSONString());

if(StringUtils.isBlank(record.getPersonJson())){
record.setPersonJson("{}");
}
boolean isPerson = false;
try{
JSONObject personObject = JSONObject.parseObject(record.getPersonJson());
if(personObject != null && !personObject.isEmpty()){
isPerson = true;
}
}catch(Exception e){}
//给数字人默认属性
if(!isPerson){
JSONObject personObject = new JSONObject();
personObject.put("id",personMould.getId());
personObject.put("type",EnumMouldPatchType.person_mould.getCode());
personObject.put("material",personMould.getMaterial());
//竖屏 数字人尺寸按竖屏尺寸处理 1080*1920
if(EnumVideoType.VERTICAL_PLATE.getCode().equals(record.getVideoType())){
personObject.put("x",0);
personObject.put("y",0);
}else{

int x = (1920-1080)/2;
personObject.put("x",x);
int y = (1080-1920);
personObject.put("y",y);
}
personObject.put("z",0);
personObject.put("w","1");//比例系数(2位小数)
personObject.put("h","1");//比例系数(2位小数)
record.setPersonJson(personObject.toJSONString());
}
//默认背景
if(record.getBackgroundId() == null){
record.setBackgroundId(personMould.getBackgroundId());
}
}
if(record.getVoiceMouldIds() != null && !record.getVoiceMouldIds().isEmpty()){
if(record.getVoiceMouldIds().size() > 1){
@@ -160,9 +196,9 @@ public class UserMouldVideoServiceImpl implements UserMouldVideoService {
materialIds.add(id);
}
String material = jsonObject.getString("material");
String x = jsonObject.getString("x");
String y = jsonObject.getString("y");
String z = jsonObject.getString("z");
Integer x = jsonObject.getInteger("x");
Integer y = jsonObject.getInteger("y");
Integer z = jsonObject.getInteger("z");
String w = jsonObject.getString("w");
String h = jsonObject.getString("h");
}


+ 1
- 0
suimangService/src/main/resources/mapper/UserMouldVideoMapper.xml 查看文件

@@ -9,6 +9,7 @@
<result column="video_type" jdbcType="INTEGER" property="videoType"/>
<result column="person_mould_id" jdbcType="BIGINT" property="personMouldId"/>
<result column="person_mould_sm" jdbcType="VARCHAR" property="personMouldSm"/>
<result column="person_json" jdbcType="VARCHAR" property="personJson"/>
<result column="voice_mould_id" jdbcType="BIGINT" property="voiceMouldId"/>
<result column="voice_mould_sm" jdbcType="VARCHAR" property="voiceMouldSm"/>
<result column="languages" jdbcType="INTEGER" property="languages"/>


Loading…
取消
儲存