|
|
@@ -59,16 +59,19 @@ public class DomainSecondController extends BaseController<DomainSecond> {
|
|
|
}
|
|
|
return AjaxResult.success(res);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
@PostMapping("/delPro")
|
|
|
public Object deletePro(@Valid @RequestBody DelHandle<DomainSecond> delHandle,@AuthUser User authUser, BindingResult bindingResult) {
|
|
|
- if (bindingResult.hasErrors()) {
|
|
|
+ if (bindingResult.hasErrors()){
|
|
|
return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
|
|
|
}
|
|
|
- QueryWrapper<DomainSecond> QueryWrapper = new QueryWrapper<>();
|
|
|
+ QueryWrapper<DomainSecond> queryWrapper = new QueryWrapper<>();
|
|
|
String[] ids = delHandle.getIds().split(",");
|
|
|
- QueryWrapper.in("id", ids);
|
|
|
- this.delRedis(ids,authUser.getDepartment());
|
|
|
- boolean res = service.remove(QueryWrapper);
|
|
|
+ queryWrapper.in("id", ids);
|
|
|
+ List<DomainSecond> delList = domainSecondService.list(queryWrapper);
|
|
|
+ this.delRedis(delList);
|
|
|
+ boolean res = service.remove(queryWrapper);
|
|
|
if (!res) {
|
|
|
return AjaxResult.error("删除失败");
|
|
|
}
|
|
|
@@ -96,10 +99,10 @@ public class DomainSecondController extends BaseController<DomainSecond> {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- public Boolean delRedis(String[] ids,String deptId){
|
|
|
- List<DomainSecond> list = domainSecondService.list(new QueryWrapper<DomainSecond>().in("id",ids));
|
|
|
- for (DomainSecond domainSecond : list){
|
|
|
- stringRedisTemplate.opsForSet().remove(RedisKey.PanSecondDomainList+deptId,domainSecond.getDomain());
|
|
|
+ public Boolean delRedis(List<DomainSecond> delList){
|
|
|
+// List<DomainSecond> list = domainSecondService.list(new QueryWrapper<DomainSecond>().in("id",ids));
|
|
|
+ for (DomainSecond domainSecond : delList){
|
|
|
+ stringRedisTemplate.opsForSet().remove(RedisKey.PanSecondDomainList+domainSecond.getDeptId(),domainSecond.getDomain());
|
|
|
}
|
|
|
return true;
|
|
|
}
|