|
@@ -14,6 +14,7 @@ import org.apache.commons.math3.ode.ODEIntegrator;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import scala.Int;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -70,6 +71,10 @@ public class CopyCaseService {
|
|
|
ICasePathService casePathService;
|
|
|
@Autowired
|
|
|
ICaseAnimationService caseAnimationService;
|
|
|
+ @Autowired
|
|
|
+ ICaseOverviewService caseOverviewService;
|
|
|
+ @Autowired
|
|
|
+ ICaseTabulationService caseTabulationService;
|
|
|
|
|
|
|
|
|
@Autowired
|
|
@@ -97,6 +102,9 @@ public class CopyCaseService {
|
|
|
|
|
|
HashMap<Integer, Integer> pathIdMap = this.cpPath(oldCaseId,newCaseId,fusionNumIdMap);
|
|
|
this.cpAnimation(oldCaseId,newCaseId,pathIdMap);
|
|
|
+
|
|
|
+ this.cpOverview(oldCaseId,newCaseId);
|
|
|
+ this.cpTabluation(oldCaseId,newCaseId);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -173,6 +181,9 @@ public class CopyCaseService {
|
|
|
return;
|
|
|
}
|
|
|
for (CaseFiles entity : listByCaseId) {
|
|
|
+ if(entity.getOverviewId() != null || entity.getTabulationId() != null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
entity.setFilesId(null);
|
|
|
entity.setCaseId(newCaseId);
|
|
|
caseFilesService.save(entity);
|
|
@@ -536,4 +547,45 @@ public class CopyCaseService {
|
|
|
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();
|
|
|
+ caseTabulation.setId(null);
|
|
|
+ caseTabulation.setCaseId(newCaseId);
|
|
|
+ caseTabulationService.save(caseTabulation);
|
|
|
+
|
|
|
+ CaseFiles caseFiles = caseFilesService.getByTabulation(oldId);
|
|
|
+ caseFiles.setFilesId(null);
|
|
|
+ caseFiles.setTabulationId(caseTabulation.getId());
|
|
|
+ caseFiles.setCaseId(newCaseId);
|
|
|
+ caseFilesService.save(caseFiles);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|