Commit c8de78c9 by 焦凯

多功能能力:基础

parent 8b0a2a92
//package com.beecode.inz.basis.config; package com.beecode.inz.basis.config;
//
//import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
//import org.springframework.core.io.ClassPathResource;
// import com.beecode.inz.basis.internal.service.InzBasisFunctionTreeServiceImpl;
//import com.beecode.inz.basis.internal.metadata.functiontree.FunctionTreeDefinitionImpl; import com.beecode.inz.basis.service.InzBasisFunctionTreeService;
//import com.beecode.inz.basis.internal.service.FunctionTreeServiceImpl; import com.beecode.inz.basis.web.InzBasisFunctionTreeController;
//import com.beecode.inz.basis.metadata.mech.FunctionTreeDefinitionMech;
//import com.beecode.inz.basis.web.FunctionTreeController; @Configuration
//@Configuration public class FunctionTreeConfiguration {
//public class FunctionTreeConfiguration {
// @Bean
// private static final String FUNCTIONTREE_DEFINITION_MECH = "inz-functionTree"; public InzBasisFunctionTreeController inzBasisFunctionTreeController() {
// return new InzBasisFunctionTreeController();
// }
// @Bean(name=FUNCTIONTREE_DEFINITION_MECH)
// public FunctionTreeDefinitionMech typeMech() { @Bean
// ClassPathResource resource = new ClassPathResource("/com/beecode/inz/basis/xsd/inz-functionTree-1.0.xsd", public InzBasisFunctionTreeService inzBasisFunctionTreeServiceImpl() {
// FunctionTreeDefinitionMech.class.getClassLoader()); return new InzBasisFunctionTreeServiceImpl();
// FunctionTreeDefinitionMech mech = new FunctionTreeDefinitionMech(); }
// mech.setBeanClass(FunctionTreeDefinitionImpl.class);
// mech.setVersion("1.0.0"); }
// mech.setNamespace("http://www.beecode.cn/schema/inz-functionTree");
// mech.setSchemaResource(resource);
// mech.setRootElementName("function-tree");
// return mech;
// }
//
// @Bean(name="com.beecode.inz.basis.internal.service.FunctionTreeServiceImpl")
// public FunctionTreeServiceImpl createFunctionTreeServiceImpl(){
// return new FunctionTreeServiceImpl();
// }
//
// @Bean(name="com.beecode.inz.basis.web.FunctionTreeController")
// public FunctionTreeController createFunctionTreeController(){
// return new FunctionTreeController();
// }
//}
package com.beecode.inz.basis.internal.service;
import java.util.List;
import org.springframework.stereotype.Service;
import com.beecode.amino.core.Amino;
import com.beecode.bap.functree.FunctionNode;
import com.beecode.bap.functree.FunctionTreeDefinition;
import com.beecode.inz.basis.service.InzBasisFunctionTreeService;
@Service
public class InzBasisFunctionTreeServiceImpl implements InzBasisFunctionTreeService {
@Override
public FunctionTreeDefinition getFunctionTreeDefinitionCompany(String name) {
FunctionTreeDefinition definition = Amino.getApplicationMetadataContext().getExtendableBean(name,
FunctionTreeDefinition.class);
List<FunctionNode> allFunctionNode = definition.getFunctionNodes().getAllFunctionNode();
FunctionNode firstNode = allFunctionNode.get(0);
String myRoles = firstNode.getRole();
//添加对于权限角色等过滤的处理
return definition;
}
@Override
public FunctionTreeDefinition getFunctionTreeDefinitionStation(String name) {
FunctionTreeDefinition definition = Amino.getApplicationMetadataContext().getExtendableBean(name,
FunctionTreeDefinition.class);
//添加对于权限角色等过滤的处理
return definition;
}
}
package com.beecode.inz.basis.service;
import com.beecode.bap.functree.FunctionTreeDefinition;
public interface InzBasisFunctionTreeService {
FunctionTreeDefinition getFunctionTreeDefinitionCompany(String name);
FunctionTreeDefinition getFunctionTreeDefinitionStation(String name);
}
package com.beecode.inz.basis.web;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.beecode.bap.functree.FunctionTreeDefinition;
import com.beecode.bap.functree.vo.FunctionTreeObj;
import com.beecode.inz.basis.service.InzBasisFunctionTreeService;
@RestController
public class InzBasisFunctionTreeController {
@Autowired
private InzBasisFunctionTreeService inzBasisFunctionTreeService;
@RequestMapping(value = "/basis/functionTree/company", method = RequestMethod.GET)
public Object getFunctionTreeCompany() {
String functreeName = "com.beecode.inz.portal.functiontree.CompanyFunctionTree";
FunctionTreeDefinition functionDefinition = inzBasisFunctionTreeService
.getFunctionTreeDefinitionCompany(functreeName);
return new FunctionTreeObj(functionDefinition);
}
@RequestMapping(value = "/basis/functionTree/station", method = RequestMethod.GET)
public Object getFunctionTreeStation() {
String functreeName = "com.beecode.inz.portal.functiontree.StationFunctionTree";
FunctionTreeDefinition functionDefinition = inzBasisFunctionTreeService
.getFunctionTreeDefinitionCompany(functreeName);
return new FunctionTreeObj(functionDefinition);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/inz-functionTree">
<specification>1.0</specification>
<id>f096377b-c10b-42a1-8bc0-d63dfdf3cb8c</id>
<name>com.beecode.inz.portal.functiontree.CompanyFunctionTree</name>
<title>默认功能树</title>
<define>inz-functionTree</define>
<define-version>1.0</define-version>
<content>
<m:function-tree>
<m:parent></m:parent>
<m:function-node>
<m:id>e2713187-ccb3-4d77-8a56-fc38a2c59afb</m:id>
<m:name>home</m:name>
<m:title>首页</m:title>
<m:index>1000</m:index>
<m:license></m:license>
<m:privilege></m:privilege>
<m:function-definition>
<m:view>Home</m:view>
<m:view-config></m:view-config>
</m:function-definition>
</m:function-node>
<m:function-node>
<m:id>ffd4a311-9714-4e16-97ec-19f330429fb8</m:id>
<m:name>project</m:name>
<m:title>项目</m:title>
<m:index>2000</m:index>
<m:license></m:license>
<m:privilege></m:privilege>
<m:function-definition>
<m:view>functions</m:view>
<m:view-config></m:view-config>
</m:function-definition>
<m:children>
<m:function-node>
<m:id>3d8a33ca-1e85-4db9-aa6a-e79270d9a801</m:id>
<m:name>project_list</m:name>
<m:title>项目备案</m:title>
<m:index>1000</m:index>
<m:license></m:license>
<m:role>管理员,经理,总监</m:role>
<m:privilege></m:privilege>
<m:function-definition>
<m:view>function-project-list</m:view>
<m:view-config></m:view-config>
</m:function-definition>
<m:icon>iconfont icon-qiyeshezhi</m:icon>
</m:function-node>
</m:children>
</m:function-node>
</m:function-tree>
</content>
</metadata>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/inz-functionTree">
<specification>1.0</specification>
<id>c72fff2a-2e75-4515-a732-a0f5c25c50d3</id>
<name>com.beecode.inz.portal.functiontree.StationFunctionTree</name>
<title>默认功能树</title>
<define>inz-functionTree</define>
<define-version>1.0</define-version>
<content>
<m:function-tree>
<m:parent></m:parent>
<m:function-node>
<m:id>c764ecdd-e8e0-4065-81a7-79f8f55e543a</m:id>
<m:name>home</m:name>
<m:title>首页</m:title>
<m:index>1000</m:index>
<m:license></m:license>
<m:privilege></m:privilege>
<m:function-definition>
<m:view>Home</m:view>
<m:view-config></m:view-config>
</m:function-definition>
</m:function-node>
<m:function-node>
<m:id>a0659619-c696-4bbf-a302-e8ff94776a6e</m:id>
<m:name>contract</m:name>
<m:title>合同</m:title>
<m:index>3000</m:index>
<m:license></m:license>
<m:privilege></m:privilege>
<m:function-definition>
<m:view>functions</m:view>
<m:view-config></m:view-config>
</m:function-definition>
<m:children>
<m:function-node>
<m:id>148afd5b-47df-4650-a37a-b53630ca901b</m:id>
<m:name>contract_list</m:name>
<m:title>合同登记</m:title>
<m:index>1000</m:index>
<m:license></m:license>
<m:privilege></m:privilege>
<m:function-definition>
<m:view>function-contract-list</m:view>
<m:view-config></m:view-config>
</m:function-definition>
<m:icon>iconfont icon-qiyeshezhi</m:icon>
</m:function-node>
<m:function-node>
<m:id>42245868-d9d9-44fb-87bd-11063b125626</m:id>
<m:name>contract_change</m:name>
<m:title>合同变更</m:title>
<m:index>2000</m:index>
<m:license></m:license>
<m:privilege></m:privilege>
<m:function-definition>
<m:view>function-contract-change</m:view>
<m:view-config></m:view-config>
</m:function-definition>
<m:icon>iconfont icon-qiyeshezhi</m:icon>
</m:function-node>
<m:function-node>
<m:id>cfdd98a0-39ef-40e3-834f-309d8b902936</m:id>
<m:name>contract_execute_warning</m:name>
<m:title>合同执行预警</m:title>
<m:index>3000</m:index>
<m:license></m:license>
<m:privilege></m:privilege>
<m:function-definition>
<m:view>function-contract-execute-warning</m:view>
<m:view-config></m:view-config>
</m:function-definition>
<m:icon>iconfont icon-qiyeshezhi</m:icon>
</m:function-node>
<m:function-node>
<m:id>1fe27a02-9319-42bd-b0e1-1ee2dbf94fa7</m:id>
<m:name>contract_execute_analyse</m:name>
<m:title>合同执行分析</m:title>
<m:index>4000</m:index>
<m:license></m:license>
<m:privilege></m:privilege>
<m:function-definition>
<m:view>function-contract-execute-analyse</m:view>
<m:view-config></m:view-config>
</m:function-definition>
<m:icon>iconfont icon-qiyeshezhi</m:icon>
</m:function-node>
<m:function-node>
<m:id>6d527c38-4ac5-49e5-a0a9-51e0c74a849b</m:id>
<m:name>contract_warning_setting</m:name>
<m:title>合同预警设置</m:title>
<m:index>1000</m:index>
<m:license></m:license>
<m:privilege></m:privilege>
<m:function-definition>
<m:view>function-contract-warning-setting</m:view>
<m:view-config></m:view-config>
</m:function-definition>
<m:icon>iconfont icon-qiyeshezhi</m:icon>
</m:function-node>
</m:children>
</m:function-node>
</m:function-tree>
</content>
</metadata>
\ No newline at end of file
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 to comment