|
|
@@ -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"); |
|
|
|
} |
|
|
|