BUGFIX:重复停止组装;
This commit is contained in:
@@ -260,28 +260,31 @@ public class PythonService {
|
||||
noPrintNum--;
|
||||
break;
|
||||
}
|
||||
|
||||
DesignPythonItemPrint designPythonItemPrint = getRandomPrint(elementVO, designPrintPictureType);
|
||||
elementVO.setDesignPythonItemPrint(designPythonItemPrint);
|
||||
elementVO.setDesignPrintPictureTypeLayoutList(calculateCurrentDesignPintPictureTypeLayout(elementVO.getModelSex()));
|
||||
|
||||
List<String> beforeAssemblyHasUseMd5List = new ArrayList<>(elementVO.getHasUseMd5List());
|
||||
DesignPythonObject pythonObject = createDesignPythonObject(elementVO, designPictureType, systemScale, singleOverall, switchCategory, i);
|
||||
|
||||
// 如果当前对象与已组装的对象重复,则跳过当前组装
|
||||
DesignPythonObject designPythonObjectCopy = getCopy(pythonObject);
|
||||
if (assembledObjects.contains(designPythonObjectCopy)) {
|
||||
if (lastAssembledObject != null && assembledObjects.contains(lastAssembledObject)) {
|
||||
// 如果当前组装与前一个组装的对象重复,且前一个组装也重复,结束组装
|
||||
System.out.println("当前组装的对象与前两个组装的对象重复,结束组装。");
|
||||
break;
|
||||
}
|
||||
// 否则,跳过当前组装
|
||||
|
||||
boolean isDuplicate = assembledObjects.contains(designPythonObjectCopy);
|
||||
|
||||
if (isDuplicate) {
|
||||
// if (lastAssembledObject != null && assembledObjects.contains(lastAssembledObject)) {
|
||||
// // 如果当前组装与前一个组装的对象重复,且前一个组装也重复,结束组装
|
||||
// System.out.println("当前组装的对象与前两个组装的对象重复,结束组装。");
|
||||
// break;
|
||||
// }
|
||||
elementVO.setHasUseMd5List(beforeAssemblyHasUseMd5List);
|
||||
i --;
|
||||
continue;
|
||||
}
|
||||
|
||||
// 将当前对象添加到已组装的集合中,并记录
|
||||
assembledObjects.add(designPythonObjectCopy);
|
||||
lastAssembledObject = designPythonObjectCopy; // 更新上一次组装的对象
|
||||
// lastAssembledObject = designPythonObjectCopy; // 更新上一次组装的对象
|
||||
|
||||
objects.add(pythonObject);
|
||||
redisUtil.addProcessId(processId, i + 1);
|
||||
|
||||
Reference in New Issue
Block a user