Ver código fonte

配置菜单页面代码生成器生成

wuxw 7 anos atrás
pai
commit
172c9773b7
16 arquivos alterados com 985 adições e 60 exclusões
  1. 168 0
      Api/src/main/java/com/java110/api/listener/configMenu/BindingConfigMenuListener.java
  2. 34 0
      WebService/src/main/java/com/java110/web/components/configMenu/ConfigMenuBindingComponent.java
  3. 19 0
      WebService/src/main/java/com/java110/web/smo/configMenu/IConfigMenuBindingSMO.java
  4. 71 0
      WebService/src/main/java/com/java110/web/smo/configMenu/impl/ConfigMenuBindingSMOImpl.java
  5. 49 0
      WebService/src/main/resources/components/menuPackage/addMenuView/addMenuView.html
  6. 109 0
      WebService/src/main/resources/components/menuPackage/addMenuView/addMenuView.js
  7. 41 0
      WebService/src/main/resources/components/menuPackage/configMenu/configMenu.html
  8. 93 0
      WebService/src/main/resources/components/menuPackage/configMenu/configMenu.js
  9. 26 22
      WebService/src/main/resources/components/menuPackage/view-menu-info/viewMenuInfo.html
  10. 40 0
      WebService/src/main/resources/components/privilegePackage/addPrivilegeView/addPrivilegeView.html
  11. 83 0
      WebService/src/main/resources/components/privilegePackage/addPrivilegeView/addPrivilegeView.js
  12. 38 0
      WebService/src/main/resources/views/configMenuFlow.html
  13. 105 38
      java110-code-generator/src/main/resources/relationship/template_1.json
  14. 92 0
      java110-code-generator/src/main/resources/relationship/template_menu.json
  15. 16 0
      java110-common/src/main/java/com/java110/common/constant/ServiceCodeConfigMenuConstant.java
  16. 1 0
      java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java

+ 168 - 0
Api/src/main/java/com/java110/api/listener/configMenu/BindingConfigMenuListener.java

