印花坐标修改
This commit is contained in:
@@ -11,6 +11,9 @@ import java.util.List;
|
|||||||
@ApiModel("designItem detail clothes 响应")
|
@ApiModel("designItem detail clothes 响应")
|
||||||
public class DesignItemClothesDetailVO {
|
public class DesignItemClothesDetailVO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* designItemDetail对应的businessId
|
||||||
|
*/
|
||||||
@ApiModelProperty("对应的上游id")
|
@ApiModelProperty("对应的上游id")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
|||||||
@@ -1390,11 +1390,10 @@ public class PythonService {
|
|||||||
List<Float> angle = new ArrayList<>(printObject.getPrints().size());
|
List<Float> angle = new ArrayList<>(printObject.getPrints().size());
|
||||||
|
|
||||||
// 设置印花的位置、大小、旋转角度
|
// 设置印花的位置、大小、旋转角度
|
||||||
// todo 空指针
|
|
||||||
List<DesignSinglePrint> prints = printObject.getPrints();
|
List<DesignSinglePrint> prints = printObject.getPrints();
|
||||||
prints.forEach(p -> {
|
prints.forEach(p -> {
|
||||||
p.getLocation().set(0,p.getLocation().get(0) * fileVO.getWidth());
|
p.getLocation().set(0,p.getLocation().get(0));
|
||||||
p.getLocation().set(1,p.getLocation().get(1) * fileVO.getHigh());
|
p.getLocation().set(1,p.getLocation().get(1));
|
||||||
Integer priority = p.getPriority();
|
Integer priority = p.getPriority();
|
||||||
location.add(priority - 1, p.getLocation());
|
location.add(priority - 1, p.getLocation());
|
||||||
scale.add(priority - 1,p.getScale());
|
scale.add(priority - 1,p.getScale());
|
||||||
@@ -1719,10 +1718,10 @@ public class PythonService {
|
|||||||
|
|
||||||
private static List<String> setGenerateImageList(JSONObject jsonObject){
|
private static List<String> setGenerateImageList(JSONObject jsonObject){
|
||||||
List<String> imageUrlList = JSONObject.parseArray(jsonObject.get("list").toString(),String.class);
|
List<String> imageUrlList = JSONObject.parseArray(jsonObject.get("list").toString(),String.class);
|
||||||
if (imageUrlList.size() == 0){
|
if (imageUrlList.isEmpty()){
|
||||||
log.error("PythonService##generateSketchOrPrint异常###{}","diffusion response list is null");
|
log.error("PythonService##generateSketchOrPrint异常###{}","diffusion response list is null");
|
||||||
// todo 如果这里返回为空,是判断出错还是返回给前端空
|
// todo 如果这里返回为空,是判断出错还是返回给前端空
|
||||||
throw new BusinessException("Some errors occurred, please try again later");
|
throw new BusinessException("The data returned on the python side is empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
return imageUrlList;
|
return imageUrlList;
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
|||||||
designItemDetail.setPrintJson(JSON.toJSONString(printObject));
|
designItemDetail.setPrintJson(JSON.toJSONString(printObject));
|
||||||
designItemDetails.add(designItemDetail);
|
designItemDetails.add(designItemDetail);
|
||||||
});
|
});
|
||||||
// todo businessId
|
// todo businessId来源
|
||||||
designItemDetailService.saveBatch(designItemDetails);
|
designItemDetailService.saveBatch(designItemDetails);
|
||||||
|
|
||||||
// 覆盖designPythonOutfit表中的模特全身图
|
// 覆盖designPythonOutfit表中的模特全身图
|
||||||
@@ -376,6 +376,8 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
|||||||
Assert.notNull(designItem,"design item does not exists!");
|
Assert.notNull(designItem,"design item does not exists!");
|
||||||
Design design = designService.getById(designItem.getDesignId());
|
Design design = designService.getById(designItem.getDesignId());
|
||||||
Assert.notNull(design,"design does not exists!");
|
Assert.notNull(design,"design does not exists!");
|
||||||
|
TDesignPythonOutfit designPythonOutfit = designPythonOutfitService.getByDesignItemId(designSingleIncludeLayersDTO.getDesignItemId());
|
||||||
|
Assert.notNull(designItem,"design item detail layers does not exists!");
|
||||||
DesignLibraryModelPointVO designLibraryModelPointVO = null;
|
DesignLibraryModelPointVO designLibraryModelPointVO = null;
|
||||||
// 设置模特
|
// 设置模特
|
||||||
if (Objects.nonNull(design.getTemplateId())){
|
if (Objects.nonNull(design.getTemplateId())){
|
||||||
@@ -386,13 +388,16 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
|||||||
designLibraryModelPointVO = collectionElementService.calculateTemplatePoint(modelPoint,library.getHigh(),library.getWidth(),library.getUrl());
|
designLibraryModelPointVO = collectionElementService.calculateTemplatePoint(modelPoint,library.getHigh(),library.getWidth(),library.getUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 组装入参
|
||||||
DesignPythonObjects objects =pythonService.covertDesignSingleParam(
|
DesignPythonObjects objects =pythonService.covertDesignSingleParam(
|
||||||
designSingleIncludeLayersDTO,design.getSingleOverall(),design.getSwitchCategory(),designLibraryModelPointVO);
|
designSingleIncludeLayersDTO,design.getSingleOverall(),design.getSwitchCategory(),designLibraryModelPointVO);
|
||||||
JSONObject jsonObject = pythonService.designNew(objects);
|
JSONObject jsonObject = pythonService.designNew(objects);
|
||||||
// preview -> 不存数据库 submit -> 存数据库
|
// preview -> 不存数据库 submit -> 存数据库
|
||||||
List<TDesignPythonOutfitDetail> tDesignPythonOutfitDetails;
|
List<TDesignPythonOutfitDetail> tDesignPythonOutfitDetails;
|
||||||
JSONObject data = jsonObject.getJSONObject("data");
|
JSONObject data = jsonObject.getJSONObject("data");
|
||||||
// todo 空指针
|
if (data == null) {
|
||||||
|
throw new BusinessException("python response data is null");
|
||||||
|
}
|
||||||
JSONObject outfit = data.getJSONObject("0");
|
JSONObject outfit = data.getJSONObject("0");
|
||||||
if (!designSingleIncludeLayersDTO.getIsPreview()){
|
if (!designSingleIncludeLayersDTO.getIsPreview()){
|
||||||
// 更新及保存图层信息
|
// 更新及保存图层信息
|
||||||
@@ -409,8 +414,6 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
|||||||
detailsVO.add(designPythonOutfitDetailService.convertToDesignPythonOutfitVO(detail));
|
detailsVO.add(designPythonOutfitDetailService.convertToDesignPythonOutfitVO(detail));
|
||||||
});
|
});
|
||||||
|
|
||||||
TDesignPythonOutfit designPythonOutfit = designPythonOutfitService.getByDesignItemId(designSingleIncludeLayersDTO.getDesignItemId());
|
|
||||||
// todo designPythonOutFit 空指针
|
|
||||||
return assembleDesignSingleResponse(designItem.getId(),minioUtil.splitThenGetPreviewUrl(designPythonOutfit.getDesignUrl(),480),
|
return assembleDesignSingleResponse(designItem.getId(),minioUtil.splitThenGetPreviewUrl(designPythonOutfit.getDesignUrl(),480),
|
||||||
designSingleIncludeLayersDTO.getDesignSingleItemDTOList(),detailsVO);
|
designSingleIncludeLayersDTO.getDesignSingleItemDTOList(),detailsVO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -808,7 +808,6 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
List<DesignItemDetail> filterDetail = designItemDetails.stream()
|
List<DesignItemDetail> filterDetail = designItemDetails.stream()
|
||||||
.filter(f -> OUTWEAR_DRESS_BLOUSE.contains(f.getType()) || SKIRT_TROUSERS.contains(f.getType()))
|
.filter(f -> OUTWEAR_DRESS_BLOUSE.contains(f.getType()) || SKIRT_TROUSERS.contains(f.getType()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
// todo 填充图层需要筛选已经被删除的图层
|
|
||||||
response.setClothes(CopyUtil.copyList(filterDetail,DesignItemClothesDetailVO.class,(o,d)->{
|
response.setClothes(CopyUtil.copyList(filterDetail,DesignItemClothesDetailVO.class,(o,d)->{
|
||||||
d.setId(o.getBusinessId());
|
d.setId(o.getBusinessId());
|
||||||
d.setLevel1Type(converTypeToLevel1(o.getType()));
|
d.setLevel1Type(converTypeToLevel1(o.getType()));
|
||||||
|
|||||||
Reference in New Issue
Block a user