Merge branch 'feature/REQ-2227' of axzsource.com:universal/infrastructure/backend/tyr into feature/REQ-2227
# Conflicts: # tyr-server/src/main/java/cn/axzo/tyr/server/service/SaasFeatureResourceService.java # tyr-server/src/main/java/cn/axzo/tyr/server/service/impl/SaasFeatureResourceServiceImpl.java
This commit is contained in:
commit
57eccebad7
@ -32,4 +32,7 @@ public class BaseFeatureResourceDO {
|
||||
|
||||
/** 图标 **/
|
||||
private String icon;
|
||||
|
||||
/** 端类型 **/
|
||||
private String terminal;
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ -21,5 +22,5 @@ public class FeatureComponentSaveReq extends BaseFeatureResourceDO {
|
||||
private String linkUrl;
|
||||
|
||||
/** 子级组件 **/
|
||||
private List<FeatureComponentSaveReq> children;
|
||||
private List<FeatureComponentSaveReq> children = new ArrayList<>();
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ -39,6 +40,9 @@ public class FeatureResourceTreeSaveReq extends BaseFeatureResourceDO {
|
||||
/** 页面及组件权限对象 **/
|
||||
private List<RolePermissionSaveReq> permissions;
|
||||
|
||||
@NotNull(message = "操作人ID不能为空")
|
||||
private Long operatorId;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
|
||||
@ -15,6 +15,7 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CommonDictResp {
|
||||
|
||||
/**
|
||||
|
||||
@ -16,8 +16,11 @@ import org.springframework.scheduling.annotation.EnableAsync;
|
||||
@SpringBootApplication(scanBasePackages = "cn.axzo")
|
||||
public class TyrApplication {
|
||||
public static void main(String[] args) {
|
||||
System.setProperty("spring.redis.port","31270");
|
||||
System.setProperty("spring.redis.host","123.249.44.111");
|
||||
ConfigurableApplicationContext run = SpringApplication.run(TyrApplication.class, args);
|
||||
Environment env = run.getEnvironment();
|
||||
|
||||
log.info(
|
||||
"--------------------------------------------------------------------------------------------------------------------\n" +
|
||||
"Application 【{}】 is running on 【{}】 environment!\n" +
|
||||
|
||||
@ -49,6 +49,9 @@ public class FeatureResourceController implements FeatureResourceApi {
|
||||
@Override
|
||||
public ApiResult<Void> saveMenu(FeatureResourceTreeSaveReq req) {
|
||||
log.info("save feature resouce req : " + req.toString());
|
||||
|
||||
featureResourceService.saveOrUpdateMenu(req);
|
||||
|
||||
return ApiResult.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,6 +120,7 @@ public class RoleUserController implements TyrSaasRoleUserApi {
|
||||
* 根据id删除用户角色关联关系
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ApiResult removeRoleUserRelation(@RequestBody @Valid List<Long> ids){
|
||||
AssertUtil.isTrue(!CollectionUtils.isEmpty(ids),"用户角色关联id不能为空");
|
||||
List<SaasRoleUserRelation> relations = saasRoleUserRelationDao.listByIds(ids);
|
||||
@ -141,6 +142,7 @@ public class RoleUserController implements TyrSaasRoleUserApi {
|
||||
* 获取分包负责人等特殊角色
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ApiResult<List<Long>> getSpecialRole() {
|
||||
return ApiResult.ok(saasRoleUserService.getSpecialRole());
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package cn.axzo.tyr.server.service;
|
||||
|
||||
import cn.axzo.tyr.server.repository.entity.SaasFeatureResource;
|
||||
import cn.axzo.tyr.client.model.req.FeatureResourceTreeSaveReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -13,6 +14,7 @@ import java.util.List;
|
||||
*/
|
||||
public interface SaasFeatureResourceService {
|
||||
|
||||
void saveOrUpdateMenu(FeatureResourceTreeSaveReq req);
|
||||
/** 根据ID查询导航菜单页面信息 - 限制查询字段 **/
|
||||
List<SaasFeatureResource> listNavByIds(List<Long> featureIds);
|
||||
}
|
||||
|
||||
@ -34,4 +34,25 @@ public class SaasFeatureResourceServiceImpl implements SaasFeatureResourceServic
|
||||
.in(SaasFeatureResource::getId, featureIds)
|
||||
.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveOrUpdateMenu(FeatureResourceTreeSaveReq req) {
|
||||
SaasFeatureResource baseResource = BeanMapper.copyBean(req, SaasFeatureResource.class);
|
||||
baseResource.setUpdateBy(req.getOperatorId());
|
||||
// 新增时候
|
||||
if (req.getId() == null) {
|
||||
baseResource.setCreateBy(req.getOperatorId());
|
||||
newResource(baseResource);
|
||||
} else {
|
||||
featureResourceDao.updateById(baseResource);
|
||||
}
|
||||
|
||||
if (CollectionUtil.isNotEmpty(req.getComponentSaveReqList())) {
|
||||
for (FeatureComponentSaveReq componentSaveReq : req.getComponentSaveReqList()) {
|
||||
saveOrUpdateFeatureComponent(componentSaveReq, baseResource.getPath(), req.getOperatorId());
|
||||
}
|
||||
} else {
|
||||
deleteComponentRecursionById(baseResource.getId(), null, req.getOperatorId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user