傅行帆 5 年前
父节点
当前提交
fe9a0fc282
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6
    3
      src/main/java/com/huiju/estateagents/controller/TaRoleController.java

+ 6
- 3
src/main/java/com/huiju/estateagents/controller/TaRoleController.java 查看文件

5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.huiju.estateagents.base.BaseController;
6
 import com.huiju.estateagents.base.BaseController;
7
 import com.huiju.estateagents.base.ResponseBean;
7
 import com.huiju.estateagents.base.ResponseBean;
8
+import com.huiju.estateagents.common.CommConstant;
8
 import com.huiju.estateagents.entity.TaRole;
9
 import com.huiju.estateagents.entity.TaRole;
9
 import com.huiju.estateagents.service.ITaRoleService;
10
 import com.huiju.estateagents.service.ITaRoleService;
10
 import org.slf4j.Logger;
11
 import org.slf4j.Logger;
49
 		    IPage<TaRole> pg = new Page<>(pageNum, pageSize);
50
 		    IPage<TaRole> pg = new Page<>(pageNum, pageSize);
50
             QueryWrapper<TaRole> queryWrapper = new QueryWrapper<>();
51
             QueryWrapper<TaRole> queryWrapper = new QueryWrapper<>();
51
             queryWrapper.eq("org_id",orgId);
52
             queryWrapper.eq("org_id",orgId);
53
+            queryWrapper.eq("status", CommConstant.STATUS_NORMAL);
52
             queryWrapper.orderByDesc("create_date");
54
             queryWrapper.orderByDesc("create_date");
53
 
55
 
54
             IPage<TaRole> result = iTaRoleService.page(pg, queryWrapper);
56
             IPage<TaRole> result = iTaRoleService.page(pg, queryWrapper);
141
     }
143
     }
142
 
144
 
143
     /**
145
     /**
144
-     * 修改角色状态--停用
146
+     * 修改角色状态--删除
145
      * @param id
147
      * @param id
146
      * @return
148
      * @return
147
      */
149
      */
150
         ResponseBean responseBean = new ResponseBean();
152
         ResponseBean responseBean = new ResponseBean();
151
         TaRole taRole = new TaRole();
153
         TaRole taRole = new TaRole();
152
         taRole = iTaRoleService.getById(id);
154
         taRole = iTaRoleService.getById(id);
153
-        taRole.setStatus(taRole.getStatus().equals(0)?1:0);
154
-        iTaRoleService.updateById(taRole);
155
+        if (null != taRole){
156
+            iTaRoleService.removeById(id);
157
+        }
155
         return responseBean;
158
         return responseBean;
156
     }
159
     }
157
 
160