@@ -0,0 +1,168 @@
+package com.java110.api.listener.configMenu;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.common.util.StringUtil;
+import com.java110.api.listener.AbstractServiceApiListener;
+import com.java110.common.util.Assert;
+import com.java110.core.context.DataFlowContext;
+import com.java110.entity.center.AppService;
+import com.java110.event.service.api.ServiceDataFlowEvent;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import com.java110.common.constant.CommonConstant;
+import com.java110.common.constant.ServiceCodeConstant;
+import com.java110.common.constant.BusinessTypeConstant;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.common.constant.ServiceCodeConfigMenuConstant;
+
+
+import com.java110.core.annotation.Java110Listener;
+
+/**
+ * 保存小区侦听
+ * add by wuxw 2019-06-30
+ */
+@Java110Listener("bindingConfigMenuListener")
+public class BindingConfigMenuListener extends AbstractServiceApiListener {
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
+        JSONArray infos = reqJson.getJSONArray("data");
+
+        Assert.hasKeyByFlowData(infos, "addMenuView", "name", "必填,请填写菜单名称");
+        Assert.hasKeyByFlowData(infos, "addMenuView", "url", "必填,请菜单菜单地址");
+        Assert.hasKeyByFlowData(infos, "addMenuView", "seq", "必填,请填写序列");
+        Assert.hasKeyByFlowData(infos, "addMenuView", "isShow", "必填,请选择是否显示菜单");
+        Assert.hasKeyByFlowData(infos, "addPrivilegeView", "name", "必填,请填写权限名称");
+        Assert.hasKeyByFlowData(infos, "addPrivilegeView", "domain", "必填,请选择商户类型");
+
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        HttpHeaders header = new HttpHeaders();
+        context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D");
+        JSONArray businesses = new JSONArray();
+
+        AppService service = event.getAppService();
+
+
+        JSONArray infos = reqJson.getJSONArray("data");
+
+
+        JSONObject viewMenuGroupInfo = getObj(infos, "viewMenuGroupInfo");
+        JSONObject addMenuView = getObj(infos, "addMenuView");
+        JSONObject addPrivilegeView = getObj(infos, "addPrivilegeView");
+        if (!hasKey(viewMenuGroupInfo, "gId")) {
+            viewMenuGroupInfo.put("gId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.MENU_GROUP));
+            viewMenuGroupInfo.put("userId", context.getRequestCurrentHeaders().get(CommonConstant.HTTP_USER_ID));
+            businesses.add(addBusinessMenuGroup(viewMenuGroupInfo, context));
+        }
+        if (!hasKey(addMenuView, "mId")) {
+            addMenuView.put("mId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.MENU));
+            addMenuView.put("userId", context.getRequestCurrentHeaders().get(CommonConstant.HTTP_USER_ID));
+            businesses.add(addBusinessMenu(addMenuView, context));
+        }
+        if (!hasKey(addPrivilegeView, "pId")) {
+            addPrivilegeView.put("pId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.BASE_PRIVILEGE));
+            addPrivilegeView.put("userId", context.getRequestCurrentHeaders().get(CommonConstant.HTTP_USER_ID));
+            businesses.add(addBusinessPrivilege(addPrivilegeView, context));
+        }
+
+
+        JSONObject paramInObj = super.restToCenterProtocol(businesses, context.getRequestCurrentHeaders());
+
+        //将 rest header 信息传递到下层服务中去
+        super.freshHttpHeader(header, context.getRequestCurrentHeaders());
+
+        ResponseEntity<String> responseEntity = this.callService(context, service.getServiceCode(), paramInObj);
+
+        context.setResponseEntity(responseEntity);
+    }
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeConfigMenuConstant.BINDING_CONFIGMENU;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+
+    private JSONObject addBusinessMenuGroup(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
+        //business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_MENU_GROUP_INFO);
+        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
+        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
+        JSONObject businessObj = new JSONObject();
+        businessObj.putAll(paramInJson);
+        //计算 应收金额
+        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessMenuGroup", businessObj);
+        return business;
+    }
+
+    private JSONObject addBusinessMenu(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
+        //business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_MENU_INFO);
+        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
+        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
+        JSONObject businessObj = new JSONObject();
+        businessObj.putAll(paramInJson);
+        //计算 应收金额
+        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessMenu", businessObj);
+        return business;
+    }
+
+    private JSONObject addBusinessPrivilege(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
+        //business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_PRIVILEGE_INFO);
+        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
+        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
+        JSONObject businessObj = new JSONObject();
+        businessObj.putAll(paramInJson);
+        //计算 应收金额
+        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessPrivilege", businessObj);
+        return business;
+    }
+
+
+    private boolean hasKey(JSONObject info, String key) {
+        if (!info.containsKey(key)
+                || StringUtil.isEmpty(info.getString(key))
+                || info.getString(key).startsWith("-")) {
+            return false;
+        }
+        return true;
+
+    }
+
+    private JSONObject getObj(JSONArray infos, String flowComponent) {
+
+        JSONObject serviceInfo = null;
+
+        for (int infoIndex = 0; infoIndex < infos.size(); infoIndex++) {
+
+            Assert.hasKeyAndValue(infos.getJSONObject(infoIndex), "flowComponent", "未包含服务流程组件名称");
+
+            if (flowComponent.equals(infos.getJSONObject(infoIndex).getString("flowComponent"))) {
+                serviceInfo = infos.getJSONObject(infoIndex);
+                Assert.notNull(serviceInfo, "未包含服务信息");
+                return serviceInfo;
+            }
+        }
+
+        throw new IllegalArgumentException("未找到组件编码为【" + flowComponent + "】数据");
+    }
+
+
+}

+ 34 - 0
WebService/src/main/java/com/java110/web/components/configMenu/ConfigMenuBindingComponent.java

@@ -0,0 +1,34 @@
+package com.java110.web.components.configMenu;
+
+import com.java110.core.context.IPageData;
+import com.java110.web.smo.configMenu.IConfigMenuBindingSMO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+
+/**
+ * 添加配置菜单组件
+ */
+@Component("configMenuBinding")
+public class ConfigMenuBindingComponent {
+
+    @Autowired
+    private IConfigMenuBindingSMO configMenuBindingSMOImpl;
+
+    /**
+     * 添加配置菜单数据
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象
+     */
+    public ResponseEntity<String> binding(IPageData pd){
+        return configMenuBindingSMOImpl.bindingConfigMenu(pd);
+    }
+
+    public IConfigMenuBindingSMO getConfigMenuBindingSMOImpl() {
+        return configMenuBindingSMOImpl;
+    }
+
+    public void setConfigMenuBindingSMOImpl(IConfigMenuBindingSMO configMenuBindingSMOImpl) {
+        this.configMenuBindingSMOImpl = configMenuBindingSMOImpl;
+    }
+}

+ 19 - 0
WebService/src/main/java/com/java110/web/smo/configMenu/IConfigMenuBindingSMO.java

@@ -0,0 +1,19 @@
+package com.java110.web.smo.configMenu;
+
+import com.java110.core.context.IPageData;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 添加配置菜单接口
+ *
+ * add by wuxw 2019-06-30
+ */
+public interface IConfigMenuBindingSMO {
+
+    /**
+     * 添加配置菜单
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象
+     */
+    ResponseEntity<String> bindingConfigMenu(IPageData pd);
+}

+ 71 - 0
WebService/src/main/java/com/java110/web/smo/configMenu/impl/ConfigMenuBindingSMOImpl.java

@@ -0,0 +1,71 @@
+package com.java110.web.smo.configMenu.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.common.constant.PrivilegeCodeConstant;
+import com.java110.common.constant.ServiceCodeConfigMenuConstant;
+import com.java110.common.constant.ServiceConstant;
+import com.java110.common.util.Assert;
+import com.java110.core.context.IPageData;
+import com.java110.web.core.AbstractComponentSMO;
+import com.java110.web.smo.configMenu.IConfigMenuBindingSMO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+
+
+/**
+ * 添加小区服务实现类
+ * add by wuxw 2019-06-30
+ */
+@Service("configMenuBindingSMOImpl")
+public class ConfigMenuBindingSMOImpl extends AbstractComponentSMO implements IConfigMenuBindingSMO {
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Override
+    protected void validate(IPageData pd, JSONObject paramIn) {
+
+        //super.validatePageInfo(pd);
+        JSONArray infos = paramIn.getJSONArray("data");
+        //Assert.hasKeyAndValue(paramIn, "xxx", "xxx");
+        Assert.hasKeyByFlowData(infos, "addMenuView", "name", "必填,请填写菜单名称");
+        Assert.hasKeyByFlowData(infos, "addMenuView", "url", "必填,请菜单菜单地址");
+        Assert.hasKeyByFlowData(infos, "addMenuView", "seq", "必填,请填写序列");
+        Assert.hasKeyByFlowData(infos, "addMenuView", "isShow", "必填,请选择是否显示菜单");
+        Assert.hasKeyByFlowData(infos, "addPrivilegeView", "name", "必填,请填写权限名称");
+        Assert.hasKeyByFlowData(infos, "addPrivilegeView", "domain", "必填,请选择商户类型");
+
+
+        super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.MENU_MANAGE);
+
+    }
+
+    @Override
+    protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) {
+        ResponseEntity<String> responseEntity = null;
+        super.validateStoreStaffCommunityRelationship(pd, restTemplate);
+
+        responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(),
+                ServiceConstant.SERVICE_API_URL + "/api/" + ServiceCodeConfigMenuConstant.BINDING_CONFIGMENU,
+                HttpMethod.POST);
+        return responseEntity;
+    }
+
+    @Override
+    public ResponseEntity<String> bindingConfigMenu(IPageData pd) {
+        return super.businessProcess(pd);
+    }
+
+    public RestTemplate getRestTemplate() {
+        return restTemplate;
+    }
+
+    public void setRestTemplate(RestTemplate restTemplate) {
+        this.restTemplate = restTemplate;
+    }
+}

+ 49 - 0
WebService/src/main/resources/components/menuPackage/addMenuView/addMenuView.html

@@ -0,0 +1,49 @@
+<div class="row">
+    <div class="col-lg-12">
+        <div class="ibox">
+            <div class="ibox-title">
+                <h5>配置菜单</h5>
+                <div class="ibox-tools" style="top:10px;">
+
+                </div>
+            </div>
+            <div class="ibox-content">
+
+                <div class="form-group row">
+                    <label class="col-sm-2 col-form-label">菜单名称</label>
+                    <div class="col-sm-10">
+                        <input v-model="addMenuViewInfo.name" type="text" placeholder="必填,请填写菜单名称" class="form-control">
+                    </div>
+                </div>
+                <div class="form-group row">
+                    <label class="col-sm-2 col-form-label">菜单地址</label>
+                    <div class="col-sm-10">
+                        <input v-model="addMenuViewInfo.url" type="text" placeholder="必填,请填写菜单地址" class="form-control">
+                    </div>
+                </div>
+                <div class="form-group row">
+                    <label class="col-sm-2 col-form-label">序列</label>
+                    <div class="col-sm-10">
+                        <input v-model="addMenuViewInfo.seq" type="text" placeholder="必填,请填写序列" class="form-control">
+                    </div>
+                </div>
+                <div class="form-group row">
+                    <label class="col-sm-2 col-form-label">菜单显示</label>
+                    <div class="col-sm-10">
+                        <select class="custom-select" v-model="addMenuViewInfo.isShow">
+                            <option selected disabled value="">必填,请选择菜单显示</option>
+                            <option value="Y">显示菜单</option>
+                            <option value="N">不显示菜单</option>
+                        </select></div>
+                </div>
+                <div class="form-group row">
+                    <label class="col-sm-2 col-form-label">描述</label>
+                    <div class="col-sm-10">
+                        <textarea placeholder="选填,请填写描述" class="form-control"
+                                  v-model="addMenuViewInfo.description"></textarea></div>
+                </div>
+
+            </div>
+        </div>
+    </div>
+</div>

+ 109 - 0
WebService/src/main/resources/components/menuPackage/addMenuView/addMenuView.js

