Commit de770824 by 宋毅

tj

parent 92c8111b
#!/bin/bash
FROM registry.cn-beijing.aliyuncs.com/hantang2/node105:v2
MAINTAINER jy "jiangyong@gongsibao.com"
ADD brg-queue-center /apps/brg-queue-center/
WORKDIR /apps/brg-queue-center/
ADD brg /apps/brg/
WORKDIR /apps/brg/
RUN cnpm install -S
CMD ["node","/apps/brg-queue-center/main.js"]
CMD ["node","/apps/brg/main.js"]
const system = require("../system");
const moment = require('moment');
const settings = require("../../../app/config/settings");
const sha256 = require('sha256');
class APIBase {
constructor() {
this.redisClient = system.getObject("util.redisClient");
this.execClient = system.getObject("util.execClient");
this.esUtils = system.getObject("util.esUtils");
}
//-----------------------新的模式------------------开始
async doexecMethod(gname, methodname, pobj, query, req) {
try {
if (!pobj.actionBody) {
pobj.actionBody = {};
}
var shaStr = await sha256(JSON.stringify(pobj));
this.redisClient.setWithEx(shaStr, 1, 3);
var result = await this[methodname](pobj, query, req);
if (!result) {
result = system.getResult(null, "请求的方法返回值为空");
}
result.requestId = await this.getBusUid("scz");
if ("LOGS-SYTXPUBLIC-MSGQ" != settings.queuedName) {
pobj.actionBody.resultInfo = result;
pobj.actionBody.requestId = result.requestId;
pobj.actionBody.opTitle = "reqPath:" + req.path;
this.esUtils.addEsLogs(settings.queuedName + "-request", pobj.actionBody);
}
return result;
} catch (error) {
var stackStr = error.stack ? error.stack : JSON.stringify(error);
// console.log(stackStr, "api.base调用出现异常,请联系管理员..........");
var rtnerror = system.getResultFail(-200, "出现异常,error:" + stackStr);
pobj.actionBody.requestId = await this.getBusUid("err");
pobj.actionBody.errorInfo = stackStr;
pobj.actionBody.opTitle = ",reqPath:" + req.path;
this.esUtils.addEsLogs(settings.queuedName + "-error", pobj.actionBody);
return rtnerror;
}
}
//-----------------------新的模式------------------结束
/**
* 带超时时间的post请求
* @param {*} params 请求数据-json格式
* @param {*} url 请求地址
* @param {*} ContentType 请求头类型,默认application/json
* @param {*} headData 请求头内容-json格式,如:请求头中传递token,格式:{token:"9098902q849q0434q09439"}
*/
async execPostByTimeOut(params, url, ContentType, headData, timeOut = 60) {
return await this.execClient.execPostTimeOutByBusiness("api.base", params, url, ContentType, headData, timeOut);
}
/**
* 返回20位业务订单号
* @param {*} prefix 业务前缀
*/
async getBusUid(prefix) {
prefix = (prefix || "");
if (prefix) {
prefix = prefix.toUpperCase();
}
var prefixlength = prefix.length;
var subLen = 8 - prefixlength;
var uidStr = "";
if (subLen > 0) {
uidStr = await this.getUidInfo(subLen, 60);
}
var timStr = moment().format("YYYYMMDDHHmm");
return prefix + timStr + uidStr;
}
/**
* 返回指定长度的字符串
* @param {*} len 返回长度
* @param {*} radix 参与计算的长度,最大为62
*/
async getUidInfo(len, radix) {
var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');//长度62,到yz长度为长36
var uuid = [], i;
radix = radix || chars.length;
if (len) {
for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
} else {
var r;
uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
uuid[14] = '4';
for (i = 0; i < 36; i++) {
if (!uuid[i]) {
r = 0 | Math.random() * 16;
uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
}
}
}
return uuid.join('');
}
}
module.exports = APIBase;
var APIBase = require("../../api.base");
var system = require("../../../system");
const settings = require("../../../../config/settings");
class IcQueryAPI extends APIBase {
constructor() {
super();
this.utilsIcSve = system.getObject("service.utilsSve.utilsIcSve");
}
/**
* 接口跳转-POST请求
* actionType 执行的功能模块
* actionBody 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionType(pobj, pobj.actionType, req);
return result;
}
async opActionType(pobj, actionType, req) {
if (settings.queuedName != "SYTXPUBLIC-MSGQ") {
return system.getResult(null, "请求地址有误!");
}
var opResult = null;
switch (actionType) {
case "getListByLikeCompanyName":
opResult = await this.utilsIcSve.getListByLikeCompanyName(pobj.actionBody);
break;
case "getItemByCompanyName":
opResult = await this.utilsIcSve.getItemByCompanyName(pobj.actionBody);
break;
default:
opResult = system.getResult(null, "actionType参数错误");
break;
}
return opResult;
}
}
module.exports = IcQueryAPI;
\ No newline at end of file
var APIBase = require("../../api.base");
var system = require("../../../system");
const settings = require("../../../../config/settings");
class ProducerAPI extends APIBase {
constructor() {
super();
this.utilsProduceSve = system.getObject("service.utilsSve.utilsProduceSve");
}
/**
* 接口跳转-POST请求
* actionType 执行的功能模块
* actionBody 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionType(pobj, pobj.actionType, req);
return result;
}
async opActionType(pobj, actionType, req) {
var opResult = null;
switch (actionType) {
case "produceData":
if (settings.queuedName != "SYTXPUBLIC-MSGQ") {
return system.getResult(null, "请求地址有误!");
}
opResult = await this.utilsProduceSve.produceData(pobj, req);
break;
case "produceLogsData":
if (settings.queuedName != "LOGS-SYTXPUBLIC-MSGQ") {
return system.getResult(null, "请求地址有误!");
}
opResult = await this.utilsProduceSve.produceLogsData(pobj, req);
break;
default:
opResult = system.getResult(null, "actionType参数错误");
break;
}
return opResult;
}
}
module.exports = ProducerAPI;
\ No newline at end of file
var APIBase = require("../../api.base");
var system = require("../../../system");
class TxCosAPI extends APIBase {
constructor() {
super();
this.utilsTxCosSve = system.getObject("service.utilsSve.utilsTxCosSve");
}
async getCosInfo(pobj, qobj, req) {
var result = await this.utilsTxCosSve.getCosInfo();
return result;
}
}
module.exports = TxCosAPI;
\ No newline at end of file
const system = require("../system");
const moment = require('moment');
const settings = require("../../config/settings");
class ConsumerBase {
constructor(className) {
this.serviceName = className;
this.execClient = system.getObject("util.execClient");
this.pushSuccessLogDao = system.getObject("db.opLogs.pushSuccessLogDao");
this.pushFailureLogDao = system.getObject("db.opLogs.pushFailureLogDao");
this.errorLogDao = system.getObject("db.opLogs.errorLogDao");
this.redisClient = system.getObject("util.redisClient");
this.duplicateInstance = this.redisClient.getDuplicateInstance();
}
static getServiceName(ClassObj) {
return ClassObj["name"];
}
async doConsumer(queuedName, counter) {
try {
if (!counter) {
counter = 1;
}
var self = this;
this.duplicateInstance.brpop(queuedName, 0, async function (err, repl) {
if (err) {
return new Error('doConsumer brpop error :' + err);
}
else {
if (repl[1]) {
self.execSubDoConsumer(queuedName, JSON.parse(repl[1]));
}
self.doConsumer(queuedName, counter);
}
});
} catch (error) {
var stackStr = error.stack ? error.stack : JSON.stringify(error);
this.errorLogDao.addOpErrorLogs("队列执行doConsumer存在异常", null, null, stackStr, 3);
//日志
console.log(stackStr, ",队列执行doConsumer存在异常");
}
}
async execSubDoConsumer(queuedName, actionBody) {
var execResult = null;
try {
const notifyQueuedName = "NOTIFY-SYTXPUBLIC-MSGQ";
this.subBeforeConsumer(queuedName, actionBody);
actionBody.requestId = await this.getBusUid("PUB-");
if ("SYTXFAIL-SYTXPUBLIC-MSGQ" != queuedName && "LOGSFAIL-SYTXPUBLIC-MSGQ" != queuedName) {
execResult = await this.subDoConsumer(queuedName, actionBody);
if (notifyQueuedName != queuedName) {
actionBody.resultInfo = execResult;
} else {
actionBody.pushAgainResultInfo = execResult;
}
if (execResult.status === 1) {
if (notifyQueuedName != queuedName) {
if (actionBody.notifyUrl && actionBody.notifyUrl.indexOf("http") >= 0) {
await this.redisClient.lpushData(notifyQueuedName, actionBody);
}
}
if ("LOGS-SYTXPUBLIC-MSGQ" != settings.queuedName) {
await this.pushSuccessLogDao.addOpSuccessLogs("推送成功", actionBody, execResult);
}
return;
}
var failQueuedName = "SYTXFAIL-SYTXPUBLIC-MSGQ";
if ("LOGS-SYTXPUBLIC-MSGQ" === queuedName) {
failQueuedName = "LOGSFAIL-SYTXPUBLIC-MSGQ";
}
actionBody.queuedName = queuedName;
actionBody.counter = actionBody.counter ? actionBody.counter : 1;
await this.redisClient.lpushData(failQueuedName, actionBody);
return;
}
if (actionBody.counter > 4) {
actionBody.pushAgainResultInfo = actionBody.pushAgainResultInfo || actionBody.resultInfo;
await this.pushFailureLogDao.addOpFailureLogs("推送失败", actionBody, actionBody.pushAgainResultInfo);
return;
}
if (actionBody.pushAgainResultInfo) {
delete actionBody["pushAgainResultInfo"];
}
execResult = await this.subDoConsumer(queuedName, actionBody);
} catch (error) {
if (execResult && execResult.status == 1) {
await this.pushSuccessLogDao.addOpSuccessLogs("推送成功", actionBody, execResult);
} else {
var stackStr = error.stack ? error.stack : JSON.stringify(error);
this.errorLogDao.addOpErrorLogs("队列执行execSubDoConsumer存在异常", actionBody, execResult, stackStr, 3);
//日志记录
console.log(stackStr, ",队列执行execSubDoConsumer存在异常");
}
}
}
async subBeforeConsumer(queuedName, actionBody) {
console.log("请在子类中重写此方法进行前置操作......", this.serviceName);
}
async subDoConsumer(queuedName, actionBody) {
throw new Error("请在子类中重写此方法进行操作业务逻辑............................!");
}
sleep(milliSeconds) {
var startTime = new Date().getTime();
while (new Date().getTime() < startTime + milliSeconds);
}
/**
* 带超时时间的post请求
* @param {*} params 请求数据-json格式
* @param {*} url 请求地址
* @param {*} ContentType 请求头类型,默认application/json
* @param {*} headData 请求头内容-json格式,如:请求头中传递token,格式:{token:"9098902q849q0434q09439"}
*/
async execPostByTimeOut(params, url, ContentType, headData, timeOut = 60) {
return await this.execClient.execPostTimeOutByBusiness("consumer.base", params, url, ContentType, headData, timeOut);
}
/*
返回20位业务订单号
prefix:业务前缀
*/
async getBusUid(prefix) {
prefix = (prefix || "");
if (prefix) {
prefix = prefix.toUpperCase();
}
var prefixlength = prefix.length;
var subLen = 8 - prefixlength;
var uidStr = "";
if (subLen > 0) {
uidStr = await this.getUidInfo(subLen, 60);
}
var timStr = moment().format("YYYYMMDDHHmm");
return prefix + timStr + uidStr;
}
/*
len:返回长度
radix:参与计算的长度,最大为62
*/
async getUidInfo(len, radix) {
var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');//长度62,到yz长度为长36
var uuid = [], i;
radix = radix || chars.length;
if (len) {
for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
} else {
var r;
uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
uuid[14] = '4';
for (i = 0; i < 36; i++) {
if (!uuid[i]) {
r = 0 | Math.random() * 16;
uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
}
}
}
return uuid.join('');
}
}
module.exports = ConsumerBase;
const ConsumerBase = require("../../consumer.base");
const system = require("../../../system");
const moment = require('moment');
class PublicFailConsumer extends ConsumerBase {
constructor() {
super(ConsumerBase.getServiceName(PublicFailConsumer));
}
async subBeforeConsumer(queuedName, actionBody) {
console.log("前置操作......", this.serviceName);
}
async subDoConsumer(queuedName, actionBody) {
actionBody.counter = actionBody.counter + 1;
var exTime = actionBody.counter * 20;
var mathStr = await this.getUidInfo(3, 10);
var scoreValue = Number(moment().format("YYYYMMDDHHmmssSSS") + mathStr);
await this.redisClient.init(scoreValue);
await this.redisClient.setDelayEventData(queuedName, scoreValue, exTime);
await this.redisClient.zaddSortedSet(queuedName, scoreValue, actionBody);
return system.getResultSuccess();
}
}
module.exports = PublicFailConsumer;
\ No newline at end of file
const ConsumerBase = require("../../consumer.base");
const system = require("../../../system");
class PublicLogsConsumer extends ConsumerBase {
constructor() {
super(ConsumerBase.getServiceName(PublicLogsConsumer));
this.configInfoDao = system.getObject("db.opLogs.configInfoDao");
this.errorLogDao = system.getObject("db.opLogs.errorLogDao");
this.esUtils = system.getObject("util.esUtils");
}
async subBeforeConsumer(queuedName, actionBody) {
console.log("前置操作......", this.serviceName);
}
async subDoConsumer(queuedName, actionBody) {
var execResult = await this.esUtils.addEsLogs(queuedName, actionBody);;
return execResult;
}
}
module.exports = PublicLogsConsumer;
\ No newline at end of file
const ConsumerBase = require("../../consumer.base");
class PublicNotifyConsumer extends ConsumerBase {
constructor() {
super(ConsumerBase.getServiceName(PublicNotifyConsumer));
}
async subBeforeConsumer(queuedName, actionBody) {
console.log("前置操作......", this.serviceName);
}
async subDoConsumer(queuedName, actionBody) {
var params = {
actionType: actionBody.actionType,
identifyCode: actionBody.identifyCode,
actionBody: {
messageBody: actionBody.messageBody,
resultInfo: actionBody.resultInfo
},
requestId: actionBody.requestId
}
var execResult = await this.execPostByTimeOut(params, actionBody.notifyUrl);
return execResult;
}
}
module.exports = PublicNotifyConsumer;
\ No newline at end of file
const ConsumerBase = require("../../consumer.base");
class PublicConsumer extends ConsumerBase {
constructor() {
super(ConsumerBase.getServiceName(PublicConsumer));
}
async subBeforeConsumer(queuedName, actionBody) {
console.log("前置操作......", this.serviceName);
}
async subDoConsumer(queuedName, actionBody) {
var params = {
actionType: actionBody.actionType,
identifyCode: actionBody.identifyCode,
actionBody: actionBody.messageBody,
requestId: actionBody.requestId
}
var execResult = await this.execPostByTimeOut(params, actionBody.pushUrl);
return execResult;
}
}
module.exports = PublicConsumer;
\ No newline at end of file
const system = require("../system");
class Dao {
constructor(modelName) {
this.modelName = modelName;
var db = system.getObject("db.common.connection").getCon();
this.db = db;
this.model = db.models[this.modelName];
}
static getModelName(ClassObj) {
var nameStr = ClassObj["name"].substring(0, ClassObj["name"].lastIndexOf("Dao"));
var initialStr = nameStr.substring(0, 1);
var resultStr = initialStr.toLowerCase() + nameStr.substring(1, nameStr.length);
return resultStr;
}
preCreate(u) {
return u;
}
/**
*
* @param {*} u 对象
* @param {*} t 事务对象t
*/
async create(u, t) {
var u2 = this.preCreate(u);
if (t) {
return this.model.create(u2, { transaction: t }).then(u => {
return u;
});
} else {
return this.model.create(u2, { transaction: t }).then(u => {
return u;
});
}
}
async customQuery(sql, paras, t) {
var tmpParas = null;//||paras=='undefined'?{type: this.db.QueryTypes.SELECT }:{ replacements: paras, type: this.db.QueryTypes.SELECT };
if (t && t != 'undefined') {
if (paras == null || paras == 'undefined') {
tmpParas = { type: this.db.QueryTypes.SELECT };
tmpParas.transaction = t;
} else {
tmpParas = { replacements: paras, type: this.db.QueryTypes.SELECT };
tmpParas.transaction = t;
}
} else {
tmpParas = paras == null || paras == 'undefined' || paras.keys == 0 ? { type: this.db.QueryTypes.SELECT } : { replacements: paras, type: this.db.QueryTypes.SELECT };
}
var result = this.db.query(sql, tmpParas);
return result;
}
}
module.exports = Dao;
const system = require("../../../system");
const Dao = require("../../dao.base");
class ConfigInfoDao extends Dao {
constructor() {
super(Dao.getModelName(ConfigInfoDao));
this.configInfoCacheKey = "queue-configuration:info";
this.redisClient = system.getObject("util.redisClient");
}
/**
* 获取配置信息列表,缓存600s
*/
async getList() {
var cacheStr = await this.redisClient.getCache(this.configInfoCacheKey);
if (cacheStr && cacheStr != "undefined") {
var list = JSON.parse(cacheStr);
return system.getResultSuccess(list);
}
var list = await this.model.findAll({
where: { is_enabled: 1 },
raw: true,
attributes: [
"c_key",
"c_value"
]
});
if (!list || list.length === 0) {
return system.getResult(null, "data is empty!");
}
cacheStr = JSON.stringify(list);
this.redisClient.setWithEx(this.configInfoCacheKey, cacheStr, 600);
var result = await system.getResultSuccess(list);
return result;
}
}
module.exports = ConfigInfoDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
const settings = require("../../../../config/settings");
class ErrorLogDao extends Dao {
constructor() {
super(Dao.getModelName(ErrorLogDao));
}
/**
* 添加错误日志
* @param {*} opTitle 操作标题
* @param {*} actionBody 操作的消息体
* @param {*} execResult 操作的返回信息
* @param {*} error 错误信息
* @param {*} logLevel 日志级别信息,debug: 0, info: 1, warn: 2, error: 3, fatal: 4
*/
async addOpErrorLogs(opTitle, actionBody, execResult, error, logLevel) {
error = typeof error === 'object' ? error : { error_info: error };
var params = {
queued_name: settings.queuedName,
identify_code: actionBody.identifyCode,
op_title: opTitle,
push_content: actionBody || null,
error_info: error || null,
result_info: execResult || null,
request_id: actionBody.requestId,
client_ip: actionBody.clientIp || "",
log_level: logLevel,
created_at: new Date()
}
await this.create(params);
return system.getResultSuccess();
}
}
module.exports = ErrorLogDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
const settings = require("../../../../config/settings");
class PushFailureLogDao extends Dao {
constructor() {
super(Dao.getModelName(PushFailureLogDao));
}
/**
* 添加失败日志
* @param {*} opTitle 操作标题
* @param {*} actionBody 操作的消息体
* @param {*} execResult 操作的返回信息
*/
async addOpFailureLogs(opTitle, actionBody, execResult) {
var params = {
queued_name: settings.queuedName,
identify_code: actionBody.identifyCode,
op_title: opTitle,
push_content: actionBody,
result_info: execResult,
request_id: actionBody.requestId,
client_ip: actionBody.clientIp || "",
created_at: new Date()
}
await this.create(params);
return system.getResultSuccess();
}
}
module.exports = PushFailureLogDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
const settings = require("../../../../config/settings");
class PushSuccessLogDao extends Dao {
constructor() {
super(Dao.getModelName(PushSuccessLogDao));
}
/**
* 添加成功日志
* @param {*} opTitle 操作标题
* @param {*} actionBody 操作的消息体
* @param {*} execResult 操作的返回信息
*/
async addOpSuccessLogs(opTitle, actionBody, execResult) {
var params = {
queued_name: settings.queuedName,
identify_code: actionBody.identifyCode,
op_title: opTitle,
push_content: actionBody,
result_info: execResult,
request_id: actionBody.requestId,
client_ip: actionBody.clientIp || "",
created_at: new Date()
}
await this.create(params);
return system.getResultSuccess();
}
}
module.exports = PushSuccessLogDao;
const system = require("../../../system");
module.exports = (db, DataTypes) => {
return db.define("configInfo", {
c_key: DataTypes.STRING(100),
c_value: DataTypes.STRING(100),
is_enabled: DataTypes.INTEGER,
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
timestamps: true,
updatedAt: false,
//freezeTableName: true,
// define the table's name
tableName: 'configuration_info',
validate: {
},
indexes: [
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
const system = require("../../../system");
module.exports = (db, DataTypes) => {
return db.define("errorLog", {
queued_name: DataTypes.STRING(512), //队列名称
identify_code: DataTypes.STRING(100), //标识code
op_title: DataTypes.STRING(100), // 操作标题
push_content: DataTypes.JSON, //推送的内容
error_info: DataTypes.JSON, //错误内容
result_info: DataTypes.JSON, //返回信息
request_id: DataTypes.STRING(100),
client_ip: DataTypes.STRING(100), //请求ip
log_level: DataTypes.INTEGER,// debug: 0, info: 1, warn: 2, error: 3, fatal: 4
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
timestamps: true,
updatedAt: false,
//freezeTableName: true,
// define the table's name
tableName: 'op_error_log',
validate: {
},
indexes: [
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
const system = require("../../../system");
module.exports = (db, DataTypes) => {
return db.define("pushFailureLog", {
queued_name: DataTypes.STRING(512), //队列名称
identify_code: DataTypes.STRING(100), //标识code
op_title: DataTypes.STRING(100), // 操作标题
push_content: DataTypes.JSON, //推送的内容
result_info: DataTypes.JSON, //返回信息
request_id: DataTypes.STRING(100),
client_ip: DataTypes.STRING(100), //请求ip
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
timestamps: true,
updatedAt: false,
//freezeTableName: true,
// define the table's name
tableName: 'x_push_failure_log',
validate: {
},
indexes: [
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
const system = require("../../../system");
module.exports = (db, DataTypes) => {
return db.define("pushSuccessLog", {
queued_name: DataTypes.STRING(512), //队列名称
identify_code: DataTypes.STRING(100), //标识code
op_title: DataTypes.STRING(100), // 操作标题
push_content: DataTypes.JSON, //推送的内容
result_info: DataTypes.JSON, //返回信息
request_id: DataTypes.STRING(100),
client_ip: DataTypes.STRING(100), //请求ip
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
timestamps: true,
updatedAt: false,
//freezeTableName: true,
// define the table's name
tableName: 'x_push_success_log',
validate: {
},
indexes: [
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
class ConfigInfoService extends ServiceBase {
constructor() {
super("opLogs", ServiceBase.getDaoName(ConfigInfoService));
}
}
module.exports = ConfigInfoService;
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
class ErrorLogService extends ServiceBase {
constructor() {
super("opLogs", ServiceBase.getDaoName(ErrorLogService));
}
}
module.exports = ErrorLogService;
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
class PushFailureLogService extends ServiceBase {
constructor() {
super("opLogs", ServiceBase.getDaoName(PushFailureLogService));
}
}
module.exports = PushFailureLogService;
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
class PushSuccessLogService extends ServiceBase {
constructor() {
super("opLogs", ServiceBase.getDaoName(PushSuccessLogService));
}
}
module.exports = PushSuccessLogService;
const system = require("../../../system");
const AppServiceBase = require("../../app.base");
const settings = require("../../../../config/settings");
const moment = require('moment');
//用户权限操作
class UtilsIcService extends AppServiceBase {
constructor() {
super();
this.esUtils = system.getObject("util.esUtils");
}
/**
* 公司模糊查询
* actionBody {companyName:公司名称,currentPage:第几页,pageSize:每页大小}
*/
async getListByLikeCompanyName(actionBody) {
if (!actionBody.companyName) {
return system.getResult(null, "companyName can not be empty");
}
actionBody.companyName = await this.getConvertSemiangleStr(actionBody.companyName);
var pageSize = !actionBody.pageSize ? 15 : Number(actionBody.pageSize);
if (pageSize < 0) {
pageSize = 15;
}
var from = !actionBody.currentPage ? 0 : Number((actionBody.currentPage - 1) * pageSize);
if (from < 0) {
from = 0;
}
var esIndexName = "tx_ic_bigdata_business_heming_index/_search";
var params = {
"query": {
"bool": {
"must": [
{
"query_string": {
"default_field": "company_name_standard",
"query": '\"' + actionBody.companyName + '\"'
}
}
]
}
},
"from": from,
"size": pageSize,
"_source": [
"company_name"//公司名称
]
}
var resultData = null;
try {
resultData = await this.esUtils.execPostEs(settings.queuedName, params, esIndexName);
var sources = [];
var data = {
"totalCount": resultData.data && resultData.data.hits ? resultData.data.hits.total : 0,
"pageSize": pageSize,
"currentPage": from === 0 ? from : (from - 1),
"list": sources
};
if (!resultData.data.hits) {
return system.getResult(null, "data is empty");
}
if (!resultData.data.hits.hits || resultData.data.hits.hits.length === 0) {
return system.getResult(null, "data is empty!");
}
resultData.data.hits.hits.forEach(function (c) {
var source = {
"companyName": c._source.company_name//公司名称
};
sources.push(source);
});
return system.getResultSuccess(data);
} catch (error) {
var stackStr = error.stack ? error.stack : JSON.stringify(error);
console.log(stackStr, ".. getListByLikeCompanyName query is error");
//TODO:日志
return system.getResultError("query is error");
}
}
/**
* 公司精确查询
* actionBody {companyName:公司名称}
*/
async getItemByCompanyName(actionBody) {
if (!actionBody.companyName) {
return system.getResult(null, "companyName can not be empty");
}
actionBody.companyName = await this.getConvertSemiangleStr(actionBody.companyName);
var esIndexName = "tx_ic_bigdata_business_index/_search";
var params = {
"query": {
"bool": {
"must": [
{
"term": {
"company_name.raw": actionBody.companyName
}
}
]
}
},
"from": 0,
"size": 1,
"_source": [
"company_name",//公司名称
"company_org_type",//公司类型
"credit_code",//统一社会信用代码
"legal_person",//法人姓名
"from_time",//营业期限开始日期
"to_time",//营业期限结束日期
"estiblish_time",//成立时间
"reg_location",//公司地址
"reg_capital",//注册资本
"reg_unit",//资本单位
"business_scope"//公司经营范围
]
// ,
// "sort": [
// {
// "reg_capital": "desc"
// }
// ]
}
var resultData = null;
try {
resultData = await this.esUtils.execPostEs(settings.queuedName, params, esIndexName);
if (!resultData.data.hits) {
return system.getResult(null, "data is empty");
}
if (!resultData.data.hits.hits || resultData.data.hits.hits.length === 0) {
return system.getResult(null, "data is empty!");
}
var fromTime = resultData.data.hits.hits[0]._source.from_time ? moment(resultData.data.hits.hits[0]._source.from_time * 1000).format("YYYY-MM-DD") : "";//营业期限开始日期
var toTime = resultData.data.hits.hits[0]._source.to_time ? moment(resultData.data.hits.hits[0]._source.to_time * 1000).format("YYYY-MM-DD") : "";//营业期限结束日期
var item = {
companyName: resultData.data.hits.hits[0]._source.company_name,//公司名称
companyOrgType: resultData.data.hits.hits[0]._source.company_org_type || "",//公司类型
creditCode: resultData.data.hits.hits[0]._source.credit_code || "",//统一社会信用代码
legalPerson: resultData.data.hits.hits[0]._source.legal_person,//法人姓名
fromTime: fromTime,//营业期限开始日期
toTime: toTime,//营业期限结束日期
operatingPeriod: (fromTime || "---") + " 至 " + (toTime || "---"),
estiblishTime: resultData.data.hits.hits[0]._source.estiblish_time ? moment(resultData.data.hits.hits[0]._source.estiblish_time * 1000).format("YYYY-MM-DD") : "",//成立时间
regLocation: resultData.data.hits.hits[0]._source.reg_location || "",//公司地址
regCapital: resultData.data.hits.hits[0]._source.reg_capital || "",//注册资本
regUnit: resultData.data.hits.hits[0]._source.reg_unit || "",//资本单位
businessScope: resultData.data.hits.hits[0]._source.business_scope || ""//公司经营范围
};
return system.getResultSuccess(item);
} catch (error) {
var stackStr = error.stack ? error.stack : JSON.stringify(error);
//TODO:日志
console.log(stackStr, ".. getItemByCompanyName query is error");
return system.getResultError("query is error");
}
}
async getConvertSemiangleStr(str) {
var result = "";
str = str.replace(/\s+/g, "");
var len = str.length;
for (var i = 0; i < len; i++) {
var cCode = str.charCodeAt(i);
//全角与半角相差(除空格外):65248(十进制)
cCode = (cCode >= 0xFF01 && cCode <= 0xFF5E) ? (cCode - 65248) : cCode;
//处理空格
cCode = (cCode == 0x03000) ? 0x0020 : cCode;
result += String.fromCharCode(cCode);
}
return result;
}
}
module.exports = UtilsIcService;
const system = require("../../../system");
const settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
//用户权限操作
class UtilsProduceService extends AppServiceBase {
constructor() {
super();
}
/**
* 接口跳转-POST请求
* action_type 执行的类型
* action_body 执行的参数
*/
async produceData(pobj, req) {
if (!pobj.actionBody) {
return system.getResult(null, "actionBody不能为空");
}
var keyCount = Object.keys(pobj.actionBody).length;
if (keyCount === 0) {
return system.getResult(null, "actionBody参数不能为空");
}
if (!pobj.actionBody.pushUrl) {
return system.getResult(null, "actionBody.pushUrl参数不能为空");
}
if (!pobj.actionBody.identifyCode) {
return system.getResult(null, "actionBody.identifyCode参数不能为空");
}
if (!pobj.actionBody.messageBody) {
return system.getResult(null, "actionBody.messageBody不能为空");
}
var msgKeyCount = Object.keys(pobj.actionBody.messageBody).length;
if (msgKeyCount === 0) {
return system.getResult(null, "actionBody.messageBody参数不能为空");
}
await this.redisClient.lpushData(settings.queuedName, pobj.actionBody);
return system.getResultSuccess();
}
/**
* 接口跳转-POST请求
* action_type 执行的类型
* action_body 执行的参数
*/
async produceLogsData(pobj, req) {
if (!pobj.actionBody) {
return system.getResult(null, "actionBody不能为空");
}
var keyCount = Object.keys(pobj.actionBody).length;
if (keyCount === 0) {
return system.getResult(null, "actionBody参数不能为空");
}
if (!pobj.actionBody.indexName) {
return system.getResult(null, "actionBody.indexName参数不能为空");
}
if (!pobj.actionBody.identifyCode) {
return system.getResult(null, "actionBody.identifyCode参数不能为空");
}
if (!pobj.actionBody.messageBody) {
return system.getResult(null, "actionBody.messageBody不能为空");
}
var msgKeyCount = Object.keys(pobj.actionBody.messageBody).length;
if (msgKeyCount === 0) {
return system.getResult(null, "actionBody.messageBody参数不能为空");
}
await this.redisClient.lpushData(settings.queuedName, pobj.actionBody);
return system.getResultSuccess();
}
}
module.exports = UtilsProduceService;
const system = require("../../../system");
const AppServiceBase = require("../../app.base");
const { TXCOSCONFIG } = require("../../../../config/platform");
const COSSTS = require('qcloud-cos-sts');
//用户权限操作
class UtilsTxCosService extends AppServiceBase {
constructor() {
super();
this.configInfoDao = system.getObject("db.opLogs.configInfoDao");
}
/**
* 接口跳转-POST请求
* action_type 执行的类型
* action_body 执行的参数
*/
async getCosInfo() {
var result = null;
if (TXCOSCONFIG.allowPrefix === '_ALLOW_DIR_/*') {
result = system.getResult(null, "请修改 allowPrefix 配置项,指定允许上传的路径前缀");
return result;
}
var configInfoResult = await this.configInfoDao.getList();
if (configInfoResult.status != 1) {
result = system.getResult(null, "db-configInfo list is empty");
return result;
}
var cosSecretId = configInfoResult.data.filter(f => f.c_key === "cosSecretId");
var cosSecretKey = configInfoResult.data.filter(f => f.c_key === "cosSecretKey");
var cosBucket = configInfoResult.data.filter(f => f.c_key === "cosBucket");
var cosRegion = configInfoResult.data.filter(f => f.c_key === "cosRegion");
var cosProxy = configInfoResult.data.filter(f => f.c_key === "cosProxy");
if (!cosSecretId || !cosSecretKey || !cosBucket || !cosRegion) {
result = system.getResult(null, "db-configInfo,cos info is empty");
return result;
}
// 获取临时密钥
var LongBucketName = cosBucket[0].c_value;
var ShortBucketName = LongBucketName.substr(0, LongBucketName.lastIndexOf('-'));
var AppId = LongBucketName.substr(LongBucketName.lastIndexOf('-') + 1);
var policy = {
'version': '2.0',
'statement': [{
'action': TXCOSCONFIG.allowActions,
'effect': 'allow',
'resource': [
'qcs::cos:' + cosRegion[0].c_value + ':uid/' + AppId + ':prefix//' + AppId + '/' + ShortBucketName + '/' + TXCOSCONFIG.allowPrefix,
],
}],
};
var options = {
secretId: cosSecretId[0].c_value,
secretKey: cosSecretKey[0].c_value,
proxy: cosProxy ? cosProxy[0].c_value || "" : "",
region: cosRegion[0].c_value,
durationSeconds: TXCOSCONFIG.durationSeconds,
policy: policy,
};
console.log(options, "...getCosInfo.....options");
var getParam = await new Promise(function (resv, rej) {
COSSTS.getCredential(options, function (err, tempKeys) {
if (err) {
rej(err);
} else {
if (tempKeys.credentials) {
tempKeys.credentials.tmpBucket = cosBucket[0].c_value;
tempKeys.credentials.tmpRegion = cosRegion[0].c_value;
}
resv(tempKeys);
}
});
});
result = getParam ? system.getResultSuccess(getParam) : system.getResult(null, "获取cos信息失败");
return result;
}
}
module.exports = UtilsTxCosService;
const system = require("../system");
const moment = require('moment')
// const settings = require("../../config/settings");
class ServiceBase {
constructor(gname, daoName) {
this.execClient = system.getObject("util.execClient");
this.db = system.getObject("db.common.connection").getCon();
this.daoName = daoName;
this.dao = system.getObject("db." + gname + "." + daoName);
}
static getDaoName(ClassObj) {
var nameStr = ClassObj["name"].substring(0, ClassObj["name"].lastIndexOf("Service")) + "Dao";
var initialStr = nameStr.substring(0, 1);
var resultStr = initialStr.toLowerCase() + nameStr.substring(1, nameStr.length);
return resultStr;
}
/**
* 带超时时间的post请求
* @param {*} params 请求数据-json格式
* @param {*} url 请求地址
* @param {*} ContentType 请求头类型,默认application/json
* @param {*} headData 请求头内容-json格式,如:请求头中传递token,格式:{token:"9098902q849q0434q09439"}
*/
async execPostByTimeOut(params, url, ContentType, headData, timeOut = 60) {
return await this.execClient.execPostTimeOutByBusiness("sve.base", params, url, ContentType, headData, timeOut);
}
async create(qobj) {
return this.dao.create(qobj);
}
async customQuery(sql, paras, t) {
return this.dao.customQuery(sql, paras, t);
}
/*
返回20位业务订单号
prefix:业务前缀
*/
async getBusUid(prefix) {
prefix = (prefix || "");
if (prefix) {
prefix = prefix.toUpperCase();
}
var prefixlength = prefix.length;
var subLen = 8 - prefixlength;
var uidStr = "";
if (subLen > 0) {
uidStr = await this.getUidInfo(subLen, 60);
}
var timStr = moment().format("YYYYMMDDHHmm");
return prefix + timStr + uidStr;
}
/*
len:返回长度
radix:参与计算的长度,最大为62
*/
async getUidInfo(len, radix) {
var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');//长度62,到yz长度为长36
var uuid = [], i;
radix = radix || chars.length;
if (len) {
for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
} else {
var r;
uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
uuid[14] = '4';
for (i = 0; i < 36; i++) {
if (!uuid[i]) {
r = 0 | Math.random() * 16;
uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
}
}
}
return uuid.join('');
}
}
module.exports = ServiceBase;
const system = require("../system");
const settings = require("../../config/settings");
const moment = require('moment');
const axios = require('axios');
class EsUtils {
constructor() {
this.execClient = system.getObject("util.execClient");
this.errorLogDao = system.getObject("db.opLogs.errorLogDao");
this.configInfoDao = system.getObject("db.opLogs.configInfoDao");
}
/**
* 添加es日志
* @param {*} queuedName 队列名称
* @param {*} actionBody 日志信息
*/
async addEsLogs(queuedName, actionBody) {
var esIndexName = queuedName;
if (["SYTXPUBLIC-MSGQ-request", "SYTXPUBLIC-MSGQ-error"].indexOf(esIndexName) < 0) {
esIndexName = queuedName + (actionBody.indexName ? "-" + actionBody.indexName : "");
}
esIndexName = esIndexName.toLocaleLowerCase() + "/_doc?pretty";
actionBody.resultInfo = typeof actionBody.resultInfo === 'object' ? JSON.stringify(actionBody.resultInfo) : actionBody.resultInfo;
actionBody.errorInfo = typeof actionBody.errorInfo === 'object' ? JSON.stringify(actionBody.errorInfo) : actionBody.errorInfo;
actionBody.messageBody = typeof actionBody.messageBody === 'object' ? JSON.stringify(actionBody.messageBody) : actionBody.messageBody;
actionBody.messageBody=actionBody.messageBody+";actionType="+actionBody.actionType+";pushUrl="+actionBody.pushUrl
var params = {
opTitle: moment().format("YYYY-MM-DD HH:mm:ss:SSS") + "," + actionBody.opTitle || "",
identifyCode: actionBody.identifyCode || "",
messageBody: actionBody.messageBody || "",
resultInfo: actionBody.resultInfo || "",
errorInfo: actionBody.errorInfo || "",
requestId: actionBody.requestId,
created_at: new Date()
}
var execResult = await this.execPostEs(queuedName, params, esIndexName);
return execResult;
}
/**
* post日志到Es
* @param {*} queuedName 队列名称
* @param {*} params 参数
* @param {*} esIndexName es索引名称
*/
async execPostEs(queuedName, params, esIndexName) {
try {
var configInfoResult = await this.configInfoDao.getList();
if (configInfoResult.status != 1) {
this.errorLogDao.addOpErrorLogs("publicLogsConsumer,configInfo list is empty", params, null, null, 1);
return system.getResultSuccess();
}
var publicLogsEsName = configInfoResult.data.filter(f => f.c_key === "publicLogsEsName");
var publicLogsEsPwd = configInfoResult.data.filter(f => f.c_key === "publicLogsEsPwd");
var publicLogsEsReqUrl = configInfoResult.data.filter(f => f.c_key === "publicLogsEsReqUrl");
if (!publicLogsEsName || !publicLogsEsPwd || !publicLogsEsReqUrl) {
this.errorLogDao.addOpErrorLogs("publicLogsConsumer,es account info is empty", params, null, null, 1);
return system.getResultSuccess();
}
var reqUrl = publicLogsEsReqUrl[0].c_value + esIndexName
if (settings.env === "dev") {
let result = await axios({
// headers: {'Content-Type': 'application/x-www-form-urlencoded'},
headers: {
'Content-type': 'application/json',
'Authorization': 'Basic YWRtaW5lczphZG1pbkdTQmVzLg=='
},
method: 'POST',
url: reqUrl,
data: JSON.stringify(params),
timeout: 5000
});
if (result.status == 201) {
return system.getResultSuccess();
}
this.errorLogDao.addOpErrorLogs(queuedName + "执行execPostEs存在错误", params, result, null, 3);
return system.getResult(null, "执行execPostEs存在错误");
}
//方式二
var result = await this.execClient.execPostEs(params, reqUrl, publicLogsEsName[0].c_value, publicLogsEsPwd[0].c_value);
if (!result || !result.stdout) {
this.errorLogDao.addOpErrorLogs(queuedName + "执行execPostEs存在错误", params, result, null, 3);
return system.getResult(null, "执行execPostEs存在错误");
return system.getResult(null, "execPostTimeOut data is empty");
}
var stdoutInfo = JSON.parse(result.stdout);
if (stdoutInfo.error) {
this.errorLogDao.addOpErrorLogs(queuedName + "执行execPostEs存在错误", params, result, null, 3);
return system.getResult(null, "执行execPostEs存在错误");
}
return system.getResultSuccess(stdoutInfo);
} catch (error) {
var stackStr = error.stack ? error.stack : JSON.stringify(error);
console.log(stackStr, "......execPostEs....error.....");
this.errorLogDao.addOpErrorLogs(queuedName + "执行execPostEs存在异常", params, null, stackStr, 3);
}
}
}
module.exports = EsUtils;
const system = require("../system");
const redis = require("redis");
const settings = require("../../config/settings");
const bluebird = require("bluebird");
bluebird.promisifyAll(redis);
class RedisClient {
constructor() {
this.redisConfig = settings.redis();
this.client = this.getCreateClientInstance();
this.subclient = this.client.duplicate();
this.client.on("error", function (err) {
//TODO:日志处理
console.log(err, "..redisClient........error");
});
const self = this;
// 监听回调
const subExpired = async (err, res) => {
// 这里需要创建一个新的Redis对象
// 因为 连接在订阅服务器模式下,只能使用订阅服务器命令
const sub = self.getCreateClientInstance();
// 设置事件参数
const expired_subKey = `__keyevent@${self.redisConfig.db}__:expired`
sub.subscribe(expired_subKey, function () {
sub.on('message', async function (channel, msg) {
try {
var opResult = msg.split("$$");
if (!opResult || opResult.length == 0) {
return;
}
if ("SYTXFAIL-SYTXPUBLIC-MSGQ" != opResult[0] && "LOGSFAIL-SYTXPUBLIC-MSGQ" != opResult[0]) {
return;
}
var lock = await self.enter(opResult[1]);
if (lock && lock === "1") {
var opData = await self.zrangeList(opResult[0], opResult[1], opResult[1]);
if (!opData || opData.length == 0) {
return;
}
var opDataItem = JSON.parse(opData[0]);
await self.lpushData(opDataItem.queuedName, opDataItem);
await self.zremRangebyscoreData(opResult[0], opResult[1], opResult[1]);
}
} catch (error) {
var stackStr = error.stack ? error.stack : JSON.stringify(error);
//TODO:日志处理
console.log(stackStr, ".....message......................error...........");
}
});
});
};
// 创建监听
this.client.send_command('config', ['set', 'notify-keyspace-events', 'Ex'], subExpired)
}
getDuplicateInstance() {
return this.subclient;
}
getCreateClientInstance() {
const self = this;
return redis.createClient({
host: self.redisConfig.host,
port: self.redisConfig.port,
password: self.redisConfig.password,
db: self.redisConfig.db,
retry_strategy: function (options) {
if (options.total_retry_time > 1000 * 60 * 60) {
return new Error('Retry time exhausted');
}
if (options.attempt > 10) {
return 10000;
}
return Math.min(options.attempt * 100, 3000);
}
});
}
/**
* 生产供消费者消费的数据
* @param {*} queuedName 队列名称
* @param {*} actionBody 业务数据
*/
lpushData(queuedName, messageBody) {
messageBody = typeof messageBody === 'object' ? JSON.stringify(messageBody) : messageBody;
this.client.lpush(queuedName, messageBody, function (err, reply) {
if (err) {
return new Error("lpush message error :" + err + ",queuedName:" + queuedName + ",messageBody:" + messageBody);
} else {
console.log("lpush message success");
}
});
}
/**
* 设置延迟事件redis存储
* @param {*} key key
* @param {*} exSeconds 过期时间-单位秒
* @param {*} value 值
*/
async setDelayEventData(key, value, exSeconds) {
value = typeof value === 'object' ? JSON.stringify(value) : value;
var key = key + "$$" + value;
this.client.set(key, "delay event", 'EX', exSeconds);
}
/**
* 添加集合数据
* @param {*} collectionName 集合名称
* @param {*} score 分数,用于区间查询
* @param {*} param 参数信息(可以是json)
*/
async zaddSortedSet(collectionName, score, param) {
param = typeof param === 'object' ? JSON.stringify(param) : param;
await this.client.zadd([collectionName + "-SORT", score, param], function (err, data) {
if (err) {
return new Error("zaddSortedSet data error :" + err + ",collectionName:" + collectionName + ",param:" + param);
} else {
console.log("zaddSortedSet data success");
}
});
}
/**
* 获取集合的区间值
* @param {*} collectionName 集合名称
* @param {*} minValue 最小值
* @param {*} maxValue 最大值
*/
async zrangeList(collectionName, minValue, maxValue) {
return await this.client.zrangebyscoreAsync(collectionName + "-SORT", minValue, maxValue);
}
/**
* 删除集合的区间值
* @param {*} collectionName 集合名称
* @param {*} minValue 最小值
* @param {*} maxValue 最大值
*/
async zremRangebyscoreData(collectionName, minValue, maxValue) {
return await this.client.zremrangebyscoreAsync(collectionName + "-SORT", minValue, maxValue);
}
/**
* 设置缓存
* @param {*} key key
* @param {*} val 值
* @param {*} t 过期时间,为空则永久存在
*/
async setWithEx(key, val, t) {
var p = this.client.setAsync(key, val);
if (t) {
this.client.expire(key, t);
}
return p;
}
/**
* 获取缓存
* @param {*} key key
*/
async getCache(key) {
return this.client.getAsync(key);
}
/**
* 判断key是否存在
* @param {*} key key
*/
async exists(key) {
return this.client.existsAsync(key);
}
/**
* 删除缓存
* @param {*} key key
*/
async delete(key) {
return this.client.delAsync(key);
}
/**
* 设置业务锁
* @param {*} lockKey 锁key
*/
async init(lockKey, lockValue, lockTime) {
this.client.rpushAsync(lockKey, lockValue || "1");
this.client.expire(lockKey, lockTime || 6000);
}
/**
* 获取业务锁
* @param {*} lockKey 锁key
*/
async enter(lockKey) {
return this.client.rpopAsync(lockKey);
}
}
module.exports = RedisClient;
var express = require('express');
var path = require('path');
var methodOverride = require('method-override');
// var cookierParser = require('cookie-parser');
// var session = require('express-session');
// var RedisStore = require('connect-redis')(session);
var bodyParser = require('body-parser');
// var multer = require('multer');
var errorHandler = require('errorhandler');
var settings = require('./settings');
var system = require('../base/system');
var routes = require('./routes');
// const logCtl = system.getObject("service.common.oplogSve");
// const clientRedis = system.getObject("util.redisClient").client;
//const tm=system.getObject("db.taskManager");
module.exports = function (app) {
app.set('port', settings.port);
app.use(methodOverride());
// app.use(cookierParser());
app.use(bodyParser.json({ limit: '50mb' }));
app.use(bodyParser.urlencoded({ limit: '50mb', extended: true }));
routes(app);//初始化路由
app.use(express.static(path.join(settings.basepath, '/app/front/entry/public')));
app.all('*', function (req, res, next) {
req.objs = system;
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild');
//跨域允许的请求方式
res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS');
res.header('Access-Control-Allow-Credentials', 'true');
if (req.method.toLowerCase() == 'options') {
res.send(200); //让options请求快速返回/
}
else {
next();
}
});
// if (settings.env == "dev") {
// app.use(session(
// {
// name: 'devdemosid',
// cookie: { maxAge: 3600000 },
// rolling: true,
// resave: false,
// saveUninitialized: false,
// secret: 'uwotm8',
// store: new RedisStore({
// client: clientRedis,
// }),
// }));
// } else {
// app.use(session(
// {
// name: 'demosid',
// cookie: { maxAge: 3600000 },
// rolling: true,
// resave: false,
// saveUninitialized: false,
// secret: 'uwotm8',
// store: new RedisStore({
// client: clientRedis,
// }),
// }));
// }
// development only
if ('development' == app.get('env')) {
app.use(errorHandler());
} else {
app.use(function (err, req, res) {
console.log("prod error handler...........................................");
console.log(err);
logCtl.error({
optitle: "environment 调用异常error:",
op: req.url,
content: e.toString(),
clientIp: system.get_client_ip(req),
agent: req.headers["user-agent"],
});
//logerApp.error("prod error handler",err);
res.send("link index");
});
}
};
module.exports = {
TXCOSCONFIG: {
durationSeconds: 1800,
// 允许操作(上传)的对象前缀,可以根据自己网站的用户登录态判断允许上传的目录,例子: user1/* 或者 * 或者a.jpg
// 请注意当使用 * 时,可能存在安全风险,详情请参阅:https://cloud.tencent.com/document/product/436/40265
// allowPrefix: '_ALLOW_DIR_/*',
allowPrefix: '*',
// 密钥的权限列表
allowActions: [
// 所有 action 请看文档 https://cloud.tencent.com/document/product/436/31923
// 简单上传
'name/cos:PutObject',
'name/cos:PostObject',
// 分片上传
'name/cos:InitiateMultipartUpload',
'name/cos:ListMultipartUploads',
'name/cos:ListParts',
'name/cos:UploadPart',
'name/cos:CompleteMultipartUpload',
//下载操作
"name/cos:GetObject"
],
}
}
\ No newline at end of file
const system = require("./app/base/system");
var settings = require("./app/config/settings");
var http = require('http');
var express = require('express');
var environment = require('./app/config/environment');
const app = express();
// //数据库支持暂缓支持
// var dbf = system.getObject("db.common.connection");
// con = dbf.getCon();
console.log(settings.consumerName, "--consumerName-----start-----");
if (settings.consumerName) {
var consumer = system.getObject("consumer." + settings.consumerName);
(async () => {
await consumer.doConsumer(settings.queuedName);
})();
} else {
console.log("not find consumer,please check ............................");
}
environment(app);//初始化环境
var server = http.createServer(app);
server.listen(settings.port, function () {
console.log('Express server listening on port ' + settings.port);
});
大家关注:推送时间:0,2,4,6,8
一.公共队列配置
公共业务配置:
消费者名称(CONSUMER_NAME):publicServiceAllocation.publicConsumer
队列名称 (QUEUED_NAME):SYTXPUBLIC-MSGQ
公共业务失败配置:
消费者名称(CONSUMER_NAME):publicFail.publicFailConsumer
队列名称 (QUEUED_NAME):SYTXFAIL-SYTXPUBLIC-MSGQ
公共通知配置:
通知者名称(CONSUMER_NAME):publicNotify.publicNotifyConsumer
队列名称 (QUEUED_NAME):NOTIFY-SYTXPUBLIC-MSGQ
公共日志配置:
消费者名称(CONSUMER_NAME):publicLogs.publicLogsConsumer
队列名称 (QUEUED_NAME):LOGS-SYTXPUBLIC-MSGQ
公共日志失败配置:
消费者名称(CONSUMER_NAME):publicFail.publicFailConsumer
队列名称 (QUEUED_NAME):LOGSFAIL-SYTXPUBLIC-MSGQ
二.公共队列接口
1.生产业务数据供消费者消费
地址:http://192.168.1.128:4018/api/queueAction/producer/springBoard
请求方式:post
参数:
{
"actionType": "produceData",// Y 功能名称
"actionBody": {
"pushUrl": "http://60.205.209.94:4012/web/auth/channelAccessAuth/springBoard",// Y 推送地址
"actionType": "test",// Y 推送地址接收时的功能名称
"notifyUrl": "http://60.205.209.94:4012/web/auth/channelAccessAuth/springBoard",// N 推送成功后通知的Url
"identifyCode": "tx-test01",// Y 操作的业务标识
"messageBody": { // Y 推送的业务消息,必须有一项对象属性值
"name":"张三",
"age":21
}
}
}
1.(1) 推送地址:http://60.205.209.94:4012/web/auth/channelAccessAuth/springBoard
参数:
{
"actionType": "test",// Y 功能名称
"identifyCode": "tx-test01",// Y 操作的业务标识
"actionBody": {
"name":"张三",
"age":21
},
"requestId":"PUB-202006111530vbot"
}
返回参数:
{
status: 1, //1为成功,否则为失败
msg: "测试成功",
data: null//业务处理返回
}
1.(2) 有推送成功后通知的Url地址:http://60.205.209.94:4012/web/auth/channelAccessAuth/springBoard (举例)
参数:
{
"actionType": "test",// Y 功能名称
"identifyCode": "tx-test01",// Y 操作的业务标识
"actionBody": {
"messageBody": { // Y 推送的业务消息,必须有一项对象属性值
"name":"张三",
"age":21
},
"resultInfo":{
status: 1, //1为成功,否则为失败
msg: "测试成功",
data: null//业务处理返回
}
},
"requestId":"PUB-202006111530vbot"
}
返回参数:
{
status: 1, //1为成功,否则为失败
msg: "测试成功",
data: null
}
2.生产日志数据供消费者消费
地址:http://192.168.1.128:4019/api/queueAction/producer/springBoard
请求方式:post
参数:
{
"actionType": "produceLogsData",// Y 功能名称
"actionBody": {
"opTitle": "",// N 操作的业务标题
"identifyCode": "logs001",// Y 操作的业务标识
"indexName":"brg-user-center",// Y es索引值,同一个项目用一个值
"messageBody": {//日志的描述信息
"opUrl": "http://192.168.1.189:4012/api/test/testApi/springBoard",// N 操作的业务Url
"message": ""// Y 日志消息描述
},
"resultInfo":"",//返回信息
"errorInfo": ""//错误信息
}
}
返回参数:
{
status: 1, //1为成功,否则为失败
msg: "测试成功",
data: null
}
三.业务查询接口
1.tx cos 信息获取
地址:http://192.168.1.128:4018/api/uploadAction/txCos/getCosInfo
请求方式:get
参数:无
返回参数:
{
"status": 1,//1成功,否则失败
"message": "success",
"data": {
"expiredTime": 1592400959,
"expiration": "2020-06-17T13:35:59Z",
"credentials": {
"sessionToken": "PoKzACX299C52uF2ZEm9DvHR5KKRIH2i6702448bfee8f3dacbb2be6d3cfd6904MsCx-g2RTRyhKe7FxRhpfffuUqHPV8paOomljLr5zKBMH8EYunXiAaOghJTuZCzZwYGrJqZ8lmJFg3HBnTvRHSh3WImZ5D8Itylq9JQM7C5Ia2rxw9r3gkPLWrxWeUvovAwXqOCpzXl8eZEsdtPJJUb086uyKnjKwQ6rV61Tu7wl1MKUne4TDl1QJrL-uiB7otDZze4SYY6pZWkJByjCyKaLE6K-Xtky01pS8vAxR9vbKjyVan6fM_us8eoEjp_lrPeiCXOBBbo26FmSFvBoPMDBFYLv_0I4A0g4t0B0mrzHE8AtCu8tXt3sQ-iw7kgfCQ2XfZonNsqO8g-KXrEGEKpZDqDGSvIHYvHPboHp2ZfcKohi12vLcQ0e5zmysqCmq-NViRXLoZRcIP_Nx2orQkDHV2UZtEDRbPdCe1fakqtbIOMSoDh8z3308pf-hl-rr1w_5JNrn_aO-ieNMNYSGO7U3R51whungjZCvJkXIVtE6kbd224l4GHq-Ozcgw2V",
"tmpSecretId": "AKIDEnTeKjjfFtycc7cxYUEJcNIA4PsrAe270UcAoEq2qDd3j2g6RnUVh7rciY4mSR_M",
"tmpSecretKey": "Z7qbmpzQRvIxv0bmIji3eH7HrGgONDe+USpqy/zuGUs=",
"tmpBucket": "test-1258715722",
"tmpRegion": "ap-beijing"
},
"requestId": "0e672c45-dc70-437d-93f5-cf2091487d38",
"startTime": 1592399159
},
"requestId": "SCZ202006172105Wz6yF"
}
2.企业模糊查询信息
地址:http://192.168.1.128:4018/api/icAction/icQuery/springBoard
请求方式:get
参数:
{
"actionType":"getListByLikeCompanyName",
"actionBody":{
"companyName":"玉实业有限公司"
}
}
返回参数:
{
"status": 1,
"message": "success",
"data": {
"totalCount": 3,
"pageSize": 15,
"currentPage": 0,
"list": [
{
"companyName": "上海汉玉实业有限公司"
},
{
"companyName": "广州贤玉实业有限公司"
},
{
"companyName": "上海琦玉实业有限公司"
}
]
},
"requestId": "SCZ2020061816078D804"
}
参数说明:
"companyName": "上海汉玉实业有限公司",//公司名称
3.企业精确查询信息
地址:http://192.168.1.128:4018/api/icAction/icQuery/springBoard
请求方式:get
参数:
{
"actionType":"getItemByCompanyName",
"actionBody":{
"companyName":"西安广发彩钢结构有限公司"
}
}
返回参数:
{
"status": 1,
"message": "success",
"data": {
"companyName": "西安广发彩钢结构有限公司",
"companyOrgType": "有限责任公司",
"creditCode": "916111050810200881",
"legalPerson": "陈鑫宇",
"fromTime": "2013-11-22",
"toTime": "",
"operatingPeriod ": "2013-11-22 至 ---",
"estiblishTime": "2013-11-22",
"regLocation": "陕西省西安市未央区六村堡街道(北徐寨)石化大道88号",
"regCapital": "108.000",
"regUnit": "万人民币",
"businessScope": "钢结构、彩钢板、彩钢夹心板、铝型材的设计、加工、销售、安装;五金交电、电线电缆、金属材料、建筑材料的销售。(依法须经批准的项目,经相关部门批准后方可开展经营活动)"
},
"requestId": "SCZ202006251651HBUiV"
}
参数说明:
"companyName": "上海汉玉实业有限公司",//公司名称
"companyOrgType": "有限责任公司",//公司类型
"creditCode": "",//统一社会信用代码
"legalPerson": "曹雪静",//法人姓名
"fromTime": "2008-03-20",//营业期限开始日期
"toTime": "2018-03-19",//营业期限结束日期
"operatingPeriod ": "2008-03-20 至 2018-03-19",//营业期限范围
"estiblishTime": "2008-03-20",//成立时间
"regLocation": "上海市金山区卫昌路229号2幢220室",//公司地址
"regCapital": "3.000",//注册资本
"regUnit": "万人民币",//资本单位
"businessScope": "化妆品,日用百货,服装鞋帽,健身器材销售,投资咨询、商务咨询(除经纪)(涉及行政许可的凭许可证经营)。",//公司经营范围
\ No newline at end of file
node_modules/
localsettings.js
\ No newline at end of file
## 工商注册项目
const system = require("../system");
const settings = require("../../config/settings");
const uuid = require('uuid');
class APIBase {
constructor() {
this.execClient = system.getObject("util.execClient");
this.exTime = 6 * 3600;//缓存过期时间,6小时
}
//-----------------------新的模式------------------开始
async doexecMethod(gname, methodname, pobj, query, req) {
var param = {
pobj: pobj,
query: query
}
try {
var result = await this[methodname](pobj, query, req);
if (!result) {
result = system.getResult(null, "请求的方法返回值为空");
}
result.requestId = result.requestId || uuid.v1();
var tmpResult = pobj.actionType.indexOf("List") < 0 ? result : { status: result.status, message: result.message, requestId: result.requestId };
this.execClient.execLogs("reqPath:" + req.path + "执行结果", param, "brg-user-apibase", tmpResult, null);
return result;
} catch (error) {
var stackStr = error.stack ? error.stack : JSON.stringify(error);
console.log(stackStr, "api调用出现异常,请联系管理员..........");
var rtnerror = system.getResultFail(-200, "出现异常,error:" + stackStr);
rtnerror.requestId = uuid.v1();
this.execClient.execLogs("reqPath:" + req.path + "执行异常", param, "brg-user-apibase", null, stackStr);
return rtnerror;
}
}
//-----------------------新的模式------------------结束
/**
* 带超时时间的post请求
* @param {*} params 请求数据-json格式
* @param {*} url 请求地址
* @param {*} ContentType 请求头类型,默认application/json
* @param {*} headData 请求头内容-json格式,如:请求头中传递token,格式:{token:"9098902q849q0434q09439"}
* @param {*} timeOut 超时时间
*/
async execPostByTimeOut(params, url, ContentType, headData, timeOut = 60) {
return await this.execClient.execPostTimeOutByBusiness("api.base", params, url, ContentType, headData, timeOut);
}
}
module.exports = APIBase;
var APIBase = require("../../api.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
class XBoss extends APIBase {
constructor() {
super();
this.utilsXbossSve = system.getObject("service.utilsSve.utilsXbossSve");
this.serviceInfoSve = system.getObject("service.serviceprovider.serviceInfoSve");
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
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("测试接口");
break;
case "xneedList"://需求列表
opResult = await this.utilsXbossSve.xneedList(pobj);
break;
case "xneedDetail"://需求详情
opResult = await this.utilsXbossSve.xneedDetail(pobj);
break;
case "xApplicantList"://主体列表
opResult = await this.utilsXbossSve.xApplicantList(pobj);
break;
case "xApplicantDetail"://主体详情
opResult = await this.utilsXbossSve.xApplicantDetail(pobj);
break;
case "getProductListBySrvicerCode"://服务商产品列表(设置服务商分配规则使用)
opResult = await this.utilsXbossSve.getProductListBySrvicerCode(pobj);
break;
case "getServiceInfoList"://服务商列表
opResult = await this.serviceInfoSve.getServiceInfoList(pobj);
break;
case "getServiceProviderList"://服务商列表(筛选条件)
opResult = await this.serviceInfoSve.getServiceProviderList(pobj);
break;
case "getServiceInfoDetail"://服务商详情
opResult = await this.serviceInfoSve.getServiceInfoDetail(pobj);
break;
case "createServiceProvider"://新增/修改服务商
opResult = await this.serviceInfoSve.createServiceProvider(pobj);
break;
case "getOrderDetail"://用户端查看订单详情
opResult = await this.utilsXbossSve.xOrderDetail(pobj);
break;
case "getContributionInfoByOrderNum"://订单详情-出资比例列表
opResult = await this.utilsXbossSve.getContributionInfoByOrderNum(pobj);
break;
case "getPrincipalInfoByOrderNum"://订单-详情查询--资质证照-公司人员情况
opResult = await this.utilsXbossSve.getPrincipalInfoByOrderNum(pobj);
break;
case "getShareholderDataByOrderNum"://订单-详情查询--资质证照-股权结构
opResult = await this.utilsXbossSve.getShareholderDataByOrderNum(pobj);
break;
case "getWebAppByOrderNum"://订单-详情查询--资质证照-网站或APP信息
opResult = await this.utilsXbossSve.getWebAppByOrderNum(pobj);
break;
case "getServiceProjectByOrderNum"://订单-详情查询--资质证照-拟开展服务项目
opResult = await this.utilsXbossSve.getServiceProjectByOrderNum(pobj);
break;
case "getSpecialApprovalInfoByOrderNum"://订单-详情查询--资质证照-专项审批项目 ICP
opResult = await this.utilsXbossSve.getSpecialApprovalInfoByOrderNum(pobj);
break;
case "getMaterialsInfoByOrderNum"://订单-详情查询--资质证照-材料清单(固定上传项)
opResult = await this.utilsXbossSve.getMaterialsInfoByOrderNum(pobj);
break;
case "getPositionInfoByOrderNum"://订单-详情查询--任职信息列表
opResult = await this.utilsXbossSve.getPositionInfoByOrderNum(pobj);
break;
case "getOrderList"://用户端获取订单列表
opResult = await this.utilsXbossSve.xOrderQueryList(pobj);
break;
case "getQcOrderList"://资质服务列表
opResult = await this.utilsXbossSve.getQcOrderList(pobj);
break;
case "getQcAnnalsOrderList"://资质年报服务列表
opResult = await this.utilsXbossSve.getQcAnnalsOrderList(pobj);
break;
case "getAnnualReportByOrderNum"://资质年报详情-资质年报列表
opResult = await this.utilsXbossSve.getAnnualReportByOrderNum(pobj);
break;
case "getOrderTransactionPipelineList"://用户端获取交易流水列表
opResult = await this.utilsXbossSve.xOrderTransactionPipelineList(pobj);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
}
module.exports = XBoss;
const system = require("../system");
class Dao {
constructor(modelName) {
this.modelName = modelName;
var db = system.getObject("db.common.connection").getCon();
this.db = db;
this.model = db.models[this.modelName];
}
preCreate(u) {
return u;
}
/**
*
* @param {*} u 对象
* @param {*} t 事务对象t
*/
async create(u, t) {
var u2 = this.preCreate(u);
if (t) {
return this.model.create(u2, { transaction: t }).then(u => {
return u;
});
} else {
return this.model.create(u2, { transaction: t }).then(u => {
return u;
});
}
}
static getModelName(ClassObj) {
var nameStr = ClassObj["name"].substring(0, ClassObj["name"].lastIndexOf("Dao"));
var initialStr = nameStr.substring(0, 1);
var resultStr = initialStr.toLowerCase() + nameStr.substring(1, nameStr.length);
return resultStr;
// return ClassObj["name"].substring(0, ClassObj["name"].lastIndexOf("Dao")).toLowerCase()
}
async refQuery(qobj) {
var w = {};
if (qobj.likestr) {
w[qobj.fields[0]] = { [this.db.Op.like]: "%" + qobj.likestr + "%" };
return this.model.findAll({ where: w, attributes: qobj.fields });
} else {
return this.model.findAll({ attributes: qobj.fields });
}
}
async bulkDeleteByWhere(whereParam, t) {
var en = null;
if (t != null && t != 'undefined') {
whereParam.transaction = t;
return await this.model.destroy(whereParam);
} else {
return await this.model.destroy(whereParam);
}
}
async bulkDelete(ids) {
var en = await this.model.destroy({ where: { id: { [this.db.Op.in]: ids } } });
return en;
}
async delete(qobj) {
var en = await this.model.findOne({ where: qobj });
if (en != null) {
return en.destroy();
}
return null;
}
extraModelFilter() {
//return {"key":"include","value":{model:this.db.models.app}};
return null;
}
extraWhere(obj, where) {
return where;
}
orderBy() {
//return {"key":"include","value":{model:this.db.models.app}};
return [["created_at", "DESC"]];
}
buildAttributes() {
return [];
}
buildQuery(qobj) {
var linkAttrs = [];
const pageNo = qobj.pageInfo.pageNo;
const pageSize = qobj.pageInfo.pageSize;
const search = qobj.search;
const orderInfo = qobj.orderInfo;//格式:[["created_at", 'desc']]
var qc = {};
//设置分页查询条件
qc.limit = pageSize;
qc.offset = (pageNo - 1) * pageSize;
//默认的查询排序
if (orderInfo) {
qc.order = orderInfo;
} else {
qc.order = this.orderBy();
}
//构造where条件
qc.where = {};
if (search) {
Object.keys(search).forEach(k => {
console.log(search[k], ":search[k]search[k]search[k]");
if (search[k] && search[k] != 'undefined' && search[k] != "") {
if ((k.indexOf("Date") >= 0 || k.indexOf("_at") >= 0)) {
if (search[k] != "" && search[k]) {
var stdate = new Date(search[k][0]);
var enddate = new Date(search[k][1]);
qc.where[k] = { [this.db.Op.between]: [stdate, enddate] };
}
}
else if (k.indexOf("id") >= 0) {
qc.where[k] = search[k];
}
else if (k.indexOf("channelCode") >= 0) {
qc.where[k] = search[k];
}
else if (k.indexOf("Type") >= 0) {
qc.where[k] = search[k];
}
else if (k.indexOf("Status") >= 0) {
qc.where[k] = search[k];
}
else if (k.indexOf("status") >= 0) {
qc.where[k] = search[k];
}
else {
if (k.indexOf("~") >= 0) {
linkAttrs.push(k);
} else {
qc.where[k] = { [this.db.Op.like]: "%" + search[k] + "%" };
}
}
}
});
}
this.extraWhere(qobj, qc.where, qc, linkAttrs);
var extraFilter = this.extraModelFilter();
if (extraFilter) {
qc[extraFilter.key] = extraFilter.value;
}
var attributesObj = this.buildAttributes();
if (attributesObj && attributesObj.length > 0) {
qc.attributes = attributesObj;
}
console.log("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm");
console.log(qc);
return qc;
}
async findAndCountAll(qobj, t) {
var qc = this.buildQuery(qobj);
var apps = await this.model.findAndCountAll(qc);
return apps;
}
preUpdate(obj) {
return obj;
}
async update(obj, tm) {
var obj2 = this.preUpdate(obj);
if (tm != null && tm != 'undefined') {
return this.model.update(obj2, { where: { id: obj2.id }, transaction: tm });
} else {
return this.model.update(obj2, { where: { id: obj2.id } });
}
}
async updateByWhere(setObj, whereObj, t) {
if (t && t != 'undefined') {
if (whereObj && whereObj != 'undefined') {
whereObj.transaction = t;
} else {
whereObj = { transaction: t };
}
}
return this.model.update(setObj, whereObj);
}
async customExecAddOrPutSql(sql, paras = null) {
return this.db.query(sql, paras);
}
async customQuery(sql, paras, t) {
var tmpParas = null;//||paras=='undefined'?{type: this.db.QueryTypes.SELECT }:{ replacements: paras, type: this.db.QueryTypes.SELECT };
if (t && t != 'undefined') {
if (paras == null || paras == 'undefined') {
tmpParas = { type: this.db.QueryTypes.SELECT };
tmpParas.transaction = t;
} else {
tmpParas = { replacements: paras, type: this.db.QueryTypes.SELECT };
tmpParas.transaction = t;
}
} else {
tmpParas = paras == null || paras == 'undefined' || paras.keys == 0 ? { type: this.db.QueryTypes.SELECT } : { replacements: paras, type: this.db.QueryTypes.SELECT };
}
var result = this.db.query(sql, tmpParas);
return result;
}
async customInsert(sql, paras, t) {
var tmpParas = null;
if (t && t != 'undefined') {
if (paras == null || paras == 'undefined') {
tmpParas = { type: this.db.QueryTypes.INSERT };
tmpParas.transaction = t;
} else {
tmpParas = { replacements: paras, type: this.db.QueryTypes.INSERT };
tmpParas.transaction = t;
}
} else {
tmpParas = paras == null || paras == 'undefined' || paras.keys == 0 ? { type: this.db.QueryTypes.INSERT } : { replacements: paras, type: this.db.QueryTypes.INSERT };
}
var result = this.db.query(sql, tmpParas);
return result;
}
async customDelete(sql, paras, t) {
var tmpParas = null;
if (t && t != 'undefined') {
if (paras == null || paras == 'undefined') {
tmpParas = { type: this.db.QueryTypes.DELETE };
tmpParas.transaction = t;
} else {
tmpParas = { replacements: paras, type: this.db.QueryTypes.DELETE };
tmpParas.transaction = t;
}
} else {
tmpParas = paras == null || paras == 'undefined' || paras.keys == 0 ? { type: this.db.QueryTypes.DELETE } : { replacements: paras, type: this.db.QueryTypes.DELETE };
}
var result = this.db.query(sql, tmpParas);
return result;
}
async customUpdate(sql, paras, t) {
var tmpParas = null;
if (t && t != 'undefined') {
if (paras == null || paras == 'undefined') {
tmpParas = { type: this.db.QueryTypes.UPDATE };
tmpParas.transaction = t;
} else {
tmpParas = { replacements: paras, type: this.db.QueryTypes.UPDATE };
tmpParas.transaction = t;
}
} else {
tmpParas = paras == null || paras == 'undefined' ? { type: this.db.QueryTypes.UPDATE } : { replacements: paras, type: this.db.QueryTypes.UPDATE };
}
return this.db.query(sql, tmpParas);
}
async findCount(whereObj = null) {
return this.model.count(whereObj, { logging: false }).then(c => {
return c;
});
}
async findSum(fieldName, whereObj = null) {
return this.model.sum(fieldName, whereObj);
}
async getPageList(pageIndex, pageSize, whereObj = null, orderObj = null, attributesObj = null, includeObj = null) {
var tmpWhere = {};
tmpWhere.limit = pageSize;
tmpWhere.offset = (pageIndex - 1) * pageSize;
if (whereObj != null) {
tmpWhere.where = whereObj;
}
if (orderObj != null && orderObj.length > 0) {
tmpWhere.order = orderObj;
}
if (attributesObj != null && attributesObj.length > 0) {
tmpWhere.attributes = attributesObj;
}
if (includeObj != null && includeObj.length > 0) {
tmpWhere.include = includeObj;
tmpWhere.distinct = true;
}
tmpWhere.raw = true;
return await this.model.findAndCountAll(tmpWhere);
}
async findOne(obj, t) {
var params = { "where": obj };
if (t) {
params.transaction = t;
}
return this.model.findOne(params);
}
async findById(oid) {
return this.model.findById(oid);
}
}
module.exports = Dao;
......@@ -63,48 +63,3 @@ class DbFactory {
}
}
module.exports = DbFactory;
\ No newline at end of file
// const dbf=new DbFactory();
// dbf.getCon().then((db)=>{
// //console.log(db);
// // db.models.user.create({nickName:"jy","description":"cccc",openId:"xxyy",unionId:"zz"})
// // .then(function(user){
// // var acc=db.models.account.build({unionId:"zz",nickName:"jy"});
// // acc.save().then(a=>{
// // user.setAccount(a);
// // });
// // console.log(user);
// // });
// // db.models.user.findAll().then(function(rs){
// // console.log("xxxxyyyyyyyyyyyyyyyyy");
// // console.log(rs);
// // })
// });
// const User = db.define('user', {
// firstName: {
// type: Sequelize.STRING
// },
// lastName: {
// type: Sequelize.STRING
// }
// });
// db
// .authenticate()
// .then(() => {
// console.log('Co+nnection has been established successfully.');
//
// User.sync(/*{force: true}*/).then(() => {
// // Table created
// return User.create({
// firstName: 'John',
// lastName: 'Hancock'
// });
// });
//
// })
// .catch(err => {
// console.error('Unable to connect to the database:', err);
// });
//
// User.findAll().then((rows)=>{
// console.log(rows[0].firstName);
// });
const system = require("../../../system");
const Dao = require("../../dao.base");
class ServiceInfoDao extends Dao {
constructor() {
super(Dao.getModelName(ServiceInfoDao));
}
/**
* 获取需求以及方案信息
*/
async getNeedAndSolutionInfoByNeedNum(needNum) {
var params = {
need_num: needNum
};
var sql = "select * from v_need_needsolution where need_num = :need_num";
var list = await this.customQuery(sql, params);
return list;
}
/**
*获取需求方案信息列表
*/
async getNeedSolutionList(ab) {
var pageSize = ab.pageSize ? Number(ab.pageSize) : 10;
var currentPage = ab.currentPage ? Number(ab.currentPage) : 1;
var offset = (currentPage - 1) * pageSize;
var params = {
limit: pageSize,
offset: offset
};
var sortType = "desc";
if (ab.sortType == "asc") {
sortType = "asc";
}
var returnRes = {
pageSize: pageSize,//每页条数
curPage: currentPage,//当前页数
search: ab,
orderArr: null,//排序字段
total: 0,//总记录条数
rows: []
};
var dataCount = "select count(1) as dataCount from v_need_needsolution where 1=1 ";
var sql = "select *,json_extract(solution_content, '$.clerkName' ) as clerkName ,json_extract(solution_content, '$.clerkPhone' ) as clerkPhone from v_need_needsolution where 1=1 ";
if (ab.productOneType) {//产品大类类型
params["productOneType"] = "%/"+ab.productOneType+"/%";
sql = sql + " and consult_type like :productOneType ";
dataCount = dataCount + " and consult_type like :productOneType ";
}
if (ab.consultType) {//产品二类
params["consult_type"] = ab.consultType;
sql = sql + " and consult_type = :consult_type ";
dataCount = dataCount + " and consult_type = :consult_type ";
}
if (ab.status) {//需求状态
params["status"] = ab.status;
sql = sql + " and status=:status ";
dataCount = dataCount + " and status=:status ";
}
if (ab.contactsName) {//联系人
params["contacts_name"] = "%"+ab.contactsName+"%";
sql = sql + " and contacts_name like :contacts_name ";
dataCount = dataCount + " and contacts_name like :contacts_name ";
}
if (ab.contactsMobile) {//联系电话
params["contacts_moblie"] = "%"+ab.contactsMobile+"%";
sql = sql + " and contacts_moblie like :contacts_moblie ";
dataCount = dataCount + " and contacts_moblie like :contacts_moblie ";
}
if (ab.needNum) {//需求号
params["need_num"] = "%"+ab.needNum+"%";
sql = sql + " and need_num like :need_num ";
dataCount = dataCount + " and need_num like :need_num ";
}
if (ab.servicerName) {//服务商
params["servicer_name"] = "%"+ab.servicerName+"%";
sql = sql + " and servicer_name like :servicer_name ";
dataCount = dataCount + " and servicer_name like :servicer_name ";
}
if (ab.clerkName) {//业务员
params["clerkName"] = "%"+ab.clerkName+"%";
sql = sql + " and solution_content->'$.clerkName' like :clerkName ";
dataCount = dataCount + " and solution_content->'$.clerkName' like :clerkName ";
}
if (ab.clerkPhone) {//业务员电话
params["clerkPhone"] = "%"+ab.clerkPhone+"%";
sql = sql + " and solution_content->'$.clerkPhone' like :clerkPhone ";
dataCount = dataCount + " and solution_content->'$.clerkPhone' like :clerkPhone ";
}
//修改时间
if (ab.dateList && ab.dateList.length==2 ) {
params["startDate"] = ab.dateList[0];
params["endDate"] = ab.dateList[1];
if(ab.dateList[0]){
sql = sql + " and updated_at >= :startDate ";
dataCount = dataCount + " and updated_at >= :startDate ";
}
if(ab.dateList[1]){
sql = sql + " and updated_at <= :endDate ";
dataCount = dataCount + " and updated_at <= :endDate ";
}
}
sql = sql + " order by updated_at " + sortType + " limit :limit offset :offset";
var list = await this.customQuery(sql, params);
returnRes.rows = list;
// var result = system.getResultSuccess(list);
var tmpResultCount = await this.customQuery(dataCount, params);
// result.dataCount = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
var result = system.getResultSuccess(returnRes);
return result;
}
/**
* 申请主体列表查询
* @param {*} ab 过滤条件参数
*/
async getApplicantList(ab) {
var pageSize = ab.pageSize ? Number(ab.pageSize) : 10;
var currentPage = ab.currentPage ? Number(ab.currentPage) : 1;
var offset = (currentPage - 1) * pageSize;
var params = {
limit: pageSize,
offset: offset
};
var returnRes = {
pageSize: pageSize,//每页条数
curPage: currentPage,//当前页数
search: ab,
orderArr: null,//排序字段
total: 0,//总记录条数
rows: []
};
var dataCount = "select count(1) as dataCount from (SELECT count( apply_name ) AS count,apply_name FROM b_apply_info WHERE deleted_at IS NULL ";
var sql = "SELECT count( apply_name ) AS count,servicer_code,servicer_name, user_id," +
"user_name, apply_name, credit_code, apply_type, operator, regist_capital," +
"business_term, establish_time, business_term, domicile," +
"ent_type, business_scope,created_at " +
"FROM b_apply_info WHERE deleted_at IS NULL ";
if (ab.applyType) {
params["apply_type"] = ab.applyType;
sql = sql + " and apply_type=:apply_type ";
dataCount = dataCount + " and apply_type=:apply_type ";
}
if (ab.applyName) {
params["apply_name"] = "%"+ab.applyName+"%";
sql = sql + " and apply_name like :apply_name ";
dataCount = dataCount + " and apply_name like :apply_name ";
}
if (ab.creditCode) {
params["credit_code"] = "%"+ab.creditCode+"%";
sql = sql + " and credit_code like :credit_code ";
dataCount = dataCount + " and credit_code like :credit_code ";
}
if (ab.domicile) {
params["domicile"] = "%"+ab.domicile+"%";
sql = sql + " and domicile like :domicile ";
dataCount = dataCount + " and domicile like :domicile ";
}
dataCount = dataCount + " GROUP BY apply_name ) as applyinfo ";
sql = sql + " GROUP BY apply_name ORDER BY id DESC LIMIT :limit OFFSET :offset";
var list = await this.customQuery(sql, params);
var tmpResultCount = await this.customQuery(dataCount, params);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
returnRes.rows = list;
var result = system.getResultSuccess(returnRes);
return result;
}
/**
* 根据社会统一信用代码获取申请主体信息
*/
async getApplyInfoByCreditCode(creditCode) {
var params = {
credit_code: creditCode
};
var sql = "select * from b_apply_info where deleted_at is null and credit_code=:credit_code order by id desc limit 1 ";
var list = await this.customQuery(sql, params);
return list;
}
/**
* 根据主体名称获取业务信息
*/
async getProductBusinessInfoByApplicant(credit_code) {
var params = {
credit_code: credit_code,
credit_code2:credit_code
};
var sql = "select * from v_order_oproduct_odelivery where "+
"(deliver_content->'$.companyInfo' is not null and deliver_content->'$.companyInfo.creditCode'=:credit_code) "+
// " or "+
// " (deliver_content -> '$.proposerInfo' IS NOT NULL "+
// "AND deliver_content -> '$.proposerInfo.businessLicense' IS NOT NULL "+
// "AND deliver_content -> '$.proposerInfo.businessLicense.enterpriseCode' = :credit_code2)"+
" order by updated_at desc";
var list = await this.customQuery(sql, params);
return list;
}
/**
* 获取服务商列表
* @param {*} ab
*/
async getServiceProviderList(ab) {
var pageSize = ab.pageSize ? Number(ab.pageSize) : 10;
var currentPage = ab.currentPage ? Number(ab.currentPage) : 1;
var offset = (currentPage - 1) * pageSize;
var params = {
limit: pageSize,
offset: offset
};
var sortType = "desc";
if (ab.sortType && ab.sortType == "asc") {
sortType = "asc";
}
var returnRes = {
pageSize: pageSize,//每页条数
curPage: currentPage,//当前页数
search: ab,
orderArr: null,//排序字段
total: 0,//总记录条数
rows: []
};
var dataCount = "select count(1) as dataCount FROM x_service_info WHERE deleted_at IS NULL ";
var sql = "SELECT servicer_code, servicer_name, servicer_short_name,province_name, city_name, region_name, is_enabled, principal_name," +
"principal_mobile, created_at FROM x_service_info WHERE deleted_at IS NULL ";
if (ab.isEnabled===0 || ab.isEnabled===1) {
params["is_enabled"] = ab.isEnabled;
sql = sql + " and is_enabled=:is_enabled ";
dataCount = dataCount + " and is_enabled=:is_enabled ";
}
if (ab.regionName) {
params["region_name"] = ab.regionName;
sql = sql + " and region_name=:region_name ";
dataCount = dataCount + " and region_name=:region_name ";
}
if (ab.servicerCode) {
params["servicer_code"] = "%"+ab.servicerCode+"%";
sql = sql + " and servicer_code like :servicer_code ";
dataCount = dataCount + " and servicer_code like :servicer_code ";
}
if (ab.servicerShortName) {
params["servicer_short_name"] = "%"+ab.servicerShortName+"%";
sql = sql + " and servicer_short_name like :servicer_short_name ";
dataCount = dataCount + " and servicer_short_name like :servicer_short_name ";
}
sql = sql + " ORDER BY created_at " + sortType + " LIMIT :limit OFFSET :offset";
var list = await this.customQuery(sql, params);
var tmpResultCount = await this.customQuery(dataCount, params);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
returnRes.rows = list;
var result = system.getResultSuccess(returnRes);
return result;
}
/**
* 获取产品二类列表
*/
async getProductTypeTwoList() {
var sql = "SELECT id,type_code,type_name FROM `x_product_type` where p_id is not null and deleted_at is null and is_enabled=1 ORDER BY id asc";
var list = await this.customQuery(sql, {});
return list;
}
/**
* 获取产品二类列表
*/
async getProductListByType(typeId, servicerCode) {
var params = {
typeId: typeId,
servicerCode: servicerCode || ""
};
var sql = "SELECT servicer_code <=> :servicerCode AS isSelected, id," +
"region_name,is_allocation,servicer_name,servicer_code FROM `x_product` WHERE " +
"deleted_at IS NULL AND is_enabled = 1 AND product_type_id = :typeId order by id asc";
var list = await this.customQuery(sql, params);
return list;
}
/**
* 获取服务商分配产品列表(id列表)
* @param {*} servicerCode
*/
async getAssignedProductsByServicerCode(servicerCode){
var params = {
servicerCode: servicerCode
};
var sql = "SELECT id FROM `x_product` WHERE " +
"deleted_at IS NULL AND is_enabled = 1 AND is_allocation=1 and servicer_code is not null and servicer_code = :servicerCode order by id asc";
var list = await this.customQuery(sql, params);
return list;
}
/**
* 删除服务商产品配置
* @param {*} servicerCode 服务商编码
* @param {*} t 事务
*/
async deleteAllProductByServicerCode(servicerCode, t) {
var sql = "update x_product set is_allocation=0,servicer_name=null,servicer_code=null where servicer_code=:servicerCode ";
var params = {
servicerCode: servicerCode
};
await this.customUpdate(sql, params, t);
}
/**
* 设置服务商产品信息
* @param {*} idList 产品id列表
* @param {*} servicerCode 服务商编码
* @param {*} servicerName 服务商名称
* @param {*} t 事务
*/
async setProductByServicerCode(idList, servicerCode, servicerName, t) {
for (var i = 0; i < idList.length; i++) {
var sql = "update x_product set is_allocation=1,servicer_name=:servicerName,servicer_code=:servicerCode where id=:id and is_enabled=1 and is_allocation=0 and deleted_at is null ";
var params = {
id: idList[i], servicerCode: servicerCode, servicerName: servicerName
};
await this.customUpdate(sql, params, t);
}
}
/**
* Xboss系统 订单-列表查询
*/
async getOrderQueryList(parambody) {
var pageSize = parambody.pageSize ? Number(parambody.pageSize) : 10;
var currentPage = parambody.currentPage ? Number(parambody.currentPage) : 1;
var offset = (currentPage - 1) * pageSize;
var params = {
limit: pageSize,
offset: offset
};
//更新时间排序,默认是降序
var sortType = "desc";
if (parambody.sortType == "asc") {
sortType = "asc";
}
var returnRes = {
pageSize: pageSize,//每页条数
curPage: currentPage,//当前页数
search: parambody,
orderArr: null,//排序字段
total: 0,//总记录条数
rows: []
};
var countSql = "select count(1) as dataCount from v_order_oproduct_odelivery where deleted_at is null ";
var sql = "select order_num,tx_orders_num,need_num,total_sum,user_name,user_id,updated_at,servicer_code,servicer_name,deliver_content, "+
"product_type,product_type_name,order_snapshot,region_id,region_name,delivery_status,delivery_status_name "+
" from v_order_oproduct_odelivery where deleted_at is null ";
if (parambody.productOneType) {//产品大类类型
params["productOneType"] = "%/"+parambody.productOneType+"/%";
sql = sql + " and product_type like :productOneType ";
countSql = countSql + " and product_type like :productOneType ";
}
//订单编号
if (parambody.orderNum) {
params["order_num"] = "%"+parambody.orderNum+"%";
sql = sql + " and order_num like :order_num";
countSql = countSql + " and order_num like :order_num";
}
//客户姓名 订单快照json
if (parambody.contactsName) {
params["contactsName"] = "%"+parambody.contactsName+"%";
sql = sql + " and order_snapshot->'$.contactsName' like :contactsName ";
countSql = countSql + " and order_snapshot->'$.contactsName' like :contactsName ";
}
//客户电话 订单快照json
if (parambody.contactsPhone) {
params["contactsPhone"] = "%"+parambody.contactsPhone+"%";
sql = sql + " and order_snapshot->'$.contactsPhone' like :contactsPhone ";
countSql = countSql + " and order_snapshot->'$.contactsPhone' like :contactsPhone ";
}
//服务顾问 交付内容json
if (parambody.clerkName) {
params["clerkName"] = "%"+parambody.clerkName +"%";
sql = sql + " and deliver_content->'$.clerkName' like :clerkName ";
countSql = countSql + " and deliver_content->'$.clerkName' like :clerkName ";
}
//顾问电话 交付内容json
if (parambody.clerkPhone) {
params["clerkPhone"] = "%"+parambody.clerkPhone+"%";
sql = sql + " and deliver_content->'$.clerkPhone' like :clerkPhone ";
countSql = countSql + " and deliver_content->'$.clerkPhone' like :clerkPhone ";
}
//服务商 编码servicer_code 名字servicer_name
if (parambody.serviceCode) {
params["serviceCode"] = "%"+parambody.serviceCode+"%";
sql = sql + " and servicer_code like :serviceCode ";
countSql = countSql + " and servicer_code like :serviceCode ";
}
//交付产品 产品类型名称(产品二类名称)product_type product_type_name
if (parambody.productType) {
params["product_type"] = "%"+parambody.productType+"%";
sql = sql + " and product_type like :product_type ";
countSql = countSql + " and product_type like :product_type ";
}
//交付状态 delivery_status delivery_status_name
if (parambody.deliveryStatus) {
params["delivery_status"] = parambody.deliveryStatus;
sql = sql + " and delivery_status = :delivery_status ";
countSql = countSql + " and delivery_status = :delivery_status ";
}
//分页及排序组装sql
sql = sql + " order by updated_at " + sortType + " limit :limit offset :offset";
var list = await this.customQuery(sql, params);
// var result = system.getResultSuccess(list);
var tmpResultCount = await this.customQuery(countSql, params);
returnRes.rows = list;
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
var result = system.getResultSuccess(returnRes);
// result.dataCount = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
return result;
}
/**
* Xboss系统 资质服务列表
*/
async getQcOrderList(parambody) {
var pageSize = parambody.pageSize ? Number(parambody.pageSize) : 10;
var currentPage = parambody.currentPage ? Number(parambody.currentPage) : 1;
var offset = (currentPage - 1) * pageSize;
var params = {
limit: pageSize,
offset: offset
};
//更新时间排序,默认是降序
var sortType = "desc";
if (parambody.sortType == "asc") {
sortType = "asc";
}
var returnRes = {
pageSize: pageSize,//每页条数
curPage: currentPage,//当前页数
search: parambody,
orderArr: null,//排序字段
total: 0,//总记录条数
rows: []
};
var countSql = "select count(1) as dataCount from v_order_oproduct_odelivery where deleted_at is null and (product_type = '/qcfw/icp/' or product_type = '/qcfw/edi/' ) ";
var sql = "select order_num,tx_orders_num,need_num,user_name,user_id,updated_at,servicer_code,servicer_name,"+
"product_type,product_type_name,order_snapshot,region_id,region_name,delivery_status,delivery_status_name "+
" from v_order_oproduct_odelivery where deleted_at is null and (product_type = '/qcfw/icp/' or product_type = '/qcfw/edi/' ) ";
//订单编号
if (parambody.orderNum) {
params["order_num"] = "%"+parambody.orderNum+"%";
sql = sql + " and order_num like :order_num";
countSql = countSql + " and order_num like :order_num";
}
//交付产品 产品类型名称(产品二类名称)product_type product_type_name
if (parambody.productType) {
params["product_type"] = "%"+parambody.productType+"%";
sql = sql + " and product_type like :product_type ";
countSql = countSql + " and product_type like :product_type ";
}
//客户姓名 订单快照json
if (parambody.contactsName) {
params["contactsName"] = "%"+parambody.contactsName+"%";
sql = sql + " and order_snapshot->'$.contactsName' like :contactsName ";
countSql = countSql + " and order_snapshot->'$.contactsName' like :contactsName ";
}
//客户电话 订单快照json
if (parambody.contactsPhone) {
params["contactsPhone"] = "%"+parambody.contactsPhone+"%";
sql = sql + " and order_snapshot->'$.contactsPhone' like :contactsPhone ";
countSql = countSql + " and order_snapshot->'$.contactsPhone' like :contactsPhone ";
}
//服务顾问 交付内容json
if (parambody.clerkName) {
params["clerkName"] = "%"+parambody.clerkName +"%";
sql = sql + " and deliver_content->'$.clerkName' like :clerkName ";
countSql = countSql + " and deliver_content->'$.clerkName' like :clerkName ";
}
//顾问电话 交付内容json
if (parambody.clerkPhone) {
params["clerkPhone"] = "%"+parambody.clerkPhone+"%";
sql = sql + " and deliver_content->'$.clerkPhone' like :clerkPhone ";
countSql = countSql + " and deliver_content->'$.clerkPhone' like :clerkPhone ";
}
//服务商 编码servicer_code 名字servicer_name
if (parambody.serviceCode) {
params["serviceCode"] = "%"+parambody.serviceCode+"%";
sql = sql + " and servicer_code like :serviceCode ";
countSql = countSql + " and servicer_code like :serviceCode ";
}
//交付状态 delivery_status delivery_status_name
if (parambody.deliveryStatus) {
params["delivery_status"] = parambody.deliveryStatus;
sql = sql + " and delivery_status = :delivery_status ";
countSql = countSql + " and delivery_status = :delivery_status ";
}
//修改时间
if (parambody.dateList && parambody.dateList.length==2 ) {
params["startDate"] = parambody.dateList[0];
params["endDate"] = parambody.dateList[1];
if(parambody.dateList[0]){
sql = sql + " and updated_at >= :startDate ";
countSql = countSql + " and updated_at >= :startDate ";
}
if(parambody.dateList[1]){
sql = sql + " and updated_at <= :endDate ";
countSql = countSql + " and updated_at <= :endDate ";
}
}
//分页及排序组装sql
sql = sql + " order by updated_at " + sortType + " limit :limit offset :offset";
var list = await this.customQuery(sql, params);
// var result = system.getResultSuccess(list);
var tmpResultCount = await this.customQuery(countSql, params);
returnRes.rows = list;
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
var result = system.getResultSuccess(returnRes);
// result.dataCount = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
return result;
}
/**
* Xboss系统 资质年报服务列表
*/
async getQcAnnalsOrderList(parambody) {
var pageSize = parambody.pageSize ? Number(parambody.pageSize) : 10;
var currentPage = parambody.currentPage ? Number(parambody.currentPage) : 1;
var offset = (currentPage - 1) * pageSize;
var params = {
limit: pageSize,
offset: offset
};
//更新时间排序,默认是降序
var sortType = "desc";
if (parambody.sortType == "asc") {
sortType = "asc";
}
var returnRes = {
pageSize: pageSize,//每页条数
curPage: currentPage,//当前页数
search: parambody,
orderArr: null,//排序字段
total: 0,//总记录条数
rows: []
};
var countSql = "select count(1) as dataCount from v_order_oproduct_odelivery where deleted_at is null and (product_type = '/qcfw/icpannals/' or product_type = '/qcfw/ediannals/' ) ";
var sql = "select order_num,tx_orders_num,need_num,user_name,user_id,updated_at,servicer_code,servicer_name,"+
"product_type,product_type_name,order_snapshot,region_id,region_name,delivery_status,delivery_status_name "+
" from v_order_oproduct_odelivery where deleted_at is null and (product_type = '/qcfw/icpannals/' or product_type = '/qcfw/ediannals/' ) ";
//订单编号
if (parambody.orderNum) {
params["order_num"] = "%"+parambody.orderNum+"%";
sql = sql + " and order_num like :order_num";
countSql = countSql + " and order_num like :order_num";
}
//交付产品 产品类型名称(产品二类名称)product_type product_type_name
if (parambody.productType) {
params["product_type"] = "%"+parambody.productType+"%";
sql = sql + " and product_type like :product_type ";
countSql = countSql + " and product_type like :product_type ";
}
//客户姓名 订单快照json
if (parambody.contactsName) {
params["contactsName"] = "%"+parambody.contactsName+"%";
sql = sql + " and order_snapshot->'$.contactsName' like :contactsName ";
countSql = countSql + " and order_snapshot->'$.contactsName' like :contactsName ";
}
//客户电话 订单快照json
if (parambody.contactsPhone) {
params["contactsPhone"] = "%"+parambody.contactsPhone+"%";
sql = sql + " and order_snapshot->'$.contactsPhone' like :contactsPhone ";
countSql = countSql + " and order_snapshot->'$.contactsPhone' like :contactsPhone ";
}
//服务顾问 交付内容json
if (parambody.clerkName) {
params["clerkName"] = "%"+parambody.clerkName +"%";
sql = sql + " and deliver_content->'$.clerkName' like :clerkName ";
countSql = countSql + " and deliver_content->'$.clerkName' like :clerkName ";
}
//顾问电话 交付内容json
if (parambody.clerkPhone) {
params["clerkPhone"] = "%"+parambody.clerkPhone+"%";
sql = sql + " and deliver_content->'$.clerkPhone' like :clerkPhone ";
countSql = countSql + " and deliver_content->'$.clerkPhone' like :clerkPhone ";
}
//服务商 编码servicer_code 名字servicer_name
if (parambody.serviceCode) {
params["serviceCode"] = "%"+parambody.serviceCode+"%";
sql = sql + " and servicer_code like :serviceCode ";
countSql = countSql + " and servicer_code like :serviceCode ";
}
//交付状态 delivery_status delivery_status_name
if (parambody.deliveryStatus) {
params["delivery_status"] = parambody.deliveryStatus;
sql = sql + " and delivery_status = :delivery_status ";
countSql = countSql + " and delivery_status = :delivery_status ";
}
//修改时间
if (parambody.dateList && parambody.dateList.length==2 ) {
params["startDate"] = parambody.dateList[0];
params["endDate"] = parambody.dateList[1];
if(parambody.dateList[0]){
sql = sql + " and updated_at >= :startDate ";
countSql = countSql + " and updated_at >= :startDate ";
}
if(parambody.dateList[1]){
sql = sql + " and updated_at <= :endDate ";
countSql = countSql + " and updated_at <= :endDate ";
}
}
//分页及排序组装sql
sql = sql + " order by updated_at " + sortType + " limit :limit offset :offset";
var list = await this.customQuery(sql, params);
// var result = system.getResultSuccess(list);
var tmpResultCount = await this.customQuery(countSql, params);
returnRes.rows = list;
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
var result = system.getResultSuccess(returnRes);
// result.dataCount = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
return result;
}
/**
* Xboss系统 订单-详情查询
*/
async getOrderDetailByOrderNum(orderNum) {
var params = {
order_num: orderNum
};
var sql = "select * from v_order_oproduct_odelivery where order_num = :order_num";
var list = await this.customQuery(sql, params);
return list;
}
/**
* 根据腾讯订单号(主订单号)及产品类型获取子订单列表
* @param {*} tx_orders_num 腾讯订单号
* @param {*} product_Type 产品类型(二类code)
*/
async getQcInfoByTxOrderNumAndProductType(tx_orders_num,product_type){
var params = {
productType: product_type,
txOrdersNum:tx_orders_num
};
var sql = "select order_snapshot,deliver_content from v_order_oproduct_odelivery where tx_orders_num = :txOrdersNum and product_type = :productType order by updated_at desc limit 1 ";
var list = await this.customQuery(sql, params);
return list;
}
/**
* 获取资质证照年报列表
* @param {*} orderNum
*/
async getAnnualReportByOrderNum(orderNum){
var params = {
order_num: orderNum
};
var sql = "select json_extract(deliver_content, '$.annualReport' ) as annualReportList from v_order_oproduct_odelivery where order_num = :order_num and deliver_content->'$.annualReport' is not null limit 1";
var list = await this.customQuery(sql, params);
return list;
}
/**
* Xboss系统 订单-详情查询--出资比例列表
*/
async getContributionInfoByOrderNum(orderNum) {
var params = {
order_num: orderNum
};
var sql = "select json_extract(deliver_content, '$.contributionInfo.contributionData' ) as contributionInfoList from v_order_oproduct_odelivery where order_num = :order_num and deliver_content->'$.contributionInfo' is not null and deliver_content->'$.contributionInfo.contributionData' is not null limit 1";
var list = await this.customQuery(sql, params);
return list;
}
/**
* 订单详情-任职信息列表
*/
async getPositionInfoByOrderNum(orderNum) {
var params = {
order_num: orderNum
};
var sql = "select json_extract(deliver_content, '$.positionInfo.positionData' ) as positionInfoList from v_order_oproduct_odelivery where order_num = :order_num and deliver_content->'$.positionInfo' is not null and deliver_content->'$.positionInfo.positionData' is not null limit 1";
var list = await this.customQuery(sql, params);
return list;
}
/**
* Xboss系统 订单-详情查询--资质证照-公司人员情况
*/
async getPrincipalInfoByOrderNum(orderNum) {
var params = {
order_num: orderNum
};
var sql = "select json_extract(deliver_content, '$.proposerInfo.principalInfo' ) as principalInfo from v_order_oproduct_odelivery where order_num = :order_num and deliver_content->'$.proposerInfo' is not null and deliver_content->'$.proposerInfo.principalInfo' is not null limit 1";
var list = await this.customQuery(sql, params);
return list;
}
/**
* Xboss系统 订单-详情查询--资质证照-股权结构
*/
async getShareholderDataByOrderNum(orderNum) {
var params = {
order_num: orderNum
};
var sql = "select json_extract(deliver_content, '$.shareholderData' ) as shareholderData from v_order_oproduct_odelivery where order_num = :order_num and deliver_content->'$.shareholderData' is not null limit 1";
var list = await this.customQuery(sql, params);
return list;
}
/**
* Xboss系统 订单-详情查询--资质证照-网站或APP信息
*/
async getWebAppByOrderNum(orderNum) {
var params = {
order_num: orderNum
};
var sql = "select json_extract(deliver_content, '$.implementationPlanInfo.webApp' ) as webApp from v_order_oproduct_odelivery where order_num = :order_num and deliver_content->'$.implementationPlanInfo' is not null and deliver_content->'$.implementationPlanInfo.webApp' is not null limit 1";
var list = await this.customQuery(sql, params);
return list;
}
/**
* Xboss系统 订单-详情查询--资质证照-拟开展服务项目
*/
async getServiceProjectByOrderNum(orderNum) {
var params = {
order_num: orderNum
};
var sql = "select json_extract(deliver_content, '$.implementationPlanInfo.serviceProjectEdi' ) as serviceProjectEdi, "+
"json_extract(deliver_content, '$.implementationPlanInfo.serviceProjectIcp' ) as serviceProjectIcp,product_type"+
" from v_order_oproduct_odelivery where order_num = :order_num and deliver_content->'$.implementationPlanInfo' "+
" is not null limit 1";
var list = await this.customQuery(sql, params);
return list;
}
/**
* Xboss系统 订单-详情查询--资质证照-材料清单(固定上传项)
*/
async getMaterialsInfoByOrderNum(orderNum) {
var params = {
order_num: orderNum
};
var sql = "select json_extract(deliver_content,'$.otherMaterialsInfo' ) as materialsInfo "+
"from v_order_oproduct_odelivery where order_num = :order_num and deliver_content->'$.otherMaterialsInfo' is not null"+
" limit 1";
var list = await this.customQuery(sql, params);
return list;
}
/**
* Xboss系统 订单-详情查询--资质证照-专项审批项目 ICP
*/
async getSpecialApprovalInfoByOrderNum(orderNum) {
var params = {
order_num: orderNum
};
var sql = "select json_extract(deliver_content, '$.implementationPlanInfo.specialApproval' ) as specialApprovalList "+
" from v_order_oproduct_odelivery where order_num = :order_num and deliver_content->'$.implementationPlanInfo' "+
" is not null limit 1";
var list = await this.customQuery(sql, params);
return list;
}
/**
* Xboss系统 交易流水列表查询
*/
async getOrderTransactionPipelineList(parambody) {
var pageSize = parambody.pageSize ? Number(parambody.pageSize) : 10;
var currentPage = parambody.currentPage ? Number(parambody.currentPage) : 1;
var offset = (currentPage - 1) * pageSize;
var params = {
limit: pageSize,
offset: offset
};
//更新时间排序,默认是降序
var sortType = "desc";
if (parambody.sortType == "asc") {
sortType = "asc";
}
var returnRes = {
pageSize: pageSize,//每页条数
curPage: currentPage,//当前页数
search: parambody,
orderArr: null,//排序字段
total: 0,//总记录条数
rows: []
};
var countSql = "select count(1) as dataCount from v_order_oproduct_odelivery where deleted_at is null ";
var sql = "select * from v_order_oproduct_odelivery where deleted_at is null ";
if (parambody.productOneType) {//产品大类类型
params["productOneType"] = "%/"+parambody.productOneType+"/%";
sql = sql + " and product_type like :productOneType ";
countSql = countSql + " and product_type like :productOneType ";
}
//时间段查询--开始日期
if (parambody.startDate) {
params["startDate"] = parambody.startDate;
sql = sql + " and updated_at >= :startDate ";
countSql = countSql + " and updated_at >= :startDate ";
}
//时间段查询--结束日期
if (parambody.endDate) {
params["endDate"] = parambody.endDate;
sql = sql + " and updated_at <=:endDate ";
countSql = countSql + " and updated_at <=:endDate ";
}
//订单编号
if (parambody.orderNum) {
params["order_num"] = "%"+parambody.orderNum+"%";
sql = sql + " and order_num like :order_num ";
countSql = countSql + " and order_num like :order_num ";
}
//服务商 编码servicer_code 名字servicer_name
if (parambody.servicerCode) {
params["servicer_code"] = "%"+parambody.servicerCode+"%";
sql = sql + " and servicer_code like :servicer_code ";
countSql = countSql + " and servicer_code like :servicer_code ";
}
//交付产品 产品类型名称(产品二类名称)product_type product_type_name
if (parambody.productType) {
params["product_type"] = "%"+parambody.productType+"%";
sql = sql + " and product_type like :product_type ";
countSql = countSql + " and product_type like :product_type ";
}
//分页及排序组装sql
sql = sql + " order by updated_at " + sortType + " limit :limit offset :offset";
var list = await this.customQuery(sql, params);
var tmpResultCount = await this.customQuery(countSql, params);
returnRes.total = tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
returnRes.rows = list;
var result = system.getResultSuccess(returnRes);
return result;
}
/**
* 根据主订单号(腾讯订单号)获取关联产品
* @param {*} mainOrderNum
* @param {*} exclvarudeOrderNum
*/
async getRelatedProductsList(mainOrderNum,excludeOrderNum){
var params = {
mainOrderNum: mainOrderNum,
excludeOrderNum:excludeOrderNum
};
var sql = "select product_type,product_type_name,order_num from v_order_oproduct_odelivery where product_type_name is not null and tx_orders_num= :mainOrderNum and order_num !=:excludeOrderNum ";
var list = await this.customQuery(sql, params);
return list;
}
}
module.exports = ServiceInfoDao;
\ No newline at end of file
const system = require("../../../system");
const {PDICT} = require("../../../../config/platform");
/**
* 服务商信息
*/
module.exports = (db, DataTypes) => {
return db.define("serviceInfo", {
servicer_code: DataTypes.STRING(100),//服务商code
apply_type:
{
type: DataTypes.INTEGER,
set: function (val) {
this.setDataValue("apply_type", val);
this.setDataValue("apply_type_name", PDICT.apply_type[val]);
}
},
apply_type_name: DataTypes.STRING(50),
// servicer_about
servicer_name: DataTypes.STRING(255),//服务商名称
servicer_short_name: DataTypes.STRING(255),//服务商简称
bank_account: DataTypes.STRING(255),
bank_account_num: DataTypes.STRING(255),
sub_bank_account: DataTypes.STRING(255),
sub_bank_account_num: DataTypes.STRING(255),
// province_name
// city_name
region_name: DataTypes.STRING(255),
servicer_address: DataTypes.STRING(255),
push_domain_addr: DataTypes.STRING(500),//推送域名地址
is_enabled: DataTypes.INTEGER,//是否启用
principal_name: DataTypes.STRING(255),
principal_mobile: DataTypes.STRING(255),
business_license: DataTypes.STRING(500),//营业执照
// business_license_address: DataTypes.STRING(500),//营业执照地址
credit_code: DataTypes.STRING(50),//统一社会信用代码
legal_identity_card: DataTypes.STRING(200),//法人身份证
legal_name: DataTypes.STRING(20),//法人姓名
legal_mobile: DataTypes.STRING(20),//法人手机号
legal_identity_card_no: DataTypes.STRING(20),//法人身份证号
settlement_cycle:
{
type: DataTypes.INTEGER,
set: function (val) {
this.setDataValue("settlement_cycle", val);
this.setDataValue("settlement_cycle_name", PDICT.settlement_cycle[val]);
}
},
settlement_cycle_name: DataTypes.STRING(50),
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
timestamps: true,
tableName: 'x_service_info',
validate: {
},
indexes: [
]
});
}
\ No newline at end of file
const system = require("../system");
const moment = require('moment');
const moment = require('moment')
const settings = require("../../config/settings");
const md5 = require("MD5");
class AppServiceBase {
constructor() {
this.execClient = system.getObject("util.execClient");
this.redisClient = system.getObject("util.redisClient");
this.pushlogFailType = { OLDRPC: 1, NEWRPC: 2, FAILLOG: 3, FQ: 4 };
}
/**
* 带超时时间的post请求
......@@ -13,10 +13,56 @@ class AppServiceBase {
* @param {*} url 请求地址
* @param {*} ContentType 请求头类型,默认application/json
* @param {*} headData 请求头内容-json格式,如:请求头中传递token,格式:{token:"9098902q849q0434q09439"}
* @param {*} timeOut 超时时间
*/
async execPostByTimeOut(params, url, ContentType, headData, timeOut = 60) {
return await this.execClient.execPostTimeOutByBusiness("app.base", params, url, ContentType, headData, timeOut);
}
/**
* 验证签名
* @param {*} params 要验证的参数
* @param {*} app_key 应用的校验key
*/
async verifySign(params, app_key) {
if (!params) {
return system.getResult(null, "请求参数为空");
}
if (!params.sign) {
return system.getResult(null, "请求参数sign为空");
}
var signArr = [];
var keys = Object.keys(params).sort();
if (keys.length == 0) {
return system.getResult(null, "请求参数信息为空");
}
for (let k = 0; k < keys.length; k++) {
const tKey = keys[k];
if (tKey != "sign" && params[tKey] && !(params[tKey] instanceof Array)) {
signArr.push(tKey + "=" + params[tKey]);
}
}
if (signArr.length == 0) {
return system.getResult(null, "请求参数组装签名参数信息为空");
}
var resultSignStr = signArr.join("&") + "&key=" + app_key;
var resultTmpSign = md5(resultSignStr).toUpperCase();
if (params.sign != resultTmpSign) {
return system.getResult(null, "返回值签名验证失败");
}
return system.getResultSuccess();
}
async opAliyunRpcVerifyParam(pobj) {//参数信息验证
var verify = system.getResultSuccess();
if (!pobj.interface_params) {
verify = system.getResult(null, "interface_params can not be empty,100440");
}
var interface_params_info = JSON.parse(pobj.interface_params);
if (!interface_params_info || !interface_params_info.action) {
verify = system.getResult(null, "interface_params.action can not be empty,100443");
}
verify.data = interface_params_info;
return verify;
}
async getConvertSemiangleStr(str) {//去除空格及全角转半角
var result = "";
......
const system = require("../../../system");
const {PDICT} = require("../../../../config/platform");
const ServiceBase = require("../../sve.base");
var settings = require("../../../../config/settings");
class ServiceInfoService extends ServiceBase {
constructor() {
super("serviceprovider", ServiceBase.getDaoName(ServiceInfoService));
}
/**
* 校验组装参数
* @param {*} ab
*/
async verifyAndPackageCreateParams(ab){
var params = {};
if(!ab.isEnabled || ab.isEnabled!=1){
params["is_enabled"] = 0;
}else{
params["is_enabled"] = 1;
}
if(!ab.servicerCode){//新增
if(!ab.pushDomainAddr){
return system.getResultFail(-101,"登录域名不能为空");
}
params["push_domain_addr"]=ab.pushDomainAddr;
if(!ab.applyType){
return system.getResultFail(-102,"账号类型不能为空");
}
params["apply_type"]=ab.applyType;
if(!ab.servicerShortName){
return system.getResultFail(-103,"服务商简称不能为空");
}
params["servicer_short_name"]=ab.servicerShortName;
if(!ab.servicerName){
return system.getResultFail(-104,"企业名称不能为空");
}
params["servicer_name"]=ab.servicerName;
}
if(!ab.bankAccount){
return system.getResultFail(-105,"公司银行开户名不能为空");
}
params["bank_account"]=ab.bankAccount;
if(!ab.bankAccountNum){
return system.getResultFail(-106,"公司银行账号不能为空");
}
params["bank_account_num"]=ab.bankAccountNum;
if(!ab.subBankAccount){
return system.getResultFail(-107,"开户行支行名称不能为空");
}
params["sub_bank_account"]=ab.subBankAccount;
if(!ab.subBankAccountNum){
return system.getResultFail(-108,"开户行支行联行号不能为空");
}
params["sub_bank_account_num"]=ab.subBankAccountNum;
if(!ab.settlementCycle){
return system.getResultFail(-109,"结算周期不能为空");
}
params["settlement_cycle"]=ab.settlementCycle;
if(!ab.regionName){
return system.getResultFail(-110,"所在地区不能为空");
}
params["region_name"]=ab.regionName;
if(!ab.servicerAddress){
return system.getResultFail(-111,"详细地址不能为空");
}
params["servicer_address"]=ab.servicerAddress;
if(!ab.principalName){
return system.getResultFail(-112,"负责人不能为空");
}
params["principal_name"]=ab.principalName;
if(!ab.principalMobile){
return system.getResultFail(-113,"联系电话不能为空");
}
params["principal_mobile"]=ab.principalMobile;
return system.getResultSuccess(params);
}
/**
* 新增/修改服务商
*/
async createServiceProvider(pobj){
if(!pobj || !pobj.actionBody){
return system.getResultFail(-100,"参数错误");
}
var ab = pobj.actionBody;
var params={};
var pakageRes = await this.verifyAndPackageCreateParams(ab);//校验组装参数
if(pakageRes.retcode!=0){
return pakageRes;
}else{
params = pakageRes.data;
}
var servicer_code = "";
if(ab.servicerCode){//传入服务商code 为修改服务商信息
servicer_code = ab.servicerCode;
params["servicer_code"] = servicer_code;
var serviceinfo = await this.dao.model.findOne({
where:{servicer_code:servicer_code},
raw:true
});
if(!serviceinfo || !serviceinfo.id){
return system.getResultFail(-300,"未知服务商");
}
params["id"] = serviceinfo.id;
var self = this;
return this.db.transaction(async function (t) {
await self.dao.update(params,t);//修改服务商信息
await self.editServiceProduct(ab.productList,serviceinfo.servicer_code,serviceinfo.servicer_name,params["is_enabled"],t);//修改服务商产品信息
return system.getResultSuccess();
})
}else{//新增服务商信息
servicer_code = await this.getBusUid("S_");
params["servicer_code"] = servicer_code;
var self = this;
return this.db.transaction(async function (t) {
var serviceinfo = await self.dao.create(params,t);//修改服务商信息
await self.editServiceProduct(ab.productList,serviceinfo.servicer_code,serviceinfo.servicer_name,params["is_enabled"],t);//编辑服务商产品信息
return system.getResultSuccess(serviceinfo);
})
}
}
/**
* 编辑服务商产品
* @param {*} productList 产品id列表
* @param {*} servicerCode 服务商编码
* @param {*} isEnabled 服务商是否启用
* @param {*} t 事务
*/
async editServiceProduct(productList,servicerCode,servicerName,isEnabled,t){
await this.dao.deleteAllProductByServicerCode(servicerCode,t);//根据服务商编码删除该服务商所有产品
// if(isEnabled==1){//服务商已启用
if(productList && productList.length>0){
await this.dao.setProductByServicerCode(productList,servicerCode,servicerName,t);//给服务商设置产品
}
// }
}
/**
* 服务商详情
*/
async getServiceInfoDetail(pobj){
if(!pobj || !pobj.actionBody){
return system.getResultFail(-100,"参数错误");
}
var ab = pobj.actionBody;
if(!ab.servicerCode){
return system.getResultFail(-101,"服务商编码不能为空");
}
var serviceinfo = await this.dao.model.findOne({
where:{servicer_code:ab.servicerCode},
raw:true
});
if(!serviceinfo || !serviceinfo.id){
return system.getResultFail(-300,"未知服务商信息");
}
//获取服务商分配产品列表
var productList = await this.dao.getAssignedProductsByServicerCode(ab.servicerCode);
var plist = [];
if(productList && productList.length>0){
for(var i=0;i<productList.length;i++){
var id = productList[i].id;
if(id){
plist.push(id);
}
}
}
serviceinfo["productList"] = plist;
return system.getResultSuccess(serviceinfo);
}
/**
* 服务商列表
*/
async getServiceInfoList(pobj){
var ab = {};
if(pobj && pobj.actionBody){
ab = pobj.actionBody
}
var result = await this.dao.getServiceProviderList(ab);
return result;
}
/**
* 服务商列表(筛选条件)
*/
async getServiceProviderList(pobj){
var ab = {};
if(pobj && pobj.actionBody){
ab = pobj.actionBody
}
var list = await this.dao.model.findAll({
attributes:["servicer_code","servicer_name","apply_type"],
raw:true,
})
return system.getResultSuccess(list);
}
}
module.exports = ServiceInfoService;
\ No newline at end of file
var system = require("../../../system");
var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
//用户权限操作
class UtilsAuthService extends AppServiceBase {
constructor() {
super();
}
}
module.exports = UtilsAuthService;
var system = require("../../../system");
var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
//XBoss系统通用接口
class UtilsXbossService extends AppServiceBase {
constructor() {
super();
this.serviceInfoDao = system.getObject("db.serviceprovider.serviceInfoDao")
}
/**
* xboss系统 需求详情
*/
async xneedDetail(pobj){
if(!pobj || !pobj.actionBody){
return system.getResultFail(-100,"参数错误");
}
var ab = pobj.actionBody;
if(!ab.servicerCode){
return system.getResultFail(-101,"服务商编码不能为空");
}
if(!ab.needNum){
return system.getResultFail(-102,"需求编码不能为空");
}
var serviceInfo = await this.serviceInfoDao.model.findOne({
where:{servicer_code:ab.servicerCode},
attributes:[
"id",
"created_at",
"servicer_code",
"servicer_name",
"servicer_short_name",
"business_license",
// "business_license_address",
"credit_code",
"legal_identity_card",
"legal_name",
"legal_mobile",
"principal_name","principal_mobile",
"legal_identity_card_no",
"push_domain_addr"
],
raw:true
});
if(!serviceInfo || !serviceInfo.id){
return system.getResultFail(-300,"未知服务商");
}
var resData = {serviceInfo:serviceInfo};
var list = await this.serviceInfoDao.getNeedAndSolutionInfoByNeedNum(ab.needNum);
if(list && list.length>0){
resData["needSolution"] = list[0];
}
return system.getResultSuccess(resData);
}
/**
* xboss系统 需求列表
*/
async xneedList(pobj){
var ab = {};
if(pobj && pobj.actionBody){
ab = pobj.actionBody
}
var result = await this.serviceInfoDao.getNeedSolutionList(ab);
return result;
}
/**
* xboss系统 申请主体列表
*/
async xApplicantList(pobj){
var ab = {};
if(pobj && pobj.actionBody){
ab = pobj.actionBody
}
var result = await this.serviceInfoDao.getApplicantList(ab);
return result;
}
/**
* xboss系统 申请主体详情
*/
async xApplicantDetail(pobj){
if(!pobj || !pobj.actionBody){
return system.getResultFail(-100,"参数错误");
}
var ab = pobj.actionBody;
if(!ab.creditCode){
return system.getResultFail(-101,"社会统一信用代码不能为空");
}
var applyInfoRes = await this.serviceInfoDao.getApplyInfoByCreditCode(ab.creditCode);
if(!applyInfoRes || applyInfoRes.length<1){
return system.getResultFail(-300,"未知申请主体");
}
var applyInfo = applyInfoRes[0];
if(!applyInfo || !applyInfo.apply_name){
return system.getResultFail(-301,"未知申请主体");
}
var resData = {applyInfo:applyInfo};
var list = await this.serviceInfoDao.getProductBusinessInfoByApplicant(applyInfo.credit_code);
resData["productBusinessInfo"] = list;
return system.getResultSuccess(resData);
}
/**
* 获取服务商产品列表
* @param {*} pobj
*/
async getProductListBySrvicerCode(pobj){
// if(!pobj || !pobj.actionBody){
// return system.getResultFail(-100,"参数错误");
// }
var ab = pobj.actionBody;
// if(!ab.servicerCode){
// return system.getResultFail(-101,"服务商编码不能为空");
// }
var typelist = await this.serviceInfoDao.getProductTypeTwoList();//获取所有产品二类
if(typelist && typelist.length>0){
for(var i=0;i<typelist.length;i++){
var productList = await this.serviceInfoDao.getProductListByType(typelist[i].id,ab.servicerCode);//根据产品类型获取产品列表
typelist[i].productList = productList;
}
}
return system.getResultSuccess({rows:typelist});
}
/**
* Xboss系统 订单管理--查询--列表查询展示
*/
async xOrderQueryList(pobj){
var parambody = {};
if(pobj && pobj.actionBody){
parambody = pobj.actionBody;
}
var result = await this.serviceInfoDao.getOrderQueryList(parambody);
return result;
}
/**
* Xboss系统 资质服务列表
*/
async getQcOrderList(pobj){
var parambody = {};
if(pobj && pobj.actionBody){
parambody = pobj.actionBody;
}
var result = await this.serviceInfoDao.getQcOrderList(parambody);
return result;
}
/**
* Xboss系统 资质年报服务列表
*/
async getQcAnnalsOrderList(pobj){
var parambody = {};
if(pobj && pobj.actionBody){
parambody = pobj.actionBody;
}
var result = await this.serviceInfoDao.getQcAnnalsOrderList(parambody);
return result;
}
/**
* Xboss系统 订单详情展示
*/
async xOrderDetail(pobj){
if(!pobj || !pobj.actionBody){
return system.getResultFail(-100,"参数错误");
}
var parambody = pobj.actionBody;
if(!parambody.orderNum){
return system.getResultFail(-101,"订单号不能为空");
}
var list = await this.serviceInfoDao.getOrderDetailByOrderNum(parambody.orderNum);
if(list && list.length>0){
var orderdetail = list[0] || {};
var relatedProducts = [];//关联产品
if(orderdetail && orderdetail.tx_orders_num && orderdetail.order_num){
//获取关联产品列表
var relatedProductsList = await this.serviceInfoDao.getRelatedProductsList(orderdetail.tx_orders_num,orderdetail.order_num);
relatedProducts = relatedProductsList;
//判断产品大类为资质证照
if(orderdetail.product_type && orderdetail.product_type.indexOf("/qcfw/")>=0){
if(orderdetail.servicer_code){
//获取服务商信息
var serviceInfo = await this.serviceInfoDao.model.findOne({
where:{servicer_code:orderdetail.servicer_code},
attributes:[
"id",
"created_at",
"servicer_code",
"servicer_name",
"servicer_short_name",
"business_license",
"credit_code",
"legal_identity_card",
"legal_name",
"legal_mobile",
"principal_name",
"principal_mobile",
"legal_identity_card_no",
"push_domain_addr"
],
raw:true
});
orderdetail["serviceInfo"] = serviceInfo || null;
}
if(orderdetail.product_type=="/qcfw/icpannals/"){//icp年報
//获取资质证照信息
var qcList = await this.serviceInfoDao.getQcInfoByTxOrderNumAndProductType(orderdetail.tx_orders_num,"/qcfw/icp/");
orderdetail["qcInfo"]=qcList&&qcList.length>0?qcList[0]:null;
}
if(orderdetail.product_type=="/qcfw/ediannals/"){//edi年報
//获取资质证照信息
var qcList = await this.serviceInfoDao.getQcInfoByTxOrderNumAndProductType(orderdetail.tx_orders_num,"/qcfw/edi/");
orderdetail["qcInfo"]=qcList&&qcList.length>0?qcList[0]:null;
}
}
}
orderdetail["relatedProducts"]=relatedProducts;//关联产品
return system.getResultSuccess(orderdetail);
}else{
return system.getResultFail(-102,"未查询到该订单号");
}
}
//获取资质年报列表
async getAnnualReportByOrderNum(pobj){
if(!pobj || !pobj.actionBody){
return system.getResultFail(-100,"参数错误");
}
var parambody = pobj.actionBody;
if(!parambody.orderNumber){
return system.getResultFail(-101,"订单号不能为空");
}
var returnRes = {
pageSize: 10,//每页条数
curPage: 1,//当前页数
search: parambody,
orderArr: null,//排序字段
total: 0,//总记录条数
rows: []
};
var list = await this.serviceInfoDao.getAnnualReportByOrderNum(parambody.orderNumber);
if(list && list.length>0){
var annualReportList = list[0].annualReportList;
if(annualReportList && annualReportList.length>0){
returnRes.rows = annualReportList;
returnRes.total = returnRes.pageSize = annualReportList.length;
}
}
return system.getResultSuccess(returnRes);
}
/**
* Xboss系统 订单详情出资比例
*/
async getContributionInfoByOrderNum(pobj){
if(!pobj || !pobj.actionBody){
return system.getResultFail(-100,"参数错误");
}
var parambody = pobj.actionBody;
if(!parambody.orderNumber){
return system.getResultFail(-101,"订单号不能为空");
}
var returnRes = {
pageSize: 10,//每页条数
curPage: 1,//当前页数
search: parambody,
orderArr: null,//排序字段
total: 0,//总记录条数
rows: []
};
var list = await this.serviceInfoDao.getContributionInfoByOrderNum(parambody.orderNumber);
if(list && list.length>0){
var contributionInfoList = list[0].contributionInfoList;
if(contributionInfoList && contributionInfoList.length>0){
returnRes.rows = contributionInfoList;
returnRes.total = returnRes.pageSize = contributionInfoList.length;
}
}
return system.getResultSuccess(returnRes);
}
/**
* Xboss系统 订单-详情查询--资质证照-公司人员情况
*/
async getPrincipalInfoByOrderNum(pobj){
if(!pobj || !pobj.actionBody){
return system.getResultFail(-100,"参数错误");
}
var parambody = pobj.actionBody;
if(!parambody.orderNumber){
return system.getResultFail(-101,"订单号不能为空");
}
var returnRes = {
pageSize: 10,//每页条数
curPage: 1,//当前页数
search: parambody,
orderArr: null,//排序字段
total: 0,//总记录条数
rows: []
};
var list = await this.serviceInfoDao.getPrincipalInfoByOrderNum(parambody.orderNumber);
if(list && list.length>0){
var principalInfo = list[0].principalInfo;
if(principalInfo && principalInfo.length>0){
returnRes.rows = principalInfo;
returnRes.total = returnRes.pageSize = principalInfo.length;
}
}
return system.getResultSuccess(returnRes);
}
/**
* Xboss系统 订单-详情查询--资质证照-股权结构
*/
async getShareholderDataByOrderNum(pobj){
if(!pobj || !pobj.actionBody){
return system.getResultFail(-100,"参数错误");
}
var parambody = pobj.actionBody;
if(!parambody.orderNumber){
return system.getResultFail(-101,"订单号不能为空");
}
var returnRes = {
pageSize: 10,//每页条数
curPage: 1,//当前页数
search: parambody,
orderArr: null,//排序字段
total: 0,//总记录条数
rows: []
};
var list = await this.serviceInfoDao.getShareholderDataByOrderNum(parambody.orderNumber);
if(list && list.length>0){
var shareholderData = list[0].shareholderData;
if(shareholderData && shareholderData.length>0){
returnRes.rows = shareholderData;
returnRes.total = returnRes.pageSize = shareholderData.length;
}
}
return system.getResultSuccess(returnRes);
}
/**
* Xboss系统 订单-详情查询--资质证照-网站或APP信息
*/
async getWebAppByOrderNum(pobj){
if(!pobj || !pobj.actionBody){
return system.getResultFail(-100,"参数错误");
}
var parambody = pobj.actionBody;
if(!parambody.orderNumber){
return system.getResultFail(-101,"订单号不能为空");
}
var returnRes = {
pageSize: 10,//每页条数
curPage: 1,//当前页数
search: parambody,
orderArr: null,//排序字段
total: 0,//总记录条数
rows: []
};
var list = await this.serviceInfoDao.getWebAppByOrderNum(parambody.orderNumber);
if(list && list.length>0){
var webApp = list[0].webApp;
if(webApp && webApp.length>0){
returnRes.rows = webApp;
returnRes.total = returnRes.pageSize = webApp.length;
}
}
return system.getResultSuccess(returnRes);
}
/**
* Xboss系统 订单-详情查询--资质证照-拟开展服务项目
*/
async getServiceProjectByOrderNum(pobj){
if(!pobj || !pobj.actionBody){
return system.getResultFail(-100,"参数错误");
}
var parambody = pobj.actionBody;
if(!parambody.orderNumber){
return system.getResultFail(-101,"订单号不能为空");
}
var returnRes = {
pageSize: 10,//每页条数
curPage: 1,//当前页数
search: parambody,
orderArr: null,//排序字段
total: 0,//总记录条数
rows: []
};
var list = await this.serviceInfoDao.getServiceProjectByOrderNum(parambody.orderNumber);
if(list && list.length>0){
var product_type = list[0].product_type;
if(product_type){
if(product_type=="/qcfw/icp/"){
var serviceProjectIcp = list[0].serviceProjectIcp;
if(serviceProjectIcp && serviceProjectIcp.length>0){
returnRes.rows = serviceProjectIcp;
returnRes.total = returnRes.pageSize = serviceProjectIcp.length;
}
}
if(product_type=="/qcfw/edi/"){
var serviceProjectEdi = list[0].serviceProjectEdi;
if(serviceProjectEdi && serviceProjectEdi.length>0){
returnRes.rows = serviceProjectEdi;
returnRes.total = returnRes.pageSize = serviceProjectEdi.length;
}
}
}
}
return system.getResultSuccess(returnRes);
}
/**
* Xboss系统 订单-详情查询--资质证照-专项审批项目 ICP
*/
async getSpecialApprovalInfoByOrderNum(pobj){
if(!pobj || !pobj.actionBody){
return system.getResultFail(-100,"参数错误");
}
var parambody = pobj.actionBody;
if(!parambody.orderNumber){
return system.getResultFail(-101,"订单号不能为空");
}
var returnRes = {
pageSize: 10,//每页条数
curPage: 1,//当前页数
search: parambody,
orderArr: null,//排序字段
total: 0,//总记录条数
rows: []
};
var list = await this.serviceInfoDao.getSpecialApprovalInfoByOrderNum(parambody.orderNumber);
if(list && list.length>0){
var specialApprovalList = list[0].specialApprovalList;
if(specialApprovalList && specialApprovalList.length>0){
returnRes.rows = specialApprovalList;
returnRes.total = returnRes.pageSize = specialApprovalList.length;
}
}
return system.getResultSuccess(returnRes);
}
/**
* Xboss系统 订单-详情查询--资质证照-材料清单(固定上传项)
*/
async getMaterialsInfoByOrderNum(pobj){
if(!pobj || !pobj.actionBody){
return system.getResultFail(-100,"参数错误");
}
var parambody = pobj.actionBody;
if(!parambody.orderNumber){
return system.getResultFail(-101,"订单号不能为空");
}
var returnRes = {
pageSize: 10,//每页条数
curPage: 1,//当前页数
search: parambody,
orderArr: null,//排序字段
total: 0,//总记录条数
rows: []
};
var list = await this.serviceInfoDao.getMaterialsInfoByOrderNum(parambody.orderNumber);
if(list && list.length>0){
var materialsInfo = list[0].materialsInfo;
if(materialsInfo && materialsInfo.length>0){
returnRes.rows = materialsInfo;
returnRes.total = returnRes.pageSize = materialsInfo.length;
}
}
return system.getResultSuccess(returnRes);
}
/**
* Xboss系统 交易流水列表
*/
async xOrderTransactionPipelineList(pobj){
var parambody = {};
if(pobj && pobj.actionBody){
parambody = pobj.actionBody;
}
var result = await this.serviceInfoDao.getOrderTransactionPipelineList(parambody);
return result;
}
/**
* 订单详情-任职信息列表
*/
async getPositionInfoByOrderNum(pobj){
if(!pobj || !pobj.actionBody){
return system.getResultFail(-100,"参数错误");
}
var parambody = pobj.actionBody;
if(!parambody.orderNumber){
return system.getResultFail(-101,"订单号不能为空");
}
var returnRes = {
pageSize: 10,//每页条数
curPage: 1,//当前页数
search: parambody,
orderArr: null,//排序字段
total: 0,//总记录条数
rows: []
};
var list = await this.serviceInfoDao.getPositionInfoByOrderNum(parambody.orderNumber);
if(list && list.length>0){
var positionInfoList = list[0].positionInfoList;
if(positionInfoList && positionInfoList.length>0){
returnRes.rows = positionInfoList;
returnRes.total = returnRes.pageSize = positionInfoList.length;
}
}
return system.getResultSuccess(returnRes);
}
}
module.exports = UtilsXbossService;
const system = require("../system");
const moment = require('moment')
const settings = require("../../config/settings");
const md5 = require("MD5");
class ServiceBase {
constructor(gname, daoName) {
this.execClient = system.getObject("util.execClient");
this.db = system.getObject("db.common.connection").getCon();
this.daoName = daoName;
this.dao = system.getObject("db." + gname + "." + daoName);
}
/**
* 带超时时间的post请求
* @param {*} params 请求数据-json格式
* @param {*} url 请求地址
* @param {*} ContentType 请求头类型,默认application/json
* @param {*} headData 请求头内容-json格式,如:请求头中传递token,格式:{token:"9098902q849q0434q09439"}
* @param {*} timeOut 超时时间
*/
async execPostByTimeOut(params, url, ContentType, headData, timeOut = 60) {
return await this.execClient.execPostTimeOutByBusiness("sve.base", params, url, ContentType, headData, timeOut);
}
/**
* 验证签名
* @param {*} params 要验证的参数
* @param {*} app_key 应用的校验key
*/
async verifySign(params, app_key) {
if (!params) {
return system.getResult(null, "请求参数为空");
}
if (!params.sign) {
return system.getResult(null, "请求参数sign为空");
}
var signArr = [];
var keys = Object.keys(params).sort();
if (keys.length == 0) {
return system.getResult(null, "请求参数信息为空");
}
for (let k = 0; k < keys.length; k++) {
const tKey = keys[k];
if (tKey != "sign" && params[tKey] && !(params[tKey] instanceof Array)) {
signArr.push(tKey + "=" + params[tKey]);
}
}
if (signArr.length == 0) {
return system.getResult(null, "请求参数组装签名参数信息为空");
}
var resultSignStr = signArr.join("&") + "&key=" + app_key;
var resultTmpSign = md5(resultSignStr).toUpperCase();
if (params.sign != resultTmpSign) {
return system.getResult(null, "返回值签名验证失败");
}
return system.getResultSuccess();
}
/**
* 创建签名
* @param {*} params 要验证的参数
* @param {*} app_key 应用的校验key
*/
async createSign(params, app_key) {
if (!params) {
return system.getResultFail(-310, "请求参数为空");
}
var signArr = [];
var keys = Object.keys(params).sort();
if (keys.length == 0) {
return system.getResultFail(-330, "请求参数信息为空");
}
for (let k = 0; k < keys.length; k++) {
const tKey = keys[k];
if (tKey != "sign" && params[tKey] && !(params[tKey] instanceof Array)) {
signArr.push(tKey + "=" + params[tKey]);
}
}
if (signArr.length == 0) {
return system.getResultFail(-350, "请求参数组装签名参数信息为空");
}
var resultSignStr = signArr.join("&") + "&key=" + app_key;
var resultTmpSign = md5(resultSignStr).toUpperCase();
return system.getResultSuccess(resultTmpSign);
}
/**
* 验证参数信息不能为空
* @param {*} params 验证的参数
* @param {*} verifyParamsCount 需要验证参数的数量,如至少验证3个,则传入3
* @param {*} columnList 需要过滤掉的验证参数列表,格式:[]
*/
async verifyParams(params, verifyParamsCount, columnList) {
if (!params) {
return system.getResult(null, "请求参数为空");
}
if (!columnList) {
columnList = [];
}
var keys = Object.keys(params);
if (keys.length == 0) {
return system.getResult(null, "请求参数信息为空");
}
if (keys.length < verifyParamsCount) {
return system.getResult(null, "请求参数不完整");
}
var tResult = system.getResultSuccess();
for (let k = 0; k < keys.length; k++) {
const tKeyValue = keys[k];
if (columnList.length == 0 || columnList.indexOf(tKeyValue) < 0) {
if (!tKeyValue) {
tResult = system.getResult(null, k + "参数不能为空");
break;
}
}//白名单为空或不在白名单中,则需要验证不能为空
}
return tResult;
}
static getDaoName(ClassObj) {
var nameStr = ClassObj["name"].substring(0, ClassObj["name"].lastIndexOf("Service")) + "Dao";
var initialStr = nameStr.substring(0, 1);
var resultStr = initialStr.toLowerCase() + nameStr.substring(1, nameStr.length);
return resultStr;
// return ClassObj["name"].substring(0, ClassObj["name"].lastIndexOf("Service")).toLowerCase() + "Dao";
}
async findAndCountAll(obj) {
const apps = await this.dao.findAndCountAll(obj);
return apps;
}
async refQuery(qobj) {
return this.dao.refQuery(qobj);
}
async bulkDeleteByWhere(whereParam, t) {
return await this.dao.bulkDeleteByWhere(whereParam, t);
}
async bulkDelete(ids) {
var en = await this.dao.bulkDelete(ids);
return en;
}
async delete(qobj) {
return this.dao.delete(qobj);
}
async create(qobj) {
return this.dao.create(qobj);
}
async update(qobj, tm = null) {
return this.dao.update(qobj, tm);
}
async updateByWhere(setObj, whereObj, t) {
return this.dao.updateByWhere(setObj, whereObj, t);
}
async customExecAddOrPutSql(sql, paras = null) {
return this.dao.customExecAddOrPutSql(sql, paras);
}
async customQuery(sql, paras, t) {
return this.dao.customQuery(sql, paras, t);
}
async findCount(whereObj = null) {
return this.dao.findCount(whereObj);
}
async findSum(fieldName, whereObj = null) {
return this.dao.findSum(fieldName, whereObj);
}
async getPageList(pageIndex, pageSize, whereObj = null, orderObj = null, attributesObj = null, includeObj = null) {
return this.dao.getPageList(pageIndex, pageSize, whereObj, orderObj, attributesObj, includeObj);
}
async findOne(obj) {
return this.dao.findOne(obj);
}
async findById(oid) {
return this.dao.findById(oid);
}
/*
返回20位业务订单号
prefix:业务前缀
*/
async getBusUid(prefix) {
prefix = (prefix || "");
if (prefix) {
prefix = prefix.toUpperCase();
}
var prefixlength = prefix.length;
var subLen = 8 - prefixlength;
var uidStr = "";
if (subLen > 0) {
uidStr = await this.getUidInfo(subLen, 60);
}
var timStr = moment().format("YYYYMMDDHHmm");
return prefix + timStr + uidStr;
}
/*
len:返回长度
radix:参与计算的长度,最大为62
*/
async getUidInfo(len, radix) {
var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');//长度62,到yz长度为长36
var uuid = [], i;
radix = radix || chars.length;
if (len) {
for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
} else {
var r;
uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
uuid[14] = '4';
for (i = 0; i < 36; i++) {
if (!uuid[i]) {
r = 0 | Math.random() * 16;
uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
}
}
}
return uuid.join('');
}
}
module.exports = ServiceBase;
......@@ -133,8 +133,8 @@ class System {
*/
static getResult(data, opmsg = "操作成功", req) {
return {
status: !data ? -1 : 1,
message: opmsg,
retcode: !data ? -1 : 1,
msg: opmsg,
data: data
};
}
......@@ -145,9 +145,9 @@ class System {
*/
static getResultSuccess(data, okmsg = "success") {
return {
status: 1,
message: okmsg,
data: data || null,
retcode: 0,
msg: okmsg,
data: data,
};
}
/**
......@@ -158,8 +158,8 @@ class System {
*/
static getResultFail(status = -1, errmsg = "fail", data = null) {
return {
status: status,
message: errmsg,
retcode: status,
msg: errmsg,
data: data,
};
}
......@@ -170,8 +170,8 @@ class System {
*/
static getResultError(errmsg = "fail", data = null) {
return {
status: -200,
message: errmsg,
retcode: -200,
msg: errmsg,
data: data,
};
}
......@@ -216,7 +216,7 @@ class System {
try {
ClassObj = require(objabspath);
} catch (e) {
// console.log(e.stack, "...getObject.....errror");
console.log(e.stack, "......getObject......");
let fname = objsettings[packageName + "base"];
ClassObj = require(fname);
}
......@@ -224,9 +224,6 @@ class System {
let modelname = filename.substring(0, filename.lastIndexOf("Dao"))
return System.register(objabspath, ClassObj, modelname);
}
if (ClassObj.name.indexOf("Ctl") >= 0) {
console.log(ClassObj.name);
}
return System.register(objabspath, ClassObj, groupName, filename);
}
}
......
......@@ -4,13 +4,13 @@ const util = require('util');
const exec = util.promisify(require('child_process').exec);
const settings = require("../../../app/config/settings");
const axios = require('axios');
const { json } = require('sequelize');
const moment = require('moment');
const uuid = require('uuid');
class ExecClient {
constructor() {
this.cmdGetPattern = "curl -G -X GET '{url}'";
this.cmdPostPattern = "curl -k -H 'Content-type: application/json' -d '{data}' {url}";
// this.cmdPushDataPostPattern = "curl -k -H 'Content-type: application/json' -H 'token:{tk}' -H 'request-id:{requestId}' -d '{data}' {url}"; //--已废弃
this.errorLogDao = system.getObject("db.opLogs.errorLogDao");
// this.cmdPushDataPostPattern = "curl -k -H 'Content-type: application/json' -H 'token:{tk}' -H 'request-id:{requestId}' -d '{data}' {url}";
}
/**
* 带超时时间的post请求
......@@ -23,6 +23,7 @@ class ExecClient {
*/
async execPostTimeOutByBusiness(execFile, params, url, ContentType, headData, timeOut = 5000) {
var rtn = null;
var reqResult = null;
try {
if (settings.env === "dev") {
var headers = {
......@@ -48,26 +49,67 @@ class ExecClient {
url: url,
data: JSON.stringify(params)
});
if (result.status == 200 && result.data) {
return result.data;
if (result.status == 200) {
reqResult = system.getResultSuccess(result.data);
} else {
reqResult = system.getResult(null, "执行execPostTimeOutByBusiness存在错误");
}
reqResult.requestId = uuid.v1();
if (result.headers) {
delete result["headers"];
}
if (result.request) {
delete result["request"];
}
this.errorLogDao.addOpErrorLogs(queuedName + "执行execPostTimeOutByBusiness存在错误", params, result, null, 3);
return system.getResult(null, "执行execPostTimeOutByBusiness存在错误,error:" + JSON.stringify(result));
if (result.config) {
delete result["config"];
}
this.execLogs(execFile + "执行execPostTimeOutByBusiness", params, params.identifyCode, reqResult, result);
return reqResult;
}
//方式二
rtn = await this.execPostTimeOut(params, url, ContentType, headData, timeOut);
rtn = await this.execClient.execPostTimeOut(params, url, ContentType, headData, timeOut);
if (!rtn || !rtn.stdout) {
return system.getResult(null, "execPostTimeOut data is empty");
}
reqResult = system.getResult(null, "execPostTimeOut data is empty");
} else {
var result = JSON.parse(rtn.stdout);
return result;
reqResult = system.getResultSuccess(result);
}
reqResult.requestId = uuid.v1();
this.execLogs(execFile + "执行execPostTimeOutByBusiness", params, params.identifyCode, reqResult, rtn);
return reqResult;
} catch (error) {
var stackStr = error.stack ? error.stack : JSON.stringify(error);
this.errorLogDao.addOpErrorLogs(execFile + "执行execPostByTimeOut存在异常", params, rtn ? rtn.stdout : null, stackStr, 3);
return system.getResultFail(-200, execFile + "执行execPostByTimeOut存在异常,error:" + stackStr);
reqResult = system.getResultFail(-200, execFile + "执行execPostByTimeOut存在异常");
reqResult.requestId = uuid.v1();
this.execLogs(execFile + "执行execPostByTimeOut存在异常", params, params.identifyCode, reqResult, error.stack);
return reqResult;
}
}
/**
* 记录日志信息
* @param {*} opTitle 操作的标题
* @param {*} params 参数
* @param {*} identifyCode 业务标识
* @param {*} resultInfo 返回结果
* @param {*} errorInfo 错误信息
*/
async execLogs(opTitle, params, identifyCode, resultInfo, errorInfo) {
var reqUrl = settings.opLogUrl();
var param = {
actionType: "produceLogsData",// Y 功能名称
actionBody: {
opTitle: opTitle || "",// N 操作的业务标题
identifyCode: identifyCode || "brg-user",// Y 操作的业务标识
indexName: "brg-user",// Y es索引值,同一个项目用一个值
messageBody: params, //日志的描述信息
resultInfo: resultInfo,//返回信息
errorInfo: errorInfo,//错误信息
requestId: resultInfo.requestId || ""
}
};
this.execPostTimeOut(param, reqUrl, 'application/json', null, 20);
}
/**
* get请求
* @param {*} params 提交的数据-格式JSON
......@@ -76,7 +118,6 @@ class ExecClient {
*/
async execGet(params, url, headData) {
let cmd = this.FetchGetCmd(params, url, headData);
console.log(cmd);
var result = await this.exec(cmd);
return result;
}
......@@ -104,6 +145,9 @@ class ExecClient {
* @param {*} headData 请求头内容-json格式,如:请求头中传递token,格式:{token:"9098902q849q0434q09439"}
*/
async execPost(params, url, ContentType, headData) {
if (!ContentType) {
ContentType = "application/json";
}
let cmd = this.FetchPostCmd(params, url, ContentType, headData);
var options = {
maxBuffer: 1024 * 1024 * 15
......@@ -120,6 +164,9 @@ class ExecClient {
* @param {*} timeOut 超时时间设置,单位秒
*/
async execPostTimeOut(params, url, ContentType, headData, timeOut = 5000) {
if (!ContentType) {
ContentType = "application/json";
}
let cmd = this.FetchPostCmd(params, url, ContentType, headData);
var options = {
timeout: timeOut,
......@@ -128,18 +175,6 @@ class ExecClient {
var result = await this.exec(cmd, options);
return result;
}
/**
* post日志到Es
* @param {*} params 参数
* @param {*} reqUrl
* @param {*} esName
* @param {*} esPwd
*/
async execPostEs(params, reqUrl, esName, esPwd) {
let cmd = this.FetchPostEsCmd(params, reqUrl, esName, esPwd);
var result = await this.exec(cmd);
return result;
}
//--------------------------------------------------辅助方法start-----------------
......@@ -152,15 +187,31 @@ class ExecClient {
FetchGetCmd(params, url, headData) {
var cmd = this.cmdGetPattern.replace(
/\{data\}/g, params).replace(/\{url\}/g, url);
console.log(cmd);
return cmd;
}
FetchPostCmd(params, url, ContentType, headData) {
if (!ContentType) {
ContentType = "application/json";
}
var data = typeof params === 'object' ? JSON.stringify(params) : params;
var data = null;
if (typeof params === 'object') {
// 声明cache变量,便于匹配是否有循环引用的情况
var cache = [];
data = JSON.stringify(params, function (key, value) {
if (typeof value === 'object' && value !== null) {
if (cache.indexOf(value) !== -1) {
// 移除
return;
}
// 收集所有的值
cache.push(value);
}
return value;
});
cache = null; // 清空变量,便于垃圾回收机制回收
} else {
data = params;
}
var cmdStr = "curl -k -H 'Content-type:" + ContentType + "'";
if (headData) {
var headDataKeys = Object.keys(headData);
......@@ -178,13 +229,49 @@ class ExecClient {
console.log(cmdStr, ":cmdStr.................");
return cmdStr;
}
FetchPostEsCmd(params, reqUrl, esName, esPwd) {
var data = JSON.stringify(params);
var cmdStr = "curl --user " + esName + ":" + esPwd + " -k -H 'Content-type: application/json' -d '" + data + "' " + reqUrl;
console.log(cmdStr, ":cmdStr.................");
return cmdStr;
}
/**
* 返回20位业务订单号
* @param {*} prefix 业务前缀
*/
async getBusUid(prefix) {
prefix = (prefix || "");
if (prefix) {
prefix = prefix.toUpperCase();
}
var prefixlength = prefix.length;
var subLen = 8 - prefixlength;
var uidStr = "";
if (subLen > 0) {
uidStr = await this.getUidInfo(subLen, 60);
}
var timStr = moment().format("YYYYMMDDHHmm");
return prefix + timStr + uidStr;
}
/**
* 返回指定长度的字符串
* @param {*} len 返回长度
* @param {*} radix 参与计算的长度,最大为62
*/
async getUidInfo(len, radix) {
var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');//长度62,到yz长度为长36
var uuid = [], i;
radix = radix || chars.length;
if (len) {
for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
} else {
var r;
uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
uuid[14] = '4';
for (i = 0; i < 36; i++) {
if (!uuid[i]) {
r = 0 | Math.random() * 16;
uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
}
}
}
return uuid.join('');
}
//--------------------------------------------------辅助方法end-----------------
}
......
const system = require("../system");
const redis = require("redis");
const settings = require("../../config/settings");
const bluebird = require("bluebird");
bluebird.promisifyAll(redis);
class RedisClient {
constructor() {
this.client = this.getCreateClientInstance();
this.subclient = this.client.duplicate();
}
getDuplicateInstance() {
return this.subclient;
}
getCreateClientInstance() {
const redisConfig = settings.redis()
return redis.createClient({
host: redisConfig.host,
port: redisConfig.port,
password: redisConfig.password,
db: redisConfig.db,
retry_strategy: function (options) {
if (options.total_retry_time > 1000 * 60 * 60) {
return new Error('Retry time exhausted');
}
if (options.attempt > 10) {
return 10000;
}
return Math.min(options.attempt * 100, 3000);
}
});
}
/**
* 设置缓存
* @param {*} key key
* @param {*} val 值
* @param {*} t 过期时间,为空则永久存在
*/
async setWithEx(key, val, t) {
var p = this.client.setAsync(key, val);
if (t) {
this.client.expire(key, t);
}
return p;
}
/**
* 获取缓存
* @param {*} key key
*/
async getCache(key) {
return this.client.getAsync(key);
}
/**
* 删除缓存
* @param {*} key key
*/
async delete(key) {
return this.client.delAsync(key);
}
/**
* 判断缓存是否存在
* @param {*} key key
*/
async exists(key) {
return this.client.existsAsync(key);
}
/**
* 设置业务锁
* @param {*} lockKey 锁key
*/
async init(lockKey, lockValue, lockTime) {
this.client.rpushAsync(lockKey, lockValue || "1");
this.client.expire(lockKey, lockTime || 6000);
}
/**
* 获取业务锁
* @param {*} lockKey 锁key
*/
async enter(lockKey) {
return this.client.rpopAsync(lockKey);
}
}
module.exports = RedisClient;
\ No newline at end of file
var express = require('express');
var path = require('path');
var methodOverride = require('method-override');
var cookierParser = require('cookie-parser');
var session = require('express-session');
var RedisStore = require('connect-redis')(session);
var bodyParser = require('body-parser');
var multer = require('multer');
var errorHandler = require('errorhandler');
var settings = require('./settings');
var system = require('../base/system');
var routes = require('./routes');
const clientRedis = system.getObject("util.redisClient").client;
//const tm=system.getObject("db.taskManager");
module.exports = function (app) {
app.set('port', settings.port);
app.set('views', settings.basepath + '/app/front/entry');
app.set('view engine', 'ejs');
app.use(methodOverride());
app.use(cookierParser());
app.use(bodyParser.json({ limit: '50mb' }));
app.use(bodyParser.urlencoded({ limit: '50mb', extended: true }));
routes(app);//初始化路由
app.use(express.static(path.join(settings.basepath, '/app/front/entry/public')));
app.all('*', function (req, res, next) {
req.objs = system;
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild');
res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS');
// res.header('Access-Control-Allow-Credentials', 'true');
if (req.method == 'OPTIONS') {
res.send(200); //让options请求快速返回/
}
else {
next();
}
});
if (settings.env == "dev") {
app.use(session(
{
name: 'devdemosid',
cookie: { maxAge: 3600000 },
rolling: true,
resave: false,
saveUninitialized: false,
secret: 'uwotm8',
store: new RedisStore({
client: clientRedis,
}),
}));
} else {
app.use(session(
{
name: 'demosid',
cookie: { maxAge: 3600000 },
rolling: true,
resave: false,
saveUninitialized: false,
secret: 'uwotm8',
store: new RedisStore({
client: clientRedis,
}),
}));
}
// development only
if ('development' == app.get('env')) {
app.use(errorHandler());
} else {
app.use(function (err, req, res) {
console.log(err.stack, "prod error handler...........................................");
res.send("link index");
});
}
};
......@@ -5,7 +5,7 @@ var settings = {
util:path.join(basepath,"app/base/utils"),
service:path.join(basepath,"app/base/service/impl"),
db:path.join(basepath,"app/base/db/impl"),
tool:path.join(basepath,"app/base/tool"),
service2:path.join(basepath,"app/base/service"),
consumer:path.join(basepath,"app/base/db/consumer"),
}
};
module.exports = settings;
module.exports = {
PDICT: {
logLevel: { "debug": 0, "info": 1, "warn": 2, "error": 3, "fatal": 4 },
push_return_type: { "0": "推送失败", "1": "推送成功" },
pay_type:{"1":"微信","2":"qq钱包","3":"网银支付","4":"余额支付"},
order_op_type:{"1":"收","2":"支"},
order_status:{"1":"已接单","10":"收集工商注册材料","11":"工商审核环节","12":"刻章环节","13":"证件邮寄环节","14":"您已签收", "310":"部分已退款","320":"已退款","330":"已作废"},
apply_type:{"1":"企业","2":"个人"},
settlement_cycle:{"1":"周结","2":"月结","3":"季结","4":"年结"},
}
}
\ No newline at end of file
const url = require("url");
const system = require("../../base/system");
const sha256 = require('sha256');
const redisClient = system.getObject("util.redisClient");
var url = require("url");
var system = require("../../base/system");
module.exports = function (app) {
//-----------------------新的模式---------api---------开始
app.all("/api/*", async function (req, res, next) {
if (req.path === "/api/uploadAction/txCos/getCosInfo") {
next();
return;
}
//-----------------------新的模式---------web---------开始
app.all("/web/*", async function (req, res, next) {
var result = system.getResult(null, "req method must is post");
if (req.method != "POST") {
res.end(JSON.stringify(result));
return;
}
if (!req.body.actionType) {
result.message = "actionType can not be empty";
result.msg = "actionType can not be empty";
res.end(JSON.stringify(result));
return;
}
next();
});
app.get('/web/:gname/:qname/:method', function (req, res) {
var classPath = req.params["qname"];
var methodName = req.params["method"];
var gname = req.params["gname"];
classPath = gname + "." + classPath;
var tClientIp = system.get_client_ip(req);
req.clientIp = tClientIp; req
req.uagent = req.headers["user-agent"];
req.classname = classPath;
var params = [];
params.push(gname);
params.push(methodName);
params.push(req.body);
params.push(req.query);
params.push(req);
var p = null;
var invokeObj = system.getObject("api." + classPath);
if (invokeObj["doexecMethod"]) {
p = invokeObj["doexecMethod"].apply(invokeObj, params);
}
p.then(r => {
res.end(JSON.stringify(r));
});
});
app.post('/web/:gname/:qname/:method', function (req, res) {
var classPath = req.params["qname"];
var methodName = req.params["method"];
var gname = req.params["gname"];
var params = [];
classPath = gname + "." + classPath;
var tClientIp = system.get_client_ip(req);
req.clientIp = tClientIp;
req.uagent = req.headers["user-agent"];
req.classname = classPath;
params.push(gname);
params.push(methodName);
params.push(req.body);
params.push(req.query);
params.push(req);
var p = null;
var invokeObj = system.getObject("api." + classPath);
if (invokeObj["doexecMethod"]) {
p = invokeObj["doexecMethod"].apply(invokeObj, params);
}
p.then(r => {
res.end(JSON.stringify(r));
});
});
//-----------------------新的模式---------web---------结束
//-----------------------新的模式---------api---------开始
app.all("/api/*", async function (req, res, next) {
var result = system.getResult(null, "req method must is post");
if (req.method != "POST") {
res.end(JSON.stringify(result));
return;
}
var shaStr = await sha256(JSON.stringify(req.body));
var existsKey = await redisClient.exists(shaStr);
if (existsKey) {
result.message = "req too often";
if (!req.body.actionType) {
result.msg = "actionType can not be empty";
res.end(JSON.stringify(result));
return;
}
......@@ -38,9 +94,10 @@ module.exports = function (app) {
classPath = gname + "." + classPath;
var tClientIp = system.get_client_ip(req);
req.clientIp = tClientIp;
req.clientIp = tClientIp; req
req.uagent = req.headers["user-agent"];
req.classname = classPath;
var params = [];
params.push(gname);
params.push(methodName);
......
var url = require("url");
var system = require("../../base/system");
var fs = require('fs');
var marked = require("marked");
module.exports = function (app) {
app.get('/doc', function (req, res) {
// if (!req.query.key) {
// res.send("文件不存在!!!");
// return;
// }
// if (req.query.key != "doc12345789") {
// res.send("文件不存在!!!!!!");
// return;
// }
var path = process.cwd() + "/app/front/entry/public/apidoc/README.md";
fs.readFile(path, function (err, data) {
if (err) {
console.log(err);
res.send("文件不存在!");
} else {
console.log(data);
str = marked(data.toString());
res.render('apidoc', { str });
}
});
});
app.get('/doc/:forder', function (req, res) {
var path = process.cwd() + "/app/front/entry/public/apidoc/README.md";
fs.readFile(path, function (err, data) {
if (err) {
console.log(err);
res.send("文件不存在!");
} else {
console.log(data);
str = marked(data.toString());
res.render('apidoc', { str });
}
});
});
app.get('/doc/api/:forder/:fileName', function (req, res) {
// if (req.url != "/doc/api/platform/fgbusinesschance.md") {
// if (!req.query.key) {
// res.send("文件不存在!!!");
// return;
// }
// if (req.query.key != "doc12345789") {
// res.send("文件不存在!!!!!!");
// return;
// }
// }
var forder = req.params["forder"];
var fileName = req.params["fileName"] || "README.md";
var path = process.cwd() + "/app/front/entry/public/apidoc";
if (forder) {
path = path + "/" + forder + "/" + fileName;
} else {
path = path + "/" + fileName;
}
fs.readFile(path, function (err, data) {
if (err) {
console.log(err);
res.send("文件不存在!");
} else {
console.log(data);
str = marked(data.toString());
console.log(str);
res.render('apidoc', { str });
}
});
});
};
var fs=require("fs");
var settings=require("../settings");
var glob = require("glob");
var system = require('../../base/system');
module.exports = function (app) {
app.get('/vue/comp/base',function(req,res){
var vuePath=settings.basepath+"/app/front/vues/base";
var baseComps=[];
var rs=glob.sync(vuePath+"/**/*.vue");
if(rs){
rs.forEach(function(r){
var comp="";
if(settings.env=="dev"){
delete require.cache[r];
comp=require(r).replace(/\n/g,"");
}else{
comp=require(r).replace(/\n/g,"");
}
baseComps.push(comp);
});
res.end(JSON.stringify(baseComps));
}
});
app.get('/vue/comp/:cname',function(req,res){
var componentName=req.params.cname;
var theme=req.headers["theme"];
var hostname=req.hostname;
buildComponent(componentName,theme,hostname).then(function(r){
res.end(escape(r.replace(/\n/g,"")));
// res.end(r);
});
});
};
......@@ -7,18 +7,22 @@ var ENVINPUT = {
REDIS_HOST: process.env.REDIS_HOST,
REDIS_PORT: process.env.REDIS_PORT,
REDIS_PWD: process.env.REDIS_PWD,
REDIS_DB: process.env.QUEUE_REDIS_DB,
DB_NAME: process.env.QUEUE_DB_NAME,
APP_ENV: process.env.APP_ENV ? process.env.APP_ENV : "test",//运行环境
CONSUMER_NAME: process.env.CONSUMER_NAME || "publicServiceAllocation.publicConsumer",//消费者名称
QUEUED_NAME: process.env.QUEUED_NAME || "SYTXPUBLIC-MSGQ",//队列名称,FAIL-失败队列(队列和失败队列一对存在进行部署)
DB_NAME: process.env.BRG_USER_CENTER_DB_NAME,
REDIS_DB: process.env.BRG_USER_CENTER_REDIS_DB,
APP_ENV: process.env.APP_ENV ? process.env.APP_ENV : "dev"
};
var settings = {
env: ENVINPUT.APP_ENV,
consumerName: ENVINPUT.CONSUMER_NAME,
queuedName: ENVINPUT.QUEUED_NAME,
usertimeout: 3600,//单位秒
basepath: path.normalize(path.join(__dirname, '../..')),
port: process.env.NODE_PORT || 4018,
port: process.env.NODE_PORT || 4012,
opLogUrl: function () {
if (this.env == "dev" || this.env == "test") {
return "http://192.168.1.128:4019/api/queueAction/producer/springBoard";
} else {
return "http://logs-sytxpublic-msgq-service/api/queueAction/producer/springBoard";
}
},
redis: function () {
if (this.env == "dev" || this.env == "test") {
var localsettings = require("./localsettings");
......@@ -46,12 +50,10 @@ var settings = {
dialect: 'mysql',
operatorsAliases: false,
pool: {
max: 5,
min: 0,
max: 50,
idle: 30000,//断开连接后,连接实例在连接池保持的时间
acquire: 30000,//请求超时时间
evict: 30000,
handleDisconnects: true
acquire: 90000000,
idle: 1000000
},
timezone: '+08:00',
debug: false,
......@@ -64,5 +66,4 @@ var settings = {
}
}
};
settings.ENVINPUT = ENVINPUT;
module.exports = settings;
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="keywords" content="api文档">
<meta name="baidu-site-verification" content="lATAxZAm8y" />
<meta name="viewport" content="width=device-width, initial-scale=0.8, maximum-scale=0.8, user-scalable=1">
<link href="https://cdn.bootcss.com/github-markdown-css/2.8.0/github-markdown.min.css" rel="stylesheet">
</head>
<body>
<div style="width:100%;text-align: center;font-size: 20px;">
API文档
</div>
<div class="markdown-body" style="margin-left:40px;" id="doc-page">
<%- str%>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="zh-CN">
<body>
<div style="width:100%;text-align: center;font-size: 20px;">
ok
</div>
</body>
</html>
\ No newline at end of file
## 调用接口方式
## 1. XBOSS平台中心
  1 [xboss接口](doc/api/platform/xboss.md)
<a name="menu" href="/doc">返回主目录</a>
1. [用户获取订单列表](#getOrderList)
1. [用户查看订单详情](#getOrderDetail)
1. [用户获取业务主体信息列表](#getApplyListByUserAndType)
1. [用户获取业务主体详情](#getApplyAndSolutionInfo)
## **<a name="getOrderList"> 用户获取订单列表</a>**
[返回到目录](#menu)
##### URL
[/api/action/order/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getOrderList
#### 参数说明
1、公司注册:
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| user_id | 是 | string | 用户id |
| productType | 是 | string | 产品类型 |
| orderStaus | 否 | int | 订单状态 |
| companyProperties | 否 | string | 公司性质 |
| taxpayerType | 否 | string | 纳税人类型 |
| sortType | 否 | string | 排序方式,(asc、desc),不传默认按修改时间倒序 |
#### 参数示例
``` javascript
{
"actionType": "getOrderList",
"actionBody": {
"user_id": "1",
"productType":"1",
"orderStaus":1,
"companyProperties":"",
"taxpayerType":""
}
}
```
#### 返回结果
```javascript
{
"status":0,
"msg":"success",
"data":[
{
"order_num":"O20201231223384682",//订单号
"order_status":1,//订单状态编码
"updated_at":null,//修改时间
"orderProductId":1,//产品类型码
"order_snapshot":null,//订单快照
"product_snapshot":null//产品快照
}
],
"dataCount":1,
"requestId":"ce1ab9f793ef466ea72d6146b8da197c"
}
```
## **<a name="getOrderDetail"> 用户查看订单详情</a>**
[返回到目录](#menu)
##### URL
[/api/action/order/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getOrderDetail
#### 参数说明
1、公司注册:
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| user_id | 是 | string | 用户id |
| orderNum | 是 | string | 订单号 |
#### 参数示例
``` javascript
{
"actionType": "getOrderDetail",
"actionBody": {
"user_id": "1",
"orderNum":"O20201231223384682"
}
}
```
#### 返回结果
```javascript
{
"status":0,
"msg":"success",
"data":{
"order_num":"O20201231223384682",//订单号
"tx_orders_num":"12343qweasd",//腾讯支付订单号
"need_num":null,//需求编码
"user_name":"张三",//用户名称
"quantity":1,//订单数量
"total_sum":"100.00",//订单总额
"discount_amount":"0.00",//折扣金额
"pay_total_sum":null,//支付订单
"refund_sum":null,//退款金额
"order_status":1,//订单状态
"notes":null,//备注
"created_at":"2020-05-29T15:27:05.000Z",//订单创建时间
"updated_at":null,//修改时间
"orderdeliveryinfo":{//订单交付信息
"deliver_content":{//交付数据
},
"created_at":"2020-05-29T08:12:43.000Z",//交付时间
"updated_at":"2020-05-29T08:12:43.000Z"
}
},
"requestId":"9fcb9e7c84784457acc9e92e1fff4b30"
}
```
#### deliver_content 参数说明
```javascript
1、公司注册
{
"baseInfo":{
"deliverNumber":"交付单号",
"payAmount":"实付金额",
"payStatus":"支付状态",
"isWhether":"是否需要公章",
"contactsName":"联系人姓名",
"contactsPhone":"联系人电话"
},
"companyInfo":{
"companyName":"公司名称",
"spareName":"备选名称,数据结构为LIST",
"taxpayerType":"纳税人类型",
"companyProperties":"公司性质",
"addressType":"地址类型-实际经营地址||虚拟地址",
"fullAddress":"注册的详细地址",
"engagedIndustry":"从事行业",
"businessScope":"经营范围",
"operatingPeriod":"经营期限"
},
"registeredInfo":{
"registeredCapital":"注册资本(万元),转换成万元后的数字",
"registeredDate":"注册资本实缴日期(年),只要数字",
"reserveProportion":"公积金缴存比例(%),只要数字"
},
"contributionInfo":[
{
"shareholder Name":"法人/ 自然人股东姓名",
"contributionAmount":"出资金额(万),只要数字",
"contributionProportion":"出资比例,只要数字",
"IdentificationNumber":"证件号码",
"phoneNumber":"联系电话/手机",
"contactAddress":"联系地址"
}
],
"positionInfo":[
{
"functionInfo":"职务信息",
"persionName":"姓名",
"mobilePhone":"手机",
"fixedPhone":"固话",
"houseAddress":"住宅地址",
"mailboxInfo":"邮箱"
}
],
"regInfo":{
"legalpersonCertificate":"法人股东证件",
"cfoCertificate":"财务负责人证件",
"titleCertificate":"产权证",
"naturalpersonCertificate":"自然人股东证件",
"socialCertificate":"社保缴费经办人证件",
"directorCertificate":"执行董事证件",
"managerCertificate":"经理证件",
"supervisorCertificate":"监事证件"
},
"expressInfo":{
"trackingNumber":"运单号",
"logisticsCompany":"物流公司",
"addresseeName":"收件人名称",
"addresseePhone":"收件人电话",
"addresseeEmail":"收件人邮箱"
}
}
2、个体户注册
{
"baseInfo":{
"deliverNumber":"交付单号",
"payAmount":"实付金额",
"payStatus":"支付状态",
"isWhether":"是否需要公章",
"contactsName":"联系人姓名",
"contactsPhone":"联系人电话"
},
"individualInfo":{
"individualName":"个体工商户名称",
"spareName":"备选名称,数据结构为LIST",
"registeredPark":"注册园区",
"individualType":"个体户类型",
"taxpayerType":"纳税人类型",
"engagedTndustry":"所属行业",
"businessScope":"经营范围",
"operatingPeriod":"经营期限"
},
"managerInfo":{
"managerName":"经营者姓名",
"IdentificationNumber":"证件号码",
"phoneNumber":"联系人电话",
"contactAddress":"联系人地址"
},
"regInfo":{
"managerCertificate":"经营者证件"
},
"expressInfo":{
"trackingNumber":"运单号",
"logisticsCompany":"物流公司",
"addresseeName":"收件人名称",
"addresseePhone":"收件人电话",
"addresseeEmail":"收件人邮箱"
}
}
3、个体独资企业注册
{
"baseInfo":{
"deliverNumber":"交付单号",
"payAmount":"实付金额",
"payStatus":"支付状态",
"isWhether":"是否需要公章",
"contactsName":"联系人姓名",
"contactsPhone":"联系人电话"
},
"companyInfo":{
"companyName":"公司名称",
"spareName":"备选名称,数据结构为LIST",
"registeredPark":"注册园区",
"taxpayerType":"纳税人类型",
"companyProperties":"公司性质",
"engagedIndustry":"从事行业",
"businessScope":"经营范围",
"operatingPeriod":"经营期限"
},
"registeredInfo":{
"registeredCapital":"注册资本(万元),转换成万元后的数字",
"registeredDate":"注册资本实缴日期(年),只要数字",
"reserveProportion":"公积金缴存比例(%),只要数字"
},
"shareholderInfo":{
"shareholderName":"股东姓名",
"contributionAmount":"出资金额(万),只要数字",
"contributionProportion":"出资比例,只要数字",
"IdentificationNumber":"证件号码",
"phoneNumber":"联系电话/手机",
"contactAddress":"身份证地址"
},
"materialInfo":{
"legalpersonCertificate":"法人股东证件",
"cfoCertificate":"财务负责人证件"
},
"expressInfo":{
"trackingNumber":"运单号",
"logisticsCompany":"物流公司",
"addresseeName":"收件人名称",
"addresseePhone":"收件人电话",
"addresseeEmail":"收件人邮箱"
}
}
4、刻章服务
{
"baseInfo":{
"orderNumber":"订单编号",
"orderAmount":"订单金额",
"serviceArea":"服务地区",
"whetherType":"刻章类型(公司章,个体工商户章)",
"updateTime":"更新时间",
"isAdviser":"分配顾问"
},
"companyInfo":{
"companyName":"公司名称",
"creditCode":"统一社会信用代码",
"companyType":"公司类型",
"establishedTime":"成立时间",
"shareholderName":"法定代表人",
"businessTerm":"营业期限",
"registeredCapital":"注册资本",
"businessScope":"经营范围",
"residenceAddress":"住所"
}
}
5、银行开户、税务报道、工商年检、工商变更、社保开户业务
{
"baseInfo":{
"orderNumber":"订单编号",
"orderAmount":"订单金额",
"serviceArea":"服务地区",
"updateTime":"更新时间",
"isAdviser":"分配顾问"
},
"companyInfo":{
"companyName":"公司名称",
"creditCode":"统一社会信用代码",
"companyType":"公司类型",
"establishedTime":"成立时间",
"shareholderName":"法定代表人",
"businessTerm":"营业期限",
"registeredCapital":"注册资本",
"businessScope":"经营范围",
"residenceAddress":"住所"
}
}
6、税控申请
{
"baseInfo":{
"orderNumber":"订单编号",
"orderAmount":"订单金额",
"serviceArea":"服务地区",
"taxpayerType":"纳税人类型",
"updateTime":"更新时间",
"isAdviser":"分配顾问"
},
"companyInfo":{
"companyName":"公司名称",
"creditCode":"统一社会信用代码",
"companyType":"公司类型",
"establishedTime":"成立时间",
"shareholderName":"法定代表人",
"businessTerm":"营业期限",
"registeredCapital":"注册资本",
"businessScope":"经营范围",
"residenceAddress":"住所"
}
}
7、代理记账
{
"baseInfo":{
"orderNumber":"订单编号",
"orderAmount":"订单金额",
"serviceArea":"服务地区",
"taxpayerType":"纳税人类型",
"buyTime":"购买时间",
"buyDuration":"购买时长",
"endTime":"到期时间",
"surplusDuration":"还剩",
"isAdviser":"分配顾问",
"isRenew":"是否自动续费"
},
"companyInfo":{
"companyName":"公司名称",
"creditCode":"统一社会信用代码",
"companyType":"公司类型",
"establishedTime":"成立时间",
"shareholderName":"法定代表人",
"businessTerm":"营业期限",
"registeredCapital":"注册资本",
"businessScope":"经营范围",
"residenceAddress":"住所"
}
}
8、注册地址
{
"baseInfo":{
"orderNumber":"订单编号",
"orderAmount":"订单金额",
"registeredAddress":"注册地址",
"buyTime":"购买时间",
"buyDuration":"购买时长",
"endTime":"到期时间",
"surplusDuration":"还剩",
"isAdviser":"分配顾问",
"isRenew":"是否自动续费"
},
"companyInfo":{
"companyName":"公司名称",
"creditCode":"统一社会信用代码",
"companyType":"公司类型",
"establishedTime":"成立时间",
"shareholderName":"法定代表人",
"businessTerm":"营业期限",
"registeredCapital":"注册资本",
"businessScope":"经营范围",
"residenceAddress":"住所"
}
}
9ICP
{
"certificateInfo":{
"company_name":"公司名称",
"credit_code":"统一社会信用代码",
"company_type":"公司类型",
"established_time":"成立时间",
"shareholder _name":"法定代表人",
"business_term":"营业期限",
"registered_capital":"注册资本",
"business_scope":"经营范围",
"residence_address":"住所"
},
"qualificationsInfo":{
"certificateNumber":"证书编号",
"serviceCategory":"业务种类",
"serviceScope":"业务覆盖范围",
"serviceContent":"服务项目",
"IssuedTime":"发证日期",
"validityTerm":"有效期至",
"certificatePhoto":"证书照片"
},
"annualReportInfo":[
{
"annualYear":"年份",
"annualstatus":"状态",
"uploadTime":"上传时间"
}
]
}
```
## **<a name="getApplyListByUserAndType"> 用户获取业务主体信息列表</a>**
[返回到目录](#menu)
##### URL
[/api/action/order/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getApplyListByUserAndType
#### 参数说明
1、公司注册:
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| userId | 是 | string | 用户id |
| applyType | 是 | int | 申请实体类型,1:企业 2:个体户 |
| currentPage | 否 | int | 当前页,默认1 |
| pageSize | 否 | int | 条数,默认10 |
| applyName | 否 | string | 公司/个体户名称 |
| domicile | 否 | string | 住所 |
#### 参数示例
``` javascript
{
"actionType": "getApplyListByUserAndType",
"actionBody": {
"userId": "1",
"applyType":"1",
"currentPage":0,
"pageSize":10,
"applyName":"公司",
"domicile":"北京"
}
}
```
#### 返回结果
```javascript
{
"status":1,
"message":"success",
"data":[
{
"apply_name":"测试公司",//公司/个体户名称
"credit_code":"111",//社会统一信用代码
"apply_type":1,//申请实体类型
"operator":"张三",//经营者
"regist_capital":"200",//注册资本
"business_term":null,//营业期限
"establish_time":null,//成立时间
"domicile":"北京市"//住所
}
],
"dataCount":1,//总条数
"requestId":"2b19fa6eba364b88bb1573013d96dff9"
}
```
## **<a name="getApplyAndSolutionInfo"> 用户获取业务主体详情</a>**
[返回到目录](#menu)
##### URL
[/api/action/order/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getApplyAndSolutionInfo
#### 参数说明
1、公司注册:
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| userId | 是 | string | 用户id |
| creditCode | 是 | string | 社会统一信用代码 |
#### 参数示例
``` javascript
{
"actionType": "getApplyAndSolutionInfo",
"actionBody": {
"userId": "1",
"creditCode":"111"
}
}
```
#### 返回结果
```javascript
"data":{
"applyInfo":{
"user_id":"1",
"apply_name":"测试公司",//申请实体名称(公司/个体户)
"credit_code":"111",//社会统一信用代码
"apply_type":1,//申请类型 1 企业 2 个体户
"operator":"张三",//经营者
"regist_capital":"200",//注册资本
"business_term":null,//经营期限
"establish_time":null,//成立时间
"domicile":"北京市",//住所
"ent_type":"1",//企业类型
"business_scope":null//经营范围
},
"solutionList":[
{
"user_id":"1",
"order_num":"O20201231223384682",//订单号
"need_num":"test001",//需求号
"order_status":1,//订单状态
"updated_at":null,//更新时间
"consult_type":null,//
"consult_type_name":null,
"status":1,//需求状态
"contacts_name":"张三",//联系人
"contacts_moblie":"13075556693",//联系电话
"region_id":"",//地区id
"region_name":null,//地区名称
"solution_content":Object{...}//方案信息
}
]
},
"requestId":"d704bd9af91e4fa09dade8379d65d8e2"
}
```
<a name="menu" href="/doc">返回主目录</a>
1. [下商标订单](#addOrder)
1. [下其他订单](#addOtherOrder)
1. [获取订单列表信息](#getOrderInfo)
1. [获取订单详情信息](#getOrderDetails)
1. [获取订单操作日志信息](#getOrderLogInfo)
1. [删除订单](#delOrder)
## **<a name="addOrder"> 下商标订单</a>**
[返回到目录](#menu)
##### URL
[/web/opaction/order/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
#### 渠道执行的类型 actionType:addOrder
``` javascript
{
"channelItemCode":"zzsbzc",// Y 产品的渠道编码
"channelItemAppendName":"",// Y 填写的商标名称
"payCode": "zzsbzc-1", // Y 支付价格code
"quantity":1,// Y 购买数量
"additions":{// N 附加购买项目
"payCode": "zzsbzc-2", // Y 支付价格code
"quantity":2// Y 购买数量
},
"totalSum":360,// Y 订单总金额---(商标自助注册计算格式:小于10项为产品价格,大于10项的小项数量在additions参数中进行传递)
"payTotalSum":360, // Y 订单付款总金额
"notes": "订单备注信息",// N 订单备注
"orderContact":{ // Y 订单联系人信息
"contacts": "宋毅",// Y 联系人
"mobile": "15010929368",// Y 联系人电话
"email": "songyi@gongsibao.com",// Y 联系人邮箱
"fax": ""// N 传真
},
"channelOrder":{// Y 渠道订单信息,没有则填写{}
"channelServiceNo":"",// N 服务单号(即渠道服务单号)
"channelOrderNo":"",// N 服务订单号(即渠道服务订单号,格式为: XX1,XX2)
"needNo":"",// N 需求单号(即渠道需求单号)
"payTime":"",// N 渠道需求单号支付时间
"orderStatus":1,// N 渠道需求单号支付支付状态 1: 待付款, 2: 已付款
"channelParams":""// N 渠道参数(自定义参数)
},
"deliveryData":{//Y 交付单信息
"apply": {//申请信息
"applyAddr": "上海市杨浦区国定路346号三楼0624室",//执照详细地址
"applyArea": "",//申请区域--暂时没有用到
"businessLicensePic": "https://gsb-zc.oss-cn-beijing.aliyuncs.com/zc_yyzz120315554031547442019316.jpg",//营业执照jpg地址
"businessLicensePdf": "https://gsb-zc.oss-cn-beijing.aliyuncs.com/zc_yyzz120315554031547442019316.pdf",//营业执照pdf地址
"code": "91310110398635929J",//统一社会信用代码
"customerType": "ent",//申请人类型 person个人,ent企业
"identityCardNo": "",//申请人身份证号--(申请类型为个人有此值)
"identityCardPic": "",//申请人身份证jpg地址--(申请类型为个人有此值)
"identityCardPdf": "", //申请人身份证pdf地址 --(申请类型为个人有此值)
"name": "上海辰者信息科技有限公司", //申请人名称
"gzwtsUrl": "https://gsb-zc.oss-cn-beijing.aliyuncs.com/zc_wts863215710393842862019914.jpg",//盖章委托书url
"smwjUrl":"",//说明文件url
"zipCode": "100000"//邮政编码
},
"tm": {
"colorizedPicUrl": "https://gsb-zc.oss-cn-beijing.aliyuncs.com/zc_word2picb2bc98b9fc564ef2a1f4b3cbe9352f39.jpg",//商标彩色图样
"tmName": "testbiao",//商标名称
"picUrl": "https://gsb-zc.oss-cn-beijing.aliyuncs.com/zc_word2picb2bc98b9fc564ef2a1f4b3cbe9352f39.jpg",//商标图样
"tmFormType": "3"//商标类型形式: "3": 字, "4": 图, "5": 字图
},
"nclones": [
{
"code": "02",//大类编码
"name": "颜料油漆",//大类名称
"nclThree": [
{
"code": "020008",//小项编码
"disabled": "false",
"fullname": "020008 绘画用铝粉",//小项编码加名称
"name": "绘画用铝粉",//小项名称
"pcode": "0202"//小项所属群组编码
},
{
"code": "020005",
"disabled": "false",
"fullname": "020005 食品用着色剂",
"name": "食品用着色剂",
"pcode": "0203"
}
]
}
]
}
}
```
#### 返回结果
```javascript
{
"status": 0,// 0为成功,否则失败
"msg": "success",
"data": {
"orderNo": "OT26202002151649kPgs",//订单号
"channelServiceNo": "OT26202002151649kPgs",//渠道服务单号
"channelOrderNo""OT26202002151649kPgs", //渠道订单号
"channelParams": ""//渠道参数
},
"requestId": "2f90fad8108b4933bb97c3d978b0fe10"
}
```
## **<a name="addOtherOrder"> 下其他订单</a>**
[返回到目录](#menu)
##### URL
[/web/opaction/order/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
#### 渠道执行的类型 actionType:addOrder
``` javascript
{
"channelItemCode":"fzsbzc",// Y 产品的渠道编码
"payCode": "fzsbzc-1", // Y 支付价格code
"quantity":1,// Y 购买数量
"totalSum":699,// Y 订单总金额
"payTotalSum":699, // Y 订单付款总金额
"notes": "订单备注信息",// N 订单备注
"orderContact":{ // N 订单联系人信息,没有则填写{}
"contacts": "宋毅",// N 联系人
"mobile": "15010929368",// N 联系人电话
"email": "songyi@gongsibao.com"// N 联系人邮箱
},
"channelOrder":{// Y 渠道订单信息,没有则填写{}
"channelServiceNo":"",// N 服务单号(即渠道服务单号)
"channelOrderNo":"",// N 服务订单号(即渠道服务订单号,格式为: XX1,XX2)
"needNo":"",// N 需求单号(即渠道需求单号)
"payTime":"",// N 渠道需求单号支付时间
"orderStatus":1,// N 渠道需求单号支付支付状态 1: 待付款, 2: 已付款
"channelParams":""// N 渠道参数(自定义参数)
},
"deliveryData":{}//Y 交付单信息,没有则填写{}
}
```
#### 返回结果
```javascript
{
"status": 0,// 0为成功,否则失败
"msg": "success",
"data": {
"orderNo": "OT26202002151649kPgs",//订单号
"channelServiceNo": "OT26202002151649kPgs",//渠道服务单号
"channelOrderNo""OT26202002151649kPgs", //渠道订单号
"channelParams": ""//渠道参数
},
"requestId": "2f90fad8108b4933bb97c3d978b0fe10"
}
```
## **<a name="getOrderInfo"> 获取订单列表信息</a>**
[返回到目录](#menu)
##### URL
[/web/opaction/order/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
#### 渠道执行的类型 actionType:getOrderInfo
``` javascript
{
"pageIndex":1,// Y 当前页{
"pageSize":20,// Y 每页大小,最大为50
"channelItemName":"",// N 产品名称
"channelServiceNo":"",// N 渠道订单号
"orderStatus":"",// N 订单状态
"startTime": "2019-10-27",// N 开始时间
"entTime": "2019-10-31"// N 结束时间
}
```
#### 返回结果
```javascript
{
"status": 0,// 0为成功,否则失败
"msg": "success",
"dataCount":2,//总条数
"data": [
{
"orderNo": "OT31202002191443AVlJ",// 订单号
"channelServiceNo": "",//渠道服务号
"channelOrderNo": "",//渠道订单号列表,格式:XX1,XX2
"channelUserId": "15010929366",//渠道用户Id
"ownerUserId": "15010929366",//拥有者Id
"payTime": null,//支付时间
"quantity": 1,//订单数量
"serviceQuantity": 0,//订单服务数量
"orderStatusName": "待付款",//订单状态名称
"orderStatus": 1,//订单状态编码: 1: 待付款, 2: 已付款, 4: 服务中, 8: 已完成
"totalSum": "10.00",//订单金额
"payTotalSum": "10.00",//订单支付金额
"refundSum": "0.00",//退款金额
"invoiceApplyStatus": "00",//发票申请状态
"opNotes": "",//操作备注
"channelItemCode": "FW_GOODS-582221-1",//渠道产品编码
"channelItemName": "京东云PLUS公司注册(北京市)",//渠道产品名称
"channelItemAppendName": "北京海淀",//渠道产品附加名称
"price":"10.00",//产品单价
"priceTypeName":"件",//产品单价单位名称
"priceDesc":"海淀区内资一般人",//产品单价描述
"serviceItemCode": null,//服务产品编码
"picUrl": null,//产品图片地址
"created_at":""//下单时间
},
{
"orderNo": "OT31202002191456tDU7",
"channelServiceNo": "0001",
"channelOrderNo": "",
"channelUserId": "15010929366",
"ownerUserId": "15010929366",
"payTime": "2020",
"quantity": 1,
"serviceQuantity": 0,
"orderStatusName": "已付款",
"orderStatus": 2,
"totalSum": "10.00",
"payTotalSum": "10.00",
"refundSum": "0.00",
"invoiceApplyStatus": "00",
"opNotes": "",
"channelItemCode": "FW_GOODS-582221-1",
"channelItemName": "京东云PLUS公司注册(北京市)",
"channelItemAppendName": "",
"price":"10.00",
"priceTypeName":"件",
"priceDesc":"海淀区内资一般人",
"serviceItemCode": null,
"picUrl": null,
"created_at":""
}
],
"requestId": "92ced0cb4d地址cb4125a4b515227f3eabe1"
}
```
## **<a name="getOrderDetails"> 获取订单详情信息</a>**
[返回到目录](#menu)
##### URL
[/web/opaction/order/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
#### 渠道执行的类型 actionType:getOrderDetails
``` javascript
{
"orderNo":"TM26202002271337mkgN"// Y 订单号
}
```
#### 返回结果
```javascript
{
"status": 0,// 0为成功,否则失败
"msg": "success",
"data": {
"orderNo": "OT31202002191443AVlJ",// 订单号
"channelServiceNo": "",//渠道服务号
"channelOrderNo": "",//渠道订单号列表,格式:XX1,XX2
"channelUserId": "15010929366",//渠道用户Id
"ownerUserId": "15010929366",//拥有者Id
"payTime": null,//支付时间
"quantity": 1,//订单数量
"serviceQuantity": 0,//订单服务数量
"orderStatusName": "待付款",//订单状态名称
"orderStatus": 1,//订单状态编码: 1: 待付款, 2: 已付款, 4: 服务中, 8: 已完成
"totalSum": "10.00",//订单金额
"payTotalSum": "10.00",//订单支付金额
"refundSum": "0.00",//退款金额
"invoiceApplyStatus": "00",//发票申请状态
"opNotes": "",//操作备注
"channelItemCode": "FW_GOODS-582221-1",//渠道产品编码
"channelItemName": "京东云PLUS公司注册(北京市)",//渠道产品名称
"channelItemAppendName": "北京海淀",//渠道产品附加名称
"price":"10.00",//产品单价
"priceTypeName":"件",//产品单价单位名称
"priceDesc":"海淀区内资一般人",//产品单价描述
"serviceItemCode": null,//服务产品编码
"picUrl": null,//产品图片地址
"created_at":""//下单时间
},
"requestId": "92ced0cb4d地址cb4125a4b515227f3eabe1"
}
```
## **<a name="getOrderLogInfo"> 获取订单操作日志信息</a>**
[返回到目录](#menu)
##### URL
[/web/opaction/order/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
#### 渠道执行的类型 actionType:getOrderLogInfo
``` javascript
{
"sourceOrderNo":"TM26202002271337mkgN"// Y 订单号
}
```
#### 返回结果
```javascript
{
"status": 0,// 0为成功,否则失败
"msg": "success",
"data": [
{
"opContent": "您的订单成功支付,请等待服务人员联系您",// 内容
"created_at": "2020-02-28T18:45:44.000Z"//创建时间
},
{
"opContent": "您提交了订单,请及时支付",
"created_at": "2020-02-25T18:44:45.000Z"
}
],
"requestId": "f21446617c5e46ad889f3fab7bb69456"
}
```
## **<a name="delOrder"> 删除订单</a>**
[返回到目录](#menu)
##### URL
[/web/opaction/order/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求头中需要增加userpin(用户登录后的凭证)的值
#### 渠道执行的类型 actionType:delOrder
``` javascript
{
"orderNo":"TM26202002271337mkgN"// Y 订单号
}
```
#### 返回结果
```javascript
{
"status": 0,// 0为成功,否则失败
"msg": "success",
"data":null,
"requestId": "f21446617c5e46ad889f3fab7bb69456"
}
```
<a name="menu" href="/doc">返回主目录</a>
1. [产品列表-根据产品大类获取](#getProductListByOneCode)
1. [产品列表-根据产品二类获取](#getProductListByTwoCode)
1. [产品详情](#getProductDetail)
## **<a name="getProductListByOneCode"> 产品列表-根据产品大类编码获取</a>**
[返回到目录](#menu)
##### URL
[/action/product/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:getProductList
``` javascript
{
"pathCode":"sbfu" //查询的路径:大类code
}
```
#### 返回结果 0为成功,否则为失败
```javascript
{
"status": 0,
"msg": "success",
"data": [
{
"uapp_id": 26,//平台id--显示不用
"path_code": "/sbfu/sbzc/",//产品路径编码--显示不用
"path_name": "/商标服务/商标注册/",//产品路径名称--显示不用
"item_code": "zzsbzc",//产品code
"item_name": "商标注册【自助申请】",//产品名称
"channel_item_code": "zzsbzc",//渠道产品code
"channel_item_name": "商标注册【自助申请】",//渠道产品名称
"pic_url": "http://gsb-zc.oss-cn-beijing.aliyuncs.com/zc_qft_pi15755163570461.png",//产品的图片
"product_short_desc": "适合熟知商标注册流程的企业用户", //产品的介绍
"product_desc": "[\"自己检索商标,准备官方所需注册材料\",\"提交迅速,及时反馈\",\"全流程跟踪,掌握申请进度\"]", //产品的描述列表
"desc_url": null,//产品介绍图片地址
"icon_url": null,//产品的icon
"productType_id": 2,//产品类型id--显示用不到
"sort": 1,//排序
"pay_code": "zzsbzc-1", //支付价格code
"service_charge": 30,//服务费
"public_expense": 270,//官费
"price": 300,//价格
"price_type": "mj",//定价类型:mj:每件,mc:每次,mt:每天,my:每月,mn:每年,qj:区间
"price_type_name": "每件",//定价类型名称
"price_desc": "每件(10小项)",//定价描述
"min_qty": null,//区间最小值
"max_qty": null//区间最大值
}
],
"requestId": "c39ee8a924074904b1694dd3bf2d6c4b"
}
```
## **<a name="getProductListByTwoCode"> 产品列表-根据产品二类获取</a>**
[返回到目录](#menu)
##### URL
[/action/product/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:getProductList
``` javascript
{
"pathCode":"sbfu/sbzc" //查询的路径:大类code/二类code
}
```
#### 返回结果 0为成功,否则为失败
```javascript
{
"status": 0,
"msg": "success",
"data": [
{
"uapp_id": 26,//平台id--显示不用
"path_code": "/sbfu/sbzc/",//产品路径编码--显示不用
"path_name": "/商标服务/商标注册/",//产品路径名称--显示不用
"item_code": "zzsbzc",//产品code
"item_name": "商标注册【自助申请】",//产品名称
"channel_item_code": "zzsbzc",//渠道产品code
"channel_item_name": "商标注册【自助申请】",//渠道产品名称
"pic_url": "http://gsb-zc.oss-cn-beijing.aliyuncs.com/zc_qft_pi15755163570461.png",//产品的图片
"product_short_desc": "适合熟知商标注册流程的企业用户", //产品的介绍
"product_desc": "[\"自己检索商标,准备官方所需注册材料\",\"提交迅速,及时反馈\",\"全流程跟踪,掌握申请进度\"]", //产品的描述列表
"desc_url": null,//产品介绍图片地址
"icon_url": null,//产品的icon
"productType_id": 2,//产品类型id--显示用不到
"sort": 1,//排序
"pay_code": "zzsbzc-1", //支付价格code
"service_charge": 30,//服务费
"public_expense": 270,//官费
"price": 300,//价格
"price_type": "mj",//定价类型:mj:每件,mc:每次,mt:每天,my:每月,mn:每年,qj:区间
"price_type_name": "每件",//定价类型名称
"price_desc": "每件(10小项)",//定价描述
"min_qty": null,//区间最小值
"max_qty": null//区间最大值
}
],
"requestId": "c39ee8a924074904b1694dd3bf2d6c4b"
}
```
## **<a name="getProductDetail"> 产品详情</a>**
[返回到目录](#menu)
##### URL
[/action/product/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:getProductDetail
``` javascript
{
"channelItemCode":"zzsbzc"
}
```
#### 返回结果 0为成功,否则为失败
```javascript
{
"status": 0,
"msg": "success",
"data": {
"id": 1,//产品Id
"uapp_id": 26,
"path_code": "/sbfu/sbzc/",
"path_name": "/商标服务/商标注册/",
"item_code": "zzsbzc",
"item_name": "商标注册【自助申请】",
"channel_item_code": "zzsbzc",
"channel_item_name": "商标注册【自助申请】",
"pic_url": "http://gsb-zc.oss-cn-beijing.aliyuncs.com/zc_qft_pi15755163570461.png",
"product_short_desc": "适合熟知商标注册流程的企业用户", //产品的介绍
"product_desc": "[\"自己检索商标,准备官方所需注册材料\",\"提交迅速,及时反馈\",\"全流程跟踪,掌握申请进度\"]", //产品的描述列表
"desc_url": null,
"icon_url": null,
"productType_id": 2,
"price_list": [
{
"pay_code": "zzsbzc-1", //支付价格code
"price": 300,
"supply_price": 270,
"service_charge": 30,
"public_expense": 270,
"is_default": 1,//是否默认,1默认,0不是默认
"is_show": 1,//是否显示在页面进行下单(1是,0不是,0为下单时附加的购买项目)
"price_type": "mj",
"price_type_name": "每件",
"sort": 1,
"price_desc": "每件(10小项)",
"min_qty": null,
"max_qty": null
},
{
"pay_code": "zzsbzc-2", //支付价格code
"price": 30,
"supply_price": 30,
"service_charge": 30,
"public_expense": 30,
"is_default": 0,
"is_show": 0,
"price_type": "mx",
"price_type_name": "项",
"sort": 2,
"price_desc": "每个小项的价格",
"min_qty": null,
"max_qty": null
}
]
},
"requestId": "5913fc3ae97a402e93330c2d488f1f7e"
}
```
\ No newline at end of file
<a name="menu" href="/doc">返回主目录</a>
1. [短信验证码](#smsCode)
1. [密码登录](#pwdLogin)
1. [验证码登录](#userPinByLgoinVcode)
1. [用户注册](#userPinByRegister)
1. [按照手机号和验证码修改密码](#putUserPwdByMobile)
1. [获取用户登录信息](#getLoginInfo)
1. [退出](#logout)
1. [飞书登录](#feishuLogin)
## **<a name="smsCode"> 短信验证码</a>**
[返回到目录](#menu)
##### URL
[/web/auth/accessAuth/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:getVerifyCode
``` javascript
{
"mobile":"15010929366" // Y 手机号
}
```
#### 返回结果
```javascript
{
"status": 0, // 0为成功,否则失败
"msg": "success",
"data": null,
"requestId": "4f3ea2afee3542f88d6b938394af84d8"
}
```
## **<a name="pwdLogin"> 帐号密码登录</a>**
[返回到目录](#menu)
##### URL
[/web/auth/accessAuth/springBoard]
#### 参数格式 `JSON`getVerifyCode
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:userPinByLgoin
``` javascript
{
"userName":"15010929366", // Y 用户名
"password":"123456" // Y 密码
}
```
#### 返回结果
``` javascript
{
"status": 0,// 0为成功,2010为账户或密码错误,2060为重复登录,否则失败
"msg": "success",
"data": {
"userpin": "230ecdf3333944ff834f56fba10a02aa" //用户登录后的凭证,增、删、改、查、涉及用户的需要传递此值在请求头中
},
"requestId": "1b12b0e9c190436da000386ddf693c8f"
}
```
## **<a name="userPinByLgoinVcode"> 验证码登录</a>**
[返回到目录](#menu)
##### URL
[/web/auth/accessAuth/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:userPinByLgoinVcode
``` javascript
{
"mobile":"15010929366", // Y 手机号
"vcode":"593555" // Y 验证码
}
```
#### 返回结果
``` javascript
{
"status": 0,// 0为成功,2030为验证码错误,2060为重复登录,否则失败
"msg": "success",
"data": {
"userpin": "230ecdf3333944ff834f56fba10a02aa" //用户登录后的凭证,增、删、改、查、涉及用户的需要传递此值在请求头中
},
"requestId": "1b12b0e9c190436da000386ddf693c8f"
}
```
## **<a name="userPinByRegister"> 用户注册</a>**
[返回到目录](#menu)
##### URL
[/web/auth/accessAuth/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:userPinByRegister
``` javascript
{
"mobile":"15010929366", // Y 手机号
"vcode":"593555", // Y 验证码
"password":"123456" // Y 密码
}
```
#### 返回结果
``` javascript
{
"status": 0,// 0为成功,2030为验证码错误,2000为已经存在此用户,注册失败,否则失败
"msg": "success",
"data": {
"userpin": "230ecdf3333944ff834f56fba10a02aa" //用户登录后的凭证,增、删、改、查、涉及用户的需要传递此值在请求头中
},
"requestId": "1b12b0e9c190436da000386ddf693c8f"
}
```
## **<a name="putUserPwdByMobile"> 按照手机号和验证码修改密码(修改后得重新登录)</a>**
[返回到目录](#menu)
##### URL
[/web/auth/accessAuth/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:putUserPwdByMobile
``` javascriptgetVerifyCode
{
"mobile":"15010929366", // Y 手机号
"vcode":"593555", // Y 验证码
"newPwd":"123456" // Y 新密码
}
```
#### 返回结果
``` javascript
{
"status": 0,// 0为成功,2030为验证码错误,否则失败
"msg": "success",
"data": null,
"requestId": "1b12b0e9c190436da000386ddf693c8f"
}
```
## **<a name="logout"> 退出</a>**
[返回到目录](#menu)
##### URL
[/web/auth/accessAuth/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:logout
``` javascript
{
"userpin":"15010929366" // Y 用户登录凭证key
}
```
#### 返回结果
``` javascript
{
"status": 0,// 0为成功,否则失败
"msg": "success",
"data": null,
"requestId": "1b12b0e9c190436da000386ddf693c8f"
}
```
## **<a name="getLoginInfo"> 获取用户登录信息</a>**
[返回到目录](#menu)
##### URL
[/web/auth/accessAuth/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:getLoginInfo
``` javascript
{
"userpin":"15010929366" // Y 用户登录凭证key
}
```
#### 返回结果
``` javascript
{
"status": 0,// 0为成功,否则失败
"msg": "success",
"data": {
"id": 9,
"uapp_id": 26,
"channel_userid": "15010929366",//渠道用户ID
"channel_username": "15010929366",//账户
"channel_nickname": "",
"open_id": null,
"head_url": null,
"mobile": "15010929366",//手机号
"org_name": "",
"org_path": "",
"email": "",
"is_admin": 0,//是否管理员
"is_super": 0,//是否超级管理员
"is_enabled": 1,
"userpin": "18c44186d54a45ea8777ef4c0a4252f6"//用户登录后的凭证key
},
"requestId": "ad31ced9ac7044f69f453185d9c1e241"
}
```
## **<a name="feishuLogin"> 飞书登录</a>**
[返回到目录](#menu)
##### URL
[http://feishu.qifu.gongsibao.com:4012/feishu/login?code={code}&state={state}&open_id={open_id}]
#### HTTP请求方式 `GET`
``` javascript
请求参数说明 :
code:用户飞书登录预授权码 必填
state:前端获取的token信息 必填
open_id:用户openid 非必填
```
#### 返回结果
``` javascript
{
"status":0,
"msg":"success",
"data":{
"userpin":"1508e7f73efd49cda8d2bc7d2552b09b"
}
}
```
<a name="menu" href="/doc">返回主目录</a>
1. [需求列表](#xneedList)
1. [需求详情](#xneedDetail)
1. [主体列表](#xApplicantList)
1. [主体详情](#xApplicantDetail)
1. [服务商产品列表(设置服务商分配规则使用)](#getProductListBySrvicerCode)
1. [服务商列表](#getServiceInfoList)
1. [服务商详情](#getServiceInfoDetail)
1. [新增/修改服务商](#createServiceProvider)
1. [订单查询列表](#getOrderList)
1. [订单详情](#getOrderDetail)
1. [交易流水](#getOrderTransactionPipelineList)
1. [订单详情-出资比例](#getContributionInfoByOrderNum)
1. [订单详情-任职信息](#getPositionInfoByOrderNum)
1. [资质服务列表](#getQcOrderList)
1. [年报服务列表](#getQcAnnalsOrderList)
1. [资质证照详情-公司人员情况](#getPrincipalInfoByOrderNum)
1. [资质证照详情-股权结构](#getShareholderDataByOrderNum)
1. [资质证照详情-网站或APP信息](#getWebAppByOrderNum)
1. [资质证照详情-拟开展服务项目](#getServiceProjectByOrderNum)
1. [资质证照详情-材料清单](#getMaterialsInfoByOrderNum)
1. [资质证照详情-年报列表](#getAnnualReportByOrderNum)
1. [服务商列表-筛选条件](#getServiceProviderList)
1. [资质证照详情-专项审批项目ICP](#getSpecialApprovalInfoByOrderNum)
## **<a name="xneedList"> 需求列表</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:xneedList
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| productOneType | 否 | string | 产品大类,用于区分工商服务/资质证照,ic:工商服务,qcfw:资质证照 |
| pageSize | 否 | int | 每页条数,默认10 |
| currentPage | 否 | int | 当前页码,默认1 |
| consultType | 否 | string | 需求类型(产品二类编码) |
| status | 否 | int | 需求状态码 1.已提交、2.待顾问反馈、3.待用户确认、4.已完成、5.已关闭 |
| contactsName | 否 | string | 联系人 |
| contactsMobile | 否 | string | 联系电话 |
| needNum | 否 | string | 需求编码 |
| servicerName | 否 | string | 服务商名称 |
| clerkName | 否 | string | 业务员名称 |
| clerkPhone | 否 | string | 业务员电话 |
| dateList | 否 | list | 修改时间,dateList[0]:开始时间,dateList[1]:截止时间 |
| sortType | 否 | string | 修改时间排序方式,"asc":正序 "desc":倒序 |
#### 参数示例
``` javascript
{
"actionType": "xneedList",
"actionBody": {
"productOneType":"ic",
"pageSize": "10",
"currentPage":"1",
"consultType":"/ic/sbopen/",
"status":3,
"contactsName":"张三",
"contactsMobile":"13075556693",
"needNum":"202006100011",
"servicerName":"公司宝",
"clerkName":"小王",
"clerkPhone":"4567801",
"dateList":["2020-06-14T13:08:07.000Z","2020-06-15T13:08:07.000Z"],
"sortType":"desc"
}
}
```
#### 返回结果
```javascript
{
"retcode":0,
"msg":"success",
"data":{
"pageSize":10,
"curPage":1,
"search":{
"productOneType":"ic",
"pageSize":"10",
"currentPage":"1",
"consultType":"/ic/sbopen/",
"status":"",
"contactsName":"",
"contactsMobile":"",
"needNum":"",
"servicerName":"",
"clerkName":"",
"clerkPhone":""
},
"orderArr":null,
"total":1,
"rows":[
{
"id":29,
"need_num":"202006100011",
"solution_num":"NS_202006152108T78w9",
"user_id":"1",
"user_name":"张三",
"contacts_name":"张三",
"contacts_moblie":"13075556693",
"region_id":"1",
"region_name":"北京",
"consult_type":"/ic/sbopen/",
"consult_type_name":"/工商服务/社保开户/",
"status":3,
"status_name":"待用户确认",
"notes":"测试数据勿删",
"need_info":null,
"servicer_code":"gsb",
"servicer_name":"公司宝",
"created_at":"2020-06-03T16:04:45.000Z",
"updated_at":"2020-06-15T13:08:07.000Z",
"deleted_at":null,
"version":null,
"solution_content":{
"agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36",
"userid":"13",
"bizpath":"/bizchanceManage/bizcase",
"clerkId":"13",
"baseInfo":{
"isRenew":"不开启",
"creditCode":"12345566",
"companyName":"根據國家",
"companyType":"如一條 ",
"serviceArea":"shanghai",
"businessTerm":"100",
"businessScope":"allll",
"establishedTime":"2009-06-27",
"serviceAreaName":"上海市",
"shareholderName":"裝備",
"residenceAddress":"規劃環境基金",
"registeredCapital":"100萬"
},
"clientIp":"127.0.0.1",
"classname":"bizchance.schemeCtl",
"clerkName":"小王",
"businessId":54,
"clerkPhone":"4567801",
"company_id":"11",
"clerkOpcode":null,
"businessMode":"202006100011",
"businessType":"/ic/sbopen/",
"servicerCode":"11",
"servicerName":"公司宝",
"currentStatus":"beforeConfirmation"
},
"isRefusal":0,
"refusal_notes":null,
"solution_notes":null,
"clerkName":"小王",
"clerkPhone":"4567801"
}
]
},
"requestId":""
}
```
## **<a name="xneedDetail"> 需求详情</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:xneedDetail
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| needNum | 是 | string | 需求编码 |
| servicerCode | 是 | string | 服务商编码 |
#### 参数示例
``` javascript
{
"actionType": "xneedDetail",
"actionBody": {
"servicerCode":"gsb",
"needNum":"202006100011"
}
}
```
#### 返回结果
```javascript
{
"retcode":0,
"msg":"success",
"data":{
"serviceInfo":{
"id":1,
"created_at":null,
"servicer_code":"gsb",
"servicer_name":null,
"servicer_short_name":null,
"business_license":null,
"credit_code":null,
"legal_identity_card":null,
"legal_name":null,
"legal_mobile":null,
"legal_identity_card_no":null,
"push_domain_addr":null
},
"needSolution":{
"id":29,
"need_num":"202006100011",
"solution_num":"NS_202006152108T78w9",
"user_id":"1",
"user_name":"张三",
"contacts_name":"张三",
"contacts_moblie":"13075556693",
"region_id":"1",
"region_name":"北京",
"consult_type":"/ic/sbopen/",
"consult_type_name":"/工商服务/社保开户/",
"status":3,
"status_name":"待用户确认",
"notes":"测试数据勿删",
"need_info":null,
"servicer_code":"gsb",
"servicer_name":"公司宝",
"created_at":"2020-06-03T16:04:45.000Z",
"updated_at":"2020-06-15T13:08:07.000Z",
"deleted_at":null,
"version":null,
"solution_content":{
"agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36",
"userid":"13",
"bizpath":"/bizchanceManage/bizcase",
"clerkId":"13",
"baseInfo":{
"isRenew":"不开启",
"creditCode":"12345566",
"companyName":"根據國家",
"companyType":"如一條 ",
"serviceArea":"shanghai",
"businessTerm":"100",
"businessScope":"allll",
"establishedTime":"2009-06-27",
"serviceAreaName":"上海市",
"shareholderName":"裝備",
"residenceAddress":"規劃環境基金",
"registeredCapital":"100萬"
},
"clientIp":"127.0.0.1",
"classname":"bizchance.schemeCtl",
"clerkName":"小王",
"businessId":54,
"clerkPhone":"4567801",
"company_id":"11",
"clerkOpcode":null,
"businessMode":"202006100011",
"businessType":"/ic/sbopen/",
"servicerCode":"11",
"servicerName":"公司宝",
"currentStatus":"beforeConfirmation"
},
"isRefusal":0,
"refusal_notes":null,
"solution_notes":null
}
},
"requestId":""
}
```
## **<a name="xApplicantList"> 主体列表</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:xApplicantList
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| applyType | 否 | int | 主体类型,1:企业 2:个体户 |
| applyName | 否 | string | 主体名称 |
| creditCode | 否 | string | 社会统一信用代码 |
| domicile | 否 | string | 住所 |
| pageSize | 否 | int | 每页条数,默认10 |
| currentPage | 否 | int | 当前页码,默认1 |
#### 参数示例
``` javascript
{
"actionType": "xApplicantList",
"actionBody": {
"pageSize": 10,
"currentPage":1,
"applyType":1,
"applyName":"testcompany",
"creditCode":"1234",
"domicile":"12"
}
}
```
#### 返回结果
```javascript
{
"retcode":0,
"msg":"success",
"data":{
"pageSize":10,
"curPage":1,
"search":{
"pageSize":10,
"currentPage":1,
"applyType":1,
"applyName":"testcompany",
"creditCode":"1234",
"domicile":"12"
},
"orderArr":null,
"total":1,
"rows":[
{
"count":1,
"servicer_code":"gsb",
"servicer_name":"公司宝",
"user_id":"011",
"user_name":"王栋源",
"apply_name":"testcompany2",
"credit_code":"1234",
"apply_type":1,
"operator":null,
"regist_capital":null,
"business_term":null,
"establish_time":null,
"domicile":"12",
"ent_type":"有限责任公司",
"business_scope":null,
"created_at":"2020-06-04T10:41:52.000Z"
}
]
},
"requestId":""
}
```
## **<a name="xApplicantDetail"> 主体详情</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:xApplicantDetail
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| creditCode | 是 | string | 社会统一信用代码 |
#### 参数示例
``` javascript
{
"actionType": "xApplicantDetail",
"actionBody": {
"creditCode":"1223345455"
}
}
```
#### 返回结果
```javascript
{
"retcode":0,
"msg":"success",
"data":{
"applyInfo":{
"id":2,
"servicer_code":"gsb",
"servicer_name":"公司宝",
"user_id":"011",
"user_name":"王栋源",
"apply_name":"testcompany2",
"credit_code":"1223345455",
"apply_type":1,
"operator":null,
"regist_capital":null,
"business_term":null,
"establish_time":null,
"domicile":"12",
"notes":null,
"op_notes":null,
"ent_type":"有限责任公司",
"business_scope":null,
"created_at":"2020-06-04T10:41:52.000Z",
"updated_at":null,
"deleted_at":null,
"version":null
},
"productBusinessInfo":[
{
"order_num":"1111115",
"user_name":"张三",
"user_id":"1",
"updated_at":"2020-06-12T10:04:20.000Z",
"total_sum":300,
"refund_sum":0,
"pay_time":null,
"deleted_at":null,
"servicer_code":"gsb",
"servicer_name":"公司宝",
"product_type":"/ic/gsreg/",
"product_type_name":"/工商服务/公司注册/",
"order_snapshot":{
"clerkId":"1",
"baseInfo":{
"memoInfo":"sfdsff",
"creditCode":"1223345455",
"companyName":"三个五",
"companyType":"有限公司",
"whetherType":"individual",
"businessTerm":"500",
"businessScope":"sgrgdrgghhh",
"establishedTime":"2010-5-6",
"shareholderName":"2B",
"residenceAddress":"北京市",
"registeredCapital":"5万元"
},
"clerkName":"小三",
"businessId":1001,
"clerkPhone":"4567800",
"clerkOpcode":null,
"businessMode":"202006100012",
"businessType":"/ic/gsreg/",
"servicerCode":"1",
"servicerName":"公司宝",
"statusReason":null,
"currentStatus":"待提交方案"
},
"end_time":null,
"delivery_status":10,
"delivery_status_name":"收集工商注册材料",
"deliver_content":{
"companyInfo":{
"isWhether":"no",
"addressType":"practical",
"fullAddress":"gsgsgsgsgsg",
"taxpayerType":"smallScaleTaxpayer",
"businessScope":"sgsgsdgsdgd",
"engagedIndustry":"culturalMedia",
"companyProperties":"limitedLiabilityCompany"
},
"deliverInfo":{
"isVirtual":"否",
"isWhether":"是",
"payStatus":"已交付",
"contactsName":"张三",
"contactsPhone":"13800138000"
},
"deliverNumber":"1111115",
"registeredInfo":{
"registeredDate":"20",
"registeredCapital":"500",
"reserveProportion":"15"
},
"contributionInfo":{
"contribution_info":[
{
"phoneNumber":"1111111",
"contactAddress":"北京",
"shareholderName":"王五",
"contributionAmount":"200",
"IdentificationNumber":"1111111",
"contributionProportion":"40"
},
{
"phoneNumber":"1111111",
"contactAddress":"北京",
"shareholderName":"王六",
"contributionAmount":"200",
"IdentificationNumber":"1111111",
"contributionProportion":"40"
},
{
"phoneNumber":"1111111",
"contactAddress":"北京",
"shareholderName":"王七",
"contributionAmount":"100",
"IdentificationNumber":"1111111",
"contributionProportion":"20"
}
]
}
}
}
]
},
"requestId":""
}
```
## **<a name="getProductListBySrvicerCode"> 服务商产品列表(设置服务商分配规则使用)</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getProductListBySrvicerCode
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| servicerCode | 是 | string | 服务商编码 |
#### 参数示例
``` javascript
{
"actionType": "getProductListBySrvicerCode",
"actionBody": {
"servicerCode":"gsb"
}
}
```
#### 返回结果
```javascript
{
"retcode":0,
"msg":"success",
"data":{
"rows":[
{
"id":2,
"type_code":"gsreg",
"type_name":"公司注册",
"productList":[
{
"isSelected":0,
"id":1,
"path_code":"/ic/gsreg/",
"path_name":"/工商服务/公司注册/",
"region_id":"1",
"region_name":"北京市",
"product_type_id":2,
"is_allocation":1,
"servicer_name":"测试服务商"
},
{
"isSelected":0,
"id":2,
"path_code":"/ic/kzfw/",
"path_name":"/工商服务/刻章服务/",
"region_id":"1",
"region_name":"北京市",
"product_type_id":2,
"is_allocation":1,
"servicer_name":"测试服务商"
}
]
},
{
"id":3,
"type_code":"kefw",
"type_name":"刻章服务",
"productList":[
]
},
{
"id":4,
"type_code":"cpreg",
"type_name":"云上园区注册",
"productList":[
]
},
{
"id":5,
"type_code":"bankopen",
"type_name":"银行开户",
"productList":[
]
}
]
},
"requestId":""
}
```
## **<a name="getServiceInfoList"> 服务商列表</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getServiceInfoList
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| servicerCode | 否 | string | 服务商编码 |
| sortType | 否 | string | 更新时间排序方式 asc desc |
| isEnabled | 否 | int | 是否启用 |
| regionName | 否 | string | 地区名称 |
| servicerShortName | 否 | string | 服务商简称 |
| pageSize | 否 | int | 每页条数,默认10 |
| currentPage | 否 | int | 当前页码,默认1 |
#### 参数示例
``` javascript
{
"actionType": "getServiceInfoList",
"actionBody": {
"pageSize": 10,
"currentPage":1,
"servicerCode":"S_2020060916124m1rLi",
"sortType":"desc",
"isEnabled":1,
"regionName":"北京市",
"servicerShortName":"测试"
}
}
```
#### 返回结果
```javascript
{
"retcode":0,
"msg":"success",
"data":{
"pageSize":10,
"curPage":1,
"search":{
"pageSize":10,
"currentPage":1,
"servicerCode":"S_2020060916124m1rLi",
"sortType":"desc",
"isEnabled":1,
"regionName":"北京市",
"servicerShortName":"测试"
},
"orderArr":null,
"total":1,
"rows":[
{
"servicer_code":"S_2020060916124m1rLi",
"servicer_name":"测试服务商",
"servicer_short_name":"测试",
"province_name":null,
"city_name":null,
"region_name":"北京市",
"is_enabled":1,
"principal_name":"张三",
"principal_mobile":"13075556693",
"created_at":"2020-06-09T08:12:04.000Z"
}
]
},
"requestId":""
}
```
## **<a name="getServiceInfoDetail"> 服务商详情</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getServiceInfoDetail
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| servicerCode | 是 | string | 服务商编码 |
#### 参数示例
``` javascript
{
"actionType": "getServiceInfoDetail",
"actionBody": {
"servicerCode":"S_202006050937ptSlyI"
}
}
```
#### 返回结果
```javascript
{
"retcode":0,
"msg":"success",
"data":{
"id":2,
"servicer_code":"S_202006050937ptSlyI",
"apply_type":1,
"apply_type_name":"企业",
"servicer_name":"测试服务商",
"servicer_short_name":"测试",
"bank_account":"测试银行",
"bank_account_num":"88888888",
"sub_bank_account":"测试银行2",
"sub_bank_account_num":"66666666",
"region_name":"北京市",
"servicer_address":"北京市朝阳区",
"push_domain_addr":"test.gongsibao.com",
"is_enabled":0,
"principal_name":"张三",
"principal_mobile":"13075556693",
"business_license":null,
"credit_code":null,
"legal_identity_card":null,
"legal_name":null,
"legal_mobile":null,
"legal_identity_card_no":null,
"settlement_cycle":null,
"settlement_cycle_name":null,
"created_at":"2020-06-05T01:37:51.000Z",
"updated_at":"2020-06-05T01:46:28.000Z",
"version":0
},
"requestId":""
}
```
## **<a name="createServiceProvider"> 新增/修改服务商</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:createServiceProvider
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| isEnabled | 否 | int | 是否启用,0:不启用 1:启用 默认0 |
| pushDomainAddr | 是 | string | 推送域名地址 |
| applyType | 是 | int | 账号类型 1.企业,2.个人 |
| servicerShortName | 是 | string | 服务商简称 |
| servicerName | 是 | string | 服务商名称 |
| bankAccount | 是 | string | 公司银行开户名称 |
| bankAccountNum | 是 | string | 公司银行账号 |
| subBankAccount | 是 | string | 开户行支行名称 |
| subBankAccountNum | 是 | string | 开户行支行联行号 |
| regionName | 是 | string | 所在地区 |
| servicerAddress | 是 | string | 服务商详细地址 |
| principalName | 是 | string | 负责人名称 |
| principalMobile | 是 | string | 负责人电话 |
| settlementCycle | 是 | int | 结算周期 1:"周结",2:"月结",3:"季结",4:"年结" |
| servicerCode | 否 | string | 服务商编码,修改时传入 |
| productList | 否 | LIST | 产品id列表,isEnabled参数为0时无效 |
#### 参数示例
``` javascript
{
"actionType": "createServiceProvider",
"actionBody": {
"isEnabled":1,
"pushDomainAddr":"test.gongsibao.com",
"applyType":1,
"servicerShortName":"测试",
"servicerName":"测试服务商",
"bankAccount":"测试银行",
"bankAccountNum":"88888888",
"subBankAccount":"测试银行2",
"subBankAccountNum":"66666666",
"regionName":"北京市",
"servicerAddress":"北京市朝阳区",
"principalName":"张三",
"principalMobile":"13075556693",
"settlementCycle":1,
"servicerCode":"",
"productList":[1]
}
}
```
#### 返回结果
```javascript
{
"retcode":0,
"msg":"success",
"data":{
"version":0,
"id":10,
"is_enabled":1,
"push_domain_addr":"test.gongsibao.com",
"apply_type":1,
"apply_type_name":"企业",
"servicer_short_name":"测试",
"servicer_name":"测试服务商",
"bank_account":"测试银行",
"bank_account_num":"88888888",
"sub_bank_account":"测试银行2",
"sub_bank_account_num":"66666666",
"settlement_cycle":1,
"settlement_cycle_name":"周结",
"region_name":"北京市",
"servicer_address":"北京市朝阳区",
"principal_name":"张三",
"principal_mobile":"13075556693",
"servicer_code":"S_2020060916124m1rLi",
"updated_at":"2020-06-09T08:12:04.666Z",
"created_at":"2020-06-09T08:12:04.666Z"
},
"requestId":""
}
```
## **<a name="getOrderDetail"> 订单详情</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getOrderDetail
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| orderNum | 是 | string | 订单号 |
#### 参数示例
``` javascript
{
"actionType": "getOrderDetail",
"actionBody": {"orderNum":"TX489156413251"}
}
```
#### 返回结果
```javascript
{
"status": 1,
"message": "success",
"data": {
"order_num": "TX489156413251",
"user_name": "wdy",
"updated_at": null,
"total_sum": 300,
"deleted_at": null,
"servicer_code": "gsb",
"servicer_name": "公司宝",
"product_type": "/ic/gsreg/",
"product_type_name": "/工商服务/公司注册/",
"order_snapshot": {
"memoInfo": "备注信息",
"clerkName": "",
"isWhether": "是否刻章",
"clerkPhone": "",
"createTime": "2020-06-03 20:47:38",
"addressType": "实际经营地址",
"companyName": "testcompany",
"fullAddress": "北京市朝阳区来广营",
"serviceArea": "北京",
"serviceCode": "8",
"businessMode": "TX489156413251",
"businessType": "/ic/gsreg/",
"contactsName": "wdy",
"servicerCode": "gsb",
"taxpayerType": "小规模纳税人",
"businessScope": "演出及经纪业务;组织文化艺术活动;演出票务代理;字画、工艺美术品(金饰品除外)、旅游纪念品的销售;演出器材的销售、租赁;艺术装饰;艺术品展示;舞台美术、工艺美术品、包装装璜设计、制作。",
"contactsPhone": "17610163852",
"channel Source": "tx",
"engagedIndustry": "服务类",
"businessTypeName": "/工商服务/公司注册/",
"servicerProvider": "公司宝",
"companyProperties": "有限责任公司"
},
"delivery_status": null,
"delivery_status_name": null,
"deliver_content": null
},
"requestId": ""
}
```
## **<a name="getOrderList"> 订单列表</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getOrderList
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| productOneType | 否 | string | 产品大类,用于区分工商服务/资质证照,ic:工商服务,qcfw:资质证照 |
| orderNum | 否 | string |订单编号 |
| contactsName | 否 | string |客户姓名 |
| contactsPhone | 否 | string |客户电话 |
| clerkName | 否 | string |服务顾问 |
| clerkPhone | 否 | string |顾问电话 |
| serviceCode | 否 | string | 服务商编码 |
| productType | 否 | string | 交付产品类型编码 |
| deliveryStatus | 否 | int | 交付状态编码 |
| sortType | 否 | string | 更新时间排序方式 asc desc |
| pageSize | 否 | int | 每页条数,默认10 |
| currentPage | 否 | int | 当前页码,默认1 |
#### 参数示例
``` javascript
{
"actionType": "getOrderList",
"actionBody": {
"orderNum":"T",
"contactsName":"w",
"contactsPhone":"1",
"clerkName":"",
"clerkPhone":"",
"productType":"gsreg",
"deliveryStatus":"",
"serviceCode":"8",
"sortType":"asc",
"pageSize": 4,
"currentPage":1
}
}
```
#### 返回结果
```javascript
{
"status": 1,
"message": "success",
"data": [
{
"order_num": "TX489156413251",
"user_name": "wdy",
"updated_at": null,
"total_sum": 300,
"deleted_at": null,
"servicer_code": "gsb",
"servicer_name": "公司宝",
"product_type": "/ic/gsreg/",
"product_type_name": "/工商服务/公司注册/",
"order_snapshot": {
"memoInfo": "备注信息",
"clerkName": "",
"isWhether": "是否刻章",
"clerkPhone": "",
"createTime": "2020-06-03 20:47:38",
"addressType": "实际经营地址",
"companyName": "testcompany",
"fullAddress": "北京市朝阳区来广营",
"serviceArea": "北京",
"serviceCode": "8",
"businessMode": "TX489156413251",
"businessType": "/ic/gsreg/",
"contactsName": "wdy",
"servicerCode": "gsb",
"taxpayerType": "小规模纳税人",
"businessScope": "演出及经纪业务;组织文化艺术活动;演出票务代理;字画、工艺美术品(金饰品除外)、旅游纪念品的销售;演出器材的销售、租赁;艺术装饰;艺术品展示;舞台美术、工艺美术品、包装装璜设计、制作。",
"contactsPhone": "17610163852",
"channel Source": "tx",
"engagedIndustry": "服务类",
"businessTypeName": "/工商服务/公司注册/",
"servicerProvider": "公司宝",
"companyProperties": "有限责任公司"
},
"delivery_status": null,
"delivery_status_name": null,
"deliver_content": null
}
],
"dataCount": 1,
"requestId": ""
}
```
## **<a name="getOrderTransactionPipelineList"> 交易流水</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getOrderTransactionPipelineList
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| productOneType | 否 | string | 产品大类,用于区分工商服务/资质证照,ic:工商服务,qcfw:资质证照 |
| orderNum | 否 | string |交付单号 |
| startdate | 否 | string |时间范围-开始日期 |
| enddate | 否 | string |时间范围-结束日期 |
| serviceCode | 否 | string | 服务商编码 |
| productType | 否 | string | 交付产品类型编码 |
| sortType | 否 | string | 用户支付时间排序方式 asc desc |
| pageSize | 否 | int | 每页条数,默认10 |
| currentPage | 否 | int | 当前页码,默认1 |
#### 参数示例
``` javascript
{
"actionType": "getOrderTransactionPipelineList",
"actionBody": {
"orderNum":"T",
"startDate":"",
"endDate":"",
"productType":"",
"serviceCode":"",
"sortType":"asc",
"pageSize": 4,
"currentPage":1
}
}
```
#### 返回结果
```javascript
{
"status": 1,
"message": "success",
"data": [
{
"order_num": "TX489156413251",
"user_name": "wdy",
"updated_at": null,
"total_sum": 300,
"deleted_at": null,
"servicer_code": "gsb",
"servicer_name": "公司宝",
"product_type": "/ic/gsreg/",
"product_type_name": "/工商服务/公司注册/",
"order_snapshot": {
"memoInfo": "备注信息",
"clerkName": "",
"isWhether": "是否刻章",
"clerkPhone": "",
"createTime": "2020-06-03 20:47:38",
"addressType": "实际经营地址",
"companyName": "testcompany",
"fullAddress": "北京市朝阳区来广营",
"serviceArea": "北京",
"serviceCode": "8",
"businessMode": "TX489156413251",
"businessType": "/ic/gsreg/",
"contactsName": "wdy",
"servicerCode": "gsb",
"taxpayerType": "小规模纳税人",
"businessScope": "演出及经纪业务;组织文化艺术活动;演出票务代理;字画、工艺美术品(金饰品除外)、旅游纪念品的销售;演出器材的销售、租赁;艺术装饰;艺术品展示;舞台美术、工艺美术品、包装装璜设计、制作。",
"contactsPhone": "17610163852",
"channel Source": "tx",
"engagedIndustry": "服务类",
"businessTypeName": "/工商服务/公司注册/",
"servicerProvider": "公司宝",
"companyProperties": "有限责任公司"
},
"delivery_status": null,
"delivery_status_name": null,
"deliver_content": null
}
],
"dataCount": 1,
"requestId": ""
}
```
## **<a name="getContributionInfoByOrderNum"> 订单详情-出资比例</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getContributionInfoByOrderNum
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| orderNumber | 是 | string | 订单号 |
#### 参数示例
``` javascript
{
"actionType": "getContributionInfoByOrderNum",
"actionBody": {
"orderNumber":"1111115"
}
}
```
#### 返回结果
```javascript
{
"retcode":0,
"msg":"success",
"data":{
"pageSize":3,
"curPage":1,
"search":{
"orderNum":"1111115"
},
"orderArr":null,
"total":3,
"rows":[
{
"phoneNumber":"1111111",
"contactAddress":"北京",
"shareholderName":"王五",
"contributionAmount":"200",
"IdentificationNumber":"1111111",
"contributionProportion":"40"
},
{
"phoneNumber":"1111111",
"contactAddress":"北京",
"shareholderName":"王六",
"contributionAmount":"200",
"IdentificationNumber":"1111111",
"contributionProportion":"40"
},
{
"phoneNumber":"1111111",
"contactAddress":"北京",
"shareholderName":"王七",
"contributionAmount":"100",
"IdentificationNumber":"1111111",
"contributionProportion":"20"
}
]
},
"requestId":""
}
```
## **<a name="getPositionInfoByOrderNum"> 订订单详情-任职信息</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getPositionInfoByOrderNum
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| orderNumber | 是 | string | 订单号 |
#### 参数示例
``` javascript
{
"actionType": "getPositionInfoByOrderNum",
"actionBody": {
"orderNumber":"1111115"
}
}
```
#### 返回结果
```javascript
{
"retcode":0,
"msg":"success",
"data":{
"pageSize":1,
"curPage":1,
"search":{
"orderNumber":"1111115"
},
"orderArr":null,
"total":1,
"rows":[
{
"fixedPhone":"2345678",
"mailboxInfo":"2839273",
"mobilePhone":"45678",
"persionName":"附近的酸辣粉",
"functionInfo":"发链接",
"houseAddress":"的激发了肯德基"
}
]
},
"requestId":""
}
```
## **<a name="getQcOrderList"> 资质服务列表</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getQcOrderList
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| orderNum | 否 | string |订单编号 |
| contactsName | 否 | string |客户姓名 |
| contactsPhone | 否 | string |客户电话 |
| clerkName | 否 | string |服务顾问 |
| clerkPhone | 否 | string |顾问电话 |
| serviceCode | 否 | string | 服务商编码 |
| productType | 否 | string | 交付产品类型编码 |
| deliveryStatus | 否 | int | 交付状态编码 |
| sortType | 否 | string | 更新时间排序方式 asc desc |
| pageSize | 否 | int | 每页条数,默认10 |
| currentPage | 否 | int | 当前页码,默认1 |
| dateList | 否 | list | 修改时间,dateList[0]:开始时间,dateList[1]:截止时间 |
#### 参数示例
``` javascript
{
"actionType": "getQcOrderList",
"actionBody": {
"orderNum":"",
"contactsName":"",
"contactsPhone":"",
"clerkName":"",
"clerkPhone":"",
"productType":"",
"deliveryStatus":"",
"serviceCode":"gsb",
"sortType":"desc",
"pageSize": 1,
"currentPage":1,
"dateList":["2020-06-13 01:53:38","2020-06-14 01:53:39"]
}
}
```
#### 返回结果
```javascript
{
"retcode":0,
"msg":"success",
"data":{
"pageSize":1,
"curPage":1,
"search":{
"orderNum":"",
"contactsName":"",
"contactsPhone":"",
"clerkName":"",
"clerkPhone":"",
"productType":"",
"deliveryStatus":"",
"serviceCode":"gsb",
"sortType":"desc",
"pageSize":1,
"currentPage":1
},
"orderArr":null,
"total":2,
"rows":[
{
"order_num":"O202006130013",
"user_name":"张三",
"user_id":"1",
"updated_at":"2020-06-13T01:54:19.000Z",
"total_sum":300,
"refund_sum":0,
"pay_time":null,
"deleted_at":null,
"servicer_code":"gsb",
"servicer_name":"公司宝",
"product_type":"/qcfw/edi/",
"product_type_name":"/资质证照/edi/",
"order_snapshot":{
"id":26,
"bizopt_id":32,
"updated_at":"2020-06-02 20:32:14",
"remark_info":"77777777777766666677777777777",
"scheme_info":{
"address":"hangzhou",
"company":"77777777777777",
"numYear":5,
"annual_report":true
},
"businessType":"/qcfw/edi/",
"salesman_name":"小三",
"facilitator_id":"test",
"salesman_phone":"199299949424",
"facilitator_name":"测试服务商"
},
"delivery_status":17,
"delivery_status_name":"已完成",
"deliver_content":{
"safetyInfo":{
"qualification":"fdf",
"responsibility":"df"
},
"proposerInfo":{
"contactInfo":{
"name":"fdgdfg",
"email":"dfgfdgdf@qq.com",
"phone":"17293892382",
"address":"fgdgfd"
},
"principalInfo":[
{
"file":{
"url":"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_34351591966084262202012204842629592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg",
"name":"9592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg"
},
"name":"jhjhjhgj",
"email":"sgsggsg",
"namel":"fgfggddg",
"phone":"gdsgs",
"title":"法定代表人",
"certificateId":"cvxcgxg",
"certificateType":"身份证"
},
{
"file":{
"url":"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_233515919661083362020122048283369592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg",
"name":"9592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg"
},
"name":"hgh",
"email":"sfsdfs",
"phone":"sfsfs",
"title":"客服负责人",
"certificateId":"vfds",
"certificateType":"护照"
},
{
"file":{
"url":"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_104515919661204172020122048404179592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg",
"name":"9592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg"
},
"name":"hfghf",
"email":"sfjifjskdf",
"namel":"dgdgd",
"phone":"fsodifisdf",
"title":"安全负责人",
"certificateId":"shjdhjhsjd",
"certificateType":"台湾居民往来内地同行证或台湾身份证"
},
{
"file":{
"url":"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_432515919661368172020122048568179592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg",
"name":"9592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg"
},
"name":"hgy",
"email":"djndfhjdf",
"phone":"fsdfsd",
"title":"许可证负责人",
"certificateId":"dfndhsf",
"certificateType":"港澳居民往来内地同行证或港澳身份证"
}
],
"recipientInfo":{
"name":"lll",
"email":"dfgfdgdf@qq.com",
"phone":"17293892382",
"address":"dfsfdsfs"
},
"businessLicense":{
"name":"佛挡杀佛",
"type":"大幅度",
"address":"大幅度",
"createdAt":"2020-06-13T16:00:00.000Z",
"businessTerm":"试试",
"scopeBusiness":"对方是否",
"enterpriseCode":"91370200163562681G",
"registeredCapital":455055,
"legalRepresentative":"方法"
},
"businessInformation":{
"address":"发顺丰",
"zipCode":"发顺丰",
"ifListed":"true",
"staffSize":"小于10人",
"legalTypes":"企业法人",
"businessScale":"无营收收入",
"comapnyNature":"民营控股",
"fixedTelephone":"对方是否",
"bussinessDirection":"电力、热力、燃气及水生产和供应业"
}
},
"qualification":{
"file":{
"url":"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_422515919726637762020122237437769592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg",
"name":"9592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg"
},
"endAt":"2020-06-23 08:00:00",
"startAt":"2020-06-09 08:00:00",
"businessScope":"d",
"businessTypes":"d",
"serviceProject":"d",
"certificateNumber":"d"
},
"recipientInfo":{
"name":"lll",
"email":"dfgfdgdf@qq.com",
"phone":"17293892382",
"address":"dfsfdsfs",
"courierNumber":"lll",
"logisticsCompany":"ffff"
},
"shareholderData":[
{
"file":{
"url":"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_242515919664687502020122054287509592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg",
"name":"9592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg"
},
"name":"fff",
"type":"境内机关法人、事业单位",
"address":"erewr",
"idNumber":"130182838392838229",
"companyCode":"fdf",
"currencyType":"人民币",
"declareCompany":"sdfsd",
"holdProportion":200,
"waysInvestment":"货币",
"investmentAmount":444,
"superiorIdNumber":"fsfsdf",
"superiorShareholder":"dfdf"
}
],
"otherMaterialsInfo":{
"fixedList":[
{
"file":{
"url":"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_5351591970663480202012224234809592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg",
"name":"9592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg"
},
"title":"营业执照"
},
{
"file":{
"url":"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_16651591970667230202012224272309592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg",
"name":"9592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg"
},
"title":"域名证书"
},
{
"file":{
"url":"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_20151591970670753202012224307539592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg",
"name":"9592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg"
},
"title":"申请者国家企业信用信息公示系统截图"
},
{
"file":{
"url":"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_24951591970674272202012224342729592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg",
"name":"9592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg"
},
"title":"股东追溯承诺书"
},
{
"file":{
"url":"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_45451591970683619202012224436199592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg",
"name":"9592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg"
},
"title":"依法经营电信业务承诺书"
},
{
"file":{
"url":"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_5751591970687735202012224477359592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg",
"name":"9592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg"
},
"title":"服务器托管协议"
},
{
"file":{
"url":"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_10551591970692820202012224528209592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg",
"name":"9592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg"
},
"title":"服务器托管商编号C证书"
},
{
"file":{
"url":"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_9051591970696742202012224567429592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg",
"name":"9592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg"
},
"title":"社保证明文件"
},
{
"file":{
"url":"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_3495159197070099620201222509969592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg",
"name":"9592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg"
},
"title":"收费方案"
}
],
"otherFiles":[
]
},
"implementationPlanInfo":{
"webApp":[
{
"name":"电放费",
"type":"网站",
"domain":"防守打法",
"appStoreName":"发送到",
"serverAddress":"反攻倒算"
}
],
"targetUser":[
"企业",
"政府/事业单位",
"个人"
],
"profitableWay":[
"前向用户收费",
"后向平台服务收费",
"混合收费"
],
"specialApproval":[
{
"file":{
},
"title":"新闻"
},
{
"file":{
},
"title":"出版"
},
{
"file":{
},
"title":"药品和医疗器材"
},
{
"file":{
},
"title":"文化"
},
{
"file":{
},
"title":"视听节目"
}
],
"serviceProjectEdi":[
{
"file":{
},
"title":"电子交换业务",
"value":[
"贸易事务数据结构化/自动处理和交换服务",
"行政事务数据结构化/自动处理和交换服务"
]
},
{
"file":{
},
"title":"交易处理业务",
"value":[
"BTO B第三方交易平台",
"含网络借贷信息中介类的互联网金融业务服务"
]
},
{
"title":"网络/电子设备数据处理业",
"value":[
"物联网应用平台服务"
]
}
],
"serviceProjectIcp":[
{
"title":"信息发布平台和递送服务",
"value":[
],
"otherValue":""
},
{
"title":"信息搜索查询服务",
"value":[
],
"otherValue":""
},
{
"title":"信息社区服务",
"value":[
],
"otherValue":""
},
{
"title":"信息及时交互服务",
"value":[
],
"otherValue":""
},
{
"title":"信息保护加工处理服务",
"value":[
],
"otherValue":""
}
]
}
}
}
]
},
"requestId":""
}
```
## **<a name="getQcAnnalsOrderList"> 年报服务列表</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getQcAnnalsOrderList
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| orderNum | 否 | string |订单编号 |
| contactsName | 否 | string |客户姓名 |
| contactsPhone | 否 | string |客户电话 |
| clerkName | 否 | string |服务顾问 |
| clerkPhone | 否 | string |顾问电话 |
| serviceCode | 否 | string | 服务商编码 |
| productType | 否 | string | 交付产品类型编码 |
| deliveryStatus | 否 | int | 交付状态编码 |
| sortType | 否 | string | 更新时间排序方式 asc desc |
| pageSize | 否 | int | 每页条数,默认10 |
| currentPage | 否 | int | 当前页码,默认1 |
| dateList | 否 | list | 修改时间,dateList[0]:开始时间,dateList[1]:截止时间 |
#### 参数示例
``` javascript
{
"actionType": "getQcAnnalsOrderList",
"actionBody": {
"orderNum":"T",
"contactsName":"w",
"contactsPhone":"1",
"clerkName":"",
"clerkPhone":"",
"productType":"gsreg",
"deliveryStatus":"",
"serviceCode":"8",
"sortType":"asc",
"pageSize": 4,
"currentPage":1,
"dateList":["2020-06-13 01:53:38","2020-06-14 01:53:39"]
}
}
```
#### 返回结果
```javascript
{
"retcode":0,
"msg":"success",
"data":{
"pageSize":1,
"curPage":1,
"search":{
"orderNum":"",
"contactsName":"",
"contactsPhone":"",
"clerkName":"",
"clerkPhone":"",
"productType":"",
"deliveryStatus":"",
"serviceCode":"gsb",
"sortType":"desc",
"pageSize":1,
"currentPage":1
},
"orderArr":null,
"total":0,
"rows":[
]
},
"requestId":""
}
```
## **<a name="getPrincipalInfoByOrderNum"> 资质证照详情-公司人员情况</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getPrincipalInfoByOrderNum
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| orderNumber | 是 | string | 订单号 |
#### 参数示例
``` javascript
{
"actionType": "getPrincipalInfoByOrderNum",
"actionBody": {
"orderNumber":"O202006130012"
}
}
```
#### 返回结果
```javascript
{
"retcode":0,
"msg":"success",
"data":{
"pageSize":4,
"curPage":1,
"search":{
"orderNumber":"O202006130012"
},
"orderArr":null,
"total":4,
"rows":[
{
"file":{
"url":"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_13151591685846571202091457265719592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg",
"name":"9592BBA6-5CA0-4536-83B7-7E8BAD85CCFE.jpeg"
},
"name":"111112222222444",
"email":"EE",
"phone":"DF",
"title":"法定代表人",
"certificateId":"D",
"certificateType":"身份证"
},
{
"file":{
},
"name":"44433C ",
"email":"CX",
"phone":"VCV",
"title":"客服负责人",
"certificateId":"C",
"certificateType":"身份证"
},
{
"file":{
},
"name":"WLLJJJ",
"email":"SD",
"phone":"EE",
"title":"安全负责人",
"certificateId":"D",
"certificateType":"台湾居民往来内地同行证或台湾身份证"
},
{
"file":{
},
"name":"C",
"email":"XCC",
"phone":"XCX",
"title":"许可证负责人",
"certificateId":"C",
"certificateType":"台湾居民往来内地同行证或台湾身份证"
}
]
},
"requestId":""
}
```
## **<a name="getShareholderDataByOrderNum"> 资质证照详情-股权结构</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getShareholderDataByOrderNum
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| orderNumber | 是 | string | 订单号 |
#### 参数示例
``` javascript
{
"actionType": "getShareholderDataByOrderNum",
"actionBody": {
"orderNumber":"O202006130012"
}
}
```
#### 返回结果
```javascript
{
"retcode":0,
"msg":"success",
"data":{
"pageSize":1,
"curPage":1,
"search":{
"orderNumber":"O202006130012"
},
"orderArr":null,
"total":1,
"rows":[
{
"file":{
"url":"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_4415159168589478720209145814787公司宝logo(透明背景).png",
"name":"公司宝logo(透明背景).png"
},
"name":"DD",
"type":"境内机自然人",
"address":"SDSD",
"idNumber":"XC",
"companyCode":"EW",
"currencyType":"人民币",
"declareCompany":"DSD",
"holdProportion":330,
"waysInvestment":"货币",
"investmentAmount":222022,
"superiorIdNumber":"SDS",
"superiorShareholder":"SDS"
}
]
},
"requestId":""
}
```
## **<a name="getWebAppByOrderNum"> 资质证照详情-网站或APP信息</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getWebAppByOrderNum
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| orderNumber | 是 | string | 订单号 |
#### 参数示例
``` javascript
{
"actionType": "getWebAppByOrderNum",
"actionBody": {
"orderNumber":"O202006130012"
}
}
```
#### 返回结果
```javascript
{
"retcode":0,
"msg":"success",
"data":{
"pageSize":2,
"curPage":1,
"search":{
"orderNumber":"O202006130012"
},
"orderArr":null,
"total":2,
"rows":[
{
"name":"XX",
"type":"APP",
"domain":"XXZ",
"appStoreName":"AA",
"serverAddress":"ZZ"
},
{
"name":"XZX",
"type":"网站",
"domain":"XZX",
"appStoreName":"QQ",
"serverAddress":"ZXZX"
}
]
},
"requestId":""
}
```
## **<a name="getServiceProjectByOrderNum"> 资质证照详情-拟开展服务项目</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getServiceProjectByOrderNum
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| orderNumber | 是 | string | 订单号 |
#### 参数示例
``` javascript
{
"actionType": "getServiceProjectByOrderNum",
"actionBody": {
"orderNumber":"O202006130012"
}
}
```
#### 返回结果
```javascript
{
"retcode":0,
"msg":"success",
"data":{
"pageSize":5,
"curPage":1,
"search":{
"orderNumber":"O202006130012"
},
"orderArr":null,
"total":5,
"rows":[
{
"title":"信息发布平台和递送服务",
"value":[
"应用商店"
],
"otherValue":""
},
{
"title":"信息搜索查询服务",
"value":[
"搜索引擎",
"其他",
"网页导航"
],
"otherValue":"XCC"
},
{
"title":"信息社区服务",
"value":[
"其他"
],
"otherValue":"CC"
},
{
"title":"信息及时交互服务",
"value":[
"其他"
],
"otherValue":""
},
{
"title":"信息保护加工处理服务",
"value":[
"防病毒平台",
"垃圾信息拦截平台"
],
"otherValue":""
}
]
},
"requestId":""
}
```
## **<a name="getMaterialsInfoByOrderNum"> 资质证照详情-材料清单</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getMaterialsInfoByOrderNum
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| orderNumber | 是 | string | 订单号 |
#### 参数示例
``` javascript
{
"actionType": "getMaterialsInfoByOrderNum",
"actionBody": {
"orderNumber":"O202006130012"
}
}
```
#### 返回结果
```javascript
{
"retcode":0,
"msg":"success",
"data":{
"pageSize":9,
"curPage":1,
"search":{
"orderNumber":"O202006130012"
},
"orderArr":null,
"total":9,
"rows":[
{
"file":{
"url":"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_375159168598492920209145944929公司宝logo(黄色背景).jpg",
"name":"公司宝logo(黄色背景).jpg"
},
"title":"营业执照"
},
{
"file":{
},
"title":"域名证书"
},
{
"file":{
},
"title":"申请者国家企业信用信息公示系统截图"
},
{
"file":{
},
"title":"股东追溯承诺书"
},
{
"file":{
},
"title":"依法经营电信业务承诺书"
},
{
"file":{
},
"title":"服务器托管协议"
},
{
"file":{
},
"title":"服务器托管商编号C证书"
},
{
"file":{
},
"title":"社保证明文件"
},
{
"file":{
},
"title":"收费方案"
}
]
},
"requestId":""
}
```
## **<a name="getServiceProviderList"> 服务商列表-筛选条件</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getServiceProviderList
#### 参数说明
#### 参数示例
``` javascript
{
"actionType": "getServiceProviderList",
"actionBody": {
}
}
```
#### 返回结果
```javascript
{
"retcode":0,
"msg":"success",
"data":[
{
"servicer_code":"gsb",
"servicer_name":null,
"apply_type":null
},
{
"servicer_code":"S_202006050937ptSlyI",
"servicer_name":"测试服务商",
"apply_type":1
},
{
"servicer_code":"S_202006050943AIEUbW",
"servicer_name":"测试服务商",
"apply_type":1
},
{
"servicer_code":"S_202006051001NpyNOO",
"servicer_name":"测试服务商",
"apply_type":1
},
{
"servicer_code":"S_202006051002UE4Lse",
"servicer_name":"测试服务商",
"apply_type":1
},
{
"servicer_code":"S_202006081548KTtnJj",
"servicer_name":"ad",
"apply_type":1
},
{
"servicer_code":"S_2020060817350axACA",
"servicer_name":"test",
"apply_type":1
},
{
"servicer_code":"S_202006082212fkPrkW",
"servicer_name":"企业名称",
"apply_type":1
},
{
"servicer_code":"S_202006082213d2tgoM",
"servicer_name":"企业名称",
"apply_type":1
},
{
"servicer_code":"S_2020060916124m1rLi",
"servicer_name":"测试服务商",
"apply_type":1
},
{
"servicer_code":"S_20200612201296NkJi",
"servicer_name":"1",
"apply_type":1
}
],
"requestId":""
}
```
## **<a name="getAnnualReportByOrderNum"> 资质证照详情-年报列表</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getAnnualReportByOrderNum
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| orderNumber | 是 | string | 订单号 |
#### 参数示例
``` javascript
{
"actionType": "getAnnualReportByOrderNum",
"actionBody": {
"orderNumber":"O202006130016"
}
}
```
#### 返回结果
```javascript
{
"retcode":0,
"msg":"success",
"data":{
"pageSize":4,
"curPage":1,
"search":{
"orderNumber":"O202006130016"
},
"orderArr":null,
"total":3,
"rows":[
{
"file":null,
"year":2021,
"status":"waitdeclare",
"updated_at":"2020-09-01"
},
{
"file":null,
"year":2022,
"status":"waitdeclare",
"updated_at":"2020-09-01"
},
{
"file":null,
"year":2023,
"status":"waitdeclare",
"updated_at":"2020-09-01"
}
]
},
"requestId":""
}
```
## **<a name="getSpecialApprovalInfoByOrderNum"> 资质证照详情-专项审批项目ICP</a>**
[返回到目录](#menu)
##### URL
[/api/action/xboss/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:getSpecialApprovalInfoByOrderNum
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| orderNumber | 是 | string | 订单号 |
#### 参数示例
``` javascript
{
"actionType": "getSpecialApprovalInfoByOrderNum",
"actionBody": {
"orderNumber":"O202006130014"
}
}
```
#### 返回结果
```javascript
{
"retcode": 0,
"msg": "success",
"data": {
"pageSize": 5,
"curPage": 1,
"search": {
"orderNumber": "O202006130014"
},
"orderArr": null,
"total": 5,
"rows": [
{
"file": {},
"title": "新闻"
},
{
"file": {},
"title": "出版"
},
{
"file": {},
"title": "药品和医疗器材"
},
{
"file": {},
"title": "文化"
},
{
"file": {},
"title": "视听节目"
}
]
},
"requestId": ""
}
```
<a name="menu" href="/doc">返回主目录</a>
1. [推送需求到服务商](#needSubmit)
1. [推送订单到服务商](#orderSubmit)
1. [关闭需求推送到服务商](#needClose)
1. [关闭订单推送到服务商](#orderClose)
1. [初始化产品表](#getH5PayUrl)
## **<a name="needSubmit"> 推送需求到服务商</a>**
[返回到目录](#menu)
##### URL:
/entService/consultation/springBoard
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:needSubmit
#### 需求类型 consultType:1.公司注册咨询、2个体户注册参数、3增值服务
### 1.公司注册参数、2个体户注册参数
参数名 | 必须 | 字段类型 | 长度限制 | 说明
-|-|-|-|-
needNum | Y | string | 100 | 需求号
userId | Y | string | 100 | 用户id
servicerCode | Y | string | 100 | 服务商code
servicerName | Y | string | 100 | 服务商名称
regionId | Y | string | 100 | 地区id
regionName | Y | string | 100 | 地区名称
contactsName | Y | string | 100 | 用户名称
contactsMoblie | Y | string | 100 | 用户电话
consultType | Y | int | 100 | 需求类型
### 3.增值服务
参数名 | 必须 | 字段类型 | 长度限制 | 说明
-|-|-|-|-
needNum | Y | string | 100 | 需求号
userId | Y | string | 100 | 用户id
servicerCode | Y | string | 100 | 服务商code
servicerName | Y | string | 100 | 服务商名称
regionId | Y | string | 100 | 地区id
regionName | Y | string | 100 | 地区名称
contactsName | Y | string | 100 | 用户名称
contactsMoblie | Y | string | 100 | 用户电话
consultType | Y | int | 100 | 需求类型
``` javascript
{
"actionType": "needSubmit",
"actionBody": {
"needNum":"n0001",
"userId":"tx000111",
"servicerCode":"gsb",
"servicerName":"公司宝",
"regionId":"1",
"regionName":"北京",
"contactsName":"张三",
"contactsMoblie":"17610163853",
"consultType":1
}
}
```
#### 返回结果
```javascript
{
"status":1, //1代表成功,否则失败
"message":"",
"data":"",
"requestId":""
}
```
## **<a name="orderSubmit"> 推送订单到服务商</a>**
[返回到目录](#menu)
##### URL
/entService/order/springBoard
#### 参数格式 `JSON`人
#### HTTP请求方式 `POST`
#### 功能模块 actionType:orderSubmit
#### 产品类型 productType:1.公司注册咨询、2个体户注册参数、3增值服务
### 1.公司注册参数、2个体户注册参数
参数名 | 必须 | 字段类型 | 长度限制 | 说明
-|-|-|-|-
orderNum | Y | string | 100 | 订单号
userId | Y | string | 100 | 用户id
servicerCode | Y | string | 100 | 服务商code
servicerName | Y | string | 100 | 服务商名称
regionId | Y | string | 100 | 地区id
regionName | Y | string | 100 | 地区名称
contactsName | Y | string | 100 | 用户名称
contactsMoblie | Y | string | 100 | 用户电话
productType | Y | int | 100 | 产品类型
### 3.增值服务
参数名 | 必须 | 字段类型 | 长度限制 | 说明
-|-|-|-|-
orderNum | Y | string | 100 | 订单号
userId | Y | string | 100 | 用户id
servicerCode | Y | string | 100 | 服务商code
servicerName | Y | string | 100 | 服务商名称
regionId | Y | string | 100 | 地区id
regionName | Y | string | 100 | 地区名称
contactsName | Y | string | 100 | 用户名称
contactsMoblie | Y | string | 100 | 用户电话
productType | Y | int | 100 | 产品类型
order_snapshot | Y | string | 500 | 订单快照(json转字符串)
``` javascript
{
"actionType": "orderSubmit",
"actionBody": {
"orderNum":"",
"userId":"",
"servicerCode":"",
"servicerName":"",
"regionId":"",
"regionName":"",
"contactsName":"",
"contactsMoblie":"",
"productType":""
"order_snapshot":"{
}"
}
}
```
#### 返回结果
```javascript
{
"status":1, //1代表成功,否则失败
"message":"",
"data":"",
"requestId":""
}
```
## **<a name="needClose"> 关闭需求推送到服务商</a>**
[返回到目录](#menu)
##### URL
/entService/consultation/springBoard
#### 参数格式 `JSON`人
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:needClose
参数名 | 必须 | 字段类型 | 长度限制 | 说明
-|-|-|-|-
needNum | Y | string | 100 | 需求号
desc | Y | string | 100 | 备注信息
``` javascript
{
"needNum":"",
"desc":"" //描述
}
```
#### 返回结果
```javascript
{
"status":1, //1代表成功,否则失败
"msg":"",
"data":"",
"requestId":""
}
```
## **<a name="orderClose"> 关闭订单推送到服务商</a>**
[返回到目录](#menu)
##### URL
/entService/order/springBoard
#### 参数格式 `JSON`人
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:orderClose
参数名 | 必须 | 字段类型 | 长度限制 | 说明
-|-|-|-|-
orderNum | Y | string | 100 | 订单号
desc | Y | string | 100 | 备注信息
``` javascript
{
"orderNum":"",
"desc":"" //描述
}
```
#### 返回结果
```javascript
{
"status":1, //1代表成功,否则失败
"msg":"",
"data":"",
"requestId":""
}
```
<a name="menu" href="/doc">返回主目录</a>
1. [服务商提交方案](#submitSolution)
1. [服务商关闭需求](#closeNeed)
1. [服务商提交交付信息](#submitDeliveryInfo)
1. [服务商修改订单交付状态](#updateOrderStatus)
## **<a name="submitSolution"> 服务商提交方案</a>**
[返回到目录](#menu)
##### URL
[/api/receive/entService/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:submitSolution
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| needNum | 是 | string | 需求编码 |
| solutionNum | 否 | string | 方案编码,修改方案时传入,不传默认新增 |
| solutionContent | 是 | json | 方案内容 |
#### 参数示例
``` javascript
{
"actionType": "submitSolution",
"actionBody": {
"needNum": "N2020052978888",
"solutionNum":"",
"solutionContent": {}
}
}
```
#### 返回结果
```javascript
{
"status":1,// 1为成功,否则失败
"msg":"success",
"data":"NS_202005291451Iy2Gk",//方案号,新增时返回
"requestId":"e52e42676d86423a91623f7474a20963"
}
```
## **<a name="closeNeed"> 服务商关闭需求</a>**
[返回到目录](#menu)
##### URL
[/api/receive/entService/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:closeNeed
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| needNum | 是 | string | 需求编码 |
| note | 是 | string | 关闭原因 |
#### 参数示例
``` javascript
{
"actionType": "closeNeed",
"actionBody": {
"needNum": "N2020052978888",
"note": "xxx"
}
}
```
#### 返回结果
```javascript
{
"status": 1,// 1为成功,否则失败
"msg": "success",
"data":null,
"requestId": "a277fb799d9f4dda9053fb8830f9d252"
}
```
## **<a name="submitDeliveryInfo"> 服务商提交交付信息</a>**
[返回到目录](#menu)
##### URL
[/api/receive/entService/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:submitDeliveryInfo
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| orderNum | 是 | string | 订单编码 |
| deliveryContent | 是 | json | 交付信息 |
#### 参数示例
``` javascript
{
"actionType": "submitDeliveryInfo",
"actionBody": {
"orderNum": "O20201231223384682",
"deliveryContent": {}
}
}
```
#### 返回结果
```javascript
{
"status": 1,// 1为成功,否则失败
"msg": "success",
"data":null,
"requestId": "a277fb799d9f4dda9053fb8830f9d252"
}
```
## **<a name="updateOrderStatus"> 服务商修改订单交付状态</a>**
[返回到目录](#menu)
##### URL
[/api/receive/entService/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 功能模块 actionType:updateOrderStatus
#### 参数说明
| 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- |
| orderNum | 是 | string | 订单编码 |
| orderStatus | 是 | int | 订单状态码 1: 已接单,10:收集工商注册材料,11:工商审核环节,12:刻章环节,13:证件邮寄环节,14:您已签收|
#### 参数示例
``` javascript
{
"actionType": "updateOrderStatus",
"actionBody": {
"orderNum": "O20201231223384682",
"orderStatus": 10
}
}
```
#### 返回结果
```javascript
{
"status": 1,// 1为成功,否则失败
"msg": "success",
"data":null,
"requestId": "a277fb799d9f4dda9053fb8830f9d252"
}
```
var http = require('http');
var express = require('express');
var app = express();
var setttings=require("./app/config/settings");
var environment = require('./app/config/environment');
// all environments
environment(app);//初始化环境
// 错误处理中间件应当在路由加载之后才能加载
var server = http.createServer(app);
server.listen(setttings.port, function(){
console.log('Express server listening on port ' + app.get('port'));
});
......@@ -44,15 +44,13 @@
"nodemailer": "^6.3.0",
"pinyin": "^2.9.0",
"puppeteer": "^1.20.0",
"qcloud-cos-sts": "^3.0.2",
"qr-image": "^3.2.0",
"sequelize": "^4.37.8",
"sequelize-cli": "^4.1.1",
"serve-favicon": "^2.4.5",
"sha1": "^1.1.1",
"sha256": "^0.2.0",
"socket.io": "^2.1.1",
"uuid": "^3.2.1"
"uuid": "^3.4.0"
},
"devDependencies": {
"element-theme": "^2.0.1",
......
++ "b/brg/\346\217\220\347\244\272\347\274\226\347\240\201\344\275\277\347\224\250"
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