diff --git a/src/main/java/com/ai/da/model/vo/DesignItemClothesDetailVO.java b/src/main/java/com/ai/da/model/vo/DesignItemClothesDetailVO.java index dbf978a6..77debdd3 100644 --- a/src/main/java/com/ai/da/model/vo/DesignItemClothesDetailVO.java +++ b/src/main/java/com/ai/da/model/vo/DesignItemClothesDetailVO.java @@ -11,6 +11,9 @@ import java.util.List; @ApiModel("designItem detail clothes 响应") public class DesignItemClothesDetailVO { + /** + * designItemDetail对应的businessId + */ @ApiModelProperty("对应的上游id") private Long id; diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index 197eeeda..b78d278c 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -1390,11 +1390,10 @@ public class PythonService { List angle = new ArrayList<>(printObject.getPrints().size()); // 设置印花的位置、大小、旋转角度 - // todo 空指针 List prints = printObject.getPrints(); prints.forEach(p -> { - p.getLocation().set(0,p.getLocation().get(0) * fileVO.getWidth()); - p.getLocation().set(1,p.getLocation().get(1) * fileVO.getHigh()); + p.getLocation().set(0,p.getLocation().get(0)); + p.getLocation().set(1,p.getLocation().get(1)); Integer priority = p.getPriority(); location.add(priority - 1, p.getLocation()); scale.add(priority - 1,p.getScale()); @@ -1719,10 +1718,10 @@ public class PythonService { private static List setGenerateImageList(JSONObject jsonObject){ List 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"); // 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; diff --git a/src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java b/src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java index cae9f2e3..f8584d1e 100644 --- a/src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java @@ -316,7 +316,7 @@ public class DesignItemServiceImpl extends ServiceImpl 不存数据库 submit -> 存数据库 List tDesignPythonOutfitDetails; JSONObject data = jsonObject.getJSONObject("data"); - // todo 空指针 + if (data == null) { + throw new BusinessException("python response data is null"); + } JSONObject outfit = data.getJSONObject("0"); if (!designSingleIncludeLayersDTO.getIsPreview()){ // 更新及保存图层信息 @@ -409,8 +414,6 @@ public class DesignItemServiceImpl extends ServiceImpl impleme List filterDetail = designItemDetails.stream() .filter(f -> OUTWEAR_DRESS_BLOUSE.contains(f.getType()) || SKIRT_TROUSERS.contains(f.getType())) .collect(Collectors.toList()); - // todo 填充图层需要筛选已经被删除的图层 response.setClothes(CopyUtil.copyList(filterDetail,DesignItemClothesDetailVO.class,(o,d)->{ d.setId(o.getBusinessId()); d.setLevel1Type(converTypeToLevel1(o.getType()));