fix(文档拆分): un 拆分目录编号、标题小数点错乱问题解决
This commit is contained in:
+40
-12
@@ -409,7 +409,7 @@ public class FileSpiltService {
|
||||
menuCanAdd = false;
|
||||
} else {
|
||||
// 增加一条数据,需要在数结构中加一条数据
|
||||
SarFileSplitMenuEO sarFileSplitMenuEO = getTreeList(nowStart.get(i), treeList, generalCatalogueId, sarFileSplitInfoEO, treeListDisplay++, itemName, enumByValue);
|
||||
SarFileSplitMenuEO sarFileSplitMenuEO = getTreeList(nowStart.get(i), treeList, generalCatalogueId, sarFileSplitInfoEO, treeListDisplay++, itemName, enumByValue, startDigit);
|
||||
treeList.add(sarFileSplitMenuEO);
|
||||
preName = startDigit;
|
||||
preNameNum = g;
|
||||
@@ -437,7 +437,7 @@ public class FileSpiltService {
|
||||
clauseContent.add(paragraphString);
|
||||
SarFileSplitItemsEO message = getSarFileSplitItemsEO(sarFileSplitInfoEO.getId(), itemName, "", clauseContent);
|
||||
// 增加一条数据,需要在数结构中加一条数据
|
||||
SarFileSplitMenuEO sarFileSplitMenuEO = getTreeList(itemName, treeList, generalCatalogueId, sarFileSplitInfoEO, treeListDisplay++, "", enumByValue);
|
||||
SarFileSplitMenuEO sarFileSplitMenuEO = getTreeList(itemName, treeList, generalCatalogueId, sarFileSplitInfoEO, treeListDisplay++, "", enumByValue, startDigit);
|
||||
//addItermsConditionsText(message, itemValList, paragraphString, alignment);
|
||||
treeList.add(sarFileSplitMenuEO);
|
||||
message.setMenuId(sarFileSplitMenuEO.getId());
|
||||
@@ -562,12 +562,12 @@ public class FileSpiltService {
|
||||
}
|
||||
|
||||
public static SarFileSplitMenuEO getTreeList(String name,
|
||||
List<SarFileSplitMenuEO> treeList,
|
||||
String generalCatalogueId,
|
||||
SarFileSplitInfoEO sarFileSplitInfoEO,
|
||||
Long treeListDisplay,
|
||||
String itemName,
|
||||
SplitFileTypeTypeEnum enumByValue) {
|
||||
List<SarFileSplitMenuEO> treeList,
|
||||
String generalCatalogueId,
|
||||
SarFileSplitInfoEO sarFileSplitInfoEO,
|
||||
Long treeListDisplay,
|
||||
String itemName,
|
||||
SplitFileTypeTypeEnum enumByValue, String startDigit) {
|
||||
SarFileSplitMenuEO documentTreeEO = new SarFileSplitMenuEO();
|
||||
// SarFileSplitMenuEO documentTreeEO = new SarFileSplitMenuEO(UUIDUtils.randomUUID20(),name,sarFileSplitInfoEO.getId(),treeListDisplay,itemName);
|
||||
|
||||
@@ -583,6 +583,7 @@ public class FileSpiltService {
|
||||
boolean oneFlag = false;
|
||||
boolean twoFlag = false;
|
||||
boolean threeFlag = false;
|
||||
List<String> dotList = new ArrayList<>();
|
||||
a:
|
||||
for (SarFileSplitMenuEO forDocumentTree : treeList) {
|
||||
String treeName = forDocumentTree.getName();
|
||||
@@ -606,6 +607,14 @@ public class FileSpiltService {
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (name.endsWith(".")){
|
||||
// 处理末尾为小数点的数据
|
||||
name = name.substring(0, name.length() - 1);
|
||||
dotList.add(forDocumentTree.getId());
|
||||
}
|
||||
if (treeName.endsWith(".")){
|
||||
treeName = treeName.substring(0, treeName.length() - 1);
|
||||
}
|
||||
if (name.indexOf(".") >= 0) {
|
||||
if (name.substring(0, name.lastIndexOf(".")).equals(treeName)) {
|
||||
documentTreeEO.setPId(forDocumentTree.getId());
|
||||
@@ -616,9 +625,18 @@ public class FileSpiltService {
|
||||
documentTreeEO.setPId(generalCatalogueId);
|
||||
// pIdList.add(generalCatalogueId);
|
||||
}
|
||||
if (startDigit.equals(name + ".")){
|
||||
documentTreeEO.setName(name + ".");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 补回小数点
|
||||
for (SarFileSplitMenuEO forDocumentTree : treeList) {
|
||||
if (dotList.contains(forDocumentTree.getId())) {
|
||||
forDocumentTree.setName(forDocumentTree.getName() + ".");
|
||||
}
|
||||
}
|
||||
return documentTreeEO;
|
||||
}
|
||||
@@ -1330,13 +1348,23 @@ public class FileSpiltService {
|
||||
// String itemName = paragraphString.substring(nowStart.get(i).length()).length()>10?paragraphString.substring(nowStart.get(i).length(),nowStart.get(i).length()+10):paragraphString.substring(nowStart.get(i).length());
|
||||
// String itemName = FileSplitUtils.getItemName(paragraphString, startDigit);
|
||||
String itemName;
|
||||
String tempnowStart = nowStart.get(i);
|
||||
if (startDigit.equals(nowStart.get(i)+ ".")){
|
||||
tempnowStart = nowStart.get(i)+ ".";
|
||||
}
|
||||
if (nowStart.get(i).equals("1")){
|
||||
nowStart.set(i, "1.");
|
||||
}
|
||||
if (paragraphString.indexOf(nowStart.get(i)) == 0){
|
||||
itemName = paragraphString.substring(nowStart.get(i).length()).trim().length() > 10 ? paragraphString.substring(nowStart.get(i).length()).trim().substring(0,10) :paragraphString.substring(nowStart.get(i).length()).trim();
|
||||
itemName = paragraphString.substring(tempnowStart.length()).trim().length() > 10 ? paragraphString.substring(tempnowStart.length()).trim().substring(0,10) :paragraphString.substring(tempnowStart.length()).trim();
|
||||
}else {
|
||||
itemName = paragraphString.substring(nowStart.get(i).length()).length() > 10 ? paragraphString.substring(nowStart.get(i).length(), nowStart.get(i).length() + 10) : paragraphString.substring(nowStart.get(i).length());
|
||||
itemName = paragraphString.substring(tempnowStart.length()).length() > 10 ? paragraphString.substring(tempnowStart.length(), tempnowStart.length() + 10) : paragraphString.substring(tempnowStart.length());
|
||||
}
|
||||
List<String> clauseContent = new ArrayList<>();
|
||||
clauseContent.add(paragraphString);
|
||||
if (startDigit.equals("1")){
|
||||
startDigit = "1.";
|
||||
}
|
||||
SarFileSplitItemsEO message = getSarFileSplitItemsEO(sarFileSplitInfoEO.getId(), startDigit, itemName, clauseContent);
|
||||
|
||||
String[] numberStr = nowStart.get(i).split("\\.");
|
||||
@@ -1346,7 +1374,7 @@ public class FileSpiltService {
|
||||
menuCanAdd = false;
|
||||
} else {
|
||||
// 增加一条数据,需要在数结构中加一条数据
|
||||
SarFileSplitMenuEO sarFileSplitMenuEO = getTreeList(nowStart.get(i), treeList, generalCatalogueId, sarFileSplitInfoEO, treeListDisplay++, itemName, enumByValue);
|
||||
SarFileSplitMenuEO sarFileSplitMenuEO = getTreeList(nowStart.get(i), treeList, generalCatalogueId, sarFileSplitInfoEO, treeListDisplay++, itemName, enumByValue, startDigit);
|
||||
treeList.add(sarFileSplitMenuEO);
|
||||
preName = nowStart.get(i);
|
||||
preNameNum = g;
|
||||
@@ -1394,7 +1422,7 @@ public class FileSpiltService {
|
||||
// SarFileSplitItemsEO message = getSarFileSplitItemsEO(sarFileSplitInfoEO.getId(), "annex", itemName, clauseContent);
|
||||
SarFileSplitItemsEO message = getSarFileSplitItemsEO(sarFileSplitInfoEO.getId(), itemName, "", clauseContent);
|
||||
// 增加一条数据,需要在数结构中加一条数据
|
||||
SarFileSplitMenuEO sarFileSplitMenuEO = getTreeList(itemName, treeList, generalCatalogueId, sarFileSplitInfoEO, treeListDisplay++, "", enumByValue);
|
||||
SarFileSplitMenuEO sarFileSplitMenuEO = getTreeList(itemName, treeList, generalCatalogueId, sarFileSplitInfoEO, treeListDisplay++, "", enumByValue, startDigit);
|
||||
addItermsConditionsText(message, itemValList, paragraphString, p.getAlignment());
|
||||
treeList.add(sarFileSplitMenuEO);
|
||||
message.setMenuId(sarFileSplitMenuEO.getId());
|
||||
|
||||
Reference in New Issue
Block a user