|
|
|
@ -260,7 +260,7 @@ public class LawCaseServiceImpl extends ServiceImpl impl |
|
|
|
caseTreeList.addAll(implement.toJavaList(CaseTree.class)); |
|
|
|
caseTreeList.addAll(criminal.toJavaList(CaseTree.class)); |
|
|
|
|
|
|
|
saveTree(caseTreeList); |
|
|
|
saveTree(caseTreeList,creditCode); |
|
|
|
|
|
|
|
|
|
|
|
// |
|
|
|
@ -278,24 +278,27 @@ public class LawCaseServiceImpl extends ServiceImpl impl |
|
|
|
// limitationService.saveOrUpdateBatch(limitationList); |
|
|
|
} |
|
|
|
|
|
|
|
private void saveTree(List<CaseTree> caseTreeList) { |
|
|
|
private void saveTree(List<CaseTree> caseTreeList,String creditCode) { |
|
|
|
List<CaseTree> allList = new ArrayList<>(); |
|
|
|
for (CaseTree caseTree:caseTreeList){ |
|
|
|
allList.addAll(flattenCaseTree(caseTree)); |
|
|
|
allList.addAll(flattenCaseTree(caseTree,creditCode)); |
|
|
|
} |
|
|
|
caseTreeService.saveOrUpdateBatch(allList); |
|
|
|
} |
|
|
|
public List<CaseTree> flattenCaseTree(CaseTree root) { |
|
|
|
public List<CaseTree> flattenCaseTree(CaseTree root,String creditCode) { |
|
|
|
if (root == null) { |
|
|
|
return Collections.emptyList(); |
|
|
|
} |
|
|
|
|
|
|
|
List<CaseTree> list = new ArrayList<>(); |
|
|
|
|
|
|
|
CaseTree current = root; |
|
|
|
|
|
|
|
// 先收集所有节点,并断开 next 引用 |
|
|
|
while (current != null) { |
|
|
|
CaseTree next = current.getNext(); // 保存下一个引用 |
|
|
|
current.setNAjbs(current.getNAjbs()+":"+creditCode); |
|
|
|
// 保存下一个引用 |
|
|
|
CaseTree next = current.getNext(); |
|
|
|
current.setNext(null); // 清除内存引用,避免序列化/MyBatis 干扰 |
|
|
|
list.add(current); |
|
|
|
current = next; |
|
|
|
@ -337,6 +340,7 @@ public class LawCaseServiceImpl extends ServiceImpl impl |
|
|
|
for (int i = 0; i < jsonArray.size(); i++) { |
|
|
|
JSONObject jsonObject = jsonArray.getJSONObject(i); |
|
|
|
LawCase lawCase = JSON.parseObject(jsonObject.toString(), LawCase.class); |
|
|
|
lawCase.setNAjbs(lawCase.getNAjbs()+":"+creditCode); |
|
|
|
lawCase.setCompanyName(companyName); |
|
|
|
lawCase.setCreditCode(creditCode); |
|
|
|
lawCase.setCaseType(type); |
|
|
|
|