Commit 185d9646 by linboxuan

Merge branch 'center-channel' of http://gitlab.gongsibao.com/jiangyong/zhichan into center-channel

parents ed2043f1 f1b1c59d
......@@ -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,74 +3,125 @@ 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`
console.log(url)
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 {
status: 0,
msg: "success",
data: result
}
} else {
return {
status: -1,
msg: res.Message
}
}
}
}
module.exports = FblicenseService;
......@@ -7,6 +7,7 @@
5. [认证](#doDnEAV)
6. [获取需求列表](#getDnNeedList)
7. [获取需求详情](#getDnNeedDetail)
8. [证照对比数据](#licenseCompare)
## **<a name="getDnList"> 获取诊断列表(人工)</a>**
......@@ -132,10 +133,11 @@
```javascript
{
"diagnosisNo": "N2020081211076qlz86H",//申请编号
"diagnosisNo": "N2020081211076qlz86H",//申请编号
"publishName": "张三" //联系人名称
"publishMobile": "13911391996", // 联系人电话
"corporateType": "qjd",//店铺类型 电商诊断:qjd/zmd/zyd(旗舰店/专卖店/专营店),直播诊断:qy/gtgsh/mbfqy/flfw(企业/个体工商户/民办非企业/法律服务)'
"diagnosisTypeName": "直播", // 诊断类型 直播 / 电商
"status": "dcl" // 状态 dcl/gtz/dqrfa/ygb/ywc(待处理/沟通中/待确认方案/已关闭/已完成)
"page":1,//页数
"pageSize":20,//每页条数
......@@ -159,6 +161,12 @@
"corporate_type": "qjd",//店铺类型
"corporate_type_name": "旗舰店",//店铺类型名称
"corporate_name": "林氏集团",//公司名称
"disagnosis_type": "zb", // 诊断类型 zb/ds
"disagnosis_type_name": "直播", // 直播/电商
"disagnosis_mode": "rg", // 诊断方式 rg / zn
"disagnosis_mode_name": "智能评估", // 智能评估 / 人工诊断
"disagnosis_result": "tg", // 诊断结果 tg / wtg / rgshz
"disagnosis_result_name": "通过", // 通过 / 未通过 / 人工审核中
"publish_name": null,//联系人名称
"publish_mobile": "13911391996",//联系人电话
"status": "dcl",//状态
......@@ -391,3 +399,54 @@
"requestId": "c0dbbd7ba07c4a63899b672816c2276e"
}
```
## **<a name="licenseCompare"> 证照对比数据</a>**
[返回到目录](#menu) <a name="menu" href="/doc">返回主目录</a>
##### URL
[/web/zzzd/diagnosisneedbus/springBoard]
#### 参数格式 `JSON`
#### HTTP 请求方式 `POST`
#### 渠道执行的类型 actionType:licenseCompare
```javascript
{
"companyName":"xx公司", // 公司名称
"picName": "xx证" // 证照名称
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"中央厨房": "否",
"主体业态": "单位食堂",
"住所": "新疆维吾尔自治区伊犁州伊宁县伊东工业园管委会",
"发证日期": "2018年07月19日",
"发证机关": "伊宁县市场监督管理局",
"散装熟食销售": "否",
"日常监督管理人员": "杜爱洪加拉斯",
"日常监督管理机构": "伊宁县市场监督管理局",
"有效期至": "2023年07月18日",
"法定代表人(负责人)": "霍庆华",
"签发人": "马江平",
"经营场所": "新疆维吾尔自治区伊犁州伊宁县伊东工业园管委会",
"经营者名称": "新疆庆华能源集团有限公司",
"经营项目": "热食类食品制售,",
"网络经营": "否",
"许可证状态": "有效",
"许可证编号": "JY36540210003935",
"集体用餐配送单位": "否"
},
"requestId": "1936ab0c419e4132805aa197920a6b33"
}
```
......@@ -6,7 +6,7 @@
## **<a name="getProductPrice">询价</a>**
[返回到目录](#menu)
##### URL
[/web/action/product/springboard/]
[/web/opaction/order/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:getProductPrice
......@@ -48,7 +48,7 @@
## **<a name="addOrder"> 创建订单</a>**
[返回到目录](#menu)
##### URL
[/web/action/product/springboard/]
[/web/opaction/order/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:addOrder
......
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