|
|
@@ -70,6 +70,190 @@ public class TaskService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ updateFusion();
|
|
|
+ updateCaseSetting();
|
|
|
+ updateHotIcon();
|
|
|
+ updateCaseTag();
|
|
|
+ updateGuide();
|
|
|
+ updatePath();
|
|
|
+ updateAnimation();
|
|
|
+ updateImg();
|
|
|
+ updateImgTag();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void updateImg() {
|
|
|
+ LambdaQueryWrapper<CaseImg> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.isNull(CaseImg::getParentId);
|
|
|
+ wrapper.eq(CaseImg::getType,0);
|
|
|
+ List<CaseImg> list = caseImgService.list();
|
|
|
+ if(list.isEmpty()){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ for (CaseImg caseImg : list) {
|
|
|
+ List<CaseImg> caseImgList = caseImgService.getByCaseId(caseImg.getCaseId(), 1);
|
|
|
+ if(caseImgList.isEmpty()){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ CaseImg parent = caseImgList.get(0);
|
|
|
+ caseImg.setParentId(parent.getId());
|
|
|
+ caseImgService.updateById(caseImg);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void updateImgTag() {
|
|
|
+
|
|
|
+ LambdaQueryWrapper<CaseImgTag> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.isNull(CaseImgTag::getImgId);
|
|
|
+ List<CaseImgTag> list2 = caseImgTagService.list(wrapper);
|
|
|
+ if(list2.isEmpty()){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ for (CaseImgTag caseImgTag : list2) {
|
|
|
+ List<CaseImg> caseImgList = caseImgService.getByCaseId(caseImgTag.getCaseId(), 1);
|
|
|
+ if(caseImgList.isEmpty()){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ CaseImg caseImg = caseImgList.get(0);
|
|
|
+ caseImgTag.setImgId(caseImg.getId());
|
|
|
+ caseImgTagService.updateById(caseImgTag);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void updateFusion(){
|
|
|
+ List<CaseFusion> list = caseFusionService.list();
|
|
|
+ List<CaseFusion> collect = list.stream().filter(e -> e.getSysUserId() == null).collect(Collectors.toList());
|
|
|
+ for (CaseFusion caseFusion : collect) {
|
|
|
+ CaseEntity caseEntity = caseService.getById(caseFusion.getCaseId());
|
|
|
+ if(caseEntity != null){
|
|
|
+ caseFusion.setFusionTitle(caseEntity.getCaseTitle());
|
|
|
+ caseFusion.setLatAndLong(caseEntity.getLatAndLong());
|
|
|
+ TmUser tmUser = tmUserService.getByUserName(caseEntity.getUserName());
|
|
|
+ if(tmUser != null){
|
|
|
+ caseFusion.setSysUserId(tmUser.getId());
|
|
|
+ }
|
|
|
+ caseFusionService.updateById(caseFusion);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<CaseFusion> collect1 = list.stream().filter(e -> e.getCaseId() != null).collect(Collectors.toList());
|
|
|
+ for (CaseFusion caseFusion : collect1) {
|
|
|
+ List<CaseFusionRelation> caseFusionRelations = caseFusionRelationService.getByCaseId(caseFusion.getCaseId());
|
|
|
+ if(caseFusionRelations == null || caseFusionRelations.isEmpty()){
|
|
|
+ CaseFusionRelation caseFusionRelation = new CaseFusionRelation();
|
|
|
+ caseFusionRelation.setCaseId(caseFusion.getCaseId());
|
|
|
+ caseFusionRelation.setFusionId(caseFusion.getFusionId());
|
|
|
+ caseFusionRelationService.save(caseFusionRelation);
|
|
|
+ }
|
|
|
+ LambdaUpdateWrapper<CaseFusion> wrapper = new LambdaUpdateWrapper<>();
|
|
|
+ wrapper.eq(CaseFusion::getFusionId,caseFusion.getFusionId());
|
|
|
+ wrapper.set(CaseFusion::getCaseId,null);
|
|
|
+ caseFusionService.update(wrapper);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ ICaseFilesTypeService caseFilesTypeService;
|
|
|
+ @Autowired
|
|
|
+ IHotIconService hotIconService;
|
|
|
+ @Autowired
|
|
|
+ IDictService dictService;
|
|
|
+ @Autowired
|
|
|
+ ICommonUploadService commonUploadService;
|
|
|
+ @Autowired
|
|
|
+ IDictFileService dictFileService;
|
|
|
+
|
|
|
+
|
|
|
+ private void updateCaseSetting() {
|
|
|
+ List<CaseSettings> list = caseSettingsService.list();
|
|
|
+ List<CaseSettings> collect = list.stream().filter(e -> e.getFusionId() == null).collect(Collectors.toList());
|
|
|
+ for (CaseSettings caseSettings : collect) {
|
|
|
+ List<CaseFusion> listByCaseId = caseFusionService.getListByCaseId(caseSettings.getCaseId());
|
|
|
+ if(!listByCaseId.isEmpty()){
|
|
|
+ LambdaUpdateWrapper<CaseSettings> wrapper = new LambdaUpdateWrapper<>();
|
|
|
+ wrapper.eq(CaseSettings::getSettingsId,caseSettings.getSettingsId());
|
|
|
+ wrapper.set(CaseSettings::getFusionId,listByCaseId.get(0).getFusionId());
|
|
|
+ caseSettingsService.update(wrapper);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void updateHotIcon() {
|
|
|
+ List<HotIcon> list = hotIconService.list();
|
|
|
+ List<HotIcon> collect = list.stream().filter(e -> e.getFusionId() == null).collect(Collectors.toList());
|
|
|
+ for (HotIcon entity : collect) {
|
|
|
+ List<CaseFusion> listByCaseId = caseFusionService.getListByCaseId(entity.getCaseId());
|
|
|
+ if(!listByCaseId.isEmpty()){
|
|
|
+ LambdaUpdateWrapper<HotIcon> wrapper = new LambdaUpdateWrapper<>();
|
|
|
+ wrapper.eq(HotIcon::getIconId,entity.getIconId());
|
|
|
+ wrapper.set(HotIcon::getFusionId,listByCaseId.get(0).getFusionId());
|
|
|
+ hotIconService.update(wrapper);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ @Autowired
|
|
|
+ ICaseTagService caseTagService;
|
|
|
+ private void updateCaseTag() {
|
|
|
+ List<CaseTag> list = caseTagService.list();
|
|
|
+ List<CaseTag> collect = list.stream().filter(e -> e.getFusionId() == null).collect(Collectors.toList());
|
|
|
+ for (CaseTag entity : collect) {
|
|
|
+ List<CaseFusion> listByCaseId = caseFusionService.getListByCaseId(entity.getCaseId());
|
|
|
+ if(!listByCaseId.isEmpty()){
|
|
|
+ LambdaUpdateWrapper<CaseTag> wrapper = new LambdaUpdateWrapper<>();
|
|
|
+ wrapper.eq(CaseTag::getTagId,entity.getTagId());
|
|
|
+ wrapper.set(CaseTag::getFusionId,listByCaseId.get(0).getFusionId());
|
|
|
+ caseTagService.update(wrapper);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ IFusionGuideService fusionGuideService;
|
|
|
+ private void updateGuide() {
|
|
|
+ List<FusionGuide> list = fusionGuideService.list();
|
|
|
+ List<FusionGuide> collect = list.stream().filter(e -> e.getFusionId() == null).collect(Collectors.toList());
|
|
|
+ for (FusionGuide entity : collect) {
|
|
|
+ List<CaseFusion> listByCaseId = caseFusionService.getListByCaseId(entity.getCaseId());
|
|
|
+ if(!listByCaseId.isEmpty()){
|
|
|
+ LambdaUpdateWrapper<FusionGuide> wrapper = new LambdaUpdateWrapper<>();
|
|
|
+ wrapper.eq(FusionGuide::getFusionGuideId,entity.getFusionGuideId());
|
|
|
+ wrapper.set(FusionGuide::getFusionId,listByCaseId.get(0).getFusionId());
|
|
|
+ fusionGuideService.update(wrapper);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ ICasePathService casePathService;
|
|
|
+ private void updatePath() {
|
|
|
+ List<CasePath> list = casePathService.list();
|
|
|
+ List<CasePath> collect = list.stream().filter(e -> e.getFusionId() == null).collect(Collectors.toList());
|
|
|
+ for (CasePath entity : collect) {
|
|
|
+ List<CaseFusion> listByCaseId = caseFusionService.getListByCaseId(entity.getCaseId());
|
|
|
+ if(!listByCaseId.isEmpty()){
|
|
|
+ LambdaUpdateWrapper<CasePath> wrapper = new LambdaUpdateWrapper<>();
|
|
|
+ wrapper.eq(CasePath::getId,entity.getId());
|
|
|
+ wrapper.set(CasePath::getFusionId,listByCaseId.get(0).getFusionId());
|
|
|
+ casePathService.update(wrapper);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ ICaseAnimationService caseAnimationService;
|
|
|
+ private void updateAnimation() {
|
|
|
+ List<CaseAnimation> list = caseAnimationService.list();
|
|
|
+ List<CaseAnimation> collect = list.stream().filter(e -> e.getFusionId() == null).collect(Collectors.toList());
|
|
|
+ for (CaseAnimation entity : collect) {
|
|
|
+ List<CaseFusion> listByCaseId = caseFusionService.getListByCaseId(entity.getCaseId());
|
|
|
+ if(!listByCaseId.isEmpty()){
|
|
|
+ LambdaUpdateWrapper<CaseAnimation> wrapper = new LambdaUpdateWrapper<>();
|
|
|
+ wrapper.eq(CaseAnimation::getId,entity.getId());
|
|
|
+ wrapper.set(CaseAnimation::getFusionId,listByCaseId.get(0).getFusionId());
|
|
|
+ caseAnimationService.update(wrapper);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|