@@ -0,0 +1,109 @@
+(function(vc){
+
+    vc.extends({
+        propTypes: {
+           callBackListener:vc.propTypes.string, //父组件名称
+           callBackFunction:vc.propTypes.string //父组件监听方法
+        },
+        data:{
+            addMenuViewInfo:{
+                flowComponent:'addMenuView',
+                name:'',
+url:'',
+seq:'',
+isShow:'',
+description:'',
+
+            }
+        },
+        watch:{
+            addMenuViewInfo:{
+                deep: true,
+                handler:function(){
+                    vc.component.saveAddMenuInfo();
+                }
+             }
+        },
+         _initMethod:function(){
+
+         },
+         _initEvent:function(){
+
+            vc.on('addMenuViewInfo', 'onIndex', function(_index){
+                vc.component.addMenuViewInfo.index = _index;
+            });
+        },
+        methods:{
+            addMenuValidate(){
+                return vc.validate.validate({
+                    addMenuViewInfo:vc.component.addMenuViewInfo
+                },{
+                    'addMenuViewInfo.name':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"菜单名称不能为空"
+                        },
+ {
+                            limit:"maxin",
+                            param:"2,10",
+                            errInfo:"菜单名称必须在2至10字符之间"
+                        },
+                    ],
+'addMenuViewInfo.url':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"菜单地址不能为空"
+                        },
+ {
+                            limit:"maxin",
+                            param:"2,10",
+                            errInfo:"菜单名称必须在2至10字符之间"
+                        },
+                    ],
+'addMenuViewInfo.seq':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"序列不能为空"
+                        },
+ {
+                            limit:"num",
+                            param:"",
+                            errInfo:"序列必须为整数"
+                        },
+                    ],
+'addMenuViewInfo.isShow':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"菜单显示不能为空"
+                        },
+ {
+                            limit:"maxin",
+                            param:"1,12",
+                            errInfo:"菜单显示错误"
+                        },
+                    ],
+'addMenuViewInfo.description':[
+ {
+                            limit:"maxLength",
+                            param:"200",
+                            errInfo:"备注内容不能超过200"
+                        },
+                    ],
+
+                });
+            },
+            saveAddMenuInfo:function(){
+                if(vc.component.addMenuValidate()){
+                    //侦听回传
+                    vc.emit($props.callBackListener,$props.callBackFunction, vc.component.addMenuViewInfo);
+                    return ;
+                }
+            }
+        }
+    });
+
+})(window.vc);

+ 41 - 0
WebService/src/main/resources/components/menuPackage/configMenu/configMenu.html

@@ -0,0 +1,41 @@
+<div id="component">
+
+    <div class="java110_step">
+        <div id="step"></div>
+    </div>
+
+    <!-- 选择 应用信息 -->
+    <div v-if="configMenuInfo.index == 0">
+        <vc:create name="viewMenuGroupInfo"
+                   callBackListener="configMenu"
+                   callBackFunction="notify"
+        ></vc:create>
+    </div>
+    <div v-if="configMenuInfo.index == 1">
+        <vc:create name="addMenuView"
+                   callBackListener="configMenu"
+                   callBackFunction="notify"
+        ></vc:create>
+    </div>
+    <div v-if="configMenuInfo.index == 2">
+        <vc:create name="addPrivilegeView"
+                   callBackListener="configMenu"
+                   callBackFunction="notify"
+        ></vc:create>
+    </div>
+
+
+    <div class="row">
+        <div class="col-md-10"></div>
+        <div class="col-md-2 " style="margin-bottom:10px; text-align:right">
+            <button type="button" class="btn btn-secondary" v-on:click="_prevStep()">上一步</button>
+            <button v-if="configMenuInfo.index != 2" type="button" class="btn btn-primary" style="margin-left:10px;"
+                    v-on:click="_nextStep()">下一步
+            </button>
+            <button v-if="configMenuInfo.index == 2" type="button" class="btn btn-primary" style="margin-left:10px;"
+                    v-on:click="_finishStep()">完成
+            </button>
+        </div>
+    </div>
+
+</div>

+ 93 - 0
WebService/src/main/resources/components/menuPackage/configMenu/configMenu.js

@@ -0,0 +1,93 @@
+/**
+    入驻小区
+**/
+(function(vc){
+    vc.extends({
+        data:{
+            configMenuInfo:{
+                $step:{},
+                index:0,
+                infos:[]
+            }
+        },
+        _initMethod:function(){
+            vc.component._initStep();
+        },
+        _initEvent:function(){
+            vc.on("configMenu", "notify", function(_info){
+                vc.component.configMenuInfo.infos[vc.component.configMenuInfo.index] = _info;
+            });
+
+        },
+        methods:{
+            _initStep:function(){
+                vc.component.configMenuInfo.$step = $("#step");
+                vc.component.configMenuInfo.$step.step({
+                    index: 0,
+                    time: 500,
+                    title: ["选择菜单组","菜单信息","权限信息"]
+                });
+                vc.component.configMenuInfo.index = vc.component.configMenuInfo.$step.getIndex();
+            },
+            _prevStep:function(){
+                vc.component.configMenuInfo.$step.prevStep();
+                vc.component.configMenuInfo.index = vc.component.configMenuInfo.$step.getIndex();
+
+                vc.emit('viewMenuGroupInfo', 'onIndex', vc.component.configMenuInfo.index);
+vc.emit('addMenuView', 'onIndex', vc.component.configMenuInfo.index);
+vc.emit('addPrivilegeView', 'onIndex', vc.component.configMenuInfo.index);
+
+            },
+            _nextStep:function(){
+                var _currentData = vc.component.configMenuInfo.infos[vc.component.configMenuInfo.index];
+                if( _currentData == null || _currentData == undefined){
+                    vc.message("请选择或填写必选信息");
+                    return ;
+                }
+                vc.component.configMenuInfo.$step.nextStep();
+                vc.component.configMenuInfo.index = vc.component.configMenuInfo.$step.getIndex();
+
+                 vc.emit('viewMenuGroupInfo', 'onIndex', vc.component.configMenuInfo.index);
+vc.emit('addMenuView', 'onIndex', vc.component.configMenuInfo.index);
+vc.emit('addPrivilegeView', 'onIndex', vc.component.configMenuInfo.index);
+
+            },
+            _finishStep:function(){
+
+
+                var _currentData = vc.component.configMenuInfo.infos[vc.component.configMenuInfo.index];
+                if( _currentData == null || _currentData == undefined){
+                    vc.message("请选择或填写必选信息");
+                    return ;
+                }
+
+                var param = {
+                    data:vc.component.configMenuInfo.infos
+                }
+
+               vc.http.post(
+                   'configMenuBinding',
+                   'binding',
+                   JSON.stringify(param),
+                   {
+                       emulateJSON:true
+                    },
+                    function(json,res){
+                       if(res.status == 200){
+
+                           vc.message('处理成功',true);
+                           //关闭model
+                           vc.jumpToPage("/flow/menuFlow?" + vc.objToGetParam(JSON.parse(json)));
+                           return ;
+                       }
+                       vc.message(json);
+                    },
+                    function(errInfo,error){
+                       console.log('请求失败处理');
+
+                       vc.message(errInfo);
+                    });
+            }
+        }
+    });
+})(window.vc);

+ 26 - 22
WebService/src/main/resources/components/menuPackage/view-menu-info/viewMenuInfo.html

@@ -4,48 +4,52 @@
             <div class="ibox-title">
                 <h5>菜单信息</h5>
                 <div class="ibox-tools" style="top:10px;">
-                    <button type="button" v-if="viewMenuInfo.index != 2" class="btn btn-primary btn-sm" style="margin-right:10px;"  v-on:click="_openSelectMenuInfoModel()">
-                        <i class="glyphicon glyphicon-search"></i> 选择菜单</button>
+                    <button type="button" v-if="viewMenuInfo.index != 2" class="btn btn-primary btn-sm"
+                            style="margin-right:10px;" v-on:click="_openSelectMenuInfoModel()">
+                        <i class="glyphicon glyphicon-search"></i> 选择菜单
+                    </button>
 
-                    <button type="button" v-if="viewMenuInfo.index != 2" class="btn btn-primary btn-sm" v-on:click="_openAddMenuInfoModel()">
-                        <i class="glyphicon glyphicon-plus"></i> 添加菜单</button>
+                    <button type="button" v-if="viewMenuInfo.index != 2" class="btn btn-primary btn-sm"
+                            v-on:click="_openAddMenuInfoModel()">
+                        <i class="glyphicon glyphicon-plus"></i> 添加菜单
+                    </button>
                 </div>
             </div>
             <div class="ibox-content">
                 <div class="row">
-<div class="col-sm-4">
+                    <div class="col-sm-4">
                         <div class="form-group">
-                            <label class="col-form-label" >菜单名称:</label>
+                            <label class="col-form-label">菜单名称:</label>
                             <label class="">{{viewMenuInfo.name}}</label>
                         </div>
-</div>
-<div class="col-sm-4">
+                    </div>
+                    <div class="col-sm-4">
                         <div class="form-group">
-                            <label class="col-form-label" >菜单地址:</label>
+                            <label class="col-form-label">菜单地址:</label>
                             <label class="">{{viewMenuInfo.url}}</label>
                         </div>
-</div>
-<div class="col-sm-4">
+                    </div>
+                    <div class="col-sm-4">
                         <div class="form-group">
-                            <label class="col-form-label" >序列:</label>
+                            <label class="col-form-label">序列:</label>
                             <label class="">{{viewMenuInfo.seq}}</label>
                         </div>
-</div>
-</div>
-<div class="row">
-<div class="col-sm-4">
+                    </div>
+                </div>
+                <div class="row">
+                    <div class="col-sm-4">
                         <div class="form-group">
-                            <label class="col-form-label" >菜单显示:</label>
+                            <label class="col-form-label">菜单显示:</label>
                             <label class="">{{viewMenuInfo.isShow}}</label>
                         </div>
-</div>
-<div class="col-sm-4">
+                    </div>
+                    <div class="col-sm-4">
                         <div class="form-group">
-                            <label class="col-form-label" >描述:</label>
+                            <label class="col-form-label">描述:</label>
                             <label class="">{{viewMenuInfo.description}}</label>
                         </div>
-</div>
-</div>
+                    </div>
+                </div>
 
             </div>
         </div>

+ 40 - 0
WebService/src/main/resources/components/privilegePackage/addPrivilegeView/addPrivilegeView.html

