system-data-controller.js 10.5 KB
var express = require('express');
var router = express.Router();
var client = require('../../client');
var api = require('../api').url;
var Mock = require('mockjs');

router.get('/systemDictionary', function(req, res) {
  	var s=Mock.mock({
  		'data|1-5':[
			{
				'id|+1':1,
				'type|0-1':0,
				'number':'CSBH1',
				'value':'参数1',
				'status|0-1':0,
				'note':'@csentence(10)'
			}
		],'totalPages|2-5':0
  	})
  	res.send(s);
});
router.post('/systemDictionary',function(req,res,next){
	client.post(api.distributor_datadict_getAll, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})

/*router.post('/systemDictionary',function(req,res){
	var s=Mock.mock({
  		'errorCode':'0',
		'id|100-200':0
  	})
  	res.send(s);
})*/
//数据
router.get('/dataDictionary',function(req,res){
	var s=Mock.mock({
  		'data|1-5':[
			{
				'id|+1':1,
				'type':'SYSRATYPE',//类型
				'typevalue':'系统参数类型',//类型说明
				'number':'1',//参数值
				'datanumber':'业务类',//数据值说明
				'value':'1',//数据值序号
				'status|0-1':0,
				'note':'@csentence(10)'
			}
		],'totalPages|2-5':0
  	})
  	res.send(s);
})

//distributor_datadict_getAll
router.post('/distributor/datadict/getAll',function(req,res,next){
	/*var s=Mock.mock({
  		'errorCode':'0',
		'id|100-200':0
  	})*/
  	//res.send(s);
  	client.post(api.distributor_datadict_getAll, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})
//distributor_datadict_delDict
router.post('/distributor/datadict/delDict',function(req,res,next){
	client.post(api.distributor_datadict_delDict, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})
//distributor_datadict_addDict
router.post('/distributor/datadict/addDict',function(req,res,next){
	client.post(api.distributor_datadict_addDict, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})

router.post('/distributor/datadict/updateDict',function(req,res,next){
	client.post(api.distributor_datadict_updateDict, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})

// 开通恋链 查询
router.post('/getcsbr20sup',function(req,res,next){
	client.post(api.distributor_datadict_getcsbr20sup, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})

// 开通恋链 启用
router.post('/synccsbr20sup',function(req,res,next){
	client.post(api.distributor_datadict_synccsbr20sup, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})


// 开通恋链 关闭
router.post('/closecsbr20sup',function(req,res,next){
	client.post(api.distributor_datadict_closecsbr20sup, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})


//系统参数
//distributor_sysparam_getAll
router.post('/distributor/sysparam/getAll',function(req,res,next){
	client.post(api.distributor_sysparam_getAll, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})
//distributor_sysparam_updateParam
router.post('/distributor/sysparam/updateParam',function(req,res,next){
	client.post(api.distributor_sysparam_updateParam, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})
//distributor_sysparam_delParam
router.post('/distributor/sysparam/delParam',function(req,res,next){
	client.post(api.distributor_sysparam_delParam, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})
//distributor_sysparam_addParam
router.post('/distributor/sysparam/addParam',function(req,res,next){
	client.post(api.distributor_sysparam_addParam, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})


//资料指标
//operator_infor_getAllIndexInforList
router.post('/operator/infor/getAllIndexInforList',function(req,res,next){
	client.post(api.operator_infor_getAllIndexInforList, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})
//operator_infor_addIndexInforList
router.post('/operator/infor/addIndexInforList',function(req,res,next){
	client.post(api.operator_infor_addIndexInforList, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})
//operator_infor_delIndexInforList
router.post('/operator/infor/delIndexInforList',function(req,res,next){
	client.post(api.operator_infor_delIndexInforList, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})
//operator_infor_updateIndexInforList
router.post('/operator/infor/updateIndexInforList',function(req,res,next){
	client.post(api.operator_infor_updateIndexInforList, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})
//operator_infor_updateAllIndexInforList
router.post('/operator/infor/updateAllIndexInforList',function(req,res,next){
	client.post(api.operator_infor_updateAllIndexInforList, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})

//属性配置 
//operator_infor_getProTabList
router.post('/operator/infor/getProTabList',function(req,res,next){
	client.post(api.operator_infor_getProTabList, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})
//operator_infor_delProTab
router.post('/operator/infor/delProTab',function(req,res,next){
	client.post(api.operator_infor_delProTab, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})
//operator_infor_addProTab
router.post('/operator/infor/addProTab',function(req,res,next){
	client.post(api.operator_infor_addProTab, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})


//operator_infor_getProList
router.post('/operator/infor/getProList',function(req,res,next){
	client.post(api.operator_infor_getProList, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})
//operator_infor_addPro
router.post('/operator/infor/addPro',function(req,res,next){
	client.post(api.operator_infor_addPro, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})
//operator_infor_delPro
router.post('/operator/infor/delPro',function(req,res,next){
	client.post(api.operator_infor_delPro, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})

//右边
router.post('/operator/infor/getLicClassList',function(req,res,next){
	client.post(api.operator_infor_getLicClassList, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})
router.post('/operator/infor/delLicClass',function(req,res,next){
	client.post(api.operator_infor_delLicClass, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})
router.post('/operator/infor/addLicClass',function(req,res,next){
	client.post(api.operator_infor_addLicClass, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})

//operator_infor_getLicClassTab
router.post('/operator/infor/getLicClassTab',function(req,res,next){
	client.post(api.operator_infor_getLicClassTab, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})
//operator_infor_setLicClassTab
router.post('/operator/infor/setLicClassTab',function(req,res,next){
	client.post(api.operator_infor_setLicClassTab, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})
//operator_infor_addLicClassCol
router.post('/operator/infor/addLicClassCol',function(req,res,next){
	client.post(api.operator_infor_addLicClassCol, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})
//operator_infor_delLicClassCol
router.post('/operator/infor/delLicClassCol',function(req,res,next){
	client.post(api.operator_infor_delLicClassCol, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})

//operator_infor_getTabLicenseList
router.post('/operator/infor/getTabLicenseList',function(req,res,next){
	client.post(api.operator_infor_getTabLicenseList, {data:req.body }, function (data) {
	  res.send(data); 
	}, req.session);
})

/*异常数据接口start*/
//异常标题列表
router.post('/getAbnormaldetail',function(req,res,next){
	client.post(api.operator_abnormal_getAbnormaldetail, {data:req.body }, function (data) {
		res.send(data);
	}, req.session);
})
//异常内容列表
router.post('/getAbnormallist',function(req,res,next){
	client.post(api.operator_abnormal_getAbnormallist, {data:req.body }, function (data) {
		res.send(data);
	}, req.session);
})
//保存新的sql
router.post('/saveMFAbnormalCheck',function(req,res,next){
	client.post(api.operator_abnormal_saveMFAbnormalCheck, {data:req.body }, function (data) {
		res.send(data);
	}, req.session);
})
//查询sql 列表
router.post('/getMFAbnormalChecklist',function(req,res,next){
	client.post(api.operator_abnormal_getMFAbnormalChecklist, {data:req.body }, function (data) {
		res.send(data);
	}, req.session);
})
//删除SQL查询
router.post('/deleteMFAbnormalChecklist',function(req,res,next){
	client.post(api.operator_abnormal_deleteMFAbnormalChecklist, {data:req.body }, function (data) {
		res.send(data);
	}, req.session);
})
//删除SQL查询
router.post('/getAuditLog',function(req,res,next){
	client.post(api.operator_operauditlog_getAuditLog, {data:req.body }, function (data) {
		res.send(data);
	}, req.session);
})
/*异常数据接口end*/


router.get('/dataIndicators',function(req,res){
	var s=Mock.mock({
  		'data|1-5':[
			{
				'id|+1':1,
				'name':'供应商企业资料',//名称
				'status|0-1':0,
				'power|0-1':1
			}
		],'totalPages|2-5':0
  	})
  	res.send(s);
})

router.post('/dataIndicators',function(req,res){
	var s=Mock.mock({
  		'errorCode':'0',
		'id|100-200':0
  	})
  	res.send(s);
})

router.get('/dataIndicatorslist',function(req,res){
	var s=Mock.mock({
  		'data|1-5':[
			{
				'id|0-999':1,
				'name|5-10':'表',//名称
				'englishname|5-10':'a'
			}
		],'totalPages|2-5':0
  	})
  	res.send(s);
})

router.get('/dataIndicatorslistb',function(req,res){
	var s=Mock.mock({
  		'data|5-10':[
			{
				'id|0-999':1,
				'status|0-1':0,
				'name|5-10':'表',//名称
				'englishname|5-10':'a'
			}
		],'totalPages|2-5':0
  	})
  	res.send(s);
})
router.get('/dataadminSupplierAuditor',function(req,res){
	var s=Mock.mock({
  		'data|5-10':[
			{
				'id|0-999':0,
				'status|0':0,
				'note':'',
				'date':'@datetime()',
				'company':'@csentence(10)',
		        'province':"@province",//省
		        'city':"@city()",
		        'county':"@county()",//区
		        'address':"@csentence(20)",
		        'adminname':'@string(10)',
		        'name':'@cname()',
		        'tel':/\d{11}/,
		        'email':'@email()'
			}
		],'totalPages|2-5':0
  	})
  	res.send(s);
})

//operator_sysparam_findmed
router.get('/getfindmed', function(req, res, next) {
  client.get(api.operator_sysparam_findmed, { }, function (data) { res.send(data); }, req.session);
});


module.exports = router;