var WXPay = require('wx-pay');

var wxpay = WXPay({
	appid: 'wx6f3ebe44defe336a',
	mch_id: '1232813602',
	partner_key: 'sinotone2014sinotone2014sinotone', //微信商户平台API密钥
	//pfx: fs.readFileSync('./wxpay_cert.p12'), //微信商户平台证书
  //pfx: "sinotone2014sinotone2014sinotone"
});
// var out_trade_no='20160203'+Math.random().toString().substr(2, 10);
// wxpay.createUnifiedOrder({
// 	body: '充值兑换宝币',
// 	out_trade_no: out_trade_no,
// 	total_fee: 1,
// 	spbill_create_ip: '192.168.2.210',
// 	notify_url: 'http://www.gongsibao.com',
// 	trade_type: 'NATIVE',
// 	product_id: '1234567890'
// }, function(err, result){
// 	console.log(result);
// 	//查询订单
// 	//通过微信订单号查
// 	wxpay.queryOrder({ out_trade_no:out_trade_no}, function(err, order){
// 		console.log(order);
// 	});
//
// });

async function queryWxOrder(idkey){
	var p=new Promise((resv,rej)=>{
		 wxpay.queryOrder({ out_trade_no:idkey}, function(err, order){
			if(err){
				return rej(err);
			}else{
				return resv(order);
			}
		});
	});
	return p;
}

async function testQuery(){
	try{
		var result = await queryWxOrder("d942bc2ccd784034af60c2d92079c897");
		console.log(result);
	}catch(e){
		console.log(e);
		console.log("error.................");
	}

}
testQuery();








// 二、框架
// 三、实战





// async function getCacheByKey(k){
//   return k;
// }
// async function buildData(data){
//   console.log(data);
//   console.log("xxxxxxxxxxxxxxxx");
//   console.log(data.length);
//   var ds=[]
//   for(var i=0;i<data.length;i++){
//     console.log(i);
//     var source={name:""};
//     var count=await getCacheByKey(data[i].name);
//     source.name=data[i].name;
//     source.value=count;
//     ds.push(source);
//   }
//   return  ds;
// }
// async function out(){
//   var data=[
//     {"name":"jy"},
//     {"name":"tom"}
//   ];
//   var ds=await buildData(data);
//   console.log(ds);
// }
//
// out();

// async function ok1(){
//   var p=new Promise(function(res,rej){
//     setTimeout(()=>{
//       return res("ok1");
//     },2000);
//   });
//   return p;
// }
// async function ok2(){
//   return "ok2";
// }
// async function ok3(){
//   var k1=await ok1();
//   console.log(k1);
//   var k2=await ok2();
//   console.log(k2);
// }
// ok3();
// const uuidv4 = require('uuid/v4');
// var u=uuidv4()
// console.log(u.replace(/\-/g,""))
// async function testAsync1(){
//   return 5;
// }
//
// async function testAsync2(){
//   return 5;
// }
// async function testAsync3(){
//   var x=  await testAsync1();
//   var y=  await testAsync2();
//   return 5;
// }

// var x=testAsync().then(function(r){
//   console.log(r);
//   return 6;
// }).then(function(r){
//   console.log(r);
//   return 7;
// });
// x.then(function(r){
//   console.log(r);
// }).catch(function(err){
//
// });
// function getArgs(func){
// 		//匹配函数括号里的参数
// 		var args=func.toString().match(/[async|function]\s.*?\(([^)]*)\)/)[1];
// 		//分解参数成数组
// 		return args.split(",").map(function (arg){
// 			//去空格和内联注释
// 			return arg.replace(/\/\*.*\*\//,"").trim();
// 		}).filter(function(args) {
// 			//确保没有undefineds
// 			return args;
// 		});
// }
// console.log(convertoss["testMethod"].toString());
// var inObj={a:"hello",b:"ok"}
// var p=convertoss["testMethod"].apply(convertoss,["hello","kkkk"]);
// var args=getArgs(convertoss["testMethod"])
// console.log(args);
//var p=convertoss["testMethod"].call(convertoss,["hello"]);
//var p=Reflect.apply(,convertoss,"hello");
// p.then(function(r){
// 	console.log(r);
// });
// convertoss.convert2pdf(key).then(function(result){
// 	console.log(result);
// }).catch(function(e){
// 	console.log(e);
// });


// var routes=[
//     {
//       path:'/',components:{
//          default:componentFactory("products"),
//         // shows:demo
//       }
//     },
//     {
//       path:'/products/:id/detail',components:{
//          default:componentFactory("detail"),
//          //shows:demo
//       }
//     },
//     {
//       path:'/platform/apps',components:{
//          default:componentFactory("apps"),
//          //shows:demo
//       }
//     },
//     {
//       path:'/platform/users',components:{
//          default:componentFactory("users"),
//          //shows:demo
//       }
//     },
//     {
//       path:'/platform/op/oplogs',components:{
//          default:componentFactory("oplogs"),
//          //shows:demo
//       }
//     },
// ]

const Sequelize = require('sequelize');
const settings = require("../../../config/settings")
const fs = require("fs")
const path = require("path");
class DbFactory {
  constructor() {
    const dbConfig = settings.database();
    this.db = new Sequelize(dbConfig.dbname,
      dbConfig.user,
      dbConfig.password,
      dbConfig.config);

    this.db.Sequelize = Sequelize;
    this.db.Op = Sequelize.Op;
    this.initModels();
    this.initRelations();
  }
  async initModels() {
    var self = this;
    var modelpath = path.normalize(path.join(__dirname, '..')) + "/models/";
    var models = fs.readdirSync(modelpath);
    models.forEach(function (m) {
      self.db.import(modelpath + m);
    });
    console.log("init models....");
  }
  async initRelations() {
    /**
      一个账户对应多个登陆用户
      一个账户对应一个commany
      一个APP对应多个登陆用户
      一个APP有多个角色
      登陆用户和角色多对多
    **/

    /*建立用户和角色之间的关系*/
    this.db.models.user.belongsToMany(this.db.models.role, { as: "Roles", through: 'p_userrole', constraints: false, });
    this.db.models.role.belongsToMany(this.db.models.user, { as: "Users", through: 'p_userrole', constraints: false, });
    /*建立频道和文章之间的关系*/
    this.db.models.article.belongsTo(this.db.models.newschannel, { constraints: false, });
    this.db.models.newschannel.hasMany(this.db.models.article, { constraints: false, });

    this.db.models.user.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.role.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.article.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.newschannel.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.serviceitem.belongsTo(this.db.models.producttype, { constraints: false, });
    this.db.models.auth.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.producttype.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.footerinfo.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.serviceitem.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.need.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.moneyaccount.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.order.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.orderflow.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.customerinfo.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.customercontacts.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.receiptvoucher.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.expensevoucher.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.moneyjourney.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.moneyjourney.belongsTo(this.db.models.moneyaccount, { constraints: false, });
    this.db.models.trademark.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.tmstuff.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.tmofficial.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.invoiceapply.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.useraddr.belongsTo(this.db.models.company, { constraints: false, });

    //项目管理
    this.db.models.pmproduct.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.pmproject.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.pmfollow.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.pmquestion.belongsTo(this.db.models.company, { constraints: false, });
    this.db.models.pmproject.belongsTo(this.db.models.pmproduct, { constraints: false, });
    this.db.models.pmfollow.belongsTo(this.db.models.pmproject, { constraints: false, });
    this.db.models.pmquestion.belongsTo(this.db.models.pmproject, { constraints: false, });

    this.db.models.pmfollow.belongsTo(this.db.models.user, { as: 'follower',constraints: false, });
    this.db.models.pmquestion.belongsTo(this.db.models.user, {  as: 'subber',constraints: false, });
    this.db.models.pmquestion.belongsTo(this.db.models.user, {  as: 'exector',constraints: false, });

    //订单流程表引用用户信息
    this.db.models.orderflow.belongsTo(this.db.models.user, { as: 'createuser', constraints: false, });

    //商标材料引用用户表
    this.db.models.tmstuff.belongsTo(this.db.models.user, { as: 'createuser', constraints: false, });
    //商标材料引用订单表
    this.db.models.tmstuff.belongsTo(this.db.models.order, { constraints: false, });
    //订单表引用用户信息
    this.db.models.order.belongsTo(this.db.models.user, { as: 'createuser', constraints: false, });
    this.db.models.order.belongsTo(this.db.models.user, { as: 'updateuser', constraints: false, });
    //订单
    this.db.models.order.belongsTo(this.db.models.customerinfo, { constraints: false, });
    this.db.models.order.belongsTo(this.db.models.receiptvoucher, { constraints: false, });
    this.db.models.order.hasMany(this.db.models.tmstuff, { constraints: false, });
    this.db.models.order.hasOne(this.db.models.invoiceapply, { constraints: false, });



    // 客户联系人引用客户信息
    this.db.models.customercontacts.belongsTo(this.db.models.customerinfo, { constraints: false, });

    //发票申请引用用户表
    this.db.models.invoiceapply.belongsTo(this.db.models.user, { as: 'createuser', constraints: false, });
    this.db.models.invoiceapply.belongsTo(this.db.models.user, { as: 'audituser', constraints: false, });
    this.db.models.invoiceapply.belongsTo(this.db.models.user, { as: 'updateuser', constraints: false, });
    //发票申请引用订单表
    this.db.models.invoiceapply.belongsTo(this.db.models.order, { constraints: false, });


    //收款单引用帐户信息
    this.db.models.receiptvoucher.belongsTo(this.db.models.moneyaccount, { constraints: false, });
    //收款单表引用用户信息
    this.db.models.receiptvoucher.belongsTo(this.db.models.user, { as: 'createuser', constraints: false, });
    this.db.models.receiptvoucher.belongsTo(this.db.models.user, { as: 'updateuser', constraints: false, });
    this.db.models.receiptvoucher.belongsTo(this.db.models.user, { as: 'payuser', constraints: false, });
    this.db.models.receiptvoucher.belongsTo(this.db.models.user, { as: 'audituser', constraints: false, });

    //费用表引用帐户信息
    this.db.models.expensevoucher.belongsTo(this.db.models.moneyaccount, { constraints: false, });
    //费用表引用用户信息
    this.db.models.expensevoucher.belongsTo(this.db.models.user, { as: 'createuser', constraints: false, });
    this.db.models.expensevoucher.belongsTo(this.db.models.user, { as: 'updateuser', constraints: false, });
    this.db.models.expensevoucher.belongsTo(this.db.models.user, { as: 'audituser', constraints: false, });

    //订单流程表引用用户信息
    this.db.models.moneyjourney.belongsTo(this.db.models.user, { as: 'createuser', constraints: false, });

    //商标表引用用户信息
    this.db.models.trademark.belongsTo(this.db.models.user, { as: 'createuser', constraints: false, });
    this.db.models.trademark.belongsTo(this.db.models.user, { as: 'updateuser', constraints: false, });
    this.db.models.trademark.belongsTo(this.db.models.user, { as: 'audituser', constraints: false, });
    this.db.models.trademark.hasMany(this.db.models.tmofficial, { constraints: false, });

    //商标官文引用用户表
    this.db.models.tmofficial.belongsTo(this.db.models.user, { as: 'createuser', constraints: false, });
    //商标官文引用商标表
    this.db.models.tmofficial.belongsTo(this.db.models.trademark, { constraints: false, });

    //用户地址引用用户表
    this.db.models.useraddr.belongsTo(this.db.models.user, { constraints: false, });
  }
  //async getCon(){,用于使用替换table模型内字段数据使用
  getCon() {
    var that = this;
    // await this.db.authenticate().then(()=>{
    //   console.log('Connection has been established successfully.');
    // }).catch(err => {
    //   console.error('Unable to connect to the database:', err);
    //   throw err;
    // });
    //同步模型
    if (settings.env == "dev") {
    }
    return this.db;
  }
}
module.exports = DbFactory;

module.exports = {
    "appid": "wx76a324c5d201d1a4",
    "label": "知识产权运营平台",
    "config": {
        "rstree": {
            "code": "toolroot",
            "label": "工具箱",
            "children": [
                {
                    "code": "roleview",
                    "bizCode": "roleview",
                    "isleft": true,
                    "label": "每日概览",
                    "icon": "el-icon-menu",
                    "isMenu": true,
                    "bizConfig": null,
                    "path": "",
                    "isctl": "no"
                },
                {
                    "code": "pmg",
                    "isleft": true,
                    "label": "平台管理",
                    "icon": "el-icon-menu",
                    "isSubmenu": true,
                    "children": [
                        {
                            "code": "sitemag", "isGroup": true, "icon": "el-icon-news", "label": "站点管理", "children": [
                                {
                                    "code": "company",
                                    "label": "站点列表",
                                    "isMenu": true,
                                    "bizCode": "company",
                                    "bizConfig": null,
                                    "path": ""
                                },
                            ]
                        },
                        {
                            "code": "pmmag", "isGroup": true, "icon": "el-icon-news", "label": "项目管理", "children": [
                                {
                                    "code": "pmproduct",
                                    "label": "产品管理",
                                    "isMenu": true,
                                    "bizCode": "pmproduct",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "pmproject",
                                    "label": "项目管理",
                                    "isMenu": true,
                                    "bizCode": "pmproject",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "pmfollow",
                                    "label": "跟进管理",
                                    "isMenu": true,
                                    "bizCode": "pmfollow",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "mypmfollow",
                                    "label": "我的跟进",
                                    "isMenu": true,
                                    "bizCode": "mypmfollow",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "pmquestion",
                                    "label": "问题管理",
                                    "isMenu": true,
                                    "bizCode": "pmquestion",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "mypmquestion",
                                    "label": "我的问题",
                                    "isMenu": true,
                                    "bizCode": "mypmquestion",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "mysubpmquestion",
                                    "label": "我提出的问题",
                                    "isMenu": true,
                                    "bizCode": "mysubpmquestion",
                                    "bizConfig": null,
                                    "path": ""
                                },
                            ]
                        },
                    ],
                },
                {
                    "code": "entcenter",
                    "isleft": true,
                    "label": "企业中心",
                    "icon": "el-icon-menu",
                    "isSubmenu": true,
                    "children": [
                        {
                            "code": "bizmag", "isGroup": true, "icon": "el-icon-news", "label": "业务管理", "children": [
                                {
                                    "code": "order",
                                    "label": "订单管理",
                                    "isMenu": true,
                                    "bizCode": "order",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "myordermag",
                                    "label": "我的订单",
                                    "isMenu": true,
                                    "bizCode": "myordermag",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "agencytmreg",
                                    "label": "代理人辅助商标注册",
                                    "isMenu": true,
                                    "bizCode": "agencytmreg",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "agencyotherreg",
                                    "label": "代下其他订单",
                                    "isMenu": true,
                                    "bizCode": "agencyotherreg",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "createwts",
                                    "label": "生成委托书",
                                    "isMenu": true,
                                    "bizCode": "createwts",
                                    "bizConfig": null,
                                    "path": ""
                                },
                            ]
                        },
                        {
                            "code": "fimag", "isGroup": true, "icon": "el-icon-news", "label": "财务管理", "children": [
                                {
                                    "code": "invoiceapply",
                                    "label": "发票管理",
                                    "isMenu": true,
                                    "bizCode": "invoiceapply",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "expensevoucher",
                                    "label": "费用管理",
                                    "isMenu": true,
                                    "bizCode": "expensevoucher",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "receiptvoucher",
                                    "label": "收款管理",
                                    "isMenu": true,
                                    "bizCode": "receiptvoucher",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "moneyaccount",
                                    "label": "企业账户",
                                    "isMenu": true,
                                    "bizCode": "moneyaccount",
                                    "bizConfig": null,
                                    "path": ""
                                },
                            ]
                        },
                        {
                            "code": "rptsta", "isGroup": true, "dilivermag": true, "icon": "el-icon-news", "label": "报表统计", "children": [
                                {
                                    "code": "moneyjourney",
                                    "label": "交易报表",
                                    "isMenu": true,
                                    "bizCode": "moneyjourney",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "profitrpt",
                                    "label": "利润报表",
                                    "isMenu": true,
                                    "bizCode": "profitrpt",
                                    "bizConfig": null,
                                    "path": ""
                                },
                            ]
                        },
                        {
                            "code": "crm", "dilivermag": true, "icon": "el-icon-news", "label": "交付管理", "children": [
                                {
                                    "code": "flowaudit",
                                    "label": "流程审核",
                                    "isMenu": true,
                                    "bizCode": "flowaudit",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "arcmag",
                                    "label": "官文管理",
                                    "isMenu": true,
                                    "bizCode": "arcmag",
                                    "bizConfig": null,
                                    "path": ""
                                },
                            ]
                        },
                        {
                            "code": "crm", "isGroup": true, "icon": "el-icon-news", "label": "客户管理", "children": [
                                {
                                    "code": "clientneed",
                                    "label": "咨询需求",
                                    "isMenu": true,
                                    "bizCode": "clientneed",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "customerinfo",
                                    "label": "客户档案",
                                    "isMenu": true,
                                    "bizCode": "customerinfo",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "mycustomerinfo",
                                    "label": "我的客户",
                                    "isMenu": true,
                                    "bizCode": "mycustomerinfo",
                                    "bizConfig": null,
                                    "path": ""
                                },
                            ]
                        },
                        {
                            "code": "productmag", "isGroup": true, "icon": "el-icon-news", "label": "产品管理", "children": [
                                {
                                    "code": "producttype",
                                    "label": "产品类型",
                                    "isMenu": true,
                                    "bizCode": "producttype",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "productcrud",
                                    "label": "产品维护",
                                    "isMenu": true,
                                    "bizCode": "productcrud",
                                    "bizConfig": null,
                                    "path": ""
                                },
                            ]
                        },
                        {
                            "code": "sitemag", "isGroup": true, "icon": "el-icon-news", "label": "网站管理", "children": [
                                {
                                    "code": "newschannel",
                                    "label": "频道管理",
                                    "isMenu": true,
                                    "bizCode": "newschannel",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "article",
                                    "label": "资讯管理",
                                    "isMenu": true,
                                    "bizCode": "article",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "loopplay",
                                    "label": "轮播管理",
                                    "isMenu": true,
                                    "bizCode": "loopplay",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "siteinfo",
                                    "label": "站点信息",
                                    "isMenu": true,
                                    "bizCode": "siteinfo",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "footerinfo",
                                    "label": "页脚信息",
                                    "isMenu": true,
                                    "bizCode": "footerinfo",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "articledetail",
                                    "label": "文章内容",
                                    "isMenu": false,
                                    "bizCode": "articledetail",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "channelquery",
                                    "label": "更多文章",
                                    "isMenu": false,
                                    "bizCode": "channelquery",
                                    "bizConfig": null,
                                    "path": ""
                                },
                            ]
                        },
                        {
                            "code": "sysmg", "isGroup": true, "icon": "el-icon-news", "label": "系统管理", "children": [
                                {
                                    "code": "users",
                                    "label": "用户管理",
                                    "isMenu": true,
                                    "bizCode": "users",
                                    "bizConfig": null,
                                    "path": ""
                                },
                                {
                                    "code": "roles",
                                    "label": "角色管理",
                                    "isMenu": true,
                                    "bizCode": "roles",
                                    "bizConfig": null,
                                    "path": ""
                                },
                            ]
                        },
                    ],
                },
                {
                    "code": "usercenter",
                    "isleft": true,
                    "label": "个人中心",
                    "icon": "el-icon-menu",
                    "isSubmenu": true,
                    "children": [
                        {
                            "code": "myorder",
                            "label": "我的订单",
                            "isMenu": true,
                            "bizCode": "myorder",
                            "bizConfig": null,
                            "path": "",
                            "children": [],
                        },
                        {
                            "code": "myinvoiceapply",
                            "label": "我的发票",
                            "isMenu": true,
                            "bizCode": "myinvoiceapply",
                            "bizConfig": null,
                            "path": ""
                        },
                        {
                            "code": "myarcmag",
                            "label": "我的官文",
                            "isMenu": true,
                            "bizCode": "myarcmag",
                            "bizConfig": null,
                            "path": ""
                        },
                        {
                            "code": "useraddr",
                            "label": "地址管理",
                            "isMenu": true,
                            "bizCode": "useraddr",
                            "bizConfig": null,
                            "path": ""
                        },
                        {
                            "code": "actsetting",
                            "label": "账号设置",
                            "isMenu": true,
                            "bizCode": "actsetting",
                            "bizConfig": null,
                            "path": ""
                        },
                    ],
                },
                {
                    "code": "toolCenter",
                    "label": "辅助工具配置",
                    "src": "",
                    "isSubmenu": false,
                    "isMenu": false,
                    "children": [
                        {
                            "code": "tools", "isGroup": true, "label": "发票申请相关", "children": [
                                {
                                    "code": "invoiceorderreference",
                                    "label": "订单参照",
                                    "bizCode": "invoiceorderreference",
                                    "bizConfig": null,
                                    "path": ""
                                },

                            ],
                        }
                    ],
                },
                {
                    "code": "home",
                    "istop": true,
                    "icon": "",
                    "isMenu": true,
                    "label": "首页",
                    "bizCode": "home",
                    "bizConfig": null,
                    "path": "",
                    "isctl": "no"
                },
                {
                    "code": "bycquerytm",
                    "bizCode": "bycquerytm",
                    "istop": true,
                    "label": "标眼查",
                    "icon": "",
                    "isMenu": true,
                    "bizConfig": null,
                    "path": "",
                    "isctl": "no"
                },
                {
                    "code": "bytmmonit",
                    "bizCode": "bytmmonit",
                    "istop": true,
                    "label": "商标监控",
                    "icon": "",
                    "isMenu": true,
                    "bizConfig": null,
                    "path": "",
                    "isctl": "no"
                },
                {
                    "code": "siteapply",
                    "bizCode": "siteapply",
                    "istop": true,
                    "label": "网站开通",
                    "icon": "",
                    "isMenu": true,
                    "bizConfig": null,
                    "path": "",
                    "isctl": "no"
                },
                {
                    "code": "openPlatform",
                    "bizCode": "openPlatform",
                    "istop": true,
                    "label": "开放平台",
                    "icon": "",
                    "isMenu": true,
                    "bizConfig": null,
                    "path": "",
                    "isctl": "no"
                },
                {
                    "code": "moreservice",
                    "icon": "fa fa-home",
                    "isMenu": false,
                    "label": "首页更多服务",
                    "bizCode": "moreservice",
                    "bizConfig": null,
                    "path": "",
                },{
                    "code": "servicedetails",
                    "icon": "fa fa-home",
                    "isMenu": false,
                    "label": "服务详情",
                    "bizCode": "servicedetails",
                    "bizConfig": null,
                    "path": "",
                },
                {
                    "code": "bycdetailtm",
                    "icon": "fa fa-home",
                    "isMenu": false,
                    "label": "商标查询详情",
                    "bizCode": "bycdetailtm",
                    "bizConfig": null,
                    "path": "",
                },
                {
                    "code": "bycnoticedetailtm",
                    "icon": "fa fa-home",
                    "isMenu": false,
                    "label": "商标公告详情",
                    "bizCode": "bycnoticedetailtm",
                    "bizConfig": null,
                    "path": "",
                },
                {
                    "code": "aboutus",
                    "icon": "fa fa-home",
                    "isMenu": false,
                    "label": "关于我们",
                    "bizCode": "aboutus",
                    "bizConfig": null,
                    "path": "",
                },
                {
                    "code": "register",
                    "icon": "fa fa-home",
                    "isMenu": false,
                    "label": "注册",
                    "bizCode": "register",
                    "bizConfig": null,
                    "path": "",
                },
                {
                    "code": "login",
                    "icon": "fa fa-home",
                    "path": "login",
                    "isMenu": false,
                    "label": "登录",
                    "bizCode": "login",
                    "bizConfig": null,
                    "path": "",
                    "istop": true
                },
                {
                    "code": "bytmmonitlist",
                    "label": "商标监控列表",
                    "bizCode": "bytmmonitlist",
                    "bizConfig": null,
                    "path": ""
                },
                {
                    "code": "bytmmonitagency",
                    "label": "商标监控代理机构",
                    "bizCode": "bytmmonitagency",
                    "bizConfig": null,
                    "path": ""
                },
                {
                    "code": "bytmmonitdynamics",
                    "label": "商标监控动态",
                    "bizCode": "bytmmonitdynamics",
                    "bizConfig": null,
                    "path": ""
                },
                {
                    "code": "bytmmonitlistdetails",
                    "label": "商标监控列表详情搜索",
                    "bizCode": "bytmmonitlistdetails",
                    "bizConfig": null,
                    "path": ""
                },
            ],
        },
        "bizs": {
            "pmproduct": { "title": "项目产品管理", "config": null, "path": "/pmproduct", "comname": "pmproduct" },
            "pmproject": { "title": "项目管理", "config": null, "path": "/pmproject", "comname": "pmproject" },
            "pmfollow": { "title": "项目跟进", "config": null, "path": "/pmfollow", "comname": "pmfollow" },
            "mypmfollow": { "title": "我的跟进", "config": null, "path": "/mypmfollow", "comname": "pmfollow" },
            "pmquestion": { "title": "问题管理", "config": null, "path": "/pmquestion", "comname": "pmquestion" },
            "mypmquestion": { "title": "我的问题", "config": null, "path": "/mypmquestion", "comname": "pmquestion" },
            "mysubpmquestion": { "title": "我提交的问题", "config": null, "path": "/mysubpmquestion", "comname": "pmquestion" },
            "roleview": { "title": "每日概览", "config": null, "path": "/roleview", "comname": "roleview" },
            "company": { "title": "公司站点", "config": null, "path": "/company", "comname": "company" },
            "home": { "title": "首页", "config": null, "path": "/", "comname": "home" },
            "moreservice": { "title": "首页更多服务", "config": null, "path": "/moreservice", "comname": "moreservice" },
            "servicedetails": { "title": "服务详情", "config": null, "path": "/servicedetails", "comname": "servicedetails" },
            "bycdetailtm": { "title": "商标查询详情", "config": null, "path": "/bycdetailtm", "comname": "bycdetailtm" },
            "bycnoticedetailtm": { "title": "商标公告详情", "config": null, "path": "/bycnoticedetailtm", "comname": "bycnoticedetailtm" },
            "aboutus": { "title": "关于我们", "config": null, "path": "/aboutus", "comname": "aboutus" },
            "register": { "title": "注册", "config": null, "path": "/register", "comname": "register" },
            "login": { "title": "登录", "config": null, "path": "/login", "comname": "login" },
            "newschannel": { "title": "频道管理", "config": null, "path": "/newschannel", "comname": "newschannel" },
            "article": { "title": "资讯管理", "config": null, "path": "/article", "comname": "article" },
            "loopplay": { "title": "轮播管理", "config": null, "path": "/loopplay", "comname": "loopplay" },
            "articledetail": { "title": "文章查看", "config": null, "path": "/articledetail/:id", "comname": "articledetail" },
            "channelquery": { "title": "按频道查看", "config": null, "path": "/channelquery/:id", "comname": "channelquery" },
            "users": { "title": "用户管理", "config": null, "path": "/users", "comname": "users" },
            "roles": { "title": "角色管理", "config": null, "path": "/roles", "comname": "roles" },
            "bycquerytm": { "title": "标眼查", "config": null, "path": "/bycquerytm", "comname": "bycquerytm" },
            "bytmmonit": { "title": "商标监控", "config": null, "path": "/bytmmonit", "comname": "bytmmonit" },
            "openPlatform": { "title": "开放平台", "config": null, "path": "/openPlatform", "comname": "openPlatform" },
            "tmregister": { "title": "商标注册", "config": null, "path": "/tmregister", "comname": "tmregister" },
            "siteapply": { "title": "网站开通", "config": null, "path": "/siteapply", "comname": "siteapply" },
            "siteinfo": { "title": "站点信息", "config": null, "path": "/siteinfo", "comname": "siteapply" },
            "footerinfo": { "title": "公司信息", "config": null, "path": "/footerinfo", "comname": "footerinfo" },
            "clientneed": { "title": "客户需求", "config": null, "path": "/clientneed", "comname": "clientneed" },
            "producttype": { "title": "产品类型", "config": null, "path": "/producttype", "comname": "producttype" },
            "productcrud": { "title": "产品维护", "config": null, "path": "/productcrud", "comname": "productcrud" },
            "order": { "title": "订单管理", "config": null, "path": "/order", "comname": "order" },
            "myordermag": { "title": "我的订单", "config": null, "path": "/myordermag", "comname": "order" },
            "agencytmreg": { "title": "代理人辅助商标注册", "config": null, "path": "/agencytmreg/:code=dlrfzzc", "comname": "agencytmreg" },
            "agencyotherreg": { "title": "代下他订单", "config": null, "path": "/agencyotherreg", "comname": "agencyotherreg" },
            "invoiceapply": { "title": "发票管理", "config": null, "path": "/invoiceapply", "comname": "myinvoiceapply" },
            "receiptvoucher": { "title": "收款管理", "config": null, "path": "/receiptvoucher", "comname": "receiptvoucher" },
            "expensevoucher": { "title": "费用管理", "config": null, "path": "/expensevoucher", "comname": "expensevoucher" },
            "moneyaccount": { "title": "企业账户", "config": null, "path": "/moneyaccount", "comname": "moneyaccount" },
            "moneyjourney": { "title": "交易报表", "config": null, "path": "/moneyjourney", "comname": "moneyjourney" },
            "profitrpt": { "title": "利润报表", "config": null, "path": "/profitrpt", "comname": "profitrpt" },
            "arcmag": { "title": "官文管理", "config": null, "path": "/arcmag", "comname": "arcmag" },
            "flowaudit": { "title": "流程审核", "config": null, "path": "/flowaudit", "comname": "flowaudit" },
            "customerinfo": { "title": "客户档案", "config": null, "path": "/customerinfo", "comname": "customerinfo" },
            "mycustomerinfo": { "title": "我的客户", "config": null, "path": "/mycustomerinfo", "comname": "mycustomerinfo" },
            "myorder": { "title": "我的订单", "config": null, "path": "/myorder", "comname": "myorder" },
            "myinvoiceapply": { "title": "我的发票", "config": null, "path": "/myinvoiceapply", "comname": "myinvoiceapply" },
            "myarcmag": { "title": "我的官文", "config": null, "path": "/myarcmag", "comname": "myarcmag" },
            "useraddr": { "title": "地址管理", "config": null, "path": "/useraddr", "comname": "useraddr" },
            "actsetting": { "title": "账号设置", "config": null, "path": "/actsetting", "comname": "actsetting" },
            "bytmmonitlist": {
                "title": "商标监控列表",
                "config": null,
                "path": "/bytmmonitlist",
                "comname": "bytmmonitlist"
            },
            "bytmmonitagency": {
                "title": "商标监控代理机构",
                "config": null,
                "path": "/bytmmonitagency",
                "comname": "bytmmonitagency"
            },
            "bytmmonitdynamics": {
                "title": "商标监控动态",
                "config": null,
                "path": "/bytmmonitdynamics",
                "comname": "bytmmonitdynamics"
            },
            "bytmmonitlistdetails": {
                "title": "商标监控列表详情搜索",
                "path": "/bytmmonitlistdetails",
                "comname": "bytmmonitlistdetails"
            },
            "createwts": {
                "title": "生成委托书",
                "config": null,
                "path": "/createwts",
                "comname": "createwts"
            },
        },
        "pauths": [
            "add", "edit", "delete", "export", "show"
        ],
        "pdict": {
            "tmCompanyAuditStatus": { "0": "待审核", "1": "审核通过", "2": "审核驳回", "3": "已过期" },
            "businessallowstatus": { "1": "待接单", "2": "已接单", "4": "拒接", "8": "成功", "16": "失败" },
            "noticeType": { "sms": "短信", "email": "邮件", "wechat": "微信" },
            "eflowstatus": { 0: "草稿", 1: "签署中", 2: "已完成", 3: "已撤销", 4: "已终止", 5: "已过期", 6: "已删除", 7: "已拒签" },
            "authType": { "add": "新增", "edit": "编辑", "delete": "删除", "export": "导出", "show": "查看" },
            "mediaType": { "vd": "视频", "ad": "音频", "qt": "其它" },
            "usageType": { "kt": "课堂", "taxkt": "财税课堂", "qt": "其它" },
            "opstatus": { "0": "失败", "1": "成功" },
            "sex": { "male": "男", "female": "女" },
            "configType": { "price": "宝币兑换率", "initGift": "初次赠送" },
            "productCata": {
                "ip": "商标", "ic": "版权", "pa": "专利", "iso": "海外业务", "common": "增值服务", "icbc": "工商注册",
                "zscq": "知识产权", "cwfw": "财务服务", "hyzz": "行业资质", "gqzr": "股权转让", "xzsp": "行政审批"
            },
            //"productCata": {"ip": "商标", "ic": "版权", "tax": "财税", "pa": "专利", "common": "常用"},
            "funcCata": { "clueDig": "商机挖掘", "query": "常见查询", "prof": "专用工具", "cp": "版权工具", "common": "常用工具", "pat": "专利工具" },
            "logLevel": { "debug": 0, "info": 1, "warn": 2, "error": 3, "fatal": 4 },
            "tradeType": {
                "fill": "充值宝币", "consume": "消费宝币", "gift": "赠送宝币", "giftMoney": "红包", "refund": "退款", "payment": "付款",
                "orderTrade": "订单交易", "orderRefund": "订单退款", "orderPersonFee": "订单个人分润", "orderPlatformFee": "订单平台分润",
                "recommendFee": "推荐分润", "tmSubDeductCoin": "商标提报宝币扣除", "cashWithdrawal": "现金提现", "platUseFee": "平台使用费",
                "publicExpense": "官费", "invoiceTaxes": "税费", "subPublicExpense": "上缴官费", "returnPublicExpense": "官费退回"
            },
            "tradeStatus": { "unSettle": "未结算", "settled": "已结算" },
            "tmNclOne": {
                "1": "第01类 化学原料", "2": "第02类 颜料油漆", "3": "第03类 日化用品", "4": "第04类 燃料油脂", "5": "第05类 医药",
                "6": "第06类 金属材料", "7": "第07类 机械设备", "8": "第08类 手工器械", "9": "第09类 科学仪器", "10": "第10类 医疗器械",
                "11": "第11类 灯具空调", "12": "第12类 运输工具", "13": "第13类 军火烟火", "14": "第14类 珠宝钟表", "15": "第15类 乐器",
                "16": "第16类 办公用品", "17": "第17类 橡胶制品", "18": "第18类 皮革皮具", "19": "第19类 建筑材料", "20": "第20类 家具",
                "21": "第21类 厨房洁具", "22": "第22类 绳网袋篷", "23": "第23类 纱线丝", "24": "第24类 布料床单", "25": "第25类 服装鞋帽",
                "26": "第26类 纽扣拉链", "27": "第27类 地毯席垫", "28": "第28类 健身器材", "29": "第29类 食品", "30": "第30类 方便食品",
                "31": "第31类 饲料种籽", "32": "第32类 啤酒饮料", "33": "第33类 酒", "34": "第34类 烟草烟具", "35": "第35类 广告销售",
                "36": "第36类 金融物管", "37": "第37类 建筑修理", "38": "第38类 通讯服务", "39": "第39类 运输贮藏", "40": "第40类 材料加工",
                "41": "第41类 教育娱乐", "42": "第42类 网站服务", "43": "第43类 餐饮住宿", "44": "第44类 医疗园艺", "45": "第45类 社会服务"
            },
            "chineseSearchOption": { "py": "查拼音", "tyz": "同音字", "xsz": "形似字", "ywty": "英文同义" },
            "partnerinfoSkill": { "tm": "商标", "pa": "专利", "sc": "软件著作权" },
            "englishSearchOption": { "zwty": "中文同义", "tyhz": "同音汉字" },
            "tm_status": { "dsz": "待审中", "ycs": "已初审", "yxzc": "有效注册", "ybh": "已驳回", "yxw": "已销亡" },
            "tm_form_type": { "1": "立体", "3": "字", "4": "图", "5": "字图", "6": "颜色", "7": "彩色" },
            "tm_type": { "p": "普通商标", "j": "集体商标", "z": "证明商标", "t": "特殊商标" },
            "ncl_calc_status": { 1: "未创建订单", 2: "已创建订单" },
            "copyright_status": { 1: "未关联订单", 2: "已关联订单" },
            "ncl_calc_calcType": { 1: "自主创建", 2: "商标特殊处理" },
            "product_unit": { 0: "人民币", 1: "美元" },
            "order_type": { "zzdd": "自主订单", "dkxd": "代客下单" },
            "receipt_type": { "sk": "收款", "tk": "退款", "zz": "转账", "csrz": "初始入账" },
            "expense_type": { "gf": "官费", "sxf": "手续费", "tax": "税金" },
            "stuff_type": { "csty": "彩色图样", "wts": "委托书", "gzwts": "盖章委托书", "ty": "图样", "sywj": "声音文件", "smwj": "说明文件" },
            "payType": { "wx": "微信", "zfb": "支付宝", "yh": "银行卡" },
            "payResult": { "Fail": "失败", "Success": "成功" },
            "tmSourceType": { 1: "PC", 2: "移动端", 4: "渠道", 8: "beehive" },
            "user_show_order_status": { 1: "显示", 2: "用户删除", 4: "系统过期删除" },
            "order_pay_status": { "dfk": "未付款", "yfk": "已付款", "ddqx": "订单取消", "tkclz": "退款处理中", "ytk": "已退款" },
            "order_flow_status": { "1": "提交订单", "2": "已付款", "3": "已审核-待递交", "4": "已递交", "5": "已完成" },
            "order_status": { "1": "提交订单", "2": "待上传材料", "3": "待审核", "4": "审核不通过", "5": "待递交", "6": "部分递交异常", "7": "已完成" },
            "audit_status": { "dsh": "待审核", "btg": "不通过", "tg": "通过" },
            "direction_type": { "sr": "收", "zc": "支" },
            "msg_notice_type": { "friend": "朋友", "boss": "老板" },
            "customer_type": { "ent": "企业", "person": "个人" },
            "invoice_status": { "submitted": "已提交", "processing": "处理中", "finished": "已完成" },
            "tm_apply_type": { "ent": "企业", "person": "个人" },
            "tm_apply_types": { "ent": "企业" },
            "op_type": { "applying": "申请中", "issued": "已发放", "issueError": "发放异常" },
            "tmFirstOrder": { 0: "否", 1: "是" },
            "partnerStatus": { 0: "禁用", 1: "启用" },
            "invoice_type": { "1": "电子普通发票", "2": "纸质普通发票", "3": "纸质专用发票" },
            "invoice_apply_status": { "1": "未申请", "2": "已申请" },
            "copyright_type": { "rjzz": "软件著作权", "zpzz": "作品著作权" },
            "composition_type": {
                "wz": "文字", "ks": "口述", "yl": "音乐", "xj": "戏剧", "qy": "曲艺", "wd": "舞蹈", "zjys": "杂技艺术", "ms": "美术", "jz": "建筑", "sy": "摄影", "dy": "电影和类似摄制电影方法创作的作品",
                "tx": "图形", "mj": "模型", "qt": "其他"
            },
            "statusProgress_status": { "AWAITCHECK": "未提交", "WAITARTIFICIALEXAMINE": "等待人工审核", "AUDITFAIL": "审核不通过", "TRECVED": "受理中", "NOTRECVED": "不予受理", "PASSED": "审核通过", "UPLOADAPPLYDOCUMENT": "已上传申请表", "FINISH": "完成", "DISCARDED": "废弃" },
            "patents_type": { "fm": "发明专利", "wg": "外观专利", "syxx": "实用新型" },
            "applicantrequire_type": { "fyjh": "费用减缓", "yqyxq": "要求优先权", "qqtqgk": "请求提前公开", "szsc": "实质审查", "qlyqcx": "权力要求超项", "bmsc": "保密审查" },
            "source_type": { "order": "订单", "expensevoucher": "费用单", "receiptvoucher": "收款单" },//order与订单表的bizcode保持一致
            "official_type": { "1": "申请书", "2": "受理通知书", "3": "驳回通知书", "4": "初审公告书", "5": "商标注册证" },
            "opType": { "person": "人工", "machine": "机器人" },
            "case_type": { "sbzc": "商标注册", "sbbg": "商标变更", "sbbh": "商标驳回" },
            "msgType": { "sys": "系统", "single": "单点", "multi": "群发", "mryzSingle": "每日易照单点", "mryzLicense": "群发", },
            "log_type": { "orderlog": "订单日志", "tmlog": "商标流程日志" },
            "tm_tscl_type": { "NOTRECVED": "不予受理", "FILLEXCEPTION": "填报异常" },
            "chance_type": { "tmReg": "商标注册" },
            "need_status": { "1": "待服务", "2": "跟进中", "4": "已完成" },
            "platform_chance_type": { "common": "普通" },
            "service_evaluation": { "0": "差评", "5": "一般", "10": "好评" },
            "account_log_type": { "platform": "平台", "user": "用户" },
            "profitRatioType": { "platformWork": "委托作业", "selfWork": "自助作业" },
            "totalType": { "zxbxl": "店铺咨询变现率", "kdl": "合伙人开店率", "yhfll": "合伙人分裂率" },
            //cms_servicesitem项目服务表，渠道类型
            "channelType": { "hhr": "合伙人端", "boss": "boss端", "wssy": "微商水印" },
            //b_customer_roll_pic图片资源表，图片类型
            "picType": { "roll": "滚动图片", "placard": "海报图片" },
            //b_customer_roll_pic图片资源表，图片分类
            "picCategory": { "ip": "商标", "ic": "版权", "pa": "专利", "common": "增值" },
            //h_business_chance需求表，商机类型
            "chanceType": {
                "ip": "商标", "ic": "版权", "pa": "专利", "iso": "海外业务", "common": "增值服务", "icbc": "工商注册",
                "zscq": "知识产权", "cwfw": "财务服务", "hyzz": "行业资质", "gqzr": "股权转让", "xzsp": "行政审批"
            },
            //cms_servicesitem  项目小类
            "serviceSmallClassType": {
                "sbzc": "商标注册", "sbxxbg": "商标信息变更", "hjsbza": "化解商标障碍", "yytrsb": "异议他人商标", "hwsbzc": "海外商标注册", "bqdjyw": "版权登记业务",
                "bqqtyw": "版权其他业务", "zlsqyw": "专利申请业务"
            },
            //h_icbc_info工商表，工商类型
            "icbcType": { "hongkong": "香港", "gn": "国内", "gnjssqs": "国内江苏省宿迁市" },
            //h_icbc_info工商表，货币类型
            "regCapitalUnitsType": { "RMB": "万人民币", "HKD": "万港币", "USD": "万美元", "GBP": "万英镑", "JPY": "万日元" },
            "isRecommend": { "0": "否", "1": "是" },
            "paymentPlatformType": { "wx": "微信", "offline": "线下" },
            "sellStatus": { "1": "待售", "2": "已售" },
            "channelProfitType": { 1: "比例分成", 2: "每单分成" },
            "taxType": { "gzxj": "工资薪金" },
            "iit_status": { "0": "未提交", "1": "已提交" },
            "customer_channel_type": { "yjs": "友金所" },
            "companyProperty": { 1: "小规模", 2: "一般" },
            "invoiceVersion": { 1: "十万版", 2: "万元版", 2: "百万版" },
            "changeService": { 1: "包变更", 2: "买家变更" },
            "publishedSources": { 1: "公司", 2: "个人" },
            "registeredCapital": { 1: "小于100万", 2: "100-500万", 4: "501-1000万", 8: "1001-5000万", 16: "大于1000万" },
            "trackType": { 1: "收藏", 2: "访问" },
            "accountType": { "cash": "现金", "bank": "银行", "wx": "微信", "alipay": "支付宝", "other": "其它" },
            "question_status": { "inmiddle": "解决中", "success": "成功解决", "invalid": "无效问题" },
            "urgent_status": { "urgent": "紧急", "general": "一般" },
        }
    }
}
