Merge remote-tracking branch 'origin/feature/REQ-1102' into feature/REQ-1102
This commit is contained in:
commit
109d244510
@ -1,9 +1,6 @@
|
|||||||
package cn.axzo.tyr.client.model.product;
|
package cn.axzo.tyr.client.model.product;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import org.hibernate.validator.constraints.Length;
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
@ -39,6 +36,11 @@ public class ProductAddReq {
|
|||||||
@NotNull(message = "工作台类型不能为空")
|
@NotNull(message = "工作台类型不能为空")
|
||||||
private Long dictWorkspaceTypeId;
|
private Long dictWorkspaceTypeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品所属工作台类型
|
||||||
|
*/
|
||||||
|
private String dictWorkspaceTypeCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上下架状态 1:上架, 0:下架
|
* 上下架状态 1:上架, 0:下架
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -40,6 +40,11 @@ public class ProductUpdateReq {
|
|||||||
*/
|
*/
|
||||||
private Long dictWorkspaceTypeId;
|
private Long dictWorkspaceTypeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品所属工作台类型 Code
|
||||||
|
*/
|
||||||
|
private String dictWorkspaceTypeCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上下架状态 1:上架, 0:下架
|
* 上下架状态 1:上架, 0:下架
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -38,6 +38,11 @@ public class ProductVO {
|
|||||||
*/
|
*/
|
||||||
private Long dictWorkspaceTypeId;
|
private Long dictWorkspaceTypeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品所属工作台类型code
|
||||||
|
*/
|
||||||
|
private String dictWorkspaceTypeCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 产品所属工作类型名称
|
* 产品所属工作类型名称
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -0,0 +1,76 @@
|
|||||||
|
package cn.axzo.tyr.server.config;
|
||||||
|
|
||||||
|
import cn.azxo.framework.common.logger.JobLoggerTemplate;
|
||||||
|
import cn.azxo.framework.common.service.JobParamResolver;
|
||||||
|
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xxl-job config
|
||||||
|
*
|
||||||
|
* @author xuxueli 2017-04-28
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class XxlJobConfig {
|
||||||
|
|
||||||
|
Logger logger = LoggerFactory.getLogger(XxlJobConfig.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* //@Value("http://dev-xxl-job.axzo.cn/xxl-job-admin")
|
||||||
|
*/
|
||||||
|
@Value("${xxl.job.admin.addresses}")
|
||||||
|
private String adminAddresses;
|
||||||
|
|
||||||
|
@Value("${xxl.job.executor.appname}")
|
||||||
|
private String appName;
|
||||||
|
|
||||||
|
@Value("")
|
||||||
|
private String ip;
|
||||||
|
|
||||||
|
@Value("${xxl.job.executor.port}")
|
||||||
|
private int port;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* // @Value("${xxl.job.accessToken}")
|
||||||
|
*/
|
||||||
|
@Value("")
|
||||||
|
private String accessToken;
|
||||||
|
|
||||||
|
@Value("")
|
||||||
|
private String logPath;
|
||||||
|
|
||||||
|
@Value("-1")
|
||||||
|
private int logRetentionDays;
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public XxlJobSpringExecutor xxlJobExecutor() {
|
||||||
|
logger.info(">>>>>>>>>>> xxl-job config init.");
|
||||||
|
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
|
||||||
|
xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
|
||||||
|
xxlJobSpringExecutor.setAppname(appName);
|
||||||
|
xxlJobSpringExecutor.setIp(ip);
|
||||||
|
xxlJobSpringExecutor.setPort(port);
|
||||||
|
xxlJobSpringExecutor.setAccessToken(accessToken);
|
||||||
|
xxlJobSpringExecutor.setLogPath(logPath);
|
||||||
|
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
|
||||||
|
|
||||||
|
return xxlJobSpringExecutor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean("jobParamResolver")
|
||||||
|
public JobParamResolver jobParamResolver(){
|
||||||
|
return new JobParamResolver();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean("jobLoggerTemplate")
|
||||||
|
public JobLoggerTemplate jobLoggerTemplate(){
|
||||||
|
return new JobLoggerTemplate();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@ -37,6 +37,11 @@ public class ProductModule extends BaseEntity<ProductModule> {
|
|||||||
*/
|
*/
|
||||||
private Long dictWorkspaceTypeId;
|
private Long dictWorkspaceTypeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品所属工作台字典 Code
|
||||||
|
*/
|
||||||
|
private String dictWorkspaceTypeCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 产品状态
|
* 产品状态
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -123,11 +123,15 @@ public class PermissionGroupImpl implements PermissionGroupService {
|
|||||||
.in(SaasPgroupPermissionRelation::getGroupId, groupIds)
|
.in(SaasPgroupPermissionRelation::getGroupId, groupIds)
|
||||||
.eq(BaseEntity::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
.eq(BaseEntity::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||||
.list();
|
.list();
|
||||||
List<PermissionPointTreeNode> feature = new ArrayList<>();
|
List<PermissionPointTreeNode> features = new ArrayList<>();
|
||||||
if (CollectionUtils.isNotEmpty(permissionList)) {
|
if (CollectionUtils.isNotEmpty(permissionList)) {
|
||||||
// 查询featureCode
|
// 查询全部featureCode
|
||||||
feature = featureService.listNodesByIds(permissionList.stream().map(SaasPgroupPermissionRelation::getFeatureId).collect(Collectors.toList()));
|
features = featureService.listNodesByIds(permissionList.stream().map(SaasPgroupPermissionRelation::getFeatureId).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
|
Map<Long, PermissionPointTreeNode> featureMap = features.stream().collect(Collectors.toMap(PermissionPointTreeNode::getPermissionPointId, Function.identity(), (e1, e2) -> e2));
|
||||||
|
Map<Long, List<PermissionPointTreeNode>> pgroupPermissionMap = permissionList.stream()
|
||||||
|
.collect(Collectors.groupingBy(SaasPgroupPermissionRelation::getGroupId,
|
||||||
|
Collectors.mapping(releation -> featureMap.get(releation.getFeatureId()), Collectors.toList())));
|
||||||
List<SaasPermissionGroupScope> saasPermissionGroupScopesSource = saasPermissionGroupScopeDao.lambdaQuery()
|
List<SaasPermissionGroupScope> saasPermissionGroupScopesSource = saasPermissionGroupScopeDao.lambdaQuery()
|
||||||
.in(SaasPermissionGroupScope::getPgroupId, groupIds)
|
.in(SaasPermissionGroupScope::getPgroupId, groupIds)
|
||||||
.eq(BaseEntity::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
.eq(BaseEntity::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||||
@ -149,14 +153,14 @@ public class PermissionGroupImpl implements PermissionGroupService {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
Map<Long, List<SaasRolePermissionScopeVO>> permissionGroupScopeMap = saasPermissionGroupScopes.stream().collect(Collectors.groupingBy(SaasPermissionGroupScope::getPgroupId, Collectors.mapping(e -> BeanMapper.copyBean(e, SaasRolePermissionScopeVO.class), Collectors.toList())));
|
||||||
// 组装填充字段
|
// 组装填充字段
|
||||||
List<PermissionPointTreeNode> finalFeature = feature;
|
List<SaasPermissionGroupVO> pageList = groupList.stream().map(group -> {
|
||||||
List<SaasPermissionGroupVO> pageList = groupList.stream().map(group ->
|
SaasPermissionGroupVO pgroupResult = SaasPermissionGroupVO.builder()
|
||||||
SaasPermissionGroupVO.builder()
|
|
||||||
.id(group.getId())
|
.id(group.getId())
|
||||||
.name(group.getName())
|
.name(group.getName())
|
||||||
.feature(finalFeature)
|
.scopes(Optional.ofNullable(permissionGroupScopeMap.get(group.getId())).orElse(new ArrayList<>()))
|
||||||
.scopes(saasPermissionGroupScopes.stream().filter(e -> e.getPgroupId().equals(group.getId())).map(e -> BeanMapper.copyBean(e, SaasRolePermissionScopeVO.class)).collect(Collectors.toList()))
|
.feature(Optional.ofNullable(pgroupPermissionMap.get(group.getId())).orElse(new ArrayList<>()))
|
||||||
.createBy(group.getCreateBy())
|
.createBy(group.getCreateBy())
|
||||||
.creatorName(group.getCreatorName())
|
.creatorName(group.getCreatorName())
|
||||||
.updateBy(group.getUpdateBy())
|
.updateBy(group.getUpdateBy())
|
||||||
@ -166,7 +170,9 @@ public class PermissionGroupImpl implements PermissionGroupService {
|
|||||||
.isCommon(group.getIsCommon())
|
.isCommon(group.getIsCommon())
|
||||||
.createAt(group.getCreateAt())
|
.createAt(group.getCreateAt())
|
||||||
.updateAt(group.getUpdateAt())
|
.updateAt(group.getUpdateAt())
|
||||||
.build()
|
.build();
|
||||||
|
return pgroupResult;
|
||||||
|
}
|
||||||
).collect(Collectors.toList());
|
).collect(Collectors.toList());
|
||||||
return PageResp.list(iPage.getCurrent(), iPage.getSize(), iPage.getTotal(), pageList);
|
return PageResp.list(iPage.getCurrent(), iPage.getSize(), iPage.getTotal(), pageList);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user