@@ -0,0 +1,40 @@
+<div class="row">
+    <div class="col-lg-12">
+        <div class="ibox">
+            <div class="ibox-title">
+                <h5>配置菜单</h5>
+                <div class="ibox-tools" style="top:10px;">
+
+                </div>
+            </div>
+            <div class="ibox-content">
+
+                <div class="form-group row">
+                    <label class="col-sm-2 col-form-label">权限名称</label>
+                    <div class="col-sm-10">
+                        <input v-model="addPrivilegeViewInfo.name" readonly type="text" placeholder="必填,请填写权限名称"
+                               class="form-control">
+                    </div>
+                </div>
+                <div class="form-group row">
+                    <label class="col-sm-2 col-form-label">商户类型</label>
+                    <div class="col-sm-10">
+                        <select class="custom-select" v-model="addPrivilegeViewInfo.domain">
+                            <option selected disabled value="">必填,请选择商户类型</option>
+                            <option value="800900000001">运营团队</option>
+                            <option value="800900000002">代理商</option>
+                            <option value="800900000003">物业</option>
+                            <option value="800900000000">开发团队</option>
+                        </select></div>
+                </div>
+                <div class="form-group row">
+                    <label class="col-sm-2 col-form-label">描述</label>
+                    <div class="col-sm-10">
+                        <textarea placeholder="选填,请填写描述" readonly class="form-control"
+                                  v-model="addPrivilegeViewInfo.description"></textarea></div>
+                </div>
+
+            </div>
+        </div>
+    </div>
+</div>

+ 83 - 0
WebService/src/main/resources/components/privilegePackage/addPrivilegeView/addPrivilegeView.js

@@ -0,0 +1,83 @@
+(function(vc){
+
+    vc.extends({
+        propTypes: {
+           callBackListener:vc.propTypes.string, //父组件名称
+           callBackFunction:vc.propTypes.string //父组件监听方法
+        },
+        data:{
+            addPrivilegeViewInfo:{
+                flowComponent:'addPrivilegeView',
+                name:'',
+                domain:'',
+                description:'',
+
+            }
+        },
+        watch:{
+            addPrivilegeViewInfo:{
+                deep: true,
+                handler:function(){
+                    vc.component.saveAddPrivilegeInfo();
+                }
+             }
+        },
+         _initMethod:function(){
+
+         },
+         _initEvent:function(){
+
+            vc.on('addPrivilegeViewInfo', 'onIndex', function(_index){
+                vc.component.addPrivilegeViewInfo.index = _index;
+            });
+        },
+        methods:{
+            addPrivilegeValidate(){
+                return vc.validate.validate({
+                    addPrivilegeViewInfo:vc.component.addPrivilegeViewInfo
+                },{
+                    'addPrivilegeViewInfo.name':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"权限名称不能为空"
+                        },
+ {
+                            limit:"maxin",
+                            param:"2,10",
+                            errInfo:"权限名称必须在2至10字符之间"
+                        },
+                    ],
+'addPrivilegeViewInfo.domain':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"商户类型不能为空"
+                        },
+ {
+                            limit:"maxin",
+                            param:"1,12",
+                            errInfo:"商户类型错误"
+                        },
+                    ],
+'addPrivilegeViewInfo.description':[
+ {
+                            limit:"maxLength",
+                            param:"200",
+                            errInfo:"备注内容不能超过200"
+                        },
+                    ],
+
+                });
+            },
+            saveAddPrivilegeInfo:function(){
+                if(vc.component.addPrivilegeValidate()){
+                    //侦听回传
+                    vc.emit($props.callBackListener,$props.callBackFunction, vc.component.addPrivilegeViewInfo);
+                    return ;
+                }
+            }
+        }
+    });
+
+})(window.vc);

+ 38 - 0
WebService/src/main/resources/views/configMenuFlow.html

@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html lang="en"
+      xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:th="http://www.thymeleaf.org"
+      xmlns:vc="http://www.thymeleaf.org">
+<head>
+    <meta charset="UTF-8"/>
+    <title>配置菜单|java110</title>
+    <vc:create name="commonTop"></vc:create>
+    <link href="/css/jquery.step.css" rel="stylesheet"/>
+    <script src="/js/jquery.step.min.js" ></script>
+</head>
+<body>
+<vc:create name="bodyTop"></vc:create>
+<div id="wrapper">
+    <vc:create name="menu"></vc:create>
+
+
+    <div id="page-wrapper" class="gray-bg dashbard-1">
+        <div class="row border-bottom">
+            <vc:create name="nav"></vc:create>
+        </div>
+        <div class="wrapper wrapper-content" style="padding-bottom: 0px;">
+            <vc:create name="breadcrumb"></vc:create>
+        </div>
+        <!-- id="component" -->
+        <div class="wrapper wrapper-content animated fadeInRight">
+            <vc:create name="configMenu"></vc:create>
+        </div>
+
+        <vc:create name="copyright"></vc:create>
+
+    </div>
+</div>
+
+<vc:create name="commonBottom"></vc:create>
+</body>
+</html>

