TASK:design new;
This commit is contained in:
@@ -218,66 +218,88 @@ public class PythonService {
|
|||||||
|
|
||||||
//系统比列
|
//系统比列
|
||||||
BigDecimal sysRatio = systemScale;
|
BigDecimal sysRatio = systemScale;
|
||||||
int pinPictureNum = calculatePinPictureNum(elementVO.getSketchBoardElements(), elementVO.getHasUseMd5List());
|
int pinSketchNum = calculatePinSketchNum(elementVO.getSketchBoardElements(), elementVO.getHasUseMd5List());
|
||||||
int sysPictureNum = calculateSysPictureNum(sysRatio, pinPictureNum);
|
int sysSketchNum = calculateSysSketchNum(sysRatio, pinSketchNum);
|
||||||
int userPictureNum = calculateUserLibraryPictureNum(sysPictureNum, pinPictureNum);
|
// int noPinSketchNum = calculateNoPinSketchNum(pinSketchNum, sysSketchNum);
|
||||||
int noPinPictureNum = 8 - pinPictureNum - sysPictureNum - userPictureNum;
|
// int sysPictureNum = calculateSysPictureNum(sysRatio, pinPictureNum);
|
||||||
|
// int userPictureNum = calculateUserLibraryPictureNum(sysPictureNum, pinPictureNum);
|
||||||
|
// int noPinPictureNum = 8 - pinPictureNum - sysPictureNum - userPictureNum;
|
||||||
|
|
||||||
for (int i = 0; i < 8; i++) {
|
// for (int i = 0; i < 8; i++) {
|
||||||
//sketch计算
|
// //sketch计算
|
||||||
CurrentDesignPictureTypeEnum designPictureType =
|
// CurrentDesignPictureTypeEnum designPictureType =
|
||||||
calculateCurrentDesignPictureType(pinPictureNum, sysPictureNum, userPictureNum, noPinPictureNum);
|
// calculateCurrentDesignPictureType(pinPictureNum, sysPictureNum, userPictureNum, noPinPictureNum);
|
||||||
if (Objects.isNull(designPictureType)) {
|
// if (Objects.isNull(designPictureType)) {
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
switch (designPictureType) {
|
// switch (designPictureType) {
|
||||||
case PIN:
|
// case PIN:
|
||||||
pinPictureNum--;
|
// pinPictureNum--;
|
||||||
break;
|
// break;
|
||||||
case USER_LIBRARY:
|
// case USER_LIBRARY:
|
||||||
userPictureNum--;
|
// userPictureNum--;
|
||||||
break;
|
// break;
|
||||||
case SYS_FILE:
|
// case SYS_FILE:
|
||||||
sysPictureNum--;
|
// sysPictureNum--;
|
||||||
break;
|
// break;
|
||||||
case NO_PIN:
|
// case NO_PIN:
|
||||||
noPinPictureNum--;
|
// noPinPictureNum--;
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
}
|
// }
|
||||||
//print计算
|
// //print计算
|
||||||
CurrentDesignPrintPictureTypeEnum designPrintPictureType =
|
// CurrentDesignPrintPictureTypeEnum designPrintPictureType =
|
||||||
calculateCurrentDesignPintPictureType(pinPrintNum, noPinPrintNum, noPrintNum);
|
// calculateCurrentDesignPintPictureType(pinPrintNum, noPinPrintNum, noPrintNum);
|
||||||
if (Objects.isNull(designPrintPictureType)) {
|
// if (Objects.isNull(designPrintPictureType)) {
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
switch (designPrintPictureType) {
|
// switch (designPrintPictureType) {
|
||||||
case PIN:
|
// case PIN:
|
||||||
pinPrintNum--;
|
// pinPrintNum--;
|
||||||
break;
|
// break;
|
||||||
case NO_PIN:
|
// case NO_PIN:
|
||||||
noPinPrintNum--;
|
// noPinPrintNum--;
|
||||||
break;
|
// break;
|
||||||
case NO:
|
// case NO:
|
||||||
noPrintNum--;
|
// noPrintNum--;
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
}
|
// }
|
||||||
//确定本次designSingle是否print
|
// //确定本次designSingle是否print
|
||||||
DesignPythonItemPrint designPythonItemPrint = getRandomPrint(elementVO, designPrintPictureType);
|
// DesignPythonItemPrint designPythonItemPrint = getRandomPrint(elementVO, designPrintPictureType);
|
||||||
elementVO.setDesignPythonItemPrint(designPythonItemPrint);
|
// elementVO.setDesignPythonItemPrint(designPythonItemPrint);
|
||||||
//参数透传 确定本次designSingle如果需要print对应的种类
|
// //参数透传 确定本次designSingle如果需要print对应的种类
|
||||||
elementVO.setDesignPrintPictureTypeLayoutList(calculateCurrentDesignPintPictureTypeLayout(elementVO.getModelSex()));
|
// elementVO.setDesignPrintPictureTypeLayoutList(calculateCurrentDesignPintPictureTypeLayout(elementVO.getModelSex()));
|
||||||
//designSingle具体参数组装
|
// //designSingle具体参数组装
|
||||||
DesignPythonObject pythonObject = new DesignPythonObject();
|
// DesignPythonObject pythonObject = new DesignPythonObject();
|
||||||
pythonObject.setItems(coverToDesignPythonItem(elementVO, designPictureType));
|
// pythonObject.setItems(coverToDesignPythonItem(elementVO, designPictureType));
|
||||||
pythonObject.setBasic(coverToBasic(pythonObject.getItems().get(0),
|
// pythonObject.setBasic(coverToBasic(pythonObject.getItems().get(0),
|
||||||
singleOverall, switchCategory, elementVO.getDesignLibraryModelPoint()));
|
// singleOverall, switchCategory, elementVO.getDesignLibraryModelPoint()));
|
||||||
objects.add(pythonObject);
|
// objects.add(pythonObject);
|
||||||
}
|
// }
|
||||||
return designPythonObjects;
|
return designPythonObjects;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int calculateSysSketchNum(BigDecimal sysRatio, int pinSketchNum) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int calculatePinSketchNum(List<CollectionElement> sketchBoardElements, List<String> hasUseMd5List) {
|
||||||
|
List<CollectionElement> pinData = getPinData(sketchBoardElements, hasUseMd5List);
|
||||||
|
if (CollectionUtil.isEmpty(pinData)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
// long topNum = sketchBoardElements.stream()
|
||||||
|
// .filter(skecth -> skecth.getHasPin() == 1
|
||||||
|
// && DesignPythonItem.OUTWEAR_DRESS_BLOUSE.contains(skecth.getLevel2Type())).count();
|
||||||
|
// long bottomNum = sketchBoardElements.stream()
|
||||||
|
// .filter(skecth -> skecth.getHasPin() == 1
|
||||||
|
// && DesignPythonItem.SKIRT_TROUSERS.contains(skecth.getLevel2Type())).count();
|
||||||
|
// int num = Arrays.asList(topNum, bottomNum).stream().max(Comparator.comparing(Long::valueOf)).get().intValue();
|
||||||
|
int num = pinData.size();
|
||||||
|
return Math.min(num, 8);
|
||||||
|
}
|
||||||
|
|
||||||
//计算当前的图片类型
|
//计算当前的图片类型
|
||||||
private CurrentDesignPictureTypeEnum calculateCurrentDesignPictureType(int pinPictureNum, int sysPictureNum, int userPictureNum, int noPinPictureNum) {
|
private CurrentDesignPictureTypeEnum calculateCurrentDesignPictureType(int pinPictureNum, int sysPictureNum, int userPictureNum, int noPinPictureNum) {
|
||||||
List<Integer> codes = Lists.newArrayList();
|
List<Integer> codes = Lists.newArrayList();
|
||||||
@@ -1451,10 +1473,10 @@ public class PythonService {
|
|||||||
if (CollectionUtils.isEmpty(sketchBoardPins)) {
|
if (CollectionUtils.isEmpty(sketchBoardPins)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
List<CollectionElement> response = resolveElementFilterHistoryMd5(sketchBoardPins);
|
// List<CollectionElement> response = resolveElementFilterHistoryMd5(sketchBoardPins);
|
||||||
if (CollectionUtils.isEmpty(response)) {
|
// if (CollectionUtils.isEmpty(response)) {
|
||||||
return null;
|
// return null;
|
||||||
}
|
// }
|
||||||
return CopyUtil.copyList(sketchBoardPins, CollectionElement.class);
|
return CopyUtil.copyList(sketchBoardPins, CollectionElement.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user