Commit 59339dd2 by 王栋源

wdy

parents 571eea34 0ce71e28
......@@ -60,7 +60,8 @@ class APIBase {
var fullname = gname + "." + methodname;
var lst = [
"test.test",
"auth.getToken"
"auth.getToken",
"auth.getJdSign"
];
var x = lst.indexOf(fullname);
return x >= 0;
......
......@@ -48,6 +48,15 @@ class ReceiveDataAPI extends APIBase {
// action_body.user = req.user;
// action_body.app = { id: 1, appPayType: "00", appDataOpType: "00" };
// action_body.user = { id: 1, app_id: 1, nickname: "测试用户",channelUserId:"channelUserIdtest01" };
var logParam = {
appid: req.app.id,
appkey: req.app.uappKey,
requestId: req.requestId || "",
op: "/igirl-channel/zhichan/igirl-channel/app/base/api/impl/action/receiveData.js/opActionProcess",
content: "参数信息:" + JSON.stringify(action_body),
clientIp: pobj.clientIp,
optitle: "接收推送过来的数据处理=>action_type=" + action_type,
};
var opResult = null;
switch (action_type) {
// sy
......@@ -71,6 +80,8 @@ class ReceiveDataAPI extends APIBase {
opResult = system.getResult(null, "action_type参数错误");
break;
}
logParam.resultInfo = JSON.stringify(opResult);
this.logCtl.info(logParam);
return opResult;
}
......
......@@ -14,6 +14,7 @@ class TmOrderAPI extends APIBase {
this.pushFqbossDataUrl = settings.pushFqbossDataUrl();
this.pushlogSve = system.getObject("service.common.pushlogSve");
this.toolSve = system.getObject("service.trademark.toolSve");
this.appProductSve = system.getObject("service.dbapp.appproductSve");
}
/**
* 接口跳转-POST请求
......@@ -174,6 +175,15 @@ class TmOrderAPI extends APIBase {
case "pushFqBusiness"://推送商机到峰擎
opResult = await this.orderSve.pushFqBusiness(action_body, pobj, req);
break;
case "getProductDetail"://根据渠道产品码获取产品详情
opResult = await this.appProductSve.findByChannelItemCode(action_body);
break;
case "getProductListByTypeOneCode"://获取产品列表(根据产品一类编码获取)
opResult = await this.appProductSve.findByProductOneTypeCode(action_body);
break;
case "getProductListByTypeCode"://获取产品列表(根据父类产品编码获取)
opResult = await this.appProductSve.findByProductTypeCode(action_body);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -3,9 +3,9 @@ var system = require("../../../system");
class TmQueryAPI extends APIBase {
constructor() {
super();
this.tmqueryApi = system.getObject("api.trademark.tmqueryApi");
// this.tmqueryApi = system.getObject("api.trademark.tmqueryApi");
this.tmquerySve = system.getObject("service.trademark.tmquerySve");
this.toolApi = system.getObject("api.tool.toolApi");
// this.toolApi = system.getObject("api.tool.toolApi");
this.toolSve = system.getObject("service.trademark.toolSve");
}
/**
......@@ -99,6 +99,9 @@ class TmQueryAPI extends APIBase {
// opResult = await this.toolApi.bycznfx(action_body);
opResult = system.getResultSuccess(null, "商标方案确认成功");
break;
case "icheming"://商标智能分析 -----
opResult = await this.toolSve.icheming(action_body, req);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
var APIBase = require("../../api.base");
var system = require("../../../system");
const { Signer, Context } = require('jdcloud-sdk-signer')
class jdAuthAPI extends APIBase {
constructor() {
super();
}
async getUser(pobj, qobj, req) {
console.log(pobj, "pobj...................................jd............");
console.log(qobj, "qobj...................................jd............");
return {tm:"ok"};
console.log("pobj......getUser..........:\n", pobj);
console.log("qobj......getUser..........:\n", qobj);
return { getUser: "ok" };
}
async payOrderInfo(pobj, qobj, req) {
console.log("pobj......payOrderInfo..........:\n", pobj);
console.log("qobj......payOrderInfo..........:\n", qobj);
return { payOrderInfo: "ok" };
}
async getJdSign(pobj, qobj, req) {
try {
let ctx = new Context('x3k0s704lfun-test.cn-north-1.jdcloud-api.net', '/market/order/order-inner/submit', 'POST', null, 'empty');
ctx.regionId = 'cn-north-1'
ctx.headers.set('content-type', 'text/plain')
let credentials = {
accessKeyId: 'C6D680733C19362B5DF478207D6A90A4', //替换自己的AK
secretAccessKey: 'EB9AFEE49CE41700CADD5F2EE3B2122C' //替换自己的SK--jd>>>>>>>
}
//测试报文:
//GET
// ctx.body = "pin=jcloud_pRiHQTd&serviceId=580010&itemCode=FW_GOODS-580010-1&platform=6"
//POST
var qs = require('querystring');
var post_data = { pin="jcloud_pRiHQTd", serviceId=580010, itemCode="FW_GOODS-580010-1", platform=6 };//这是需要提交的数据
var tmpContent = JSON.stringify(post_data);
var content = qs.stringify(post_data);
ctx.body = content;
ctx.method = 'POST'
var signer = new Signer(ctx, credentials)
var dd = new Date()
ctx.headers.set('Content-Length', ctx.body.length)
ctx.buildNonce()
var auth = signer.sign(dd);
console.log("POST签名为:", auth)
ctx.headers.set('Authorization', auth)
////////////////////////////////////////////////////////////////////////////////////////////////////////////
var http = require('https');
// var content = ctx.body;
var options = {
host: 'x3k0s704lfun-test.cn-north-1.jdcloud-api.net',
port: 443,
path: '/market/order/order-inner/submit',
method: 'POST',
headers: {
}
};
for (let [key, value] of ctx.headers) {
options.headers[key] = value
}
console.log("post options:\n", options);
//console.log("content:",content);
//console.log("\n");
var req = http.request(options, function (res) {
console.log("--jd>>>>>>>>>>>>>statusCode: ", res.statusCode);
console.log("--jd>>>>>>>>>>>>>headers: ", res.headers);
var _data = '';
res.on('data', function (chunk) {
_data += chunk;
});
res.on('end', function () {
console.log("\n---jd>>>>>>>>>>>>>.>>\nresult:", _data)
});
});
req.on('error', (e) => {
console.error(`--jd>>>>>>>>>>>>>请求遇到问题: ${e.message}`);
});
req.write(content);
req.end();
} catch (errorMsg) {
console.log(errorMsg, "--jd>>>>>>>errorMsg..............................>>>>>>");
}
}
}
......
......@@ -4,6 +4,33 @@ class AppProductDao extends Dao {
constructor() {
super(Dao.getModelName(AppProductDao));
}
async findOneByServiceItemCode(itemCode, appId) {
return this.model.findOne({
where: {
serviceItemCode: itemCode,
app_id: appId
},
attributes: ["id",
"app_id", // 应用id
"itemCode", // 产品编码
"itemName", // 产品名称
"picUrl", // 产品图片地址
"channelItemCode", // 渠道产品编码
"channelItemName", // 渠道产品名称
"status", // 状态 0禁用 1启用
"verifyPrice", // 是否验证价格 0不验证 1验证
"proPrice", // 产品价格
"serviceCharge", // 服务费
"publicExpense", // 官费
"rateConfig", // 税率
"discountsRateConfig",// 优惠税率
"channelProfitRate",// 渠道利润分成比率(只分订单中毛利润总额的分成)
"sort",
"productType_id",
"productOneType_id"],
raw: true
});
}
async findOneByCode(itemCode, appId) {
return this.model.findOne({
where: {
......
......@@ -114,38 +114,6 @@ class OrderDao extends Dao {
"appPayType",
"payTime",
"itemCode",
"itemName"
],
raw: true
});
}
async getItemByChannelServiceNo(channelServiceNo, appId) {//通过订单号查询订单
return this.model.findOne({
where: {
channelServiceNo: channelServiceNo,
app_id: appId
},
attributes: ["id",
"orderNo",
"channelUserId",
"channelServiceNo",
"channelOrderNo",
"needNo",
"invoiceApplyStatus",
"orderType",
"salesNum",
"salesDiliverNum",
"minitermNum",
"minitermDiliverNum",
"orderPayStatus",
"notes",
"totalServiceCharge",
"totalPublicExpense",
"totalTaxes",
"totalSum",
"appPayType",
"payTime",
"itemCode",
"itemName",
"buyerMoblie"
],
......
......@@ -10,6 +10,7 @@ class OrderFlowDao extends Dao {
sourceOrderNo: sourceOrderNo,
isShow: 1
},
order:[["created_at", 'desc']],
raw: true
});
}
......
......@@ -34,7 +34,7 @@ module.exports = {
//订单服务付款状态
"order_service_pay_status": { "dfk": "待付款", "yfk": "已付款" },
//商标交付状态
"delivery_status": {"dqrfa":"待确认方案", "dsccl": "待上传材料", "dsh": "待审核", "ddj": "待递交", "ydj": "已递交", "ywc": "已完成" },
"delivery_status": { "dqrfa": "待确认方案", "fabtg": "方案不通过", "dsccl": "待上传材料", "dsh": "待审核", "ddj": "待递交", "ydj": "已递交", "ywc": "已完成" },
//商标类型
"tm_type": { "p": "普通商标", "j": "集体商标", "z": "证明商标", "t": "特殊商标" },
//商标类型形式
......@@ -50,14 +50,14 @@ module.exports = {
"1": "商标注册申请书", "2": "商标注册申请补正通知书", "3": "商标注册申请受理通知书", "4": "商标注册申请不予受理通知书", "5": "商标注册同日申请补送使用证据通知书",
"6": "商标注册同日申请协商通知书商标注册同日申请抽签通知书", "7": "商标驳回通知书", "8": "商标部分驳回通知书", "9": "商标注册申请初步审定公告通知书",
"10": "商标异议答辩通知书", "11": "异议裁定书", "12": "纸质版商标注册证", "13": "电子版商标注册证",
"dsccl": "待上传材料", "dsh": "待审核", "shbtg": "审核不通过", "ddj": "待递交", "ydj": "已递交", "djyc": "递交异常"
"dsccl": "待上传材料", "dqrfa": "待确认方案", "fabtg": "方案不通过", "dsh": "待审核", "shbtg": "审核不通过", "ddj": "待递交", "ydj": "已递交", "djyc": "递交异常"
},
//申请企业类型
"customer_type": { "ent": "企业", "person": "个人" },
//附件类型
"stuff_type": { "csty": "彩色图样", "wts": "委托书", "gzwts": "盖章委托书", "ty": "图样", "sywj": "声音文件", "smwj": "说明文件" },
//来源类型
"source_type": { "order": "订单", "expensevoucher": "费用单", "receiptvoucher": "收款单", "refundvoucher": "退款单", "trademark": "商标单" },
"source_type": { "childorders": "子订单", "expensevoucher": "费用单" },
//审核状态
"audit_status": { "dsh": "待审核", "btg": "不通过", "tg": "通过" },
//收款类型
......@@ -65,10 +65,10 @@ module.exports = {
//退款类型
"refund_type": { "tk": "退款", "ptdtk": "平台代退款" },
//费用类型
"expense_type": { "gf": "官费", "sxf": "手续费", "tax": "税金", "salary": "薪酬", "sale": "销售费用", "mag": "管理费用", "channelSettleProfit": "订单渠道分润结算" },
"expense_type": { "gf": "官费", "tax": "税金", "channelSettleProfit": "订单渠道分润结算" },
//凭单类型
"direction_type": { "sr": "收", "zc": "支" },
"push_return_type":{"0":"推送失败","1":"推送成功"},
"push_return_type": { "0": "推送失败", "1": "推送成功" },
},
}
}
\ No newline at end of file
......@@ -8,7 +8,8 @@ module.exports = (db, DataTypes) => {
itemName :DataTypes.STRING(100),// 产品名称
picUrl :DataTypes.STRING(500),// 产品图片地址
channelItemCode :DataTypes.STRING(100),// 渠道产品编码
channelItemName :DataTypes.STRING(100),// 渠道产品名称
channelItemName :DataTypes.STRING(100),// 渠道产品名称
serviceItemCode :DataTypes.STRING(100),// 服务商产品编码
status :DataTypes.BOOLEAN,// 状态 0禁用 1启用
verifyPrice :DataTypes.BOOLEAN,// 是否验证价格 0不验证 1验证
proPrice :DataTypes.DOUBLE,// 产品价格
......
const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("childorders", {
uapp_id :DataTypes.INTEGER,//
sourceOrderNo: DataTypes.STRING(64), // 来源单号
childOrderNo :DataTypes.STRING(64),// 子订单号
appPayType :{
type: DataTypes.ENUM,
values: Object.keys(uiconfig.config.pdict.app_pay_type),
},// 支付类型:00第三方支付,10平台代收款
totalServiceCharge :DataTypes.DECIMAL(12, 2),// 服务费总额(产品配置的服务费*订单件数)
totalPublicExpense :DataTypes.DECIMAL(12, 2),// 官费总额(产品配置的官费*订单件数)
totalTaxes :DataTypes.DECIMAL(12, 2),// 税费总额(订单总额-(订单总额/(1+产品费率)))
totalSum :DataTypes.DECIMAL(12, 2),// 订单总额(产品价格×优惠费率×订单件数)
refundSum :DataTypes.DECIMAL(12, 2),// 退款金额
totalProfitSum :DataTypes.DECIMAL(12, 2),// 订单毛利润总额(订单总额-官费总额)
totalDiscounts :DataTypes.DECIMAL(12, 2),// 优惠总额((服务费总额+官费总额)-订单总额(产品价格×优惠费率×订单件数)>0则有优惠额度)
pfProfitSum :DataTypes.DECIMAL(12, 2),// 订单平台毛利润总额(订单毛利润总额-订单渠道分成毛利润总额)
channelProfitSum :DataTypes.DECIMAL(12, 2),// 订单渠道分成毛利润总额((订单总额-官费总额)*渠道利润分成比率)
pfSettleProfit :DataTypes.INTEGER,// 平台结算渠道利润,0否,1是
invoiceApplyStatus :DataTypes.STRING(10),// 发票状态:00: 未申请, 10: 已申请,20:已开票
opPayType :DataTypes.STRING(10),// 操作付款类型:00: 收款, 10: 退款
accountType: {
//帐户类型( 支付类型):"cash": "现金", "bank": "银行" ,"wx":"微信","alipay":"支付宝","other":"其它"
type: DataTypes.ENUM,
values: Object.keys(uiconfig.config.pdict.pay_account_type),
set: function (val) {
this.setDataValue("accountType", val);
this.setDataValue("accountTypeName", uiconfig.config.pdict.pay_account_type[val]);
}
},
accountTypeName: {//帐户类型名称
type: DataTypes.STRING,
},
certifyFileUrl: DataTypes.STRING(500), //支付证明文件Url
wxPayOrderCode: DataTypes.STRING(50),//业务微信支付订单号
aliPayOrderCode: DataTypes.STRING(50),//业务支付宝支付订单号
busPayOrderCode: DataTypes.STRING(50),//业务支付订单号
auditStatusName: {
type: DataTypes.STRING(50),
defaultValue: "待审核",
},
auditStatus: {//审核状态"dsh": "待审核", "btg": "不通过", "tg": "通过"
type: DataTypes.ENUM,
values: Object.keys(uiconfig.config.pdict.audit_status),
set: function (val) {
this.setDataValue("auditStatus", val);
this.setDataValue("auditStatusName", uiconfig.config.pdict.audit_status[val]);
},
defaultValue: "dsh",
},
notes :DataTypes.STRING,// 备注
}, {
paranoid: true,//假的删除
underscored: true,
version: true,
freezeTableName: true,
timestamps: true,
updatedAt: false,
//freezeTableName: true,
// define the table's name
tableName: 'c_child_orders',
validate: {
},
indexes: [
]
});
}
const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("flowlog", {
uapp_id: DataTypes.INTEGER, //
sourceOrderNo: DataTypes.STRING(64), // 来源单号
opContent: DataTypes.STRING(1024), // 操作描述
notes: DataTypes.STRING, // 备注
isShow: {//是否显示
type: DataTypes.BOOLEAN,
defaultValue: false,
},
}, {
paranoid: true,//假的删除
underscored: true,
version: true,
freezeTableName: true,
timestamps: true,
updatedAt: false,
//freezeTableName: true,
// define the table's name
tableName: 'c_flow_log',
validate: {
},
indexes: [
]
});
}
const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("ordercontacts", {
uapp_id :DataTypes.INTEGER, //
sourceOrderNo :DataTypes.STRING(64),//来源单号
contactName :DataTypes.STRING(1000), // 联系人
mobile :DataTypes.STRING(20), //
email :DataTypes.STRING(50), //
tel :DataTypes.STRING(20), //
fax :DataTypes.STRING(50), //
}, {
paranoid: true,//假的删除
underscored: true,
version: true,
freezeTableName: true,
timestamps: true,
updatedAt: false,
//freezeTableName: true,
// define the table's name
tableName: 'c_order_contacts',
validate: {
},
indexes: [
]
});
}
const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("orderinfo", {
uapp_id :DataTypes.INTEGER,//
orderNo :DataTypes.STRING(64),// 订单号
channelServiceNo :DataTypes.STRING(64),// 渠道服务单号
channelOrderNo :DataTypes.STRING(1024),// 渠道订单号列表,多个以,隔开
channelUserId :DataTypes.STRING(64), // 渠道用户ID
ownerUserId :DataTypes.STRING(20),// 拥有渠道用户ID
needNo :DataTypes.STRING(64), // 需求单号
payTime :DataTypes.DATE,// 渠道有支付时间则用渠道的支付时间
salesNum :DataTypes.INTEGER,// 项目订单数量(即服务项目的倍数,默认值为1)
salesDiliverNum :DataTypes.INTEGER,// 项目订单交付数量(即与项目订单数量相对应)
minitermNum :DataTypes.INTEGER,// 订单小项数量
minitermDiliverNum :DataTypes.INTEGER,// 订单小项交付数量
orderPayStatusName: DataTypes.STRING(50),//
orderPayStatus :{
type: DataTypes.ENUM,
values: Object.keys(uiconfig.config.pdict.order_pay_status),
set: function (val) {
this.setDataValue("orderPayStatus", val);
this.setDataValue("orderPayStatusName", uiconfig.config.pdict.order_pay_status[val]);
}
},// 订单付款状态dfk: 待付款, zfpz: 已上传支付凭证, yfk: 已付款, ddqx: 订单取消, tkclz: 退款处理中, bfytk: 部分已退款, ytk: 已退款,zfshbtg:支付审核不通过
totalSum :DataTypes.DECIMAL(12, 2),// 订单总额(产品价格×优惠费率×订单件数)
refundSum :DataTypes.DECIMAL(12, 2),// 退款金额
opNotes :DataTypes.STRING,// 备注
notes :DataTypes.STRING,// 备注
}, {
paranoid: true,//假的删除
underscored: true,
version: true,
freezeTableName: true,
timestamps: true,
updatedAt: false,
//freezeTableName: true,
// define the table's name
tableName: 'c_order_info',
validate: {
},
indexes: [
]
});
}
const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("orderproduct", {
uapp_id: DataTypes.INTEGER,//
sourceOrderNo :DataTypes.STRING(64),//来源单号
productType_id :DataTypes.INTEGER,//产品类型Id
productOneType_id :DataTypes.INTEGER,//产品大类Id
itemCode :DataTypes.STRING(64),//产品编码
itemName :DataTypes.STRING(100),//产品名称
channelItemCode :DataTypes.STRING(100),// 渠道产品编码
channelItemName :DataTypes.STRING(100),// 渠道产品名称
serviceItemCode :DataTypes.STRING(100),// 服务商产品编码
picUrl :DataTypes.STRING(500),// 产品图片地址
proPrice :DataTypes.DOUBLE, // 产品价格
serviceItemSnapshot :DataTypes.TEXT, //产品快照
}, {
paranoid: true,//假的删除
underscored: true,
version: true,
freezeTableName: true,
timestamps: true,
updatedAt: false,
//freezeTableName: true,
// define the table's name
tableName: 'c_order_product',
validate: {
},
indexes: [
]
});
}
const system = require("../../system");
const settings = require("../../../config/settings");
const uiconfig = system.getUiConfig2(settings.wxconfig.appId);
module.exports = (db, DataTypes) => {//费用单:
return db.define("expensevoucher", {
uapp_id: DataTypes.INTEGER, //
sourceOrderNo: DataTypes.STRING(64), // 来源单号
childOrderNo: DataTypes.STRING(64),// 子订单号
expenseTypeName: DataTypes.STRING,
expenseType: {//收款类型,gf: 官费, tax: 税金, channelSettleProfit: 订单渠道分润结算
type: DataTypes.ENUM,
values: Object.keys(uiconfig.config.pdict.expense_type),
set: function (val) {
this.setDataValue("expenseType", val);
this.setDataValue("expenseTypeName", uiconfig.config.pdict.expense_type[val]);
}
},
totalSum: DataTypes.DECIMAL(12, 3),//总额
notes: DataTypes.STRING,//备注
}, {
paranoid: true,//假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'biz_expensevoucher',
validate: {
}
});
}
const system = require("../../system");
const settings = require("../../../config/settings");
const uiconfig = system.getUiConfig2(settings.wxconfig.appId);
module.exports = (db, DataTypes) => {
return db.define("moneyjourney", {
uapp_id: DataTypes.INTEGER, //
sourceOrderNo: DataTypes.STRING(64), // 来源单号
childOrderNo: DataTypes.STRING(64),// 子订单号
channelUserId: DataTypes.STRING(64), // 渠道用户ID
ownerUserId: DataTypes.STRING(20),// 拥有渠道用户ID
accountType: {
//帐户类型( 支付类型):"cash": "现金", "bank": "银行" ,"wx":"微信","alipay":"支付宝","other":"其它"
type: DataTypes.ENUM,
values: Object.keys(uiconfig.config.pdict.pay_account_type),
set: function (val) {
this.setDataValue("accountType", val);
this.setDataValue("accountTypeName", uiconfig.config.pdict.pay_account_type[val]);
}
},
accountTypeName: {//帐户类型名称
type: DataTypes.STRING,
},
directionTypeName: DataTypes.STRING,
directionType: {//凭单类型,"sr": "收","zc": "支"
type: DataTypes.STRING,
},
voucherDate: DataTypes.DATE,//凭单时间
recvAmount: DataTypes.DECIMAL(12, 3),//收总额
payAmount: DataTypes.DECIMAL(12, 3),//支总额
sourceTypeName: DataTypes.STRING,
sourceType: {//来源类型 "childorders": "子订单","expensevoucher": "费用单"
type: DataTypes.ENUM,
values: Object.keys(uiconfig.config.pdict.source_type),
set: function (val) {
this.setDataValue("sourceType", val);
this.setDataValue("sourceTypeName", uiconfig.config.pdict.source_type[val]);
}
},
notes: DataTypes.STRING,//备注
opNotes: DataTypes.STRING,//操作备注
}, {
paranoid: true,//假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'biz_moneyjourney',
validate: {
}
});
}
const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("orderreceiptvoucher", {//收款单:
uapp_id: DataTypes.INTEGER, //
sourceOrderNo: DataTypes.STRING(64), // 来源单号
childOrderNo :DataTypes.STRING(64),// 子订单号
busPayOrderCode: DataTypes.STRING(100),//业务支付订单号
accountType: {
//帐户类型( 支付类型):"cash": "现金", "bank": "银行" ,"wx":"微信","alipay":"支付宝","other":"其它"
type: DataTypes.ENUM,
values: Object.keys(uiconfig.config.pdict.pay_account_type),
set: function (val) {
this.setDataValue("accountType", val);
this.setDataValue("accountTypeName", uiconfig.config.pdict.pay_account_type[val]);
}
},
accountTypeName: {//帐户类型名称
type: DataTypes.STRING,
},
payDate: DataTypes.DATE,//支付时间
totalSum: DataTypes.DECIMAL(12, 3),//订单总额(平台费用+服务费+官费+发票税费+个人利润+平台利润)
certifyFileUrl: DataTypes.STRING(500), //证明文件Url
payOrderNo: DataTypes.STRING, //支付凭证流水单号,如:微信支付凭证单号
buyerOpenId: DataTypes.STRING,//用户在支付商户appid下的唯一标识或买家在支付宝的用户id
passTradeNo: DataTypes.STRING,//通道的统一订单号
buyerAliLogonId: DataTypes.STRING,//买家支付宝账号
notes: DataTypes.STRING,//备注
opNotes: DataTypes.STRING,//操作备注
}, {
paranoid: true,//假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'c_order_receiptvoucher',
validate: {
}
});
}
const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("orderrefundvoucher", {//退款单:
uapp_id: DataTypes.INTEGER, //
sourceOrderNo: DataTypes.STRING(64), // 来源单号
childOrderNo :DataTypes.STRING(64),// 子订单号
busPayOrderCode: DataTypes.STRING(100),//业务支付订单号
accountType: {
//帐户类型( 支付类型):"cash": "现金", "bank": "银行" ,"wx":"微信","alipay":"支付宝","other":"其它"
type: DataTypes.ENUM,
values: Object.keys(uiconfig.config.pdict.pay_account_type),
set: function (val) {
this.setDataValue("accountType", val);
this.setDataValue("accountTypeName", uiconfig.config.pdict.pay_account_type[val]);
}
},
accountTypeName: {//帐户类型名称
type: DataTypes.STRING,
},
payDate: DataTypes.DATE,//支付时间
totalSum: DataTypes.DECIMAL(12, 3),//订单总额(平台费用+服务费+官费+发票税费+个人利润+平台利润)
certifyFileUrl: DataTypes.STRING(500), //证明文件Url
payOrderNo: DataTypes.STRING, //支付凭证流水单号,如:微信支付凭证单号
buyerOpenId: DataTypes.STRING,//用户在支付商户appid下的唯一标识或买家在支付宝的用户id
passTradeNo: DataTypes.STRING,//通道的统一订单号
buyerAliLogonId: DataTypes.STRING,//买家支付宝账号
notes: DataTypes.STRING,//备注
opNotes: DataTypes.STRING,//操作备注
}, {
paranoid: true,//假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'c_order_refundvoucher',
validate: {
}
});
}
......@@ -6,5 +6,90 @@ class AppProductService extends ServiceBase {
constructor() {
super("dbapp", ServiceBase.getDaoName(AppProductService));
}
//根据渠道产品码获取产品详情
async findByChannelItemCode(obj){
// var user = obj.user;
var app = obj.app;
// if(!user){
// return system.getResultFail(-101, "未知用户");
// }
if(!app){
return system.getResultFail(-102, "未知渠道");
}
var channelItemCode = obj.channelItemCode;
if(!channelItemCode){
return system.getResultFail(-103, "渠道产品编码不能为空");
}
var product = await this.dao.model.findOne({
where:{channelItemCode:channelItemCode,app_id:app.id,status:1},
attributes:["id","app_id","itemCode","itemName","picUrl","channelItemCode","channelItemName",
"serviceItemCode","proPrice","serviceCharge","publicExpense","rateConfig","discountsRateConfig"],
raw:true
});
if(!product){
return system.getResultFail(-104, "未知产品");
}
return system.getResultSuccess(product);
}
//获取产品列表(根据父类产品编码获取)
async findByProductTypeCode(obj){
// var user = obj.user;
var app = obj.app;
// if(!user){
// return system.getResultFail(-101, "未知用户");
// }
if(!app){
return system.getResultFail(-102, "未知渠道");
}
var itemCode = obj.itemCode;
if(!itemCode){
return system.getResultFail(-103, "渠道产品编码不能为空");
}
var pProduct = await this.dao.model.findOne({
where:{itemCode:itemCode,app_id:app.id,status:1},
attributes:["id","app_id","itemCode","itemName"],
raw:true
});
if(!pProduct || !pProduct.id){
return system.getResultFail(-104, "未知产品");
}
var pList = await this.dao.model.findAll({
where:{productType_id:pProduct.id,app_id:app.id,status:1},
attributes:["id","app_id","itemCode","itemName","picUrl","channelItemCode","channelItemName",
"serviceItemCode","proPrice","serviceCharge","publicExpense","rateConfig","discountsRateConfig"],
raw:true
});
return system.getResultSuccess(pList);
}
//获取产品列表(根据产品一类编码获取)
async findByProductOneTypeCode(obj){
// var user = obj.user;
var app = obj.app;
// if(!user){
// return system.getResultFail(-101, "未知用户");
// }
if(!app){
return system.getResultFail(-102, "未知渠道");
}
var itemCode = obj.itemCode;
if(!itemCode){
return system.getResultFail(-103, "渠道产品编码不能为空");
}
var pProduct = await this.dao.model.findOne({
where:{itemCode:itemCode,app_id:app.id,status:1},
attributes:["id","app_id","itemCode","itemName"],
raw:true
});
if(!pProduct || !pProduct.id){
return system.getResultFail(-104, "未知产品");
}
var pList = await this.dao.model.findAll({
where:{productOneType_id:pProduct.id,productType_id:{ [this.db.Op.ne]: 0 },app_id:app.id,status:1},
attributes:["id","app_id","itemCode","itemName","picUrl","channelItemCode","channelItemName",
"serviceItemCode","proPrice","serviceCharge","publicExpense","rateConfig","discountsRateConfig"],
raw:true
});
return system.getResultSuccess(pList);
}
}
module.exports = AppProductService;
......@@ -97,9 +97,11 @@ class CustomerInfoService extends ServiceBase {
},
raw:true
});
if(ordertmproduct.gzwtsUrl && customerinfo2.businessLicensePdf && customerinfo2.identityCardPdf){
if(ordertmproduct.gzwtsUrl && customerinfo2.businessLicensePdf && (customerinfo2.customerType=="ent" || customerinfo2.identityCardPdf)){
// otpObj["deliveryStatus"]="dsh";
await self.ordertmproductSve.update({id:ordertmproduct.id,deliveryStatus:"dsh"},t);
if(ordertmproduct.deliveryStatus=="dsccl"){
await self.ordertmproductSve.update({id:ordertmproduct.id,deliveryStatus:"dsh"},t);
}
await self.trademarkDao.model.update({officialType:"dsh"},{where:{deliveryOrderNo:deliveryOrderNo},transaction:t});
}
return system.getResultSuccess();
......@@ -186,8 +188,10 @@ class CustomerInfoService extends ServiceBase {
if(obj.smwjUrl){
otpObj["smwjUrl"]=obj.smwjUrl;
}
if((ordertmproduct.gzwtsUrl || otpObj["gzwtsUrl"]) && customerinfo2.businessLicensePdf && customerinfo2.identityCardPdf){
otpObj["deliveryStatus"]="dsh";
if((ordertmproduct.gzwtsUrl || otpObj["gzwtsUrl"]) && customerinfo2.businessLicensePdf && (customerinfo2.customerType=="ent" || customerinfo2.identityCardPdf)){
if(ordertmproduct.deliveryStatus=="dsccl"){
otpObj["deliveryStatus"]="dsh";
}
await self.trademarkDao.model.update({officialType:"dsh"},{where:{deliveryOrderNo:deliveryOrderNo},transaction:t});
}
......
......@@ -49,7 +49,7 @@ class OrderService extends ServiceBase {
async op1688ChannelPushOrderTest(action_body, pobj, req) {
try {
var returnValue = [
var returnValue = [
{
"bizStatusExt": "service",
"memberId": "b2b-****02",
......@@ -448,29 +448,27 @@ class OrderService extends ServiceBase {
serviceItemSnapshot: JSON.stringify(productItem),//产品快照
};
var orderItem = await self.dao.create(orderParams, t);//创建订单
var receiptvoucherItem = await self.receiptvoucherDao.addReceiptvoucher(orderParams, req, t);//创建订单支付信息
if (productItem.itemCode == "zzsbzc") {
var orderProductObj = {
app_id: req.app.id,//
productType_id: productItem.productType_id,//产品类型Id
productOneType_id: productItem.productOneType_id,//产品大类Id
itemCode: productItem.itemCode,//
itemName: productItem.itemName,//
orderServicePayStatus: "yfk",//支付状态:dfk: 待付款, yfk: 已支付
appDataOpType: req.app.appDataOpType,// 应用数据操作类型:00独立,10全委托,20部分委托
sourceOrderNo: ordercode,//来源单号
deliveryOrderNo: await self.getBusUid("jf"),
channelServiceNo: element.orderItemNum || null,// 渠道服务单号
needNo: element.orderItemNum || null,//需求单号
sourceType: "00",
channelUserId: req.user.channelUserId || "",// 渠道用户id
createuser_id: req.user.id,//
createuser: req.user.nickname,//
};
//创建服务单
var orderTm = await self.ordertmproductDao.create(orderProductObj, t);//创建商标订单
}
var orderProductObj = {
app_id: req.app.id,//
productType_id: productItem.productType_id,//产品类型Id
productOneType_id: productItem.productOneType_id,//产品大类Id
itemCode: productItem.itemCode,//
itemName: productItem.itemName,//
orderServicePayStatus: "yfk",//支付状态:dfk: 待付款, yfk: 已支付
appDataOpType: req.app.appDataOpType,// 应用数据操作类型:00独立,10全委托,20部分委托
sourceOrderNo: ordercode,//来源单号
deliveryOrderNo: await self.getBusUid("jf"),
channelServiceNo: element.orderItemNum || null,// 渠道服务单号
needNo: element.orderItemNum || null,//需求单号
sourceType: "00",
channelUserId: req.user.channelUserId || "",// 渠道用户id
createuser_id: req.user.id,//
createuser: req.user.nickname,//
};
//创建服务单
var orderTm = await self.ordertmproductDao.create(orderProductObj, t);//创建订单交付流程
});
}
}
......@@ -493,7 +491,7 @@ class OrderService extends ServiceBase {
var reqUrl = "https://yunfuapi.gongsibao.com/crm/order/submit";
try {
var body = {
idempotentId: item.orderNo,// 是 业务 ID
idempotentId: item.channelServiceNo,// 是 业务 ID
idempotentSource: req.app.appSourceCode ? "tm_" + req.app.appSourceCode : "tm_1688",// 是 业务来源(ali、jd)
idempotentSourceName: req.app.name || "1688应用",// 是 阿里,京东
city: "",// 否 所属城市
......@@ -501,7 +499,7 @@ class OrderService extends ServiceBase {
userId: item.channelUserId,// 否 用户 ID
companyName: "",// 否 公司名称
orderPrice: item.totalSum,// 是 订单金额
productId: "5dc936eb296d1572b9bc5b8d",// 是 产品 ID
productId: "5dd513db4f3b08000a6fc082",// 是 产品 ID
productQuantity: item.salesNum,// 是 产品数量
};
rtn = await rc.post(reqUrl, body);
......
......@@ -34,6 +34,24 @@ class OrderTmProductService extends ServiceBase {
if (!nclones || nclones.length < 1) {
return system.getResult(null, "尼斯大类不能为空");
}
if (nclones.length > 1) {
return system.getResult(null, "尼斯大类不能大于1个大类");
}
//判断尼斯小项的数量
var selectNclThreeCount = 0;
for (let index = 0; index < nclones.length; index++) {
const element = nclones[index];
var nclList = null;
if (typeof (element) == "string") {
nclList = JSON.parse(element);
} else {
nclList = element;
}
selectNclThreeCount = selectNclThreeCount + nclList.nclThree.length;
}
if (selectNclThreeCount > 10) {
return system.getResult(null, "尼斯小项数量不能大于10个小项数量,目前选择的小项数量为" + selectNclThreeCount);
}
if (!itemCode) {
return system.getResult(null, "itemCode参数错误");
}
......@@ -103,7 +121,7 @@ class OrderTmProductService extends ServiceBase {
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待上传材料" : "订单已创建待付款";
} else {
orderProductObj["deliveryStatus"] = "dsh";
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待审核" : "订单已创建待付款";
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待专家服务" : "订单已创建待付款";
}
}
if (apply.customerType == "ent") {
......@@ -112,7 +130,7 @@ class OrderTmProductService extends ServiceBase {
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待上传材料" : "订单已创建待付款";
} else {
orderProductObj["deliveryStatus"] = "dsh";
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待审核" : "订单已创建待付款";
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待专家服务" : "订单已创建待付款";
}
}
//订单客户档案添加和修改
......@@ -236,7 +254,7 @@ class OrderTmProductService extends ServiceBase {
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待上传材料" : "订单已创建待付款";
} else {
orderProductObj["deliveryStatus"] = "dsh";
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待审核" : "订单已创建待付款";
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款" : "订单已创建待付款";
}
}
if (apply.customerType == "ent") {
......@@ -245,7 +263,7 @@ class OrderTmProductService extends ServiceBase {
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待上传材料" : "订单已创建待付款";
} else {
orderProductObj["deliveryStatus"] = "dsh";
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待审核" : "订单已创建待付款";
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款" : "订单已创建待付款";
}
}
//订单客户档案添加和修改
......@@ -761,7 +779,7 @@ class OrderTmProductService extends ServiceBase {
return system.getResult(null, "itemCode参数错误");
}
// itemCode="zzsbzc";//测试
var productItem = await this.appproductDao.findOneByCode(itemCode, user.app_id);//获取产品
var productItem = await this.appproductDao.findOneByServiceItemCode(itemCode, user.app_id);//获取产品
if (!productItem) {
return system.getResult(null, "未知的产品");
}
......@@ -809,7 +827,7 @@ class OrderTmProductService extends ServiceBase {
tmFormType: tm.tmFormType,//商标类型形式:"1": "立体", "3": "字", "4": "图", "5": "字图", "6": "颜色", "7": "彩色"
nclOneCodes: tm.nclOneCodes ? tm.nclOneCodes.join(",") : null,//尼斯大类列表:格式以,隔开
orderServicePayStatus: channelOrder.payStatus,//支付状态:dfk: 待付款, yfk: 已支付
deliveryStatus: "dsccl",//商标交付状态:dsccl: 待上传材料, dsh: 待审核, ddj: 待递交, ywc: 已完成
deliveryStatus: "dqrfa",//商标交付状态:dsccl: 待上传材料, dsh: 待审核, ddj: 待递交, ywc: 已完成
appDataOpType: app.appDataOpType,// 应用数据操作类型:00独立,10全委托,20部分委托
sourceOrderNo: ordercode,//来源单号
deliveryOrderNo: channelOrder.deliveryOrderNo || jfcode,
......@@ -830,35 +848,37 @@ class OrderTmProductService extends ServiceBase {
nclCount: tm.nclCount,
};
var flowContent = "";
if (apply.customerType == "person") {
if (!apply.businessLicensePic || !apply.identityCardPic || !tm.gzwtsUrl) {
orderProductObj["deliveryStatus"] = "dsccl";
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待上传材料" : "订单已创建待付款";
} else {
orderProductObj["deliveryStatus"] = "dsh";
if (tm.tmStatus && tm.tmStatus == "SUBALITMOK") {
orderProductObj["deliveryStatus"] = "dqrfa";
}
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待审核" : "订单已创建待付款";
}
}
if (apply.customerType == "ent") {
if (!apply.businessLicensePic || !tm.gzwtsUrl) {
orderProductObj["deliveryStatus"] = "dsccl";
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待上传材料" : "订单已创建待付款";
} else {
orderProductObj["deliveryStatus"] = "dsh";
if (tm.tmStatus && tm.tmStatus == "SUBALITMOK") {
orderProductObj["deliveryStatus"] = "dqrfa";
}
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待审核" : "订单已创建待付款";
}
}
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待专家服务" : "订单已创建待付款";
// if (apply.customerType == "person") {
// if (!apply.businessLicensePic || !apply.identityCardPic || !tm.gzwtsUrl) {
// orderProductObj["deliveryStatus"] = "dsccl";
// flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待上传材料" : "订单已创建待付款";
// } else {
// orderProductObj["deliveryStatus"] = "dsh";
// if (tm.tmStatus && tm.tmStatus == "SUBALITMOK") {
// orderProductObj["deliveryStatus"] = "dqrfa";
// }
// flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待审核" : "订单已创建待付款";
// }
// }
// if (apply.customerType == "ent") {
// if (!apply.businessLicensePic || !tm.gzwtsUrl) {
// orderProductObj["deliveryStatus"] = "dsccl";
// flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待上传材料" : "订单已创建待付款";
// } else {
// orderProductObj["deliveryStatus"] = "dsh";
// if (tm.tmStatus && tm.tmStatus == "SUBALITMOK") {
// orderProductObj["deliveryStatus"] = "dqrfa";
// }
// flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待审核" : "订单已创建待付款";
// }
// }
//订单客户档案添加和修改
await self.opCustomerInfo(user, apply, orderProductObj, t);
//获取历史交付单信息
var beforeOtp = await self.ordertmproductDao.model.findOne({
where: { deliveryOrderNo: channelOrder.deliveryOrderNo },
// where: { deliveryOrderNo: channelOrder.deliveryOrderNo },
where: { [self.db.Op.or]: [{ deliveryOrderNo: channelOrder.deliveryOrderNo }, { sourceOrderNo: order.orderNo }] },
raw: true
});
var orderTm = null;
......@@ -882,7 +902,7 @@ class OrderTmProductService extends ServiceBase {
flowObj.sourceOrderNo = orderProductObj.deliveryOrderNo;
await self.orderflowDao.create(flowObj, t);//创建交付流程
orderTm.needNo = channelOrder.needNo || null;//需求单号
var returnTm = await self.opTmInfo(user, tm, apply, nclones, orderTm, JSON.stringify(productItem), t);
var returnTm = await self.opAssistTmInfo(user, tm, apply, nclones, orderTm, JSON.stringify(productItem), t);
var orderObj = {
id: order.id
};
......@@ -901,6 +921,60 @@ class OrderTmProductService extends ServiceBase {
});
})
}
async opAssistTmInfo(user, tm, apply, nclones, orderTm, serviceItemSnapshot, t, ) {//商标(商标注册)添加操作
//获取产品快照
var productItem = serviceItemSnapshot;
if (productItem) {
productItem = JSON.parse(productItem);
}
var gf = productItem.publicExpense ? Number(productItem.publicExpense) : 0;//产品官费
var nclSmallPrice = gf / 10;//单个小类官费
nclSmallPrice = Number(nclSmallPrice.toFixed(2));
var self = this;
var returnTm = [];
await this.trademarkDao.bulkDeleteByWhere({ where: { deliveryOrderNo: orderTm.deliveryOrderNo, nclOneCodes: { [self.db.Op.in]: tm.nclOneCodes } } }, t);
for (var i = 0; i < nclones.length; i++) {
var tbcode = await self.getBusUid("tb");
var nclone = nclones[i];
if (nclone.tbCode) {//用于辅助注册推送数据
tbcode = nclone.tbCode;
}
var nclthreeobj = nclone.nclThree;
var nclthreeobjCount = nclone.nclThree.length;
//计算尼斯小类官方总额
var nclgfze = 300;
if (nclthreeobj.length > 10) {
nclgfze = nclgfze + (nclthreeobj.length - 10) * nclSmallPrice;
}
nclthreeobj = JSON.stringify(nclthreeobj);
var trademarkobj = {
tbCode: tbcode,//提报号(自动生成)
deliveryOrderNo: orderTm.deliveryOrderNo,
needNo: orderTm.needNo,//需求单号
officialType: orderTm.deliveryStatus,//"dsccl": "待上传材料", "dsh": "待审核"
app_id: user.app_id,
createuser_id: user.id,
owner_id: user.id,
owner: user.nickname,
ownerMoblie: user.userMoblie,
creator: user.nickname,
nclOneCodes: nclone.code,//尼斯大类
nclSmallCodes: nclthreeobj,//尼斯小类
nclCount: nclthreeobjCount,//尼斯数量
nclPublicExpense: nclgfze,
itemCode: productItem.itemCode,//
itemName: productItem.itemName,//
channelUserId: user.channelUserId
};
var trademark = await self.trademarkDao.create(trademarkobj, t);//创建商标
var returnObj = {
nclOne: nclone.code, tbCode: tbcode
};
returnTm.push(returnObj);
}
return returnTm;
}
/**
* 接收辅助注册商标修改数据
*/
......@@ -948,7 +1022,7 @@ class OrderTmProductService extends ServiceBase {
if (!itemCode) {
return system.getResultFail(-106, "产品编码参数错误");
}
var productItem = await this.appproductDao.findOneByCode(itemCode, app.id);//获取产品
var productItem = await this.appproductDao.findOneByServiceItemCode(itemCode, app.id);//获取产品
if (!productItem) {
return system.getResultFail(-107, "未知的产品");
}
......@@ -979,33 +1053,36 @@ class OrderTmProductService extends ServiceBase {
tm["itemName"] = productItem.itemName;
tm["channelUserId"] = user.channelUserId;
tm["updated_at"] = new Date();
if (tm.officialType == "WAITARTIFICIALEXAMINE") {
tm.officialType = "dsh"
}
else if (tm.officialType == "FILLEXCEPTION") {
tm.officialType = "shbtg"
}
else if (tm.officialType == "WAITCOMMIT") {
tm.officialType = "ddj"
}
else if (tm.officialType == "ROBOT") {
tm.officialType = "ydj"
} else {
tm.officialType = "dsccl";
}
tm.officialType = "dsh"
// if (tm.officialType == "WAITARTIFICIALEXAMINE") {
// tm.officialType = "dsh"
// }
// else if (tm.officialType == "FILLEXCEPTION") {
// tm.officialType = "shbtg"
// }
// else if (tm.officialType == "WAITCOMMIT") {
// tm.officialType = "ddj"
// }
// else if (tm.officialType == "ROBOT") {
// tm.officialType = "ydj"
// } else {
// tm.officialType = "dsccl";
// }
await self.trademarkDao.create(tm, t);
}
//交付单
var otp = obj.order;
if (otp.tmStatus && otp.tmStatus == "SUBALITMOK") {
otp["deliveryStatus"] = "dqrfa";
}
// if (otp.tmStatus && otp.tmStatus == "SUBALITMOK") {
// otp["deliveryStatus"] = "dqrfa";
// }
otp["deliveryStatus"] = "dqrfa";
otp["updated_at"] = new Date();
await self.dao.model.update(otp, whereObj);
return system.getResultSuccess();
})
}
async tmConfirm(obj) {
var self = this;
var channelUserId = obj.channelUserId;
......@@ -1036,19 +1113,20 @@ class OrderTmProductService extends ServiceBase {
// }
return await self.db.transaction(async function (t) {
var otpObj = { id: ordertmproduct.id };
var tmObj = { officialType: "dsh" };
if (isConfirm == "0") {
if (!obj.notes) {
return system.getResultFail(-106, "方案确认失败,不通过原因不能为空");
}
otpObj["deliveryStatus"] = "fabtg";
otpObj["notes"] = obj.notes;
tmObj.officialType = "fabtg";
}
if (isConfirm == "1") {
otpObj["deliveryStatus"] = "dsh";
otpObj["notes"] = obj.notes || "";
var tmObj = { deliveryOrderNo: deliveryOrderNo, officialType: "dsh" };
await self.trademarkDao.model.update(tmObj, { where: { deliveryOrderNo: deliveryOrderNo }, transaction: t });
}
await self.trademarkDao.updateByWhere(tmObj, { where: { deliveryOrderNo: deliveryOrderNo } }, t);
await self.dao.update(otpObj, t);
return system.getResultSuccess();
})
......
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
class TradeMarkService extends ServiceBase {
constructor() {
super("dbtrademark", ServiceBase.getDaoName(TradeMarkService));
this.ordertmproductSve = system.getObject("service.dborder.ordertmproductSve");
this.tmofficialDao = system.getObject("db.dbtrademark.tmofficialDao");
this.statusConvertJSON={
this.orderflowDao = system.getObject("db.dborder.orderflowDao");
this.statusConvertJSON = {
"WAITARTIFICIALEXAMINE": "dsh",
"1": "1",
"2": "2",
......@@ -32,8 +33,8 @@ class TradeMarkService extends ServiceBase {
"RECVCOMMIT": "ydj",
"FILLEXCEPTION": "shbtg",
//1688
"WAITCONFIRM":"dqrfa",
"CONFIRMFAIL":"dqrfa"
"WAITCONFIRM": "dqrfa",
"CONFIRMFAIL": "dqrfa"
}
}
......@@ -48,55 +49,55 @@ class TradeMarkService extends ServiceBase {
* obj.colorizedPicUrl 商标彩色图样,
* obj.user 用户数据
*/
async updateTmInfo(obj){
async updateTmInfo(obj) {
var user = obj.user;
if(!user || !user.id){
if (!user || !user.id) {
return system.getResultFail(-100, "未知用户");
}
var deliveryOrderNo = obj.deliveryOrderNo;
if(!deliveryOrderNo){
if (!deliveryOrderNo) {
return system.getResultFail(-101, "deliveryOrderNo参数错误");
}
// 1.获取交付单信息
var ordertmproduct = await this.ordertmproductSve.dao.model.findOne({
where:{deliveryOrderNo:deliveryOrderNo},
raw:true
where: { deliveryOrderNo: deliveryOrderNo },
raw: true
});
if(!ordertmproduct || !ordertmproduct.id){
if (!ordertmproduct || !ordertmproduct.id) {
return system.getResultFail(-102, "商标交付单不存在");
}
// 2.获取交付单状态,判断是否可修改
if(ordertmproduct.deliveryStatus=='ddj' || ordertmproduct.deliveryStatus=='ywc'){
if (ordertmproduct.deliveryStatus == 'ddj' || ordertmproduct.deliveryStatus == 'ywc') {
var deliveryStatusName = "待递交";
if(ordertmproduct.deliveryStatus=='ywc'){
deliveryStatusName="已完成";
if (ordertmproduct.deliveryStatus == 'ywc') {
deliveryStatusName = "已完成";
}
return system.getResultFail(-103, "该商标交付单状态为"+deliveryStatusName+",不能进行修改");
return system.getResultFail(-103, "该商标交付单状态为" + deliveryStatusName + ",不能进行修改");
}
var self = this;
return await self.db.transaction(async function (t) {
var otpObj={
id:ordertmproduct.id,
deliveryOrderNo:deliveryOrderNo,
updateuser_id:user.id,
updateuser:user.nickname
var otpObj = {
id: ordertmproduct.id,
deliveryOrderNo: deliveryOrderNo,
updateuser_id: user.id,
updateuser: user.nickname
};
if(obj.picUrl){//商标图样 黑白
otpObj["picUrl"]=obj.picUrl;
if (obj.picUrl) {//商标图样 黑白
otpObj["picUrl"] = obj.picUrl;
}
if(obj.colorizedPicUrl){//彩色商标图样
otpObj["colorizedPicUrl"]=obj.colorizedPicUrl;
if (obj.colorizedPicUrl) {//彩色商标图样
otpObj["colorizedPicUrl"] = obj.colorizedPicUrl;
}
if(obj.tmName){//商标名称
otpObj["tmName"]=obj.tmName;
if (obj.tmName) {//商标名称
otpObj["tmName"] = obj.tmName;
}
if(obj.tmFormType){//商标类型
otpObj["tmFormType"]=obj.tmFormType;
if (obj.tmFormType) {//商标类型
otpObj["tmFormType"] = obj.tmFormType;
}
if(obj.notes){//商标说明
otpObj["notes"]=obj.notes;
if (obj.notes) {//商标说明
otpObj["notes"] = obj.notes;
}
await self.ordertmproductSve.dao.update(otpObj,t);//商标交付单 修改商标图样
await self.ordertmproductSve.dao.update(otpObj, t);//商标交付单 修改商标图样
return system.getResultSuccess();
})
}
......@@ -110,87 +111,87 @@ class TradeMarkService extends ServiceBase {
* obj.nclSmallCodes 商标尼斯小类数组
* obj.user 用户数据
*/
async updateNclInfo(obj){
async updateNclInfo(obj) {
var user = obj.user;
var self = this;
if(!user || !user.id){
if (!user || !user.id) {
return system.getResultFail(-100, "未知用户");
}
var deliveryOrderNo = obj.deliveryOrderNo;
if(!deliveryOrderNo){
if (!deliveryOrderNo) {
return system.getResultFail(-101, "deliveryOrderNo参数错误");
}
// 1.获取交付单信息
var ordertmproduct = await this.ordertmproductSve.dao.model.findOne({
where:{deliveryOrderNo:deliveryOrderNo},
raw:true
where: { deliveryOrderNo: deliveryOrderNo },
raw: true
});
if(!ordertmproduct || !ordertmproduct.id){
if (!ordertmproduct || !ordertmproduct.id) {
return system.getResultFail(-102, "商标交付单不存在");
}
// 2.获取交付单状态,判断是否可修改
if(ordertmproduct.deliveryStatus=='ddj' || ordertmproduct.deliveryStatus=='ywc'){
if (ordertmproduct.deliveryStatus == 'ddj' || ordertmproduct.deliveryStatus == 'ywc') {
var deliveryStatusName = "待递交";
if(ordertmproduct.deliveryStatus=='ywc'){
deliveryStatusName="已完成";
if (ordertmproduct.deliveryStatus == 'ywc') {
deliveryStatusName = "已完成";
}
return system.getResultFail(-103, "该商标交付单状态为"+deliveryStatusName+",不能进行修改");
return system.getResultFail(-103, "该商标交付单状态为" + deliveryStatusName + ",不能进行修改");
}
var tbCode = obj.tbCode;
if(!tbCode){
if (!tbCode) {
return system.getResultFail(-104, "tbCode参数错误");
}
//获取商标尼斯信息
var tm = await this.dao.model.findOne({
where:{tbCode:tbCode},
raw:true
where: { tbCode: tbCode },
raw: true
});
if(!tm || !tm.id){
if (!tm || !tm.id) {
return system.getResultFail(-105, "尼斯信息不存在");
}
//获取交付单下其它商标尼斯信息
var othertm = await this.dao.model.findAll({
where:{
deliveryOrderNo:deliveryOrderNo,
tbCode: { [self.db.Op.ne]: tbCode }
where: {
deliveryOrderNo: deliveryOrderNo,
tbCode: { [self.db.Op.ne]: tbCode }
},
raw:true
raw: true
});
if(!obj.nclOneCodes){
if (!obj.nclOneCodes) {
return system.getResultFail(-106, "nclOneCodes参数错误");
}
if(!obj.nclSmallCodes || obj.nclSmallCodes.length<1){
if (!obj.nclSmallCodes || obj.nclSmallCodes.length < 1) {
return system.getResultFail(-107, "nclSmallCodes参数错误");
}
if(obj.nclSmallCodes.length>10){
if (obj.nclSmallCodes.length > 10) {
return system.getResultFail(-108, "尼斯小类不能超过10项");
}
var nclOneCodes2 = obj.nclOneCodes;
for(var i=0;i<othertm.length;i++){//判断重复大类
for (var i = 0; i < othertm.length; i++) {//判断重复大类
var other = othertm[i];
if(other.nclOneCodes==obj.nclOneCodes){
if (other.nclOneCodes == obj.nclOneCodes) {
return system.getResultFail(-109, "该商标存在重复的尼斯大类");
}else{
nclOneCodes2=nclOneCodes2+","+other.nclOneCodes;
} else {
nclOneCodes2 = nclOneCodes2 + "," + other.nclOneCodes;
}
}
return await self.db.transaction(async function (t) {
var tmObj={
id:tm.id,
nclOneCodes:obj.nclOneCodes,
var tmObj = {
id: tm.id,
nclOneCodes: obj.nclOneCodes,
nclSmallCodes: JSON.stringify(obj.nclSmallCodes),
updateuser_id:user.id,
updateuser:user.nickname
updateuser_id: user.id,
updateuser: user.nickname
};
await self.dao.update(tmObj,t);//修改商标尼斯信息
var otpObj={
id:ordertmproduct.id,
nclOneCodes:nclOneCodes2,
updateuser_id:user.id,
updateuser:user.nickname
await self.dao.update(tmObj, t);//修改商标尼斯信息
var otpObj = {
id: ordertmproduct.id,
nclOneCodes: nclOneCodes2,
updateuser_id: user.id,
updateuser: user.nickname
};
await self.ordertmproductSve.dao.update(otpObj,t);//商标交付单 修改大类列表
await self.ordertmproductSve.dao.update(otpObj, t);//商标交付单 修改大类列表
return system.getResultSuccess();
})
}
......@@ -210,7 +211,7 @@ class TradeMarkService extends ServiceBase {
* obj.officialFileName 官文文件名称 ,
* obj.officialFileUrl 官文文件地址 ,
*/
async receiveTmOfficialData(obj){
async receiveTmOfficialData(obj) {
// return system.getResultFail(-100, "接口开发中");
// var user = obj.user;
// var app = obj.app;
......@@ -219,60 +220,60 @@ class TradeMarkService extends ServiceBase {
// return system.getResultFail(-100, "未知用户");
// }
var deliveryOrderNo = obj.deliveryOrderNo;
if(!deliveryOrderNo){
if (!deliveryOrderNo) {
return system.getResultFail(-101, "deliveryOrderNo参数错误");
}
// 1.获取交付单信息
var ordertmproduct = await this.ordertmproductSve.dao.model.findOne({
where:{deliveryOrderNo:deliveryOrderNo},
raw:true
where: { deliveryOrderNo: deliveryOrderNo },
raw: true
});
if(!ordertmproduct || !ordertmproduct.id){
if (!ordertmproduct || !ordertmproduct.id) {
return system.getResultFail(-102, "商标交付单不存在");
}
// if(!app){
// return system.getResultFail(-103, "未知应用");
// }
var tbCode = obj.tbCode;
if(!tbCode){
if (!tbCode) {
return system.getResultFail(-104, "tbCode参数错误");
}
//获取商标尼斯信息
var tm = await this.dao.model.findOne({
where:{tbCode:tbCode,deliveryOrderNo:deliveryOrderNo},
raw:true
where: { tbCode: tbCode, deliveryOrderNo: deliveryOrderNo },
raw: true
});
if(!tm || !tm.id){
if (!tm || !tm.id) {
return system.getResultFail(-105, "尼斯信息不存在");
}
return await self.db.transaction(async function (t) {
var tmObj={
id:tm.id
var tmObj = {
id: tm.id
};
var officialObj={
app_id:ordertmproduct.app_id
var officialObj = {
app_id: ordertmproduct.app_id
};
if(obj.officialType){
if(self.statusConvertJSON[obj.officialType]){
tmObj["officialType"]=self.statusConvertJSON[obj.officialType];
if (obj.officialType) {
if (self.statusConvertJSON[obj.officialType]) {
tmObj["officialType"] = self.statusConvertJSON[obj.officialType];
officialObj["officialType"] = self.statusConvertJSON[obj.officialType];
}
}
if(obj.tmRegistNum){
if (obj.tmRegistNum) {
officialObj["tmRegistNum"] = obj.tmRegistNum;
tmObj["tmRegistNum"]=obj.tmRegistNum;
tmObj["tmRegistNum"] = obj.tmRegistNum;
}
await self.dao.update(tmObj,t);//修改商标状态信息
if(officialObj["tmRegistNum"] && officialObj["officialType"]){
if(obj.officialFileName){
await self.dao.update(tmObj, t);//修改商标状态信息
if (officialObj["tmRegistNum"] && officialObj["officialType"]) {
if (obj.officialFileName) {
officialObj["officialFileName"] = obj.officialFileName;
}
if(obj.officialFileUrl){
if (obj.officialFileUrl) {
officialObj["officialFileUrl"] = obj.officialFileUrl;
}
var code = await self.getBusUid("tmoff");
officialObj["code"]=code;
await self.tmofficialDao.create(officialObj,t);
officialObj["code"] = code;
await self.tmofficialDao.create(officialObj, t);
}
return system.getResultSuccess();
})
......@@ -281,54 +282,67 @@ class TradeMarkService extends ServiceBase {
* 辅助商标状态修改
* @param {*} obj
*/
async updateAssistTmStatus(obj){
async updateAssistTmStatus(obj) {
var self = this;
var deliveryOrderNo = obj.channelOrderNum;
if(!deliveryOrderNo){
if (!deliveryOrderNo) {
return system.getResultFail(-101, "deliveryOrderNo参数错误");
}
// 1.获取交付单信息
var ordertmproduct = await this.ordertmproductSve.dao.model.findOne({
where:{deliveryOrderNo:deliveryOrderNo},
raw:true
where: { deliveryOrderNo: deliveryOrderNo },
raw: true
});
if(!ordertmproduct || !ordertmproduct.id){
if (!ordertmproduct || !ordertmproduct.id) {
return system.getResultFail(-102, "商标交付单不存在");
}
var tbCode = obj.proxyCode;
if(!tbCode){
if (!tbCode) {
return system.getResultFail(-104, "tbCode参数错误");
}
//获取商标尼斯信息
var tm = await this.dao.model.findOne({
where:{tbCode:tbCode,deliveryOrderNo:deliveryOrderNo},
raw:true
where: { tbCode: tbCode, deliveryOrderNo: deliveryOrderNo },
raw: true
});
if(!tm || !tm.id){
if (!tm || !tm.id) {
return system.getResultFail(-105, "商标信息不存在");
}
return await self.db.transaction(async function (t) {
var tmObj={id:tm.id};
var otp = {id:ordertmproduct.id};
if(obj.tmStatus){
if(self.statusConvertJSON[obj.tmStatus]){
tmObj["officialType"]=self.statusConvertJSON[obj.tmStatus];
var tmObj = { id: tm.id };
var otp = { id: ordertmproduct.id };
if (obj.tmStatus) {
if (self.statusConvertJSON[obj.tmStatus]) {
tmObj["officialType"] = self.statusConvertJSON[obj.tmStatus];
}
if(tmObj.officialType && ",dqrfa,dsccl,dsh,ddj,ydj,ywc,".indexOf(tmObj.officialType)>=0){
otp["deliveryStatus"]=tmObj.officialType;
await self.ordertmproductSve.update(otp,t);
if (tmObj.officialType && ",dqrfa,dsccl,dsh,ddj,ydj,ywc,".indexOf(tmObj.officialType) >= 0) {
otp["deliveryStatus"] = tmObj.officialType;
await self.ordertmproductSve.update(otp, t);
}
// {"dqrfa":"待确认方案", "dsccl": "待上传材料", "dsh": "待审核", "ddj": "待递交", "ydj": "已递交", "ywc": "已完成" },
// {"dqrfa":"待确认方案", "dsccl": "待上传材料", "dsh": "待审核", "ddj": "待递交", "ydj": "已递交", "ywc": "已完成" },
}
if(obj.opNotes){
tmObj["opNotes"]=obj.opNotes;
if (obj.opNotes) {
tmObj["opNotes"] = obj.opNotes;
}
if(obj.submitTime){
tmObj["submitTime"]=obj.submitTime;
if (obj.submitTime) {
tmObj["submitTime"] = obj.submitTime;
}
if(obj.tmRegistNum){
tmObj["tmRegistNum"]=obj.tmRegistNum;
}
await self.dao.update(tmObj,t);//修改商标状态信息
var deliveryStatusName = uiconfig.config.pdict.official_type[tmObj.officialType];
var flowObj = {
isShow: 1,
app_id: ordertmproduct.app_id,
createuser_id: ordertmproduct.createuser_id,
sourceOrderNo: deliveryOrderNo,
opContent: "第" + tm.nclOneCodes + "类商标状态更新为【" + deliveryStatusName + "】" + obj.opNotes
};
await self.orderflowDao.create(flowObj, t);//创建交付流程
await self.dao.update(tmObj, t);//修改商标状态信息
return system.getResultSuccess();
})
}
}
module.exports=TradeMarkService;
module.exports = TradeMarkService;
......@@ -60,7 +60,11 @@ class ToolService {
var url = this.zcApiUrl + "api/tool/toolApi/adjustWTSSize";
return await this.opReqResult(url, queryobj, req);
}
//工商核名
async icheming(queryobj, req) {
var url = this.zcApiUrl + "api/trademark/tmqueryApi/icheming";
return await this.opReqResult(url, queryobj, req);
}
async opReqResult(reqUrl, queryobj, req) {
var rtn = await this.execClient.execPushDataPost(queryobj, reqUrl, req.headers["token"], req.headers["request-id"]);
var data = JSON.parse(rtn.stdout);
......
const Client = require('aliyun-api-gateway').Client;
var RPCClient = require('@alicloud/pop-core').RPCClient;
// const client = new Client('203727307', 'b6za34qem6k9a3s3jguvh24nc3ridlnh');
const client = new Client('203756805', 'crkyej0xlmqa6bmvqijun6ltxparllyn');
// const client = new Client('203756805', 'crkyej0xlmqa6bmvqijun6ltxparllyn');
const client = new Client('203763771', 'e5e2ytnn6nrkr9qnqk4w5e6z0xlhkznu');
class aliyunClient {
constructor() {
// this.aliReqUrl = "https://aliapi.gongsibao.com/tm/springboard";
......
......@@ -34,7 +34,7 @@ module.exports = function (app) {
});
});
app.get('/doc/:forder/:fileName', function (req, res) {
app.get('/doc/api/:forder/:fileName', function (req, res) {
var forder = req.params["forder"];
var fileName = req.params["fileName"] || "README.md";
var path = process.cwd() + "/app/front/entry/public/apidoc";
......
......@@ -24,7 +24,7 @@ var settings = {
if (this.env == "dev") {
return "http://p.apps.com:4001/";
} else {
return "http://open.gongsibao.com/";
return "https://open.gongsibao.com/";
}
},
reqTransferurl: function () {
......
......@@ -10,12 +10,12 @@
</head>
<body >
<body>
<div style="width:100%;text-align: center;font-size: 20px;">
薪果果个体工商户API文档
渠道接入API文档
</div>
<div class="markdown-body" style="margin-left:40px;" id="doc-page">
<%- str%>
<%- str%>
</div>
</body>
......
## 1. 调用接口需要开通app应用
  1 [获取app信息](doc/api/appDesc/demoDesc.md)
## 1. 用户相关接口
  1 [用户中心](doc/user/user.md)
  2 [获取token信息](doc/api/appDesc/demoDesc.md)
## 2. 商户相关接口
  1 [商户接口](doc/merchant/merchant.md)
## 2. 订单相关接口
  1 [订单](doc/order/order.md)
  2 [个体工商户](doc/order/businessmen.md)
## 3. 发票接口
  1 [发票](gongsibao-er/README.md)
  3 [通用接口示例](doc/api/appDesc/demoDesc.md)
## 2. 商标操作相关接口
  1 [商标操作中心](doc/api/opTrademark/opTm.md)
## 3. 商标检索相关接口
  1 [商标检索中心](doc/api/opTrademark/opTm.md)
<a name="menu" href="/doc">返回主目录</a>
1. [开通app参数](#appParams)
1. [获取token](#getToken)
1. [通用接口示例](#demo)
## **<a name="appParams"> 开通app参数</a>**
[返回到目录](#menu)
#### 请求接口之前需要向合作方获取如下参数:
#### appkey:2019090811
#### secret:f99d413b767f09b5dff0b3610366cc46
#### 参数说明:appkey、secret为获取请求头token的参数。
## **<a name="getToken"> 获取token</a>**
[返回到目录](#menu)
##### URL
[/auth/accessAuth/getToken]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"appkey": "2019090811", //Y string appkey
"secret": "f99d413b767f09b5dff0b3610366cc46"//Y string 密钥
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"token": "40d64e586551405c9bcafab87266bc04" //token用于其他接口请求时,放在请求头中
},
"requestId": "2016c54abe7249a2a1195d236b333f79"
}
```
## **<a name="demo"> 通用接口示例</a>**
[返回到目录](#menu)
##### URL
[/auth/accessAuth]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
所有请求接口在请求前,必须获取token,并把token放在请求头Headers中,无特殊说明请求方式统一为POST请求。
通用请求接口示例:
请求头中需要传递的参数:tokenrequest-id
请求参数:
{
"actionProcess": "jd", //Y string 执行的渠道名称
"actionType": "demo", //Y string 渠道执行的类型
"actionBody": { //N JSON 要传递的body信息
"userId": "019101116473600000", //N string 用户ID
"userName": "张三" //N string 用户名称
}
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"opDesc": "京东云合作"
},
"requestId": "2016c54abe7249a2a1195d236b333f79"
}
返回值参数说明:
status 返回状态,0为成功,否则为失败
msg 成功或失败信息描述
data 接口返回的数据信息
requestId 请求头中的request-id,作为接口调用跟踪
```
<a name="menu">目录</a>
1. [商户nameList](#nameList)
1. [新增/修改商户](#saveMerchant)
1. [商户列表](#merchantList)
1. [商户审核](#merchantAudit)
1. [商户签约](#merchantSign)
1. [查看签约](#showSign)
1. [签约列表](#signList)
1. [资金账户列表](#accountList)
1. [充值申请列表](#rechargeList)
1. [充值申请审核](#rechargeAudit)
1. [资金交易列表](#tradeList)
1. [资金流水列表](#processList)
## **<a name="nameList"> 商户nameList</a>**
[返回到目录](#menu)
##### URL
[/web/merchant/merchantCtl/nameList]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": [
{
"id": 110361382269, // 商户id
"name": "司机宝" // 商户名称
},
{
"id": 110361384474,
"name": "测试公司录入1"
},
{
"id": 110361384475,
"name": "测试公司录入3"
},
{
"id": 110361384476,
"name": "546444544"
}
]
}
```
## **<a name="saveMerchant"> 新增/修改商户</a>**
[返回到目录](#menu)
##### URL
[/web/merchant/merchantCtl/saveMerchant]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"id": 110361384475, // 商户id,新增时为0, 修改时为当前修改的商户id
"name": "测试公司录入3", // 商户名称
"taxType": 1, // 纳税人类型 0一般纳税人 1小规模纳税人
"contactName": "宋毅", // 联系人姓名
"contactMobile": "13338383838", // 联系人手机
"contactEmail": "songyi@gongisbao.com", // 联系人邮箱
"taxNo": "sssssssss", // 纳税人识别号
"invoiceAddr": "朝来高科技产业园33333", // 开票地址
"invoiceMobile": "13838383838", // 开票电话
"accountName": "宋毅", // 开户名称
"accountPublic": "xxxx对公账户22222", // 对公账户
"mailAddr": "来广营", // 邮寄地址
"mailTo": "宋小毅", // 收件人
"mailMobile": "13838383838", // 收件电话
"ownerName": "宋大毅", // 客户经理姓名
"ownerMobile": "13838383838", // 客户经理电话
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success"
}
```
## **<a name="merchantList"> 商户列表</a>**
[返回到目录](#menu)
##### URL
[/web/merchant/merchantCtl/allList]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"currentPage": 1, // 当前页
"pageSize": 10, // 每页显示条数
"name": "测试公司", // 公司名称
"merchantId": 11111, // 商户id
"createdBegin": "", // 创建时间-开始
"createdEnd": "" // 创建时间-结束
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"count": 1, // 总数
"rows": [ // 商户列表
{
"id": 110361384475, // 商户id
"name": "测试公司录入3", // 商户名称
"taxType": 1, // 纳税人类型 0一般纳税人 1小规模纳税人
"contactName": "宋毅", // 联系人姓名
"contactMobile": "13338383838", // 联系人手机
"contactEmail": "songyi@gongisbao.com", // 联系人邮箱
"taxNo": "sssssssss", // 纳税人识别号
"invoiceAddr": "朝来高科技产业园33333", // 开票地址
"invoiceMobile": "13838383838", // 开票电话
"accountName": "宋毅", // 开户名称
"accountPublic": "xxxx对公账户22222", // 对公账户
"mailAddr": "来广营", // 邮寄地址
"mailTo": "宋小毅", // 收件人
"mailMobile": "13838383838", // 收件电话
"ownerName": "宋大毅", // 客户经理姓名
"ownerMobile": "13838383838", // 客户经理电话
"statusName": "待审核" // 商户状态名称
"status": 0, // 商户状态 0待审核 1待签约 2签约完成
"created_at": "2019-09-23 08:00", // 创建时间
},
]
}
}
```
## **<a name="merchantAudit"> 商户审核</a>**
[返回到目录](#menu)
##### URL
[/web/merchant/merchantCtl/merchantAudit]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"id": 110361382269, // 商户id
"ucname": "18600002222" // 商户登录帐号
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success"
}
```
## **<a name="merchantSign"> 添加/修改签约</a>**
[返回到目录](#menu)
##### URL
[/web/merchant/merchantsignedCtl/merchantSign]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"merchant_id": 110361382269, // 商户id
"nameA": "xxxxx有限公司", // 签约主体
"contractNo": "NO233332222", // 合同编码
"beginDate": "2019-08-22", // 合同开始时间
"endDate": "2020-08-22", // 合同结束时间
"serviceRate": "5.23", // 服务费率
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success"
}
```
## **<a name="showSign"> 查看签约</a>**
[返回到目录](#menu)
##### URL
[/web/merchant/merchantsignedCtl/showSign]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"merchant_id": 110361384474
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"merchant": {
"id": 110361384475, // 商户id
"name": "测试公司录入3", // 商户名称
},
"merchantSign": {
"merchant_id": 110361384474, // 商户id
"nameA": "xxxxx有限公司", // 签约主体
"contractNo": "NO233332222", // 合同编码
"beginDate": "2019-08-22T00:00:00.000Z", // 合同开始时间
"endDate": "2020-08-22T00:00:00.000Z", // 合同结束时间
"serviceRate": 5.23, // 服务费率
"created_at": "2019-09-23T12:08:38.000Z", // 创建时间
}
}
}
```
## **<a name="signList"> 签约列表</a>**
[返回到目录](#menu)
##### URL
[/web/merchant/merchantsignedCtl/signList]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"currentPage": 1, // 页码
"pageSize": 10, // 每页条数
"merchantId": 11111, // 商户id
"merchantName": "" // 商户名称
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"count": 2,
"rows": [
{
"merchant": {
"id": 110361384475, // 商户id
"name": "测试公司录入3", // 商户名称
},
"merchantSign": {
"merchant_id": 110361384474, // 商户id
"nameA": "xxxxx有限公司", // 签约主体
"contractNo": "NO233332222", // 合同编码
"beginDate": "2019-08-22T00:00:00.000Z", // 合同开始时间
"endDate": "2020-08-22T00:00:00.000Z", // 合同结束时间
"serviceRate": 5.23, // 服务费率
"created_at": "2019-09-23T12:08:38.000Z", // 创建时间
}
},
]
}
}
```
## **<a name="accountList"> 资金账户</a>**
[返回到目录](#menu)
##### URL
[/web/merchant/merchantaccountCtl/accountList]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"currentPage": 1, // 页码
"pageSize": 10, // 每页条数
"merchantName": "" // 商户名称
"merchantId": "" // 商户id
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"count": 1,
"rows": [
{
"id": 1,
"merchant_id": 110361382269, // 商户id
"frozen_amt": 120512852, // 冻结金额
"frozen_amt_y": "1205128.52", // 冻结金额(元)
"available_amt": 4879475646, // 可用金额
"available_amt_y": "48794756.46 " // 可用余额(元)
"created_at": "2019-09-10 13:27", // 创建时间
"merchantName": "司机宝", // 企业名称
}
]
}
}
```
## **<a name="rechargeList"> 充值申请列表</a>**
[返回到目录](#menu)
##### URL
[/web/merchant/merchantrechargeCtl/rechargeList]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"currentPage": 1,
"pageSize": 10,
"merchantName": " ", // 商户名称
"merchantId": "" // 商户id
"createdBegin": "", // 创建时间-开始
"createdEnd": "", // 创建时间-结束
"status": null // 状态 0待审核 1已入账 2审核失败
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"count": 2,
"rows": [
{
"id": 1, // id, 审核时候传入
"merchant_id": 110361382269, // 商户id
"outTradeNo": "2", // 充值流水号
"voucher": "https://www.baidu.com/1.png", // 充值凭证
"amt": 100000, // 充值金额(分)
"amt_y": "1000", // 充值金额(元)
"statusName": "待审核", // 审核状态名称
"status": 0, // 审核状态
"remark": "", // 审核备注
"merchantName": "司机宝" // 商户名称
"auditUserName": "样情局" // 审核人
},
]
}
}
```
## **<a name="rechargeAudit"> 充值申请审核</a>**
[返回到目录](#menu)
##### URL
[/web/merchant/merchantrechargeCtl/rechargeAudit]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"id": 3, // 充值id
"status": 1, // 审核状态 1已入账 2审核失败
"remark": "审核备注" // 审核备注 审核失败时必须填写
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
}
```
## **<a name="tradeList"> 资金交易列表</a>**
[返回到目录](#menu)
##### URL
[/web/merchant/merchanttradeCtl/tradeList]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"currentPage": 1,
"pageSize": 10,
"merchantId":"", // 商户id
"invoiceApplyNo":"456456", // 发票申请号
"type":"", // 收支类型 1充值 2支出
"createdBegin":"", // 创建时间-开始
"createdEnd":"" // 创建时间-结束
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"count": 1,
"rows": [
{
"id": 7, // id
"merchant_id": 110361382269, // 商户id
"merchantName": "司机宝", // 商户名称
"invoiceNo": "123123", // 发票编号
"invoiceApplyNo": "456456", // 发票申请号
"outTradeNo": "2", // 充值流水号
"amt": 100000, // 交易金额(分)
"amt_y": "1000" // 交易金额(元)
"balance": 4879525646, // 账户余额
"type": 2, // 收支类型 1充值 2支出
"businessTypeName": "增值费扣款", // 业务类型名称
"businessType": 20, // 业务类型 00服务费扣款 10个税扣款 20增值费扣款 30附加费扣款 90充值入账
"created_at": "2019-09-24 11:41", // 创建时间
}
]
}
}
```
## **<a name="processList"> 资金流水列表</a>**
[返回到目录](#menu)
##### URL
[/web/merchant/merchanttradeprocessCtl/processList]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"currentPage": 1,
"pageSize": 10,
"merchantId":"", // 商户id
"invoiceApplyNo":"456456", // 发票申请号
"busiType":"", // 业务类型 00开票冻结 10解冻扣款 20撤回发票退款 30审核驳回退款
"createdBegin":"", // 创建时间-开始
"createdEnd":"" // 创建时间-结束
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"count": 4,
"rows": [
{
"id": 50, // id
"merchant_id": 110361382269, // 商户id
"merchantName": "司机宝", // 商户名号曾
"invoiceApplyNo": "100002", // 发票申请号
"amtType": "30", // 费用类型 00服务费 10个税 20增值费 30附加费
"amtTypeName": "附加费", // 费用类型名称
"amt": 0, // 流水金额(分)
"amt_y": "0", // 流水金额(元)
"frozen_amt": 120519881, // 账户冻结金额(分)
"frozen_amt_y": "1205198.81", // 账户冻结金额(元)
"available_amt": 4879468617, // 账户可用余额(分)
"available_amt_y": "48794686.17" // 账户可用余额(元)
"busiType": "00", // 业务类型 00开票冻结 10解冻扣款 20撤回发票退款 30审核驳回退款
"busiTypeName":"解冻扣款", // 业务类型名称
"created_at": "2019-09-20 03:16", // 创建时间
},
]
}
}
```
<a name="menu" href="/doc">返回主目录</a>
1. [尼斯查询(一)](#getNcl)
1. [尼斯查询(二)](#getNclTwo)
## **<a name="getNcl"> 尼斯查询(一)</a>**
[返回到目录](#menu)
##### URL
[/action/tmTools/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:getNcl
``` javascript
{
"nclcode": "01" //Y string 尼斯编号(尼斯大类类别获取群组类别)
}
```
#### 返回结果
```javascript
{
"status": 0,//操作状态0:操作成功-1:操作失败
"msg": "操作成功",//操作信息
"data": [
{
"code": "01",//尼斯大类编码
"name": "",//大类名称
"pcode": "",//父类编码 大类要为父类则为空
"type": 1,
"children": [//尼斯群组信息
{
"code": "0106",//群组编码
"name": "化学试剂",//群组名称
"pcode": "01",//群组父类编码 即其所属大类编码
"type": 1,
"children": [//尼斯小类
{
"code": "010122",//小类编码
"name": "生物化学催化剂",//小类名称
"pcode": "0106"//小类父类编码 即其所属群组编码
}
]
}
]
},
{
"code": "42",
"name": "",
"pcode": "",
"type": 1,
"children": [
{
"code": "4211",
"name": "提供化学研究服务",
"pcode": "42",
"type": 1,
"children": [
{
"code": "",
"name": "生物化学研究和分析",
"pcode": "4211"
}
]
}
]
}
],
"requestId": "8cd7e91ec607453c805da8302f3e068c"
}
```
## **<a name="getNclTwo"> 尼斯查询(二)</a>**
[返回到目录](#menu)
##### URL
[/action/tmTools/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:getNcl
``` javascript
{
"name": "生物化学",//Y strin 尼斯名称
"ncls ": ["01"]//N List 尼斯大类编码列表
}
```
#### 返回结果
```javascript
{
"status": 0,//操作状态0:操作成功-1:操作失败
"msg": "操作成功",//操作信息
"data": [
{
"code": "01",//尼斯大类编码
"name": "",//大类名称
"pcode": "",//父类编码 大类要为父类则为空
"type": 1,
"children": [//尼斯群组信息
{
"code": "0106",//群组编码
"name": "化学试剂",//群组名称
"pcode": "01",//群组父类编码 即其所属大类编码
"type": 1,
"children": [//尼斯小类
{
"code": "010122",//小类编码
"name": "生物化学催化剂",//小类名称
"pcode": "0106"//小类父类编码 即其所属群组编码
}
]
}
]
},
{
"code": "42",
"name": "",
"pcode": "",
"type": 1,
"children": [
{
"code": "4211",
"name": "提供化学研究服务",
"pcode": "42",
"type": 1,
"children": [
{
"code": "",
"name": "生物化学研究和分析",
"pcode": "4211"
}
]
}
]
}
],
"requestId": "8cd7e91ec607453c805da8302f3e068c"
}
```
<a name="menu">目录</a>
1. [图片验证码](#captcha)
1. [短信验证码](#smsCode)
1. [登录](#login)
1. [当前用户信息查询](#loginUser)
1. [获取菜单](#getMenu)
## **<a name="captcha"> 图片验证码</a>**
[返回到目录](#menu)
##### URL
[/web/auth/userCtl/captcha]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
| 参数 | 必选 | 类型 | 说明|
| -------- | -------- | ------------|---------|
| **width** | 否 | int | 图片验证码宽度 默认120px|
| **height** | 否 | int | 图片验证码高度 默认32px |
| **background** | 否 | String | 背景色颜色值,默认#E8E8E8 |
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"key": "381c1fc567c746d0a4aa33892239cef0", // 图片验证码key
"captcha": "...." // 图片
}
}
```
## **<a name="smsCode"> 短信验证码</a>**
[返回到目录](#menu)
##### URL
[/web/auth/userCtl/smsCode]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
| 参数 | 必选 | 类型 | 说明|
| -------- | -------- | ------------|---------|
| **mobile** | 是 | String | 手机号码|
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
}
```
## **<a name="login"> 登录</a>**
[返回到目录](#menu)
##### URL
[/web/auth/userCtl/login]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
| 参数 | 必选 | 类型 | 说明|
| -------- | -------- | ------------|---------|
| **loginName** | 是 | String | 登录名|
| **password** | 是 | String | 密码 |
| **captchaKey** | 是 | String | 图片验证码key |
| **captchaCode** | 是 | String | 图片验证码填入值 |
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"xggadminsid": "3cb49932-fa02-44f0-90db-9f06fe02e5c7" // 登录key
}
}
```
## **<a name="currentUser"> 当前用户信息查询</a>**
[返回到目录](#menu)
##### URL
[/web/auth/userCtl/currentUser]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
}
```
## **<a name="getMenu"> 获取菜单</a>**
[返回到目录](#menu)
##### URL
[/web/auth/userCtl/getMenu]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 返回结果
```javascript
[
{
"name": "首页",
"path": "/",
"submenu": []
},
{
"name": "商户中心",
"path": "/merchants",
"submenu": [
{
"name": "客户管理",
"team": [
{
"name": "商户信息",
"path": "/merchants/businessInformation"
},
...
]
}
]
},
...
]
```
......@@ -32,6 +32,7 @@
"express": "^4.16.2",
"express-session": "^1.15.6",
"gm": "^1.23.1",
"jdcloud-sdk-signer": "^2.0.0",
"marked": "^0.7.0",
"method-override": "^2.3.10",
"mongoose": "^5.7.1",
......
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