Commit 8009f19e by 李小龙

fixbug:首页养老院选择去掉认证校验

parent a8a6301a
...@@ -7,6 +7,7 @@ import com.makeit.common.page.PageVO; ...@@ -7,6 +7,7 @@ import com.makeit.common.page.PageVO;
import com.makeit.common.response.ApiResponseEntity; import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils; import com.makeit.common.response.ApiResponseUtils;
import com.makeit.entity.saas.PlatTenant; import com.makeit.entity.saas.PlatTenant;
import com.makeit.global.annotation.AuthIgnore;
import com.makeit.module.admin.dto.plat.PlatTenantDTOVO; import com.makeit.module.admin.dto.plat.PlatTenantDTOVO;
import com.makeit.module.admin.vo.plat.PlatTenantVO; import com.makeit.module.admin.vo.plat.PlatTenantVO;
import com.makeit.service.saas.PlatTenantService; import com.makeit.service.saas.PlatTenantService;
...@@ -53,14 +54,16 @@ public class PlatTenantChildrenController { ...@@ -53,14 +54,16 @@ public class PlatTenantChildrenController {
@ApiOperation("分页列表(AuthIgnore)") @ApiOperation("分页列表(AuthIgnore)")
@PostMapping("pageAuthIgnore") @PostMapping("pageAuthIgnore")
@AuthIgnore
public ApiResponseEntity<PageVO<PlatTenantVO>> pageAuthIgnore(@RequestBody PageReqDTO<PlatTenantVO> page){ public ApiResponseEntity<PageVO<PlatTenantVO>> pageAuthIgnore(@RequestBody PageReqDTO<PlatTenantVO> page){
return ApiResponseUtils.success(platTenantService.page(page)); return ApiResponseUtils.success(platTenantService.pageAuthIgnore(page));
} }
@ApiOperation("列表(AuthIgnore)") @ApiOperation("列表(AuthIgnore)")
@PostMapping("listAuthIgnore") @PostMapping("listAuthIgnore")
@AuthIgnore
public ApiResponseEntity<List<PlatTenant>> listAuthIgnore(@RequestBody PlatTenantVO dto){ public ApiResponseEntity<List<PlatTenant>> listAuthIgnore(@RequestBody PlatTenantVO dto){
return ApiResponseUtils.success(platTenantService.list(dto)); return ApiResponseUtils.success(platTenantService.listAuthIgnore(dto));
} }
@ApiOperation("列表 根据账号精确查询") @ApiOperation("列表 根据账号精确查询")
......
...@@ -21,6 +21,10 @@ public interface PlatTenantService extends IService<PlatTenant> { ...@@ -21,6 +21,10 @@ public interface PlatTenantService extends IService<PlatTenant> {
List<PlatTenant> list(PlatTenantVO dto); List<PlatTenant> list(PlatTenantVO dto);
PageVO<PlatTenantVO> pageAuthIgnore(PageReqDTO<PlatTenantVO> page);
List<PlatTenant> listAuthIgnore(PlatTenantVO dto);
List<PlatTenant> listByUserIdAndAccount(PlatTenantVO dto); List<PlatTenant> listByUserIdAndAccount(PlatTenantVO dto);
String add(PlatTenantDTOVO dto); String add(PlatTenantDTOVO dto);
......
...@@ -106,6 +106,27 @@ public class PlatTenantServiceImpl extends ServiceImpl<PlatTenantMapper, PlatTen ...@@ -106,6 +106,27 @@ public class PlatTenantServiceImpl extends ServiceImpl<PlatTenantMapper, PlatTen
return lambdaQueryWrapper; return lambdaQueryWrapper;
} }
private LambdaQueryWrapper<PlatTenant> listLambdaQueryWrapperAuthIgnore(PlatTenantVO dto, boolean userAccountLike) {
List<String> tenantUserIdList = new ArrayList<>(10);
tenantUserIdList.add(-1 + "");
if (StringUtils.isNotBlank(dto.getUserAccount())) {
List<PlatUser> tntUserList = platUserService.list(new QueryWrapper<PlatUser>().lambda()
.like(userAccountLike, PlatUser::getAccount, dto.getUserAccount())
.eq(!userAccountLike, PlatUser::getAccount, dto.getUserAccount())
.eq(PlatUser::getIsTenant, IsTenantAccountEnum.YES.getValue())
);
tenantUserIdList.addAll(StreamUtil.map(tntUserList, PlatUser::getId));
}
LambdaQueryWrapper<PlatTenant> lambdaQueryWrapper = new QueryWrapper<PlatTenant>().lambda()
.like(StringUtils.isNotBlank(dto.getName()), PlatTenant::getName, dto.getName())
.eq(StringUtils.isNotBlank(dto.getStatus()), PlatTenant::getStatus, dto.getStatus())
.in(StringUtils.isNotBlank(dto.getUserAccount()), PlatTenant::getPlatUserId, tenantUserIdList)
;
lambdaQueryWrapper.orderByDesc(PlatTenant::getCreateDate);
return lambdaQueryWrapper;
}
@Override @Override
public List<PlatTenant> list(PlatTenantVO dto) { public List<PlatTenant> list(PlatTenantVO dto) {
LambdaQueryWrapper<PlatTenant> lambdaQueryWrapper = listLambdaQueryWrapper(dto, true); LambdaQueryWrapper<PlatTenant> lambdaQueryWrapper = listLambdaQueryWrapper(dto, true);
...@@ -114,6 +135,13 @@ public class PlatTenantServiceImpl extends ServiceImpl<PlatTenantMapper, PlatTen ...@@ -114,6 +135,13 @@ public class PlatTenantServiceImpl extends ServiceImpl<PlatTenantMapper, PlatTen
} }
@Override @Override
public List<PlatTenant> listAuthIgnore(PlatTenantVO dto) {
LambdaQueryWrapper<PlatTenant> lambdaQueryWrapper = listLambdaQueryWrapperAuthIgnore(dto, true);
List<PlatTenant> tntTenantList = list(lambdaQueryWrapper);
return tntTenantList;
}
@Override
public List<PlatTenant> listByUserIdAndAccount(PlatTenantVO dto) { public List<PlatTenant> listByUserIdAndAccount(PlatTenantVO dto) {
LambdaQueryWrapper<PlatTenant> lambdaQueryWrapper = listLambdaQueryWrapper(dto, false); LambdaQueryWrapper<PlatTenant> lambdaQueryWrapper = listLambdaQueryWrapper(dto, false);
List<PlatTenant> tntTenantList = list(lambdaQueryWrapper); List<PlatTenant> tntTenantList = list(lambdaQueryWrapper);
...@@ -142,6 +170,28 @@ public class PlatTenantServiceImpl extends ServiceImpl<PlatTenantMapper, PlatTen ...@@ -142,6 +170,28 @@ public class PlatTenantServiceImpl extends ServiceImpl<PlatTenantMapper, PlatTen
return PageUtil.toPageVO(voList, pageList); return PageUtil.toPageVO(voList, pageList);
} }
@Override
public PageVO<PlatTenantVO> pageAuthIgnore(PageReqDTO<PlatTenantVO> page) {
PlatTenantVO dto = page.getData();
Page<PlatTenant> p = PageUtil.toMpPage(page);
LambdaQueryWrapper<PlatTenant> lambdaQueryWrapper = listLambdaQueryWrapperAuthIgnore(dto, true);
Page<PlatTenant> pageList = page(p, lambdaQueryWrapper);
List<PlatTenantVO> voList = BeanDtoVoUtils.listVo(pageList.getRecords(), PlatTenantVO.class);
TntUserJoinUtil.join(platUserService, voList, qw -> qw.eq(PlatUser::getIsTenant, IsTenantAccountEnum.YES.getValue()),
PlatTenantVO::getPlatUserId, (t, u) -> {
t.setUserAccount(u.getAccount());
t.setUserName(u.getUsername());
}, BaseEntity::getId);
return PageUtil.toPageVO(voList, pageList);
}
private void checkName(PlatTenantDTOVO dto) { private void checkName(PlatTenantDTOVO dto) {
PlatTenant tntTenant = getOne( PlatTenant tntTenant = getOne(
new QueryWrapper<PlatTenant>().lambda() new QueryWrapper<PlatTenant>().lambda()
......
...@@ -125,7 +125,7 @@ interceptor: ...@@ -125,7 +125,7 @@ interceptor:
authorizationSaasPathIgnore: /saas/login/login authorizationSaasPathIgnore: /saas/login/login
authenticationWechatPath: /children/**,/wechat/** authenticationWechatPath: /children/**,/wechat/**
authenticationWechatPathIgnore: /children/login/login,/wechat/plat/login/login authenticationWechatPathIgnore: /children/login/login,/wechat/plat/login/login,/children/tenant/pageAuthIgnore,/children/tenant/listAuthIgnore
sign: sign:
flag: true flag: true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment