|
|
@@ -36,6 +36,7 @@ import org.zhongzheng.common.env.ZhongZhengConstant;
|
|
|
import org.zhongzheng.common.env.RoleConstant;
|
|
|
import org.zhongzheng.common.utils.Func;
|
|
|
import org.zhongzheng.common.feignclient.zzbusinessuser.entity.User;
|
|
|
+import org.zhongzheng.common.utils.StringUtil;
|
|
|
import org.zhongzheng.user.service.IUserService;
|
|
|
import org.zhongzheng.user.vo.UserVO;
|
|
|
import org.zhongzheng.user.wrapper.UserWrapper;
|
|
|
@@ -109,9 +110,18 @@ public class UserController {
|
|
|
public R<IPage<UserVO>> list(@ApiIgnore @RequestParam Map<String, Object> user, Query query, ZhongZhengUser zzUser) throws SQLException {
|
|
|
System.out.println("list user 1:" + user.toString());
|
|
|
QueryWrapper<User> queryWrapper = Condition.getQueryWrapper(user, User.class);
|
|
|
+
|
|
|
System.out.println("list user 2:" + query.toString());
|
|
|
System.out.println("list user 3:" + zzUser.toString());
|
|
|
- IPage<User> pages = userService.page(Condition.getPage(query), (!zzUser.getTenantId().equals(ZhongZhengConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(User::getTenantId, zzUser.getTenantId()) : queryWrapper);
|
|
|
+
|
|
|
+ String tenantId = zzUser.getTenantId();
|
|
|
+ IPage<User> pages;
|
|
|
+ if(StringUtil.isNoneBlank(tenantId)) {
|
|
|
+ pages = userService.page(Condition.getPage(query), (!tenantId.equals(ZhongZhengConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(User::getTenantId, zzUser.getTenantId()) : queryWrapper);
|
|
|
+ }else{
|
|
|
+ pages = userService.page(Condition.getPage(query), queryWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
return R.data(UserWrapper.build().pageVO(pages));
|
|
|
}
|
|
|
|
|
|
@@ -119,7 +129,7 @@ public class UserController {
|
|
|
* 新增或修改
|
|
|
*/
|
|
|
@PostMapping("/submit")
|
|
|
- @PreAuth("hasRole('administrator')")
|
|
|
+ //@PreAuth("hasRole('administrator')")
|
|
|
@ApiOperationSupport(order = 4)
|
|
|
@ApiOperation(value = "新增或修改", notes = "传入User")
|
|
|
public R submit(@Valid @RequestBody User user) {
|
|
|
@@ -143,7 +153,7 @@ public class UserController {
|
|
|
*/
|
|
|
@PostMapping("/remove")
|
|
|
@ApiOperationSupport(order = 6)
|
|
|
- @ApiOperation(value = "删除", notes = "传入地基和")
|
|
|
+ @ApiOperation(value = "删除", notes = "传入id集合: ids")
|
|
|
public R remove(@RequestParam String ids) {
|
|
|
return R.status(userService.deleteLogic(Func.toLongList(ids)));
|
|
|
}
|