+ 105 - 38
java110-code-generator/src/main/resources/relationship/template_1.json

@@ -1,6 +1,6 @@
 {
-  "templateName":"菜单",
-  "templateCode":"menu",
+  "templateName":"配置菜单",
+  "templateCode":"configMenu",
   "templateKey":"mId",
   "templateKeyName":"菜单ID",
   "package": "menuPackage",
@@ -22,71 +22,138 @@
       "code":"menu",
       "flowKey": "mId",
       "cnCode":"菜单信息",
-      "vcName":"viewMenuInfo",
-      "businessName": "businessService",
-      "businessType": "BUSINESS_TYPE_SAVE_SERVICE_INFO",
-      "existsComponent": true
+      "vcName":"addMenuView",
+      "businessName": "businessMenu",
+      "businessType": "BUSINESS_TYPE_SAVE_MENU_INFO",
+      "existsComponent": false
     },
     {
       "index": 2,
       "code":"privilege",
-      "flowKey": "id",
+      "flowKey": "pId",
       "cnCode":"权限信息",
-      "vcName":"addRouteView",
-      "businessName": "businessRoute",
-      "businessType": "BUSINESS_TYPE_SAVE_ROUTE_INFO",
+      "vcName":"addPrivilegeView",
+      "businessName": "businessPrivilege",
+      "businessType": "BUSINESS_TYPE_SAVE_PRIVILEGE_INFO",
       "existsComponent": false
     }
   ],
   "components": {
-      "addRouteView": {
-        "templateName":"扩展信息",
-        "templateCode":"addRoute",
-        "package": "servicePackage",
+      "addMenuView": {
+        "templateName":"菜单信息",
+        "templateCode":"addMenu",
+        "package": "menuPackage",
         "columns":[
           {
-            "code":"orderTypeCd",
-            "cnCode":"订单类型",
-            "desc":"必填,请填写订单类型",
+            "code":"name",
+            "cnCode":"菜单名称",
+            "desc":"必填,请填写菜单名称",
             "required":true,
             "hasDefaultValue":false,
-            "inputType":"select",
-            "selectValue":"Q,D",
-            "selectValueName":"查询,业务受理",
+            "inputType":"input",
+            "limit":"maxin",
+            "limitParam":"2,10",
+            "limitErrInfo":"菜单名称必须在2至10字符之间",
+            "show": true
+          },
+          {
+            "code":"url",
+            "cnCode":"菜单地址",
+            "desc":"必填,请菜单菜单地址",
+            "required":true,
+            "hasDefaultValue":false,
+            "inputType":"input",
             "limit":"maxin",
-            "limitParam":"1,4",
-            "limitErrInfo":"订单类型错误",
+            "limitParam":"2,10",
+            "limitErrInfo":"菜单名称必须在2至10字符之间",
             "show": true
           },
           {
-            "code":"invokeLimitTimes",
-            "cnCode":"调用次数",
-            "desc":"必填,请填写调用次数",
+            "code":"seq",
+            "cnCode":"序列",
+            "desc":"必填,请填写序列",
             "required":true,
-            "hasDefaultValue":true,
-            "defaultValue":"1000",
+            "hasDefaultValue":false,
             "inputType":"input",
             "limit":"num",
             "limitParam":"",
-            "limitErrInfo":"调用次数错误",
-            "show": false
+            "limitErrInfo":"序列必须为整数",
+            "show": true
           },
           {
-            "code":"invokeModel",
-            "cnCode":"调用方式",
-            "desc":"可填,请填写消息队列,订单在异步调用时使用",
+            "code":"isShow",
+            "cnCode":"菜单显示",
+            "desc":"必填,请选择是否显示菜单",
             "required":true,
             "hasDefaultValue":false,
-            "defaultValue":"",
             "inputType":"select",
-            "selectValue":"S,A",
-            "selectValueName":"同步方式,异步方式",
+            "selectValue":"Y,N",
+            "selectValueName":"显示菜单,不显示菜单",
+            "limit":"maxin",
+            "limitParam":"1,12",
+            "limitErrInfo":"菜单显示错误",
+            "show": true
+          },
+          {
+            "code":"description",
+            "cnCode":"描述",
+            "desc":"可填,请填写描述",
+            "required":false,
+            "hasDefaultValue":false,
+            "defaultValue":"",
+            "inputType":"textarea",
             "limit":"maxLength",
-            "limitParam":"50",
-            "limitErrInfo":"消息队列不能超过50",
+            "limitParam":"200",
+            "limitErrInfo":"备注内容不能超过200",
             "show": false
           }
         ]
-      }
+      },
+    "addPrivilegeView": {
+      "templateName":"权限信息",
+      "templateCode":"addPrivilege",
+      "package": "privilegePackage",
+      "columns":[
+        {
+          "code":"name",
+          "cnCode":"权限名称",
+          "desc":"必填,请填写权限名称",
+          "required":true,
+          "hasDefaultValue":false,
+          "inputType":"input",
+          "limit":"maxin",
+          "limitParam":"2,10",
+          "limitErrInfo":"权限名称必须在2至10字符之间",
+          "show": true
+        },
+        {
+          "code":"domain",
+          "cnCode":"商户类型",
+          "desc":"必填,请选择商户类型",
+          "required":true,
+          "hasDefaultValue":false,
+          "inputType":"select",
+          "selectValue":"800900000001,800900000002,800900000003,800900000000",
+          "selectValueName":"运营团队,代理商,物业,开发团队",
+          "limit":"maxin",
+          "limitParam":"1,12",
+          "limitErrInfo":"商户类型错误",
+          "show": true
+        },
+        {
+          "code":"description",
+          "cnCode":"描述",
+          "desc":"可填,请填写描述",
+          "required":false,
+          "hasDefaultValue":false,
+          "defaultValue":"",
+          "inputType":"textarea",
+          "limit":"maxLength",
+          "limitParam":"200",
+          "limitErrInfo":"备注内容不能超过200",
+          "show": false
+        }
+      ]
+    }
   }
 }

+ 92 - 0
java110-code-generator/src/main/resources/relationship/template_menu.json

@@ -0,0 +1,92 @@
+{
+  "templateName":"菜单",
+  "templateCode":"menu",
+  "templateKey":"mId",
+  "templateKeyName":"菜单ID",
+  "package": "menuPackage",
+  "successUrl": "/flow/menuFlow",
+  "needAffirm": false,
+  "flows":[
+    {
+      "index": 0,
+      "code":"menuGroup",
+      "flowKey": "gId",
+      "cnCode":"选择菜单组",
+      "vcName":"viewMenuGroupInfo",
+      "businessName": "businessMenuGroup",
+      "businessType": "BUSINESS_TYPE_SAVE_MENU_GROUP_INFO",
+      "existsComponent": true
+    },
+    {
+      "index": 1,
+      "code":"menu",
+      "flowKey": "mId",
+      "cnCode":"菜单信息",
+      "vcName":"viewMenuInfo",
+      "businessName": "businessService",
+      "businessType": "BUSINESS_TYPE_SAVE_SERVICE_INFO",
+      "existsComponent": true
+    },
+    {
+      "index": 2,
+      "code":"privilege",
+      "flowKey": "id",
+      "cnCode":"权限信息",
+      "vcName":"addRouteView",
+      "businessName": "businessRoute",
+      "businessType": "BUSINESS_TYPE_SAVE_ROUTE_INFO",
+      "existsComponent": false
+    }
+  ],
+  "components": {
+      "addRouteView": {
+        "templateName":"扩展信息",
+        "templateCode":"addRoute",
+        "package": "servicePackage",
+        "columns":[
+          {
+            "code":"orderTypeCd",
+            "cnCode":"订单类型",
+            "desc":"必填,请填写订单类型",
+            "required":true,
+            "hasDefaultValue":false,
+            "inputType":"select",
+            "selectValue":"Q,D",
+            "selectValueName":"查询,业务受理",
+            "limit":"maxin",
+            "limitParam":"1,4",
+            "limitErrInfo":"订单类型错误",
+            "show": true
+          },
+          {
+            "code":"invokeLimitTimes",
+            "cnCode":"调用次数",
+            "desc":"必填,请填写调用次数",
+            "required":true,
+            "hasDefaultValue":true,
+            "defaultValue":"1000",
+            "inputType":"input",
+            "limit":"num",
+            "limitParam":"",
+            "limitErrInfo":"调用次数错误",
+            "show": false
+          },
+          {
+            "code":"invokeModel",
+            "cnCode":"调用方式",
+            "desc":"可填,请填写消息队列,订单在异步调用时使用",
+            "required":true,
+            "hasDefaultValue":false,
+            "defaultValue":"",
+            "inputType":"select",
+            "selectValue":"S,A",
+            "selectValueName":"同步方式,异步方式",
+            "limit":"maxLength",
+            "limitParam":"50",
+            "limitErrInfo":"消息队列不能超过50",
+            "show": false
+          }
+        ]
+      }
+  }
+}

+ 16 - 0
java110-common/src/main/java/com/java110/common/constant/ServiceCodeConfigMenuConstant.java

@@ -0,0 +1,16 @@
+package com.java110.common.constant;
+
+/**
+ * 配置菜单常量类
+ * Created by wuxw on 2017/5/20.
+ */
+public class ServiceCodeConfigMenuConstant {
+
+    /**
+     * 添加 配置菜单
+     */
+    public static final String BINDING_CONFIGMENU = "menu.configMenu";
+
+
+
+}

+ 1 - 0
java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java

@@ -87,6 +87,7 @@ public class GenerateCodeFactory {
     public static final String CODE_PREFIX_service_id="98";
 
     public static final String MENU_GROUP = "80";
+    public static final String MENU = "70";
     public static final String BASE_PRIVILEGE = "50";
 
     /**