TASK:workspace、design模块代码;
This commit is contained in:
@@ -240,7 +240,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
// pythonObjects增加image_id关联
|
||||
relationImageId(pythonObjects);
|
||||
//design
|
||||
JSONObject responseJSONObject= pythonService.designNew(pythonObjects);
|
||||
JSONObject responseJSONObject = pythonService.designNew(pythonObjects);
|
||||
//生成library
|
||||
generateLibrary(elementVO,designDTO.getTimeZone());
|
||||
//处理关联关系,修复element覆盖得情况
|
||||
@@ -262,7 +262,9 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
for (DesignPythonItem item : o.getItems()) {
|
||||
String path = item.getPath();
|
||||
if (StringUtils.isEmpty(path)) {
|
||||
item.setImageId(null);
|
||||
String bodyPath = item.getBody_path();
|
||||
Long imageId = pythonTAllInfoService.getImageIdByPath(bodyPath);
|
||||
item.setImageId(imageId);
|
||||
}else {
|
||||
Long imageId = pythonTAllInfoService.getImageIdByPath(path);
|
||||
item.setImageId(imageId);
|
||||
@@ -364,6 +366,9 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
Long designItemId = designItemService.saveOne(designItem);
|
||||
// python design返回入库及封装
|
||||
JSONObject outfit = data.getJSONObject(i + "");
|
||||
if (null == outfit) {
|
||||
continue;
|
||||
}
|
||||
TDesignPythonOutfit designPythonOutfit = new TDesignPythonOutfit();
|
||||
designPythonOutfit.setDesignItemId(designItemId);
|
||||
designPythonOutfit.setUserId(userInfo.getId());
|
||||
@@ -378,7 +383,30 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
TDesignPythonOutfitDetail designPythonOutfitDetail = new TDesignPythonOutfitDetail();
|
||||
designPythonOutfitDetail.setDesignId(designId);
|
||||
designPythonOutfitDetail.setDesignPythonOutfitId(designPythonOutfit.getId());
|
||||
designPythonOutfitDetail.setPosition(jsonObject.getString("position"));
|
||||
JSONArray position = jsonObject.getJSONArray("position");
|
||||
if (position != null && !CollectionUtils.isEmpty(position)) {
|
||||
StringBuilder builder = null;
|
||||
for (int i2 = 0; i2 < position.size(); i2++) {
|
||||
if (i2 != position.size() - 1) {
|
||||
builder.append(position.getInteger(i2)).append(",");
|
||||
}else {
|
||||
builder.append(position.getInteger(i2));
|
||||
}
|
||||
}
|
||||
designPythonOutfitDetail.setPosition(builder.toString());
|
||||
}
|
||||
JSONArray imageSize = jsonObject.getJSONArray("image_size");
|
||||
if (imageSize != null && !CollectionUtils.isEmpty(position)) {
|
||||
StringBuilder builder = null;
|
||||
for (int i2 = 0; i2 < imageSize.size(); i2++) {
|
||||
if (i2 != imageSize.size() - 1) {
|
||||
builder.append(imageSize.getInteger(i2)).append(",");
|
||||
}else {
|
||||
builder.append(imageSize.getInteger(i2));
|
||||
}
|
||||
}
|
||||
designPythonOutfitDetail.setImageSize(builder.toString());
|
||||
}
|
||||
designPythonOutfitDetail.setImageUrl(jsonObject.getString("image_url"));
|
||||
designPythonOutfitDetail.setImageCategory(jsonObject.getString("image_category"));
|
||||
designPythonOutfitDetail.setMaskUrl(jsonObject.getString("mask_url"));
|
||||
@@ -470,6 +498,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
}
|
||||
private List<Long> getElementId(ValidateElementVO elementVO){
|
||||
List<Long> elementIds = Lists.newArrayList();
|
||||
// collection type
|
||||
if(CollectionUtil.isNotEmpty(elementVO.getSketchBoardElements())){
|
||||
elementIds.addAll(elementVO.getSketchBoardElements().stream().map(CollectionElement::getId).collect(Collectors.toList()));
|
||||
}
|
||||
@@ -479,9 +508,9 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
if(CollectionUtil.isNotEmpty(elementVO.getPrintBoardElements())){
|
||||
elementIds.addAll(elementVO.getPrintBoardElements().stream().map(CollectionElement::getId).collect(Collectors.toList()));
|
||||
}
|
||||
if(CollectionUtil.isNotEmpty(elementVO.getMarketingSketchElements())){
|
||||
elementIds.addAll(elementVO.getMarketingSketchElements().stream().map(CollectionElement::getId).collect(Collectors.toList()));
|
||||
}
|
||||
// if(CollectionUtil.isNotEmpty(elementVO.getMarketingSketchElements())){
|
||||
// elementIds.addAll(elementVO.getMarketingSketchElements().stream().map(CollectionElement::getId).collect(Collectors.toList()));
|
||||
// }
|
||||
return elementIds;
|
||||
}
|
||||
|
||||
|
||||
@@ -122,8 +122,8 @@ public class PanToneServiceImpl extends ServiceImpl<PanToneMapper, PanTone> impl
|
||||
|
||||
@Override
|
||||
public List<PantoneVO> getRgbByHsvBatch(List<GetRgbByHsvBatchDTO> hsvBatch) {
|
||||
if(hsvBatch.size() >15){
|
||||
throw new BusinessException("hsv value cannot exceed the maximum of 15");
|
||||
if(hsvBatch.size() >8){
|
||||
throw new BusinessException("hsv value cannot exceed the maximum of 8");
|
||||
}
|
||||
List<Integer> colorValues = Lists.newArrayList();
|
||||
Map<Integer,GetRgbByHsvBatchDTO> valueToHsv = Maps.newHashMap();
|
||||
|
||||
Reference in New Issue
Block a user