feat:merge master to REQ-2750

This commit is contained in:
lilong 2024-09-20 11:32:00 +08:00
parent 6235f4a801
commit c4e37637da
8 changed files with 23 additions and 14 deletions

View File

@ -162,4 +162,7 @@ public class ListRoleReq {
*/
@CriteriaField(field = "productUnitType", operator = Operator.IN)
private Set<Integer> productUnitTypes;
@CriteriaField(field = "roleType", operator = Operator.NOT_IN)
private List<String> roleTypesNotIn;
}

View File

@ -680,7 +680,7 @@ public class PrivateController {
* @throws Exception
*/
@PostMapping("/api/private/rolePermission/store")
public Object storeRolePermission(@RequestBody RoleService.ListSaasRoleParam request) throws Exception {
public Object storeRolePermission(@RequestBody ListRoleReq request) throws Exception {
cacheRolePermissionJob.execute(JSON.toJSONString(request));
return "ok";
}
@ -716,7 +716,7 @@ public class PrivateController {
* @throws Exception
*/
@PostMapping("/api/private/roleSaasFeature/store")
public Object storeRoleSaasFeature(@RequestBody RoleService.PageSaasRoleParam request) throws Exception {
public Object storeRoleSaasFeature(@RequestBody ListRoleReq request) throws Exception {
cacheRoleFeatureResourceJob.execute(JSON.toJSONString(request));
return "ok";
}

View File

@ -3,6 +3,7 @@ package cn.axzo.tyr.server.event.inner;
import cn.axzo.framework.rocketmq.Event;
import cn.axzo.framework.rocketmq.EventConsumer;
import cn.axzo.tyr.client.common.enums.RoleTypeEnum;
import cn.axzo.tyr.client.model.req.ListRoleReq;
import cn.axzo.tyr.client.model.res.SaasRoleRes;
import cn.axzo.tyr.server.event.payload.PageElementFeatureResourceUpsertPayload;
import cn.axzo.tyr.server.event.payload.RolePermissionCreatedPayload;
@ -44,7 +45,7 @@ public class CacheRolePermissionHandler implements InitializingBean {
// return;
// }
RoleService.ListSaasRoleParam listSaasRoleParam = RoleService.ListSaasRoleParam.builder()
ListRoleReq listSaasRoleParam = ListRoleReq.builder()
.roleIds(Optional.ofNullable(payload.getRoleIds())
.map(Lists::newArrayList)
.orElse(null))
@ -72,7 +73,7 @@ public class CacheRolePermissionHandler implements InitializingBean {
return;
}
RoleService.ListSaasRoleParam listSaasRoleParam = RoleService.ListSaasRoleParam.builder()
ListRoleReq listSaasRoleParam = ListRoleReq.builder()
.roleTypesNotIn(RoleTypeEnum.listAdmin())
.build();
Set<Long> roleIds = roleService.list(listSaasRoleParam).stream()

View File

@ -3,6 +3,7 @@ package cn.axzo.tyr.server.event.inner;
import cn.axzo.framework.rocketmq.Event;
import cn.axzo.framework.rocketmq.EventConsumer;
import cn.axzo.tyr.client.common.enums.RoleTypeEnum;
import cn.axzo.tyr.client.model.req.ListRoleReq;
import cn.axzo.tyr.client.model.res.SaasRoleRes;
import cn.axzo.tyr.server.event.payload.PageElementFeatureResourceUpsertPayload;
import cn.axzo.tyr.server.event.payload.RolePermissionCreatedPayload;
@ -45,7 +46,7 @@ public class CacheRoleSaasFeatureResourceHandler implements InitializingBean {
// return;
// }
RoleService.ListSaasRoleParam listSaasRoleParam = RoleService.ListSaasRoleParam.builder()
ListRoleReq listSaasRoleParam = ListRoleReq.builder()
.roleIds(Optional.ofNullable(payload.getRoleIds())
.map(Lists::newArrayList)
.orElse(null))
@ -73,7 +74,7 @@ public class CacheRoleSaasFeatureResourceHandler implements InitializingBean {
return;
}
RoleService.ListSaasRoleParam listSaasRoleParam = RoleService.ListSaasRoleParam.builder()
ListRoleReq listSaasRoleParam = ListRoleReq.builder()
.roleTypesNotIn(RoleTypeEnum.listAdmin())
.build();

View File

@ -1,6 +1,7 @@
package cn.axzo.tyr.server.job;
import cn.axzo.tyr.client.common.enums.RoleTypeEnum;
import cn.axzo.tyr.client.model.req.ListRoleReq;
import cn.axzo.tyr.client.model.res.SaasRoleRes;
import cn.axzo.tyr.server.service.RoleSaasFeatureResourceCacheService;
import cn.axzo.tyr.server.service.RoleService;
@ -31,9 +32,9 @@ public class CacheRoleFeatureResourceJob extends IJobHandler {
public ReturnT<String> execute(String s) throws Exception {
log.info("start CacheRoleFeatureResourceJob, s:{}", s);
RoleService.ListSaasRoleParam listSaasRoleParam = Optional.ofNullable(s)
.map(e -> JSONObject.parseObject(e, RoleService.ListSaasRoleParam.class))
.orElseGet(() -> RoleService.ListSaasRoleParam.builder().build());
ListRoleReq listSaasRoleParam = Optional.ofNullable(s)
.map(e -> JSONObject.parseObject(e, ListRoleReq.class))
.orElseGet(() -> ListRoleReq.builder().build());
listSaasRoleParam.setRoleTypesNotIn(RoleTypeEnum.listAdmin());
Set<Long> roleIds = roleService.list(listSaasRoleParam).stream()

View File

@ -1,6 +1,7 @@
package cn.axzo.tyr.server.job;
import cn.axzo.tyr.client.common.enums.RoleTypeEnum;
import cn.axzo.tyr.client.model.req.ListRoleReq;
import cn.axzo.tyr.client.model.res.SaasRoleRes;
import cn.axzo.tyr.server.service.RolePermissionCacheService;
import cn.axzo.tyr.server.service.RoleService;
@ -32,9 +33,9 @@ public class CacheRolePermissionJob extends IJobHandler {
public ReturnT<String> execute(String s) throws Exception {
log.info("start CacheRolePermissionJob, s:{}", s);
RoleService.ListSaasRoleParam listSaasRoleParam = Optional.ofNullable(s)
.map(e -> JSONObject.parseObject(e, RoleService.ListSaasRoleParam.class))
.orElseGet(() -> RoleService.ListSaasRoleParam.builder().build());
ListRoleReq listSaasRoleParam = Optional.ofNullable(s)
.map(e -> JSONObject.parseObject(e, ListRoleReq.class))
.orElseGet(() -> ListRoleReq.builder().build());
listSaasRoleParam.setRoleTypesNotIn(RoleTypeEnum.listAdmin());

View File

@ -1,6 +1,7 @@
package cn.axzo.tyr.server.service.impl;
import cn.axzo.basics.common.exception.ServiceException;
import cn.axzo.tyr.client.model.req.ListRoleReq;
import cn.axzo.tyr.client.model.req.PageSaasFeatureResourceReq;
import cn.axzo.tyr.client.model.res.SaasFeatureResourceResp;
import cn.axzo.tyr.client.model.res.SaasPermissionRelationRes;
@ -111,7 +112,7 @@ public class RolePermissionCacheServiceImpl implements RolePermissionCacheServic
}
private Map<Long, List<PermissionDTO>> listRolePermission(List<Long> roleIds) {
RoleService.ListSaasRoleParam listSaasRoleParam = RoleService.ListSaasRoleParam.builder()
ListRoleReq listSaasRoleParam = ListRoleReq.builder()
.roleIds(roleIds)
.needPermissionRelation(true)
.build();

View File

@ -2,6 +2,7 @@ package cn.axzo.tyr.server.service.impl;
import cn.axzo.basics.common.exception.ServiceException;
import cn.axzo.tyr.client.common.enums.FeatureResourceType;
import cn.axzo.tyr.client.model.req.ListRoleReq;
import cn.axzo.tyr.client.model.req.PageSaasFeatureResourceReq;
import cn.axzo.tyr.client.model.res.SaasFeatureResourceResp;
import cn.axzo.tyr.client.model.res.SaasPermissionRelationRes;
@ -116,7 +117,7 @@ public class RoleSaasFeatureResourceCacheServiceImpl implements RoleSaasFeatureR
return Collections.emptyMap();
}
RoleService.ListSaasRoleParam listSaasRoleParam = RoleService.ListSaasRoleParam.builder()
ListRoleReq listSaasRoleParam = ListRoleReq.builder()
.roleIds(roleIds)
.needPermissionRelation(true)
.type(NEW_FEATURE)