Commit 5c37ec57 by wkliang

add lc

parent 1016efff
......@@ -2,70 +2,74 @@ var WEBBase = require("../../web.base");
var system = require("../../../system");
class diagnosisNeedBus extends WEBBase {
constructor () {
super();
this.unSve = system.getObject('service.utilsSve.utilsNdbSve')
}
constructor () {
super();
this.unSve = system.getObject('service.utilsSve.utilsNdbSve')
}
async springBoard (pobj, qobj, req) {
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async springBoard (pobj, qobj, req) {
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async opActionProcess (pobj, action_type, req) {
var opResult = null;
switch (action_type) {
case "test"://测试
opResult = system.getResultSuccess(null, "测试成功");
break;
case "getDnList":// 获取人工列表
pobj.actionBody.diagnosis_mode = 'rg'
if (Object.keys(pobj.actionBody).length < 1) {
return system.getResult(null, `参数不能为空`)
}
opResult = await this.unSve.getList(pobj);
break;
case 'getDnListPending': // 获取待处理列表
pobj.actionBody.status = 'dcl';
pobj.actionBody.diagnosis_mode = 'rg'
opResult = await this.unSve.getList(pobj);
break;
case "getDnListAll":// 获取人工列表
if (Object.keys(pobj.actionBody).length < 1) {
return system.getResult(null, `参数不能为空`)
}
opResult = await this.unSve.getList(pobj);
break;
case 'getDnDetail': // 获取详情
if (!pobj.actionBody.id) {
return system.getResult(null, `id不能为空`)
}
opResult = await this.unSve.getDetail(pobj);
break;
case 'doDnEAV': //认证
if (!pobj.actionBody.id) {
return system.getResult(null, `id不能为空`)
}
if (!pobj.actionBody.diagnosisResult) {
return system.getResult(null, `诊断结果不能为空`)
}
opResult = await this.unSve.doEAV(pobj);
break;
case 'getDnNeedList': //获取需求列表
opResult = await this.unSve.getNeedList(pobj);
break;
case 'getDnNeedDetail': //获取需求详情
if (!pobj.actionBody.needNo) {
return system.getResult(null, `needNo不能为空`)
}
opResult = await this.unSve.getNeedDetail(pobj);
break;
default:
opResult = system.getResult(null, "actionType参数错误");
break;
async opActionProcess (pobj, action_type, req) {
var opResult = null;
switch (action_type) {
case "test"://测试
opResult = system.getResultSuccess(null, "测试成功");
break;
case "getDnList":// 获取人工列表
pobj.actionBody.diagnosis_mode = 'rg'
if (Object.keys(pobj.actionBody).length < 1) {
return system.getResult(null, `参数不能为空`)
}
opResult = await this.unSve.getList(pobj);
break;
case 'getDnListPending': // 获取待处理列表
pobj.actionBody.status = 'dcl';
pobj.actionBody.diagnosis_mode = 'rg'
opResult = await this.unSve.getList(pobj);
break;
case "getDnListAll":// 获取人工列表
if (Object.keys(pobj.actionBody).length < 1) {
return system.getResult(null, `参数不能为空`)
}
opResult = await this.unSve.getList(pobj);
break;
case 'getDnDetail': // 获取详情
if (!pobj.actionBody.id) {
return system.getResult(null, `id不能为空`)
}
return opResult;
opResult = await this.unSve.getDetail(pobj);
break;
case 'doDnEAV': //认证
if (!pobj.actionBody.id) {
return system.getResult(null, `id不能为空`)
}
if (!pobj.actionBody.diagnosisResult) {
return system.getResult(null, `诊断结果不能为空`)
}
opResult = await this.unSve.doEAV(pobj);
break;
case 'getDnNeedList': //获取需求列表
opResult = await this.unSve.getNeedList(pobj);
break;
case 'getDnNeedDetail': //获取需求详情
if (!pobj.actionBody.needNo) {
return system.getResult(null, `needNo不能为空`)
}
opResult = await this.unSve.getNeedDetail(pobj);
break;
case 'licenseCompare':
opResult = await this.unSve.licenseCompare(pobj);
break
default:
opResult = system.getResult(null, "actionType参数错误");
break;
}
return opResult;
}
}
module.exports = diagnosisNeedBus;
\ No newline at end of file
......@@ -3,73 +3,116 @@ var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
class FblicenseService extends AppServiceBase {
constructor() {
super();
this.centerOrderUrl = settings.centerOrderUrl()
this.restClient = system.getObject("util.restClient")
};
constructor () {
super();
this.centerOrderUrl = settings.centerOrderUrl()
this.restClient = system.getObject("util.restClient")
};
//获取列表、检索
async getList(pobj) {
try {
let url = `${this.centerOrderUrl}action/diagnosisneedbus/springBoard`
pobj.actionType = 'getList'
let result = await this.restClient.execPost(pobj, url)
return JSON.parse(result.stdout)
} catch (error) {
return system.getResultFail(-1, error.message || 'failed')
}
//获取列表、检索
async getList (pobj) {
try {
let url = `${this.centerOrderUrl}action/diagnosisneedbus/springBoard`
pobj.actionType = 'getList'
let result = await this.restClient.execPost(pobj, url)
return JSON.parse(result.stdout)
} catch (error) {
return system.getResultFail(-1, error.message || 'failed')
}
}
// 获取详情
async getDetail(pobj) {
try {
let url = `${this.centerOrderUrl}action/diagnosisneedbus/springBoard`
pobj.actionType = 'getDetail'
let result = await this.restClient.execPost(pobj, url)
let data = JSON.parse(result.stdout)
if (data.status != 0)
return system.getResultFail(-1, error.message || 'failed')
return data;
} catch (error) {
return system.getResultFail(-1, error.message || 'failed')
}
// 获取详情
async getDetail (pobj) {
try {
let url = `${this.centerOrderUrl}action/diagnosisneedbus/springBoard`
pobj.actionType = 'getDetail'
let result = await this.restClient.execPost(pobj, url)
let data = JSON.parse(result.stdout)
if (data.status != 0)
return system.getResultFail(-1, error.message || 'failed')
return data;
} catch (error) {
return system.getResultFail(-1, error.message || 'failed')
}
}
// 认证
async doEAV(pobj) {
try {
let url = `${this.centerOrderUrl}action/diagnosisneedbus/springBoard`
pobj.actionType = 'doEAV'
let result = await this.restClient.execPost(pobj, url)
return JSON.parse(result.stdout)
} catch (error) {
return system.getResultFail(-1, error.message || 'failed')
}
// 认证
async doEAV (pobj) {
try {
let url = `${this.centerOrderUrl}action/diagnosisneedbus/springBoard`
pobj.actionType = 'doEAV'
let result = await this.restClient.execPost(pobj, url)
return JSON.parse(result.stdout)
} catch (error) {
return system.getResultFail(-1, error.message || 'failed')
}
}
// 获取需求列表
async getNeedList(pobj) {
try {
let url = `${this.centerOrderUrl}action/diagnosisneedbus/springBoard`
pobj.actionType = 'getNeedList'
let result = await this.restClient.execPost(pobj, url)
return JSON.parse(result.stdout)
} catch (error) {
return system.getResultFail(-1, error.message || 'failed')
}
// 获取需求列表
async getNeedList (pobj) {
try {
let url = `${this.centerOrderUrl}action/diagnosisneedbus/springBoard`
pobj.actionType = 'getNeedList'
let result = await this.restClient.execPost(pobj, url)
return JSON.parse(result.stdout)
} catch (error) {
return system.getResultFail(-1, error.message || 'failed')
}
}
// 获取需求详情
async getNeedDetail (pobj) {
try {
let url = `${this.centerOrderUrl}action/diagnosisneedbus/springBoard`
pobj.actionType = 'getNeedDetail'
let result = await this.restClient.execPost(pobj, url)
return JSON.parse(result.stdout)
} catch (error) {
return system.getResultFail(-1, error.message || 'failed')
}
}
async licenseCompare (pobj) {
let res = {
"Message": "查询成功",
"OrderNumber": null,
"Result": {
"Data": {
"中央厨房": "否",
"主体业态": "单位食堂",
"住所": "新疆维吾尔自治区伊犁州伊宁县伊东工业园管委会",
"发证日期": "2018年07月19日",
"发证机关": "伊宁县市场监督管理局",
"散装熟食销售": "否",
"日常监督管理人员": "杜爱洪加拉斯",
"日常监督管理机构": "伊宁县市场监督管理局",
"有效期至": "2023年07月18日",
"法定代表人(负责人)": "霍庆华",
"监督举报电话": "",
"签发人": "马江平",
"经营场所": "新疆维吾尔自治区伊犁州伊宁县伊东工业园管委会",
"经营者名称": "新疆庆华能源集团有限公司",
"经营项目": "热食类食品制售,",
"网络经营": "否",
"许可证状态": "有效",
"许可证编号": "JY36540210003935",
"集体用餐配送单位": "否"
},
"Id": "85eb513de02c7ff8199bda197992888c",
"Schema": null
},
"Status": "200"
}
// 获取需求详情
async getNeedDetail(pobj) {
try {
let url = `${this.centerOrderUrl}action/diagnosisneedbus/springBoard`
pobj.actionType = 'getNeedDetail'
let result = await this.restClient.execPost(pobj, url)
return JSON.parse(result.stdout)
} catch (error) {
return system.getResultFail(-1, error.message || 'failed')
if (res.Status == 200) {
let result = res.Result.Data
let keys = Object.keys(result)
for (let i of keys) {
if (!result[i]) {
delete result[i]
}
}
return result
}
}
}
module.exports = FblicenseService;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment