|
@@ -103,8 +103,6 @@ public class CopyCaseService {
|
|
HashMap<Integer, Integer> pathIdMap = this.cpPath(oldCaseId,newCaseId,fusionNumIdMap);
|
|
HashMap<Integer, Integer> pathIdMap = this.cpPath(oldCaseId,newCaseId,fusionNumIdMap);
|
|
this.cpAnimation(oldCaseId,newCaseId,pathIdMap);
|
|
this.cpAnimation(oldCaseId,newCaseId,pathIdMap);
|
|
|
|
|
|
- this.cpOverview(oldCaseId,newCaseId);
|
|
|
|
- this.cpTabluation(oldCaseId,newCaseId);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -181,9 +179,16 @@ public class CopyCaseService {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
for (CaseFiles entity : listByCaseId) {
|
|
for (CaseFiles entity : listByCaseId) {
|
|
- if(entity.getOverviewId() != null || entity.getTabulationId() != null){
|
|
|
|
- continue;
|
|
|
|
|
|
+ if(entity.getOverviewId() != null ){
|
|
|
|
+ HashMap<String,Integer> map = this.cpOverview(newCaseId,entity.getOverviewId());
|
|
|
|
+ entity.setOverviewId(map.get("overviewId"));
|
|
|
|
+ entity.setTabulationId(map.get("tabulationId"));
|
|
|
|
+ }
|
|
|
|
+ if(entity.getOverviewId() == null && entity.getTabulationId() != null ){
|
|
|
|
+ Integer newId = this.cpTabluation(newCaseId,entity.getTabulationId());
|
|
|
|
+ entity.setTabulationId(newId);
|
|
}
|
|
}
|
|
|
|
+
|
|
entity.setFilesId(null);
|
|
entity.setFilesId(null);
|
|
entity.setCaseId(newCaseId);
|
|
entity.setCaseId(newCaseId);
|
|
caseFilesService.save(entity);
|
|
caseFilesService.save(entity);
|
|
@@ -547,45 +552,33 @@ public class CopyCaseService {
|
|
caseAnimationService.save(caseAnimation);
|
|
caseAnimationService.save(caseAnimation);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- private void cpOverview(Integer oldCaseId, Integer newCaseId){
|
|
|
|
- List<CaseOverview> byCaseId = caseOverviewService.getByCaseId(oldCaseId);
|
|
|
|
- for (CaseOverview caseOverview : byCaseId) {
|
|
|
|
- Integer oldOverId = caseOverview.getId();
|
|
|
|
- caseOverview.setId(null);
|
|
|
|
- caseOverview.setCaseId(newCaseId);
|
|
|
|
- caseOverviewService.save(caseOverview);
|
|
|
|
-
|
|
|
|
- CaseFiles caseFiles = caseFilesService.getByOverviewId(oldOverId);
|
|
|
|
- caseFiles.setFilesId(null);
|
|
|
|
- caseFiles.setOverviewId(caseOverview.getId());
|
|
|
|
- caseFiles.setCaseId(newCaseId);
|
|
|
|
- if(caseOverview.getCaseTabulation() != null){
|
|
|
|
- List<CaseTabulation> byOverId = caseTabulationService.getByOverId(oldOverId);
|
|
|
|
- for (CaseTabulation caseTabulation : byOverId) {
|
|
|
|
- caseTabulation.setId(null);
|
|
|
|
- caseTabulation.setOverviewId(caseOverview.getId());
|
|
|
|
- caseTabulation.setCaseId(newCaseId);
|
|
|
|
- caseTabulationService.save(caseTabulation);
|
|
|
|
- caseFiles.setTabulationId(caseTabulation.getId());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- caseFilesService.save(caseFiles);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- private void cpTabluation(Integer oldCaseId, Integer newCaseId){
|
|
|
|
- List<CaseTabulation> byCaseId = caseTabulationService.getByCaseId(oldCaseId);
|
|
|
|
- for (CaseTabulation caseTabulation : byCaseId) {
|
|
|
|
- Integer oldId = caseTabulation.getId();
|
|
|
|
|
|
+ private HashMap<String,Integer> cpOverview(Integer newCaseId, Integer oldId){
|
|
|
|
+ HashMap<String,Integer> map = new HashMap<>();
|
|
|
|
+ CaseOverview caseOverview = caseOverviewService.getById(oldId);
|
|
|
|
+ Integer oldOverId = caseOverview.getId();
|
|
|
|
+ caseOverview.setId(null);
|
|
|
|
+ caseOverview.setCaseId(newCaseId);
|
|
|
|
+ caseOverviewService.save(caseOverview);
|
|
|
|
+ map.put("overviewId",caseOverview.getId());
|
|
|
|
+
|
|
|
|
+ List<CaseTabulation> byOverId = caseTabulationService.getByOverId(oldOverId);
|
|
|
|
+ for (CaseTabulation caseTabulation : byOverId) {
|
|
caseTabulation.setId(null);
|
|
caseTabulation.setId(null);
|
|
|
|
+ caseTabulation.setOverviewId(caseOverview.getId());
|
|
caseTabulation.setCaseId(newCaseId);
|
|
caseTabulation.setCaseId(newCaseId);
|
|
caseTabulationService.save(caseTabulation);
|
|
caseTabulationService.save(caseTabulation);
|
|
|
|
+ map.put("tabulationId",caseTabulation.getId());
|
|
|
|
|
|
- CaseFiles caseFiles = caseFilesService.getByTabulation(oldId);
|
|
|
|
- caseFiles.setFilesId(null);
|
|
|
|
- caseFiles.setTabulationId(caseTabulation.getId());
|
|
|
|
- caseFiles.setCaseId(newCaseId);
|
|
|
|
- caseFilesService.save(caseFiles);
|
|
|
|
}
|
|
}
|
|
|
|
+ return map;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private Integer cpTabluation( Integer newCaseId,Integer oldId){
|
|
|
|
+ CaseTabulation caseTabulation = caseTabulationService.getById(oldId);
|
|
|
|
+ caseTabulation.setId(null);
|
|
|
|
+ caseTabulation.setCaseId(newCaseId);
|
|
|
|
+ caseTabulationService.save(caseTabulation);
|
|
|
|
+ return caseTabulation.getId();
|
|
}
|
|
}
|
|
}
|
|
}
|