CopyCaseService.java 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. package com.fdkankan.fusion.service.impl;
  2. import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  3. import com.fdkankan.fusion.common.ResultCode;
  4. import com.fdkankan.fusion.common.enums.IdPreEnum;
  5. import com.fdkankan.fusion.common.util.IdUtils;
  6. import com.fdkankan.fusion.common.util.UploadToOssUtil;
  7. import com.fdkankan.fusion.entity.*;
  8. import com.fdkankan.fusion.exception.BusinessException;
  9. import com.fdkankan.fusion.service.*;
  10. import lombok.extern.slf4j.Slf4j;
  11. import org.apache.commons.lang3.StringUtils;
  12. import org.apache.commons.math3.ode.ODEIntegrator;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.beans.factory.annotation.Value;
  15. import org.springframework.stereotype.Service;
  16. import java.util.HashMap;
  17. import java.util.List;
  18. @Service
  19. @Slf4j
  20. public class CopyCaseService {
  21. @Autowired
  22. ICaseService caseService;
  23. @Autowired
  24. ICaseNumService caseNumService;
  25. @Autowired
  26. ICaseExtractDetailService caseExtractDetailService;
  27. @Autowired
  28. ICaseFilesService caseFilesService;
  29. @Autowired
  30. ICaseFusionService caseFusionService;
  31. @Autowired
  32. ICaseImgService caseImgService;
  33. @Autowired
  34. ICaseInquestService caseInquestService;
  35. @Autowired
  36. ICaseSettingsService caseSettingsService;
  37. @Autowired
  38. ICaseSettingsResourceService caseSettingsResourceService;
  39. @Autowired
  40. ICaseTagService caseTagService;
  41. @Autowired
  42. ICaseTagPointService caseTagPointService;
  43. @Autowired
  44. ICaseVideoFolderService caseVideoFolderService;
  45. @Autowired
  46. ICaseVideoService caseVideoService;
  47. @Autowired
  48. ICaseViewService caseViewService;
  49. @Autowired
  50. IFusionGuideService fusionGuideService;
  51. @Autowired
  52. IFusionGuidePathService fusionGuidePathService;
  53. @Autowired
  54. IFusionNumService fusionNumService;
  55. @Autowired
  56. IFusionMeterService fusionMeterService;
  57. @Autowired
  58. ITmProjectService projectService;
  59. @Autowired
  60. ITmMessageService tmMessageService;
  61. @Autowired
  62. ICaseScriptService caseScriptService;
  63. @Autowired
  64. ICaseImgTagService caseImgTagService;
  65. @Autowired
  66. ICasePathService casePathService;
  67. @Autowired
  68. ICaseAnimationService caseAnimationService;
  69. @Autowired
  70. ICaseOverviewService caseOverviewService;
  71. @Autowired
  72. ICaseTabulationService caseTabulationService;
  73. @Autowired
  74. UploadToOssUtil uploadToOssUtil;
  75. public void copyCase(Integer oldCaseId){
  76. Integer newCaseId = this.cpCaseEntity(oldCaseId);
  77. this.cpCaseExtractDetail(oldCaseId,newCaseId);
  78. this.cpCaseFile(oldCaseId,newCaseId);
  79. this.cpCaseImg(oldCaseId,newCaseId);
  80. this.cpCaseInquest(oldCaseId,newCaseId);
  81. this.cpCaseNum(oldCaseId,newCaseId);
  82. this.cpCaseSettings(oldCaseId,newCaseId);
  83. this.cpCaseSettingsResource(oldCaseId,newCaseId);
  84. this.cpCaseVideo(oldCaseId,newCaseId);
  85. this.cpCaseViewByCaseId(oldCaseId,newCaseId);
  86. this.cpFusionGuide(oldCaseId,newCaseId);
  87. this.cpCaseScript(oldCaseId,newCaseId);
  88. this.cpImgTag(oldCaseId,newCaseId);
  89. HashMap<Integer, Integer> fusionNumIdMap = this.cpCaseFusion(oldCaseId, newCaseId);
  90. this.cpCaseTag(oldCaseId,newCaseId,fusionNumIdMap);
  91. HashMap<Integer, Integer> pathIdMap = this.cpPath(oldCaseId,newCaseId,fusionNumIdMap);
  92. this.cpAnimation(oldCaseId,newCaseId,pathIdMap);
  93. }
  94. /**
  95. * 复制案件信息
  96. */
  97. private Integer cpCaseEntity(Integer caseId) {
  98. CaseEntity caseEntity = caseService.getById(caseId);
  99. if(caseEntity == null){
  100. throw new BusinessException(ResultCode.CASE_NOT_EXIST);
  101. }
  102. caseEntity.setCaseId(null);
  103. caseEntity.setCaseTitle(caseEntity.getCaseTitle()+"(copy)");
  104. if(caseEntity.getTmProjectId() != null){
  105. String oldProjectId = caseEntity.getTmProjectId();
  106. String newProjectId = cpProject(oldProjectId);
  107. caseEntity.setTmProjectId(newProjectId);
  108. }
  109. caseService.save(caseEntity);
  110. return caseEntity.getCaseId();
  111. }
  112. private String cpProject(String oldProjectId) {
  113. TmProject tmProject = projectService.getById(oldProjectId);
  114. String newId = IdUtils.genId(IdPreEnum.PROJECT_PRE.getPre());
  115. tmProject.setId(newId);
  116. String projectSn = tmProject.getProjectSn() +"(copy)";
  117. TmProject byProjectSn = projectService.getByProjectSn(projectSn);
  118. if(byProjectSn != null){
  119. List<TmProject> projectSnList = projectService.getLikeByProjectSn(projectSn);
  120. projectSn += projectSnList.size();
  121. }
  122. tmProject.setProjectSn(projectSn);
  123. //tmProject.setCaseNewName(projectService.setCaseNewName(tmProject));
  124. projectService.save(tmProject);
  125. cpMessage(oldProjectId,newId);
  126. return newId;
  127. }
  128. private void cpMessage(String oldProjectId, String newId) {
  129. List<TmMessage> messages = tmMessageService.getByProjectId(oldProjectId);
  130. if(messages == null || messages.isEmpty()){
  131. return;
  132. }
  133. for (TmMessage message : messages) {
  134. message.setId(IdUtils.genId(IdPreEnum.MESSAGE_PRE.getPre()));
  135. message.setProjectId(newId);
  136. tmMessageService.save(message);
  137. }
  138. }
  139. /**
  140. * 复制案件提取清单
  141. */
  142. private void cpCaseExtractDetail(Integer oldCaseId,Integer newCaseId){
  143. CaseExtractDetail caseExtractDetail = caseExtractDetailService.getByCaseId(oldCaseId);
  144. if(caseExtractDetail== null){
  145. return;
  146. }
  147. caseExtractDetail.setId(null);
  148. caseExtractDetail.setCaseId(newCaseId);
  149. caseExtractDetailService.save(caseExtractDetail);
  150. }
  151. /**
  152. * 复制案件方位图等
  153. */
  154. private void cpCaseFile(Integer oldCaseId, Integer newCaseId) {
  155. List<CaseFiles> listByCaseId = caseFilesService.getByCaseId(oldCaseId);
  156. if(listByCaseId == null || listByCaseId.isEmpty()){
  157. return;
  158. }
  159. for (CaseFiles entity : listByCaseId) {
  160. if(entity.getOverviewId() != null ){
  161. HashMap<String,Integer> map = this.cpOverview(newCaseId,entity.getOverviewId());
  162. entity.setOverviewId(map.get("overviewId"));
  163. entity.setTabulationId(map.get("tabulationId"));
  164. }
  165. if(entity.getOverviewId() == null && entity.getTabulationId() != null ){
  166. Integer newId = this.cpTabluation(newCaseId,entity.getTabulationId());
  167. entity.setTabulationId(newId);
  168. }
  169. entity.setFilesId(null);
  170. entity.setCaseId(newCaseId);
  171. caseFilesService.save(entity);
  172. }
  173. }
  174. /**
  175. * 复制案件编辑器关联关系
  176. */
  177. private HashMap<Integer,Integer> cpCaseFusion(Integer oldCaseId, Integer newCaseId) {
  178. HashMap<Integer,Integer> fusionNumIdMap = new HashMap<>();
  179. List<CaseFusion> listByCaseId = caseFusionService.getListByCaseId(oldCaseId);
  180. if(listByCaseId == null || listByCaseId.isEmpty()){
  181. return fusionNumIdMap;
  182. }
  183. for (CaseFusion entity : listByCaseId) {
  184. Integer oldFusionId = entity.getFusionId();
  185. entity.setFusionId(null);
  186. entity.setCaseId(newCaseId);
  187. caseFusionService.save(entity);
  188. cpCaseViewByFusionId(oldFusionId,entity.getFusionId(),newCaseId);
  189. cpFusionNum(oldFusionId,entity.getFusionId(),fusionNumIdMap);
  190. cpFusionMeter(oldFusionId,entity.getFusionId(),fusionNumIdMap);
  191. }
  192. return fusionNumIdMap;
  193. }
  194. /**
  195. * 复制案件照片制卷
  196. */
  197. private void cpCaseImg(Integer oldCaseId, Integer newCaseId) {
  198. List<CaseImg> listByCaseId = caseImgService.getByCaseId(oldCaseId,null);
  199. if(listByCaseId == null || listByCaseId.isEmpty()){
  200. return;
  201. }
  202. for (CaseImg entity : listByCaseId) {
  203. entity.setId(null);
  204. entity.setCaseId(newCaseId);
  205. caseImgService.save(entity);
  206. }
  207. }
  208. /**
  209. * 复制案件勘验笔录
  210. */
  211. private void cpCaseInquest(Integer oldCaseId, Integer newCaseId) {
  212. CaseInquest entity = caseInquestService.getByCaseId(oldCaseId);
  213. if(entity == null ){
  214. return;
  215. }
  216. entity.setId(null);
  217. entity.setCaseId(newCaseId);
  218. caseInquestService.save(entity);
  219. }
  220. /**
  221. * 复制案件脚本
  222. */
  223. private void cpCaseScript(Integer oldCaseId, Integer newCaseId) {
  224. CaseScript entity = caseScriptService.getByCaseId(oldCaseId);
  225. if(entity == null ){
  226. return;
  227. }
  228. entity.setId(null);
  229. entity.setCaseId(newCaseId);
  230. caseScriptService.save(entity);
  231. }
  232. /**
  233. * 复制案件图片标注
  234. */
  235. private void cpImgTag(Integer oldCaseId, Integer newCaseId) {
  236. CaseImgTag entity = caseImgTagService.getByCaseId(oldCaseId);
  237. if(entity == null ){
  238. return;
  239. }
  240. entity.setId(null);
  241. entity.setCaseId(newCaseId);
  242. caseImgTagService.save(entity);
  243. }
  244. /**
  245. * 复制案件场景关系
  246. */
  247. private void cpCaseNum(Integer oldCaseId, Integer newCaseId) {
  248. List<CaseNumEntity> listByCaseId = caseNumService.getByCaseId(oldCaseId);
  249. if(listByCaseId == null || listByCaseId.isEmpty()){
  250. return;
  251. }
  252. for (CaseNumEntity entity : listByCaseId) {
  253. entity.setId(null);
  254. entity.setCaseId(newCaseId);
  255. caseNumService.save(entity);
  256. }
  257. }
  258. /**
  259. * 复制案件系统设置
  260. */
  261. private void cpCaseSettings(Integer oldCaseId, Integer newCaseId) {
  262. List<CaseSettings> listByCaseId = caseSettingsService.getByCaseId(oldCaseId);
  263. if(listByCaseId == null || listByCaseId.isEmpty()){
  264. return;
  265. }
  266. for (CaseSettings entity : listByCaseId) {
  267. entity.setSettingsId(null);
  268. entity.setCaseId(newCaseId);
  269. caseSettingsService.save(entity);
  270. }
  271. }
  272. /**
  273. * 复制案件系统设置资源
  274. */
  275. private void cpCaseSettingsResource(Integer oldCaseId, Integer newCaseId) {
  276. List<CaseSettingsResource> listByCaseId = caseSettingsResourceService.getByCaseId(oldCaseId);
  277. if(listByCaseId == null || listByCaseId.isEmpty()){
  278. return;
  279. }
  280. for (CaseSettingsResource entity : listByCaseId) {
  281. entity.setId(null);
  282. entity.setCaseId(newCaseId);
  283. caseSettingsResourceService.save(entity);
  284. }
  285. }
  286. /**
  287. * 复制案件标注
  288. */
  289. private void cpCaseTag(Integer oldCaseId, Integer newCaseId, HashMap<Integer, Integer> fusionNumIdMap ) {
  290. List<CaseTag> listByCaseId = caseTagService.getListByCaseId(oldCaseId);
  291. if(listByCaseId == null || listByCaseId.isEmpty()){
  292. return;
  293. }
  294. for (CaseTag entity : listByCaseId) {
  295. Integer oldTagId =entity.getTagId();
  296. entity.setTagId(null);
  297. entity.setCaseId(newCaseId);
  298. caseTagService.save(entity);
  299. Integer newTagId = entity.getTagId();
  300. List<CaseTagPoint> caseTagPointList = caseTagPointService.getByTagId(oldTagId);
  301. if(caseTagPointList == null || caseTagPointList.isEmpty()){
  302. continue;
  303. }
  304. for (CaseTagPoint caseTagPoint : caseTagPointList) {
  305. caseTagPoint.setTagPointId(null);
  306. caseTagPoint.setTagId(newTagId);
  307. caseTagPoint.setFusionNumId(fusionNumIdMap.get(caseTagPoint.getFusionNumId()));
  308. if(StringUtils.isNotBlank(caseTagPoint.getPose())){
  309. String path = caseTagPoint.getPose();
  310. for (Integer oldId : fusionNumIdMap.keySet()) {
  311. path = path.replaceAll("\"modelId\":\""+oldId+"\"","\"modelId\":\""+fusionNumIdMap.get(oldId)+"\"");
  312. }
  313. caseTagPoint.setPose(path);
  314. }
  315. caseTagPointService.save(caseTagPoint);
  316. }
  317. }
  318. }
  319. /**
  320. * 复制案件录制视频
  321. */
  322. private void cpCaseVideo(Integer oldCaseId, Integer newCaseId) {
  323. List<CaseVideoFolder> listByCaseId = caseVideoFolderService.getAllList(oldCaseId);
  324. if(listByCaseId == null || listByCaseId.isEmpty()){
  325. return;
  326. }
  327. for (CaseVideoFolder entity : listByCaseId) {
  328. Integer oldFolderId =entity.getVideoFolderId();
  329. entity.setVideoFolderId(null);
  330. entity.setCaseId(newCaseId);
  331. caseVideoFolderService.save(entity);
  332. Integer newFolderId = entity.getVideoFolderId();
  333. if(StringUtils.isNotBlank(entity.getVideoFolderCover())){
  334. String oldVideoFolderCoverOssPath = uploadToOssUtil.getOssPath(entity.getVideoFolderCover());
  335. String newVideoFolderCover= entity.getVideoFolderCover().replace(oldFolderId+"",newFolderId+"");
  336. String newVideoFolderCoverOssPath = uploadToOssUtil.getOssPath(newVideoFolderCover);
  337. uploadToOssUtil.copyFile(oldVideoFolderCoverOssPath,newVideoFolderCoverOssPath);
  338. if(uploadToOssUtil.existKey(newVideoFolderCoverOssPath)){
  339. entity.setVideoFolderCover(newVideoFolderCover);
  340. }
  341. }
  342. if(StringUtils.isNotBlank(entity.getVideoMergeUrl())){
  343. String newVideoMergeUrl = entity.getVideoMergeUrl().replace(oldFolderId+"",newFolderId+"");
  344. String oldVideoMergeUrlOssPath = uploadToOssUtil.getOssPath(entity.getVideoMergeUrl());
  345. String newVideoMergeUrlOssPath = uploadToOssUtil.getOssPath(newVideoMergeUrl);
  346. uploadToOssUtil.copyFile(oldVideoMergeUrlOssPath,newVideoMergeUrlOssPath);
  347. if(uploadToOssUtil.existKey(newVideoMergeUrlOssPath)){
  348. entity.setVideoMergeUrl(newVideoMergeUrl);
  349. }
  350. }
  351. caseVideoFolderService.updateById(entity);
  352. List<CaseVideo> caseVideos = caseVideoService.getAllList(oldFolderId);
  353. if(caseVideos == null || caseVideos.isEmpty()){
  354. continue;
  355. }
  356. for (CaseVideo caseVideo : caseVideos) {
  357. caseVideo.setVideoId(null);
  358. caseVideo.setFolderId(newFolderId);
  359. caseVideo.setVideoPath(caseVideo.getVideoPath().replace(oldFolderId+"",newFolderId+""));
  360. caseVideoService.save(caseVideo);
  361. }
  362. }
  363. }
  364. /**
  365. * 复制案件视图提取
  366. */
  367. private void cpCaseViewByCaseId(Integer oldCaseId, Integer newCaseId) {
  368. List<CaseView> listByCaseId = caseViewService.getByCaseId(oldCaseId);
  369. if(listByCaseId == null || listByCaseId.isEmpty()){
  370. return;
  371. }
  372. for (CaseView entity : listByCaseId) {
  373. if(entity.getFusionId() != null){
  374. continue;
  375. }
  376. entity.setViewId(null);
  377. entity.setCaseId(newCaseId);
  378. caseViewService.save(entity);
  379. }
  380. }
  381. private void cpCaseViewByFusionId(Integer oldFusionId, Integer newFusionId,Integer newCaseId) {
  382. List<CaseView> listByCaseId = caseViewService.getByFusionId(oldFusionId);
  383. if(listByCaseId == null || listByCaseId.isEmpty()){
  384. return;
  385. }
  386. for (CaseView entity : listByCaseId) {
  387. entity.setViewId(null);
  388. entity.setFusionId(newFusionId+"");
  389. entity.setCaseId(newCaseId);
  390. caseViewService.save(entity);
  391. }
  392. }
  393. /**
  394. * 复制案件导览
  395. */
  396. private void cpFusionGuide(Integer oldCaseId, Integer newCaseId) {
  397. List<FusionGuide> listByCaseId = fusionGuideService.getAllList(oldCaseId);
  398. if(listByCaseId == null || listByCaseId.isEmpty()){
  399. return;
  400. }
  401. for (FusionGuide entity : listByCaseId) {
  402. Integer oldGuideId =entity.getFusionGuideId();
  403. entity.setFusionGuideId(null);
  404. entity.setCaseId(newCaseId);
  405. fusionGuideService.save(entity);
  406. Integer newGuideId = entity.getFusionGuideId();
  407. List<FusionGuidePath> listByGuideId = fusionGuidePathService.getListByGuideId(oldGuideId);
  408. if(listByGuideId == null || listByGuideId.isEmpty()){
  409. continue;
  410. }
  411. for (FusionGuidePath byId : listByGuideId) {
  412. byId.setGuidePathId(null);
  413. byId.setGuideId(newGuideId);
  414. fusionGuidePathService.save(byId);
  415. }
  416. }
  417. }
  418. /**
  419. * 复制案件编辑器ID
  420. */
  421. private void cpFusionNum(Integer oldFusionId, Integer newFusionId,HashMap<Integer,Integer> fusionNumIdMap) {
  422. List<FusionNum> listByCaseId = fusionNumService.getByFusionId(oldFusionId);
  423. if(listByCaseId == null || listByCaseId.isEmpty()){
  424. return;
  425. }
  426. for (FusionNum entity : listByCaseId) {
  427. Integer oldId = entity.getFusionNumId();
  428. entity.setFusionNumId(null);
  429. entity.setFusionId(newFusionId);
  430. fusionNumService.save(entity);
  431. fusionNumIdMap.put(oldId,entity.getFusionNumId());
  432. }
  433. }
  434. /**
  435. * 复制案件测量数据
  436. */
  437. private void cpFusionMeter(Integer oldFusionId,Integer newFusionId,HashMap<Integer,Integer> fusionNumIdMap) {
  438. List<FusionMeter> listByCaseId = fusionMeterService.getListByFusionId(oldFusionId,null);
  439. if(listByCaseId == null || listByCaseId.isEmpty()){
  440. return;
  441. }
  442. for (FusionMeter entity : listByCaseId) {
  443. entity.setFusionMeterId(null);
  444. entity.setFusionId(newFusionId);
  445. if(StringUtils.isNotBlank(entity.getPosition())){
  446. String path = entity.getPosition();
  447. for (Integer oldId : fusionNumIdMap.keySet()) {
  448. path = path.replaceAll("\"fusionNumId\":\""+oldId+"\"","\"fusionNumId\":\""+fusionNumIdMap.get(oldId)+"\"");
  449. }
  450. entity.setPosition(path);
  451. }
  452. fusionMeterService.save(entity);
  453. }
  454. }
  455. /**
  456. * 复制路线
  457. */
  458. private HashMap<Integer, Integer> cpPath(Integer oldCaseId,Integer newCaseId,HashMap<Integer, Integer> fusionNumIdMap){
  459. HashMap<Integer, Integer> pathIdMap = new HashMap<>();
  460. List<CasePath> casePaths = casePathService.getByCaseId(oldCaseId);
  461. for (CasePath casePath : casePaths) {
  462. Integer oldPathId = casePath.getId();
  463. casePath.setId(null);
  464. casePath.setCaseId(newCaseId);
  465. if(StringUtils.isNotBlank(casePath.getPath())){
  466. String path = casePath.getPath();
  467. for (Integer oldId : fusionNumIdMap.keySet()) {
  468. path = path.replaceAll("\"modelId\":\""+oldId+"\"","\"modelId\":\""+fusionNumIdMap.get(oldId)+"\"");
  469. }
  470. casePath.setPath(path);
  471. casePathService.save(casePath);
  472. }
  473. pathIdMap.put(oldPathId,casePath.getId());
  474. }
  475. return pathIdMap;
  476. }
  477. /**
  478. * 复制动画数据
  479. */
  480. private void cpAnimation(Integer oldCaseId,Integer newCaseId,HashMap<Integer, Integer> pathIdMap){
  481. List<CaseAnimation> list = caseAnimationService.getListByCaseId(oldCaseId);
  482. for (CaseAnimation caseAnimation : list) {
  483. caseAnimation.setId(null);
  484. caseAnimation.setCaseId(newCaseId);
  485. if(StringUtils.isNotBlank(caseAnimation.getPaths())){
  486. String path = caseAnimation.getPaths();
  487. for (Integer oldId : pathIdMap.keySet()) {
  488. path = path.replaceAll("\"pathId\":\""+oldId+"\"","\"pathId\":\""+pathIdMap.get(oldId)+"\"");
  489. }
  490. caseAnimation.setPaths(path);
  491. }
  492. caseAnimationService.save(caseAnimation);
  493. }
  494. }
  495. private HashMap<String,Integer> cpOverview(Integer newCaseId, Integer oldId){
  496. HashMap<String,Integer> map = new HashMap<>();
  497. CaseOverview caseOverview = caseOverviewService.getById(oldId);
  498. Integer oldOverId = caseOverview.getId();
  499. caseOverview.setId(null);
  500. caseOverview.setCaseId(newCaseId);
  501. caseOverviewService.save(caseOverview);
  502. map.put("overviewId",caseOverview.getId());
  503. List<CaseTabulation> byOverId = caseTabulationService.getByOverId(oldOverId);
  504. for (CaseTabulation caseTabulation : byOverId) {
  505. caseTabulation.setId(null);
  506. caseTabulation.setOverviewId(caseOverview.getId());
  507. caseTabulation.setCaseId(newCaseId);
  508. caseTabulationService.save(caseTabulation);
  509. map.put("tabulationId",caseTabulation.getId());
  510. }
  511. return map;
  512. }
  513. private Integer cpTabluation( Integer newCaseId,Integer oldId){
  514. CaseTabulation caseTabulation = caseTabulationService.getById(oldId);
  515. caseTabulation.setId(null);
  516. caseTabulation.setCaseId(newCaseId);
  517. caseTabulationService.save(caseTabulation);
  518. return caseTabulation.getId();
  519. }
  520. }