Commit 440c9800 by 王昆

gsb

parent 1fe866c5
var APIBase = require("../../api.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
class ActionAPI extends APIBase {
constructor() {
super();
this.iborderSve = system.getObject("service.order.iborderSve");
this.iborderdeliverSve = system.getObject("service.order.iborderdeliverSve");
this.businessmenSve = system.getObject("service.business.businessmenSve");
this.businessmencontractSve = system.getObject("service.business.businessmencontractSve");
}
/**
* 接口跳转
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springboard(pobj, qobj, req) {
var result;
if (!pobj.action_process) {
return system.getResult(null, "action_process参数不能为空");
}
if (!pobj.action_type) {
return system.getResult(null, "action_type参数不能为空");
}
console.log(pobj.action_process, pobj.action_type, pobj.action_body, "---------------- this is order micro sve --------------------");
try {
result = await this.handleRequest(pobj.action_process, pobj.action_type, pobj.action_body);
} catch (error) {
console.log(error);
}
return result;
}
async handleRequest(action_process, action_type, action_body) {
var opResult = null;
switch (action_type) {
// 订单
case "addOrder":
opResult = await this.iborderSve.apiAdd(action_body);
break;
case "updOrder":
opResult = await this.iborderSve.apiUpd(action_body);
break;
case "allOrderList":
opResult = await this.iborderSve.apiAllList(action_body);
break;
case "orderInfo":
opResult = await this.iborderSve.apiInfo(action_body);
break;
case "orderInfoAll":
opResult = await this.iborderSve.apiAllInfo(action_body);
break;
case "byChannelOrderId":
opResult = await this.iborderSve.apiByChannelOrderId(action_body);
break;
case "orderEdit":
opResult = await this.iborderSve.apiEdit(action_body);
break;
case "orderAssign":
opResult = await this.iborderSve.apiAssign(action_body);
break;
case "myOrderPage":
opResult = await this.iborderSve.apiMyPage(action_body);
break;
case "orderPay":
opResult = await this.iborderSve.apiOrderPay(action_body);
break;
case "orderClose":
opResult = await this.iborderSve.apiOrderClose(action_body);
break;
case "closeOrderById":
opResult = await this.iborderSve.apiCloseById(action_body);
break;
case "orderComplete":
opResult = await this.iborderSve.apiComplete(action_body);
break;
case "orderByDeliverId":
opResult = await this.iborderSve.apiByDeliverId(action_body);
break;
// 订单办理
case "orderDeliverList":
opResult = await this.iborderdeliverSve.apiPage(action_body);
break;
case "orderDeliverHandle":
opResult = await this.iborderdeliverSve.apiHandle(action_body);
break;
case "orderDeliverInfo":
opResult = await this.iborderdeliverSve.apiInfo(action_body);
break;
case "orderDeliverEdit":
opResult = await this.iborderdeliverSve.apiEdit(action_body);
break;
case "orderDeliverAudit":
opResult = await this.iborderdeliverSve.apiAudit(action_body);
break;
case "orderDeliverClose":
opResult = await this.iborderdeliverSve.apiClose(action_body);
break;
// 个体户管理
case "businessmenByOrderId":
opResult = await this.businessmenSve.apiByOrderId(action_body);
break;
case "businessmenByChannelOrderNo":
opResult = await this.businessmenSve.apiByChannelOrderNo(action_body);
break;
case "businessmenNameList":
opResult = await this.businessmenSve.apiNameList(action_body);
break;
case "businessmenPage":
opResult = await this.businessmenSve.apiPage(action_body);
break;
case "businessmenInfo":
opResult = await this.businessmenSve.apiInfo(action_body);
break;
case "businessmenSign":
opResult = await this.businessmenSve.apiSign(action_body);
break;
case "businessmenSignPage":
opResult = await this.businessmenSve.apiSignPage(action_body);
break;
case "businessmenInfoPage":
opResult = await this.businessmenSve.apiInfoPage(action_body);
break;
case "businessmenUserPage":
opResult = await this.businessmenSve.apiUserPage(action_body);
break;
case "businessmenDeliverPage":
opResult = await this.businessmenSve.apiDeliverPage(action_body);
break;
case "addBusinessmenContract":
opResult = await this.businessmenSve.apiAddContract(action_body);
break;
case "businessmenCompleteMapByCreditCodes":
opResult = await this.businessmenSve.apiCompleteMapByCreditCodes(action_body);
break;
// 统计数据
case "statTransData":
opResult = await this.iborderSve.apiStatTransData(action_body);
break;
case "statBusinessData":
opResult = await this.iborderSve.apiStatBusinessData(action_body);
break;
case "statDeliverData":
opResult = await this.iborderdeliverSve.apiStatDeliverData(action_body);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
exam() {
return `<pre><pre/>`;
}
classDesc() {
return {
groupName: "op",
groupDesc: "元数据服务包",
name: "ActionAPI",
desc: "此类是对外提供接口服务",
exam: "",
};
}
methodDescs() {
return [{
methodDesc: `<pre><pre/>`,
methodName: "springboard",
paramdescs: [{
paramDesc: "请求的行为,传递如:sjb",
paramName: "action_process",
paramType: "string",
defaultValue: null,
},
{
paramDesc: "业务操作类型,详情见方法中的描述",
paramName: "action_type",
paramType: "string",
defaultValue: null,
},
{
paramDesc: "业务操作类型的参数,action_body必须传递的参数有,times_tamp(时间戳,类型int)、sign(签名,类型string),其余的为业务需要的参数",
paramName: "action_body",
paramType: "json",
defaultValue: null,
}
],
rtnTypeDesc: `<pre><pre/>`,
rtnType: `<pre><pre/>`
}];
}
}
module.exports = ActionAPI;
\ No newline at end of file
const system = require("../../../system");
const Dao = require("../../dao.base");
class BusinessmenDao extends Dao {
constructor() {
super(Dao.getModelName(BusinessmenDao));
this.bstatusMap = {
"2000": "办理中",
"2010": "待签约",
"2020": "已完成",
}
this.gstatusMap = {
"2000": "办理中",
"2020": "已完成",
}
this.dstatusMap = {
"2000": "办理中",
"2020": "已完成",
}
}
async nameList(bstatuses) {
var sql = "SELECT id, name FROM " + this.model.tableName + " WHERE 1 = 1 ";
var params = {};
if (bstatuses && bstatuses.length > 0) {
sql = sql + " AND bstatus IN (:bstatuses) ";
params.bstatuses = bstatuses;
}
return this.customQuery(sql, params);
}
async getByOrderId(orderId, attrs) {
if (!orderId) {
return null;
}
attrs = attrs || "*";
var sql = "SELECT " + attrs + " FROM " + this.model.tableName + " where order_id = :orderId ";
var list = await this.customQuery(sql, {
orderId: orderId
});
return list && list.length > 0 ? list[0] : null;
}
async getByChannelOrderNo(merchantId, channelOrderNo, attrs) {
if (!merchantId || !channelOrderNo) {
return null;
}
var params = {
merchantId: merchantId,
channelOrderNo: channelOrderNo,
}
attrs = attrs || "*";
var sql = "SELECT " + attrs + " FROM " + this.model.tableName + " where merchant_id = :merchantId AND channelOrderNo = :channelOrderNo LIMIT 1";
var list = await this.customQuery(sql, params);
return list && list.length > 0 ? list[0] : null;
}
async getByCreditCodes(params, attrs) {
var creditCodes = params.creditCodes;
var statuses = params.statuses;
var result = {};
if (!creditCodes || creditCodes.length == 0) {
return result;
}
attrs = attrs || "*";
var sql = "SELECT " + attrs + " FROM " + this.model.tableName + " where creditCode IN (:creditCodes) ";
if (statuses && statuses.length > 0) {
sql = sql + " AND bstatus IN (:statuses) "
}
return await this.customQuery(sql, params);
}
async getMapByCreditCodes(params, attrs) {
var result = {};
var list = this.getByCreditCodes(params, attrs);
if (!list) {
return result;
}
for (var item of list) {
result[item.creditCode] = item;
}
return result;
}
}
module.exports = BusinessmenDao;
\ No newline at end of file
const system=require("../../../system");
const Dao=require("../../dao.base");
class BusinessmencontractDao extends Dao{
constructor(){
super(Dao.getModelName(BusinessmencontractDao));
}
}
module.exports=BusinessmencontractDao;
const system=require("../../../system");
const Dao=require("../../dao.base");
class BusinessmeninvoicecontentDao extends Dao{
constructor(){
super(Dao.getModelName(BusinessmeninvoicecontentDao));
}
async delByBusinessmenId(businessmenId, t) {
var sql = "DELETE FROM " + this.model.tableName + " WHERE businessmen_id = :businessmenId";
var list = await this.customUpdate(sql, {
businessmenId: businessmenId
}, t) || [null];
return list[0];
}
async mapByBusinessmenIds(businessmenIds, attrs) {
var result = {};
if (!businessmenIds || businessmenIds.length == 0) {
return result;
}
attrs = attrs || "*";
var sql = "SELECT businessmen_id, invoicecontent_id, invoicecontentName FROM " + this.model.tableName + " where businessmen_id IN (:businessmenIds) ";
var list = await this.customQuery(sql, {
businessmenIds: businessmenIds
});
if(!list) {
return result;
}
for(var item of list) {
var lst = result[item.businessmen_id];
if(!lst) {
lst = [];
}
lst.push(item);
result[item.businessmen_id] = lst;
}
return result;
}
}
module.exports=BusinessmeninvoicecontentDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
class IborderdeliverDao extends Dao {
constructor() {
super(Dao.getModelName(IborderdeliverDao));
this.statusMap = {
"1030": "待处理",
"1040": "关闭订单",
"1050": "执照办理中",
"1060": "已出执照",
"1070": "刻章办理中",
"1080": "已刻章",
"1090": "银行开户中",
"1100": "银行卡已开户",
"1110": "税务报道中",
"1120": "已税务报道",
"1130": "待审核",
"1140": "审核失败",
"1150": "审核通过",
"1160": "已邮寄",
};
}
async findAssignedOrder(orderId) {
var sql = "SELECT * FROM `ib_order_deliver` WHERE order_id = :orderId AND `status` <> '1040' LIMIT 1";
var list = await this.customQuery(sql, {
orderId: orderId
});
return list && list.length > 0 ? list[0] : null;
}
async findMapByOrderIds(orderIds) {
var result = {};
var sql = "SELECT * FROM `ib_order_deliver` WHERE order_id IN (:orderIds) AND `status` <> '1040' LIMIT 1";
var list = await this.customQuery(sql, {
orderIds: orderIds
});
if (!list || list.length == 0) {
return result;
}
for (var item of list) {
await this.setRowCodeName(item, "status");
result[item.order_id] = item;
}
return result;
}
async findMapByOrderIds(orderIds) {
var result = {};
var sql = "SELECT * FROM `ib_order_deliver` WHERE order_id IN (:orderIds) AND `status` <> '9000'";
var list = await this.customQuery(sql, {
orderIds: orderIds
});
if (!list || list.length == 0) {
return result;
}
for (var item of list) {
await this.setRowCodeName(item, "status");
result[item.order_id] = item;
}
return result;
}
async findMapByIds(ids) {
var result = {};
var sql = "SELECT * FROM `ib_order_deliver` WHERE id IN (:ids)";
var list = await this.customQuery(sql, {
ids: ids
});
if (!list || list.length == 0) {
return result;
}
for (var item of list) {
await this.setRowCodeName(item, "status");
result[item.id] = item;
}
return result;
}
async countStat(params) {
var sql = [];
sql.push("SELECT");
sql.push("COUNT(DISTINCT deliver_id) AS total");
sql.push("FROM `ib_order_deliver`");
sql.push("WHERE 1 = 1");
this.setCondition(params, sql);
var list = await this.customQuery(sql.join(" "), params);
return list && list.length > 0 ? (list[0].total || 0) : 0;
}
async queryStat(params, startRow, pageSize) {
var sql = [];
// SELECT deliver_id, deliverName, SUM(deliverDivide) AS servicePrice FROM `ib_order_deliver` GROUP BY deliver_id;
sql.push("SELECT");
sql.push("deliver_id, deliverName, SUM(deliverDivide) AS servicePrice");
sql.push("FROM `ib_order_deliver` ");
sql.push("WHERE 1 = 1");
this.setCondition(params, sql);
sql.push("GROUP BY deliver_id");
sql.push("LIMIT :startRow, :pageSize");
params.startRow = startRow;
params.pageSize = pageSize;
var list = await this.customQuery(sql.join(" "), params);
return list;
}
async statDeliverByStatus(params) {
var sql = [];
sql.push("SELECT");
sql.push("deliver_id, `status`, COUNT(1) AS orderCount");
sql.push("FROM `ib_order_deliver`");
sql.push("WHERE 1 = 1");
if(params.deliverIds) {
sql.push("AND deliver_id IN (:deliverIds)")
}
if (params.begin) {
sql.push("AND created_at >= :begin");
}
if (params.end) {
sql.push("AND created_at <= :end");
}
sql.push("GROUP BY `status`");
var result = {};
var list = await this.customQuery(sql.join(" "), params);
if (!list || list.length == 0) {
return result;
}
for (var item of list) {
result[item.deliver_id + "_" + item.status] = item.orderCount || 0;
}
return result;
}
setCondition(params, sql) {
if (params.begin) {
sql.push("AND created_at >= :begin");
}
if (params.end) {
sql.push("AND created_at <= :end");
}
}
}
module.exports = IborderdeliverDao;
\ No newline at end of file
const system = require("../../../system");
const settings = require("../../../../config/settings");
module.exports = (db, DataTypes) => {
return db.define("businessmen", {
order_id: DataTypes.STRING(32),
merchant_id: DataTypes.STRING(32),
channelOrderNo: DataTypes.STRING(64),
// 业务状态: 2000办理中, 2010待签约, 2020已完成
bstatus: DataTypes.STRING(10),
// 客户状态: 2000办理中, 2020已完成
gstatus: DataTypes.STRING(10),
// 客户状态: 2000办理中, 2020已完成
dstatus: DataTypes.STRING(10),
legalName: DataTypes.STRING(20),
legalMobile: DataTypes.STRING(20),
legalIdcard: DataTypes.STRING(30),
name: DataTypes.STRING(100),
creditCode: DataTypes.STRING(100),
businessPlace: DataTypes.STRING(100),
businessScope: DataTypes.STRING(500),
regDate: DataTypes.DATE,
businessImg: DataTypes.STRING(300),
gongzhang: DataTypes.STRING(300),
caiwuzhang: DataTypes.STRING(300),
fapiaozhang: DataTypes.STRING(300),
hetongzhang: DataTypes.STRING(300),
farenzhang: DataTypes.STRING(300),
isBank: {
type: DataTypes.BOOLEAN,
defaultValue: false
},
bankName: DataTypes.STRING(50),
bankNo: DataTypes.STRING(30),
bank: DataTypes.STRING(100),
bankImg: DataTypes.STRING(300),
caImg: DataTypes.STRING(300),
taxRegDay: DataTypes.DATE,
taxOrg: DataTypes.STRING(100),
courierNo: DataTypes.STRING(100),
courierImg: DataTypes.STRING(100),
contractStartData: DataTypes.DATE,
contractEndData: DataTypes.DATE,
contract: DataTypes.STRING(300), //个体户合同
notes: DataTypes.STRING, //备注
opNotes: DataTypes.STRING, //操作备注
// 个体户签约相关字段
taxUpType: DataTypes.STRING,
addValueUpType: DataTypes.STRING,
costRate: DataTypes.INTEGER,
taxRate: DataTypes.INTEGER,
serviceRate: DataTypes.INTEGER,
signNotes: DataTypes.STRING,
commonTaxLadder: DataTypes.STRING(1000),
commonOtherLadder: DataTypes.STRING(1000),
specialTaxLadder: DataTypes.STRING(1000),
specialOtherLadder: DataTypes.STRING(1000),
signTime: DataTypes.DATE,
bdId: DataTypes.STRING,
bdPath: DataTypes.STRING,
userId: DataTypes.STRING,
}, {
paranoid: true, //假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'ib_businessmen',
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}]
// }
]
});
}
\ No newline at end of file
const system = require("../../../system");
const settings = require("../../../../config/settings");
module.exports = (db, DataTypes) => {
return db.define("businessmencontract", {
businessmen_id: DataTypes.STRING(32),
merchant_id: DataTypes.STRING(32),
contractStartData: DataTypes.DATE,
contractEndData: DataTypes.DATE,
contract: DataTypes.STRING(300),//个体户合同
}, {
paranoid: true, //假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'ib_businessmen_contract',
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}]
// }
]
});
}
\ No newline at end of file
const system = require("../../../system");
const settings = require("../../../../config/settings");
module.exports = (db, DataTypes) => {
return db.define("businessmeninvoicecontent", {
businessmen_id: DataTypes.STRING(32),
invoicecontent_id: DataTypes.STRING(32),
invoicecontentName: DataTypes.STRING(32),
}, {
paranoid: true, //假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'ib_businessmen_invoicecontent',
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}]
// }
]
});
}
\ No newline at end of file
const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("iborderdeliver", {
order_id: DataTypes.STRING(32),
// 办理状态 1030待处理, 1040关闭订单, 1050执照办理中, 1060已出执照, 1070刻章办理中,
// 1080已刻章, 1090银行开户中, 1100银行卡已开户, 1110税务报道中, 1120已税务报道,
// 1130提交审核, 1140审核失败, 1150审核通过, 1160已邮寄
status: DataTypes.STRING(10),
deliver_id: DataTypes.STRING(32),
deliverName: DataTypes.STRING(50),
deliverDivide: DataTypes.BIGINT,
auditRemark: DataTypes.STRING,
content: DataTypes.STRING,
addressee: DataTypes.STRING,
mobile: DataTypes.STRING,
addr: DataTypes.STRING,
auditUser: DataTypes.STRING,
auditResult: DataTypes.STRING,
breakReason: DataTypes.STRING(300),
}, {
paranoid: true, //假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'ib_order_deliver',
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}]
// }
]
});
}
\ No newline at end of file
const system = require("../../system");
const uuidv4 = require('uuid/v4');
const md5 = require("MD5");
const settings = require("../../../config/settings");
class MicrosveClient {
constructor() {
this.logCtl = system.getObject("web.common.oplogCtl");
this.restClient = system.getObject("util.restClient");
this.micro = system.microsetting();
}
async call(sveName, apiName, params) {
var errorMsg;
var reqUrl = this.micro[sveName];
if(!reqUrl) {
return system.getResult(null, "未找到【" + sveName + "】服务,请检查settings文件是否存在");
}
if(!apiName) {
return system.getResult(null, "apiName不能为空");
}
try {
var params = {
"action_process": "xgg-sve-order",
"action_type": apiName,
"action_body": params || {},
}
var rs = await this.restClient.execPost(params, reqUrl);
if (rs && rs.stdout) {
return JSON.parse(rs.stdout);
}
return system.getResult(null, rs);
} catch (error) {
console.log(error)
this.logCtl.error({
optitle: "微服务请求失败",
op: "sveName = " + sveName + "; apiName = " + apiName,
content: "params = " + JSON.stringify(params),
clientIp: ""
});
return system.getResult(null, error.message);
}
}
}
module.exports = MicrosveClient;
node_modules/
\ No newline at end of file
var APIBase = require("../../api.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
class ActionAPI extends APIBase {
constructor() {
super();
}
/**
* 接口跳转
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springboard(pobj, qobj, req) {
var result;
if (!pobj.action_process) {
return system.getResult(null, "action_process参数不能为空");
}
if (!pobj.action_type) {
return system.getResult(null, "action_type参数不能为空");
}
console.log(pobj.action_process, pobj.action_type, pobj.action_body, "---------------- this is order micro sve --------------------");
try {
result = await this.handleRequest(pobj.action_process, pobj.action_type, pobj.action_body);
} catch (error) {
console.log(error);
}
return result;
}
async handleRequest(action_process, action_type, action_body) {
var opResult = null;
switch (action_type) {
// 订单
case "addOrder":
break;
}
return opResult;
}
exam() {
return `<pre><pre/>`;
}
classDesc() {
return {
groupName: "op",
groupDesc: "元数据服务包",
name: "ActionAPI",
desc: "此类是对外提供接口服务",
exam: "",
};
}
methodDescs() {
return [{
methodDesc: `<pre><pre/>`,
methodName: "springboard",
paramdescs: [{
paramDesc: "请求的行为,传递如:sjb",
paramName: "action_process",
paramType: "string",
defaultValue: null,
},
{
paramDesc: "业务操作类型,详情见方法中的描述",
paramName: "action_type",
paramType: "string",
defaultValue: null,
},
{
paramDesc: "业务操作类型的参数,action_body必须传递的参数有,times_tamp(时间戳,类型int)、sign(签名,类型string),其余的为业务需要的参数",
paramName: "action_body",
paramType: "json",
defaultValue: null,
}
],
rtnTypeDesc: `<pre><pre/>`,
rtnType: `<pre><pre/>`
}];
}
}
module.exports = ActionAPI;
\ No newline at end of file
......@@ -3,47 +3,6 @@ const Dao = require("../../dao.base");
class IborderDao extends Dao {
constructor() {
super(Dao.getModelName(IborderDao));
this.statusMap = {
"1000": "未付款",
"1010": "订单关闭",
"1020": "待分配",
"1030": "待处理",
"1040": "交付商关闭",
"1050": "执照办理中",
"1060": "已出执照",
"1070": "刻章办理中",
"1080": "已刻章",
"1090": "银行开户中",
"1100": "银行卡已开户",
"1110": "税务报道中",
"1120": "已税务报道",
"1130": "待审核",
"1140": "审核失败",
"1150": "审核通过",
"1160": "已邮寄",
"1170": "已完成",
};
this.ostatusMap = {
"1000": "未付款",
"1010": "订单关闭",
"1030": "待处理",
"1050": "执照办理中",
"1060": "已出执照",
"1070": "刻章办理中",
"1080": "已刻章",
"1090": "银行开户中",
"1100": "银行卡已开户",
"1110": "税务报道中",
"1120": "已税务报道",
"1170": "已完成",
};
this.deliverTypeMap = {
"10": "交付商交付",
"20": "平台交付",
"30": "平台保存无需交付",
}
}
async statOrderByTime(begin, end) {
......
const system = require("../../../system");
const ServiceBase = require("../../sve.base")
const settings = require("../../../../config/settings")
class BusinessmencontractService extends ServiceBase {
const moment = require("moment");
class IborderService extends ServiceBase {
constructor() {
super("business", ServiceBase.getDaoName(BusinessmencontractService));
super("order", ServiceBase.getDaoName(IborderService));
}
async api(params) {
try {
return await this.xxx(params);
return await this.m(params);
} catch (error) {
console.log(error);
return system.getResult(null, "接口异常");
}
}
async apiAdd(params) {
try {
return await this.apiSave(params);
} catch (error) {
console.log(error);
return system.getResult(null, "接口异常");
}
}
// -----------------------以此间隔,上面为API,下面为service---------------------------------
async add(params) {
return system.getResultSuccess();
}
async method(params) {
return system.getResultSuccess();
}
async m(params) {}
}
module.exports = BusinessmencontractService;
module.exports = IborderService;
// var task=new UserService();
// task.getUserStatisticGroupByApp().then(function(result){
// console.log((result));
......
......@@ -6,13 +6,13 @@ var settings={
db:10,
},
database:{
dbname : "xgg-order",
user: "write",
password: "write",
config: {
dbname : "xgg-uc",
user: "root",
password: "root",
config: {
// host: '43.247.184.35',
// port: 8899,
host: '192.168.18.237',
host: '192.168.18.110',
port: 3306,
dialect: 'mysql',
......
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