|
|
@@ -7,13 +7,11 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.fdkankan.manage.common.PageInfo;
|
|
|
import com.fdkankan.manage.common.ResultCode;
|
|
|
-import com.fdkankan.manage.entity.FeedbackOption;
|
|
|
-import com.fdkankan.manage.entity.SysUser;
|
|
|
+import com.fdkankan.manage.entity.*;
|
|
|
import com.fdkankan.manage.exception.BusinessException;
|
|
|
import com.fdkankan.manage.mapper.IFeedbackOptionMapper;
|
|
|
-import com.fdkankan.manage.service.IFeedbackOptionService;
|
|
|
+import com.fdkankan.manage.service.*;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.fdkankan.manage.service.ISysUserService;
|
|
|
import com.fdkankan.manage.vo.request.FeedbackOptionParam;
|
|
|
import com.fdkankan.manage.vo.response.CaseVo;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
@@ -103,6 +101,14 @@ public class FeedbackOptionServiceImpl extends ServiceImpl<IFeedbackOptionMapper
|
|
|
this.updateById(feedbackOption);
|
|
|
}
|
|
|
|
|
|
+ @Autowired
|
|
|
+ ICaseService caseService;
|
|
|
+ @Autowired
|
|
|
+ ISceneProService sceneProService;
|
|
|
+ @Autowired
|
|
|
+ IScenePlusService scenePlusService;
|
|
|
+ @Autowired
|
|
|
+ ICameraDetailService cameraDetailService;
|
|
|
@Override
|
|
|
public void delete(FeedbackOption param) {
|
|
|
if(param.getId() == null){
|
|
|
@@ -113,6 +119,49 @@ public class FeedbackOptionServiceImpl extends ServiceImpl<IFeedbackOptionMapper
|
|
|
throw new BusinessException(ResultCode.FEEDBACK_OPTION_DELETE_ERROR);
|
|
|
}
|
|
|
this.removeById(param.getId());
|
|
|
+
|
|
|
+ LambdaQueryWrapper<FeedbackOption> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.like(FeedbackOption::getAiOption,param.getId());
|
|
|
+ List<FeedbackOption> list = this.list(wrapper);
|
|
|
+ for (FeedbackOption option : list) {
|
|
|
+ JSONArray aiOption = option.getAiOption();
|
|
|
+ aiOption.removeAll(Arrays.asList(param.getId()));
|
|
|
+ aiOption.removeAll(Arrays.asList(String.valueOf(param.getId())));
|
|
|
+
|
|
|
+ LambdaUpdateWrapper<FeedbackOption> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper.eq(FeedbackOption::getId,option.getId());
|
|
|
+ updateWrapper.set(FeedbackOption::getAiOption,aiOption);
|
|
|
+ this.update(updateWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ LambdaQueryWrapper<Case> wrapper2 = new LambdaQueryWrapper<>();
|
|
|
+ wrapper2.like(Case::getFeedbackOptionIds,param.getId());
|
|
|
+ List<Case> list2 = caseService.list(wrapper2);
|
|
|
+ for (Case option : list2) {
|
|
|
+ JSONArray aiOption = option.getFeedbackOptionIds();
|
|
|
+ aiOption.removeAll(Arrays.asList(param.getId()));
|
|
|
+ aiOption.removeAll(Arrays.asList(String.valueOf(param.getId())));
|
|
|
+
|
|
|
+ LambdaUpdateWrapper<Case> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper.eq(Case::getId,option.getId());
|
|
|
+ updateWrapper.set(Case::getFeedbackOptionIds,aiOption);
|
|
|
+ caseService.update(updateWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ LambdaUpdateWrapper<ScenePro> sw = new LambdaUpdateWrapper<>();
|
|
|
+ sw.eq(ScenePro::getFeedbackOptionId,param.getId());
|
|
|
+ sw.set(ScenePro::getFeedbackOptionId,null);
|
|
|
+ sceneProService.update(sw);
|
|
|
+
|
|
|
+ LambdaUpdateWrapper<ScenePlus> sw2 = new LambdaUpdateWrapper<>();
|
|
|
+ sw2.eq(ScenePlus::getFeedbackOptionId,param.getId());
|
|
|
+ sw2.set(ScenePlus::getFeedbackOptionId,null);
|
|
|
+ scenePlusService.update(sw2);
|
|
|
+
|
|
|
+ LambdaUpdateWrapper<CameraDetail> sw3 = new LambdaUpdateWrapper<>();
|
|
|
+ sw3.eq(CameraDetail::getFeedbackOptionId,param.getId());
|
|
|
+ sw3.set(CameraDetail::getFeedbackOptionId,null);
|
|
|
+ cameraDetailService.update(sw3);
|
|
|
}
|
|
|
|
|
|
@Override
|