Commit 30e5cb74 by 张云飞

tj

parent bd4aae1d
...@@ -24,7 +24,7 @@ class APIBase { ...@@ -24,7 +24,7 @@ class APIBase {
"GetQualificationCertificateDetail": "getQualificationCertificateDetail", "GetQualificationCertificateDetail": "getQualificationCertificateDetail",
"RefusalSolution": "refusalSolution", "RefusalSolution": "refusalSolution",
"SendVerificationCode": "sendVerificationCode", "SendVerificationCode": "sendVerificationCode",
"CheckBusinessNameList": "checkBusinessNameList",
}; };
} }
//-----------------------新的模式------------------开始 //-----------------------新的模式------------------开始
...@@ -43,13 +43,14 @@ class APIBase { ...@@ -43,13 +43,14 @@ class APIBase {
if (!result) { if (!result) {
result = system.getResult(null, "请求的方法返回值为空"); result = system.getResult(null, "请求的方法返回值为空");
} }
var tmpResult = pobj.actionType.indexOf("List") < 0 ? result : { status: result.status, message: result.message, requestId: result.requestId };
this.execClient.execLogs("reqPath:" + req.path + "执行结果", param, "brg-user-center-apibase", tmpResult, null);
result.requestId = result.requestId || uuid.v1(); result.requestId = result.requestId || uuid.v1();
if (req.body.Action && this.userCenterAction[req.body.Action]) { if (req.body.Action && this.userCenterAction[req.body.Action]) {
result = await this.handleTxResult(result); result = await this.handleTxResult(result);
delete req.body["ActionBody"]; delete req.body["ActionBody"];
delete req.body["Action"]; delete req.body["Action"];
}//处理tx返回数据 }//处理tx返回数据
this.execClient.execLogs("reqPath:" + req.path + "执行结果", param, "brg-user-center-apibase", result, null);
return result; return result;
} catch (error) { } catch (error) {
var stackStr = error.stack ? error.stack : JSON.stringify(error); var stackStr = error.stack ? error.stack : JSON.stringify(error);
......
var APIBase = require("../../api.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
class icName extends APIBase {
constructor() {
super();
this.utilsIcNameSve = system.getObject("service.utilsSve.utilsIcNameSve");
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async opActionProcess(pobj, action_type, req) {
var opResult = null;
switch (action_type) {
case "test"://测试
opResult = system.getResultSuccess("测试接口");
break;
case "checkBusinessNameList"://工商核名
opResult = await this.utilsIcNameSve.checkBusinessNameList(pobj.actionBody);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
}
module.exports = icName;
...@@ -22,12 +22,24 @@ class Need extends APIBase { ...@@ -22,12 +22,24 @@ class Need extends APIBase {
async opActionProcess(pobj, action_type, req) { async opActionProcess(pobj, action_type, req) {
var opResult = null; var opResult = null;
switch (action_type) { switch (action_type) {
case "qcloud.domain.checkCreate"://新购参数检查
opResult = await this.txPushLogSve.checkCreate(pobj);
break;
case "qcloud.cbs.CreateCbsInstance"://支付回调 case "qcloud.cbs.CreateCbsInstance"://支付回调
opResult = await this.txPushLogSve.createCbsInstance(pobj); opResult = await this.txPushLogSve.createCbsInstance(pobj);
break; break;
case "qcloud.PRODUCT_NAME.queryFlow"://发货状态查询 case "qcloud.PRODUCT_NAME.queryFlow"://发货状态查询
opResult = await this.txPushLogSve.queryFlow(pobj); opResult = await this.txPushLogSve.queryFlow(pobj);
break; break;
case "qcloud.PRODUCT_NAME.isolateResource"://资源隔离
opResult = await this.txPushLogSve.isolateResource(pobj);
break;
case "qcloud.PRODUCT_NAME.queryResources"://资源拉取
opResult = await this.txPushLogSve.queryResources(pobj);
break;
case "qcloud.PRODUCT_NAME.destroyResource"://销毁资源
opResult = await this.txPushLogSve.destroyResource(pobj);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -16,7 +16,7 @@ class OrderDeliveryDao extends Dao{ ...@@ -16,7 +16,7 @@ class OrderDeliveryDao extends Dao{
userId:userId, userId:userId,
productTypeOne:"%/"+productTypeOne+"/%" productTypeOne:"%/"+productTypeOne+"/%"
}; };
var sql = "select count(1) as dataCount from v_order_oproduct_odelivery where deleted_at is null and delivery_status = :deliveryStatus "+ var sql = "select count(1) as dataCount from v_order_oproduct_odelivery where deleted_at is null and delivery_status = "+deliveryStatus+" "+
" and user_id = :userId and product_type like :productTypeOne "; " and user_id = :userId and product_type like :productTypeOne ";
var tmpResultCount = await this.customQuery(sql, params); var tmpResultCount = await this.customQuery(sql, params);
return tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0; return tmpResultCount && tmpResultCount.length > 0 ? tmpResultCount[0].dataCount : 0;
......
...@@ -13,7 +13,7 @@ class OrderProductDao extends Dao { ...@@ -13,7 +13,7 @@ class OrderProductDao extends Dao {
creditCode: creditCode, creditCode: creditCode,
creditCode2:creditCode creditCode2:creditCode
}; };
var sql = "SELECT order_num,product_type_name,product_type,delivery_status,delivery_status_name,"+ var sql = "SELECT order_num,total_sum,product_type_name,product_type,delivery_status,delivery_status_name,"+
"updated_at,order_snapshot FROM `v_order_oproduct_odelivery` where user_id=:user_id and "+ "updated_at,order_snapshot FROM `v_order_oproduct_odelivery` where user_id=:user_id and "+
"(deliver_content->'$.companyInfo' is not null and deliver_content->'$.companyInfo.creditCode'=:creditCode) "+ "(deliver_content->'$.companyInfo' is not null and deliver_content->'$.companyInfo.creditCode'=:creditCode) "+
// " or "+ // " or "+
......
...@@ -120,43 +120,87 @@ class TxPushLogService extends ServiceBase { ...@@ -120,43 +120,87 @@ class TxPushLogService extends ServiceBase {
} }
// { // {
// "version": "1.0", // "version": "1.0",
// "caller": "mall_logic", // "caller": "mall_logic",
// "componentName": "mall_logic", // "componentName": "mall_logic",
// "password": "mall_logic", // "password": "mall_logic",
// "callee": "cdb", // "callee": "cdb",
// "eventId": 843836670, // "eventId": 843836670,
// "seqId": "1501802577.465723597230350480", // "seqId": "1501802577.465723597230350480",
// "spanId": "logical;1", // "spanId": "logical;1",
// "timestamp": 1501802577, // "timestamp": 1501802577,
// "interface": { // "interface": {
// "interfaceName": "qcloud.PRODUCT_NAME.isolateResource", // "interfaceName": "qcloud.PRODUCT_NAME.isolateResource",
// "para": { // "para": {
// "appId": 123, // "appId": 123,
// "uin": "123", // "uin": "123",
// "operateUin": "123", // "operateUin": "123",
// "type": "cdb", // "type": "cdb",
// "region": 4, // "region": 4,
// "resourceId": "cdb-dfe8t7i9" // "resourceId": "cdb-dfe8t7i9"
// "renewFlag": 0, // "renewFlag": 0,
// "newDeadline": "2016-10-22 12:00:00", // "newDeadline": "2016-10-22 12:00:00",
// "billingIsolateType": "refund", // "billingIsolateType": "refund",
// "billingExtParam":{ // "billingExtParam":{
// "sv_xxx":"sv_xxx"// 查询用量时业务返回的数据 // "sv_xxx":"sv_xxx"// 查询用量时业务返回的数据
// } // }
// } // }
// } // }
// } // }
//隔离资源 //隔离资源
async isolateResource(pobj) { async isolateResource(pobj) {
if (!pobj.interface.para.resourceId) { if (!pobj.interface.para.resourceId) {
return self.returnTX(-1, "mall_logic", "参数错误", null) return self.returnTX(-1, "mall_logic", "参数错误", null)
} }
var orderProduct = await this.orderProductDao.findOne({ order_num: pobj.interface.para.resourceId });
if (!orderProduct) {
return self.returnTX(-1, "mall_logic", "资源不存在", null)
}
if (orderProduct.dataValues.status == 2) {
return self.returnTX(1, "mall_logic", "ok", null)
}
if (orderProduct.dataValues.status == 3) {
return self.returnTX(-1, "mall_logic", "资源已销毁", null)
}
await this.orderProductDao.update({ id: orderProduct.dataValues.id, status: 2, isolated_time: new Date() });
return self.returnTX(1, "mall_logic", "ok", null)
}
//销毁资源
async destroyResource(pobj) {
if (!pobj.interface.para.resourceId) {
return self.returnTX(-1, "mall_logic", "参数错误", null)
}
var orderProduct = await this.orderProductDao.findOne({ order_num: pobj.interface.para.resourceId });
if (!orderProduct) {
return self.returnTX(-1, "mall_logic", "资源不存在", null)
}
if (orderProduct.dataValues.status == 1) {
return self.returnTX(-1, "mall_logic", "资源未隔离", null)
}
if (orderProduct.dataValues.status == 3) {
return self.returnTX(1, "mall_logic", "资源已销毁", null)
} }
var flow_id = await this.getBusUid("f");
var newobj = {
flow_id: flow_id,
deal_name: pobj.interface.para.resourceId,
request_url: "qcloud.PRODUCT_NAME.destroyResource",
requestjson: pobj,
push_url: "",
push_action_type: "",
push_status: "2",
}
var creatlog = await this.create(newobj);
if (!creatlog) {
return self.returnTX(-1, "mall_logic", "请求错误", null)
}
await this.orderProductDao.update({ id: orderProduct.dataValues.id, status: 3 });
return self.returnTX(1, "mall_logic", "ok", { flowId: flow_id })
}
//新购参数检查 //新购参数检查
async checkCreate(pobj) { async checkCreate(pobj) {
......
...@@ -101,7 +101,7 @@ class NeedSolutionService extends ServiceBase { ...@@ -101,7 +101,7 @@ class NeedSolutionService extends ServiceBase {
await self.dao.update(updateObj, t); await self.dao.update(updateObj, t);
await self.needInfoDao.update({ id: needinfo.id, status: "3" }, t); await self.needInfoDao.update({ id: needinfo.id, status: "3" }, t);
//发送短信通知 //发送短信通知
self.sendSmsNotification("15675201933",needinfo.user_id,needinfo.consult_type,needinfo.consult_type_name,3); self.sendSmsNotification(needinfo.contacts_mobile,needinfo.user_id,needinfo.consult_type,needinfo.consult_type_name,3);
return system.getResultSuccess(); return system.getResultSuccess();
}); });
...@@ -126,7 +126,8 @@ class NeedSolutionService extends ServiceBase { ...@@ -126,7 +126,8 @@ class NeedSolutionService extends ServiceBase {
await self.needInfoDao.update({ id: needinfo.id, status: "3" }, t); await self.needInfoDao.update({ id: needinfo.id, status: "3" }, t);
await self.dao.create(createObj, t); await self.dao.create(createObj, t);
//发送短信通知 //发送短信通知
self.sendSmsNotification("15675201933",needinfo.consult_type,needinfo.consult_type_name,3); // self.sendSmsNotification(needinfo.contacts_mobile,needinfo.consult_type,needinfo.consult_type_name,3);
self.sendSmsNotification(needinfo.contacts_mobile,needinfo.user_id,needinfo.consult_type,needinfo.consult_type_name,3);
return system.getResultSuccess(solution_num); return system.getResultSuccess(solution_num);
}); });
......
...@@ -118,7 +118,7 @@ class ApplyInfoService extends ServiceBase { ...@@ -118,7 +118,7 @@ class ApplyInfoService extends ServiceBase {
var companyCount = await this.dao.findCount({ where: { apply_type: 1, user_id: ab.UserId } });//公司数量 var companyCount = await this.dao.findCount({ where: { apply_type: 1, user_id: ab.UserId } });//公司数量
var selfEmployedPersonCount = await this.dao.findCount({ where: { apply_type: 2, user_id: ab.UserId } });//个体户数量 var selfEmployedPersonCount = await this.dao.findCount({ where: { apply_type: 2, user_id: ab.UserId } });//个体户数量
var waitConfirmCount = await this.needInfoDao.findCount({ where: { status: 3, user_id: ab.UserId, consult_type: { [this.db.Op.like]: productTypeOne } } });//待确认方案数量 var waitConfirmCount = await this.needInfoDao.findCount({ where: { status: 3, user_id: ab.UserId, consult_type: { [this.db.Op.like]: productTypeOne } } });//待确认方案数量
var waitReceiveFileOrderCount = await this.orderDeliveryDao.findOverviewCount(13, ab.UserId, ab.ProductTypeOne);//待收文件数量 var waitReceiveFileOrderCount = await this.orderDeliveryDao.findOverviewCount(150, ab.UserId, ab.ProductTypeOne);//待收文件数量
// var unpaidCount = await this.orderInfoDao.findCount({where:{order_status:0}});//待支付订单数量 // var unpaidCount = await this.orderInfoDao.findCount({where:{order_status:0}});//待支付订单数量
if(ab.ProductTypeOne == "qcfw"){//资质证照 if(ab.ProductTypeOne == "qcfw"){//资质证照
var icpCount = await this.orderInfoDao.findOrderCountByProductPathCode("/qcfw/icp/",ab.UserId);//icp数量 var icpCount = await this.orderInfoDao.findOrderCountByProductPathCode("/qcfw/icp/",ab.UserId);//icp数量
......
...@@ -139,13 +139,14 @@ class OrderDeliveryService extends ServiceBase { ...@@ -139,13 +139,14 @@ class OrderDeliveryService extends ServiceBase {
var deliver_content = orderdeliveryinfo.deliver_content || {}; var deliver_content = orderdeliveryinfo.deliver_content || {};
var updateObj = { id: orderdeliveryinfo.id, delivery_status: ab.status }; var updateObj = { id: orderdeliveryinfo.id, delivery_status: ab.status };
if (ab.deliverContent && Object.keys(ab.deliverContent).length > 0) {//判断传参交付内容不为空 if (ab.deliverContent && Object.keys(ab.deliverContent).length > 0) {//判断传参交付内容不为空
for (var item in ab.deliverContent) { // for (var item in ab.deliverContent) {
deliver_content[item] = ab.deliverContent[item]; // deliver_content[item] = ab.deliverContent[item];
} // }
Object.assign(deliver_content, ab.deliverContent);
updateObj["deliver_content"] = deliver_content; updateObj["deliver_content"] = deliver_content;
} }
await this.dao.update(updateObj); await this.dao.update(updateObj);
if(ab.status==170 || ab.status==30 || ab.status==160 ){//交付状态:已完成,已交付,已签收 if(ab.status==170 || ab.status==30 || ab.status==160 || ab.status==150 ){//交付状态:已完成,已交付,已签收
this.createQualificationCertificateInfo(ab.orderNum);//创建资质证照信息 this.createQualificationCertificateInfo(ab.orderNum);//创建资质证照信息
this.createApplyInfo(ab.orderNum);//创建申请主体信息 this.createApplyInfo(ab.orderNum);//创建申请主体信息
} }
...@@ -174,7 +175,7 @@ class OrderDeliveryService extends ServiceBase { ...@@ -174,7 +175,7 @@ class OrderDeliveryService extends ServiceBase {
product_type_name = productArr[2]; product_type_name = productArr[2];
} }
//联系人电话 //联系人电话
smsParams.phoneNumber=orderdetail.order_snapshot && orderdetail.order_snapshot.contactsPhone?orderdetail.order_snapshot.contactsPhone:"15675201933";//联系人手机号 smsParams.phoneNumber=orderdetail.order_snapshot && orderdetail.order_snapshot.contactsPhone?orderdetail.order_snapshot.contactsPhone:"";//联系人手机号
//用户id //用户id
webinfoParams.subAccount=orderdetail.user_id || "";//用户id webinfoParams.subAccount=orderdetail.user_id || "";//用户id
//判断联系人手机号、用户id、产品类型 //判断联系人手机号、用户id、产品类型
...@@ -277,12 +278,13 @@ class OrderDeliveryService extends ServiceBase { ...@@ -277,12 +278,13 @@ class OrderDeliveryService extends ServiceBase {
} }
smsParams.messageBody = smsMessageBody; smsParams.messageBody = smsMessageBody;
webinfoParams.messageBody = webinfoMessageBody; webinfoParams.messageBody = webinfoMessageBody;
smsParams.phoneNumber = "15675201933";//测试电话号码 // smsParams.phoneNumber = "13075556693";//测试电话号码
await this.utilsMsgSendSve.sendMessageVerify({phoneList:[smsParams],subAccountList:[webinfoParams]});//发送短信 await this.utilsMsgSendSve.sendMessageVerify({phoneList:[smsParams],subAccountList:[webinfoParams]});//发送短信
} }
return; return;
} }
} catch (e) { } catch (e) {
console.log(e.stack)
this.execClient.execLogs("orderDeliverySve.js/sendSmsNotification(发送短信通知)方法出现异常", {orderNum:orderNum,status:status}, "", null, e.stack); this.execClient.execLogs("orderDeliverySve.js/sendSmsNotification(发送短信通知)方法出现异常", {orderNum:orderNum,status:status}, "", null, e.stack);
return; return;
} }
...@@ -372,7 +374,7 @@ class OrderDeliveryService extends ServiceBase { ...@@ -372,7 +374,7 @@ class OrderDeliveryService extends ServiceBase {
apply_name: companyInfo.companyName, apply_name: companyInfo.companyName,
credit_code: companyInfo.creditCode, credit_code: companyInfo.creditCode,
apply_type:companyInfo.companyType=="个体工商户" ? 2 : 1, apply_type:companyInfo.companyType=="个体工商户" ? 2 : 1,
operator: deliver_content.managerInfo && deliver_content.managerInfo.operatorName?deliver_content.managerInfo.operatorName:"", operator: companyInfo.shareholderName||"",
regist_capital: companyInfo.registeredCapital, regist_capital: companyInfo.registeredCapital,
business_term: companyInfo.businessTerm, business_term: companyInfo.businessTerm,
establish_time: companyInfo.establishedTime, establish_time: companyInfo.establishedTime,
...@@ -386,7 +388,7 @@ class OrderDeliveryService extends ServiceBase { ...@@ -386,7 +388,7 @@ class OrderDeliveryService extends ServiceBase {
apply_name: companyInfo.companyName, apply_name: companyInfo.companyName,
credit_code: companyInfo.creditCode, credit_code: companyInfo.creditCode,
apply_type:companyInfo.companyType=="个体工商户" ? 2 : 1, apply_type:companyInfo.companyType=="个体工商户" ? 2 : 1,
operator: deliver_content.managerInfo && deliver_content.managerInfo.operatorName?deliver_content.managerInfo.operatorName:"", operator:companyInfo.shareholderName||"",
regist_capital: companyInfo.registeredCapital, regist_capital: companyInfo.registeredCapital,
business_term: companyInfo.businessTerm, business_term: companyInfo.businessTerm,
establish_time: companyInfo.establishedTime, establish_time: companyInfo.establishedTime,
......
...@@ -49,6 +49,11 @@ class OrderInfoService extends ServiceBase { ...@@ -49,6 +49,11 @@ class OrderInfoService extends ServiceBase {
if (!orderinfo || !orderinfo.order_num) { if (!orderinfo || !orderinfo.order_num) {
return system.getResultFail(-300, "未知订单信息"); return system.getResultFail(-300, "未知订单信息");
} }
var relatedProductsList = [];
if(orderinfo.tx_orders_num){
relatedProductsList = await this.getRelatedProductsList(orderinfo.tx_orders_num,ab.UserId,ab.OrderNum);
}
orderinfo["relatedProductsList"] = relatedProductsList;
var deliveryParams = { var deliveryParams = {
where: { order_num: ab.OrderNum }, where: { order_num: ab.OrderNum },
attributes: ["deliver_content", "created_at", "updated_at", "delivery_status", "delivery_status_name"], attributes: ["deliver_content", "created_at", "updated_at", "delivery_status", "delivery_status_name"],
...@@ -65,6 +70,22 @@ class OrderInfoService extends ServiceBase { ...@@ -65,6 +70,22 @@ class OrderInfoService extends ServiceBase {
orderinfo["orderProductInfo"] = orderproduct; orderinfo["orderProductInfo"] = orderproduct;
return system.getResultSuccess(orderinfo); return system.getResultSuccess(orderinfo);
} }
//获取关联产品列表
async getRelatedProductsList(TxOrdersNum,UserId,OrderNum){
var whereObj = {
tx_orders_num:TxOrdersNum,user_id:UserId
};
if(OrderNum){
whereObj["order_num"] = { [this.db.Op.ne]: OrderNum };
}
// orderdetail.tx_orders_num,orderdetail.order_num
var relatedProductsList = await this.orderProductDao.model.findAll({
attributes:["product_type","product_type_name"],
where:whereObj,
raw:true
});
return relatedProductsList;
}
//获取订单列表 //获取订单列表
async getOrderList(pobj) { async getOrderList(pobj) {
if (!pobj || !pobj.actionBody) { if (!pobj || !pobj.actionBody) {
...@@ -101,109 +122,114 @@ class OrderInfoService extends ServiceBase { ...@@ -101,109 +122,114 @@ class OrderInfoService extends ServiceBase {
if (!pobj.actionBody.logId) { if (!pobj.actionBody.logId) {
return system.getResultFail(-101, "参数错误"); return system.getResultFail(-101, "参数错误");
} }
// var selobj = {
// "version": 1,
// "componentName": "qcbuy",
// "eventId": 143371,
// "timestamp": Date.now(),
// "user": "auto",
// "interface": {
// "interfaceName": "qcloud.Deal.getDealsByNameOrBigId",
// "para": {
// "cond": {
// "name": pobj.actionBody.interface.para.dealName,
// "ownerUin": pobj.actionBody.interface.para.uin,
// }
// }
// },
// "seqId": "647ea242-f654-965d-a62a-eabe0289d954",
// "spanId": "https://buy.qcloud.com;61911"
// }
// var txorder = this.execPostByTimeOut(selobj, "http://trade.sandbox.com/interfaces/interface.php");
if (!pobj.actionBody.interface.para.dealName || !pobj.actionBody.interface.para.bigDealId) { if (!pobj.actionBody.interface.para.dealName || !pobj.actionBody.interface.para.bigDealId) {
return system.getResultFail(-101, "参数异常"); return system.getResultFail(-101, "参数异常");
} }
var selobj = {
pobj.actionBody.interface.para.bigDealId
var txorder = {
"version": 1, "version": 1,
"componentName": "trade", "componentName": "qcbuy",
"timestamp": 1506343680, "eventId": 143371,
"eventId": 642681313, "timestamp": Date.now(),
"returnValue": 0, "user": "auto",
"returnCode": 0, "interface": {
"returnMessage": "ok", "interfaceName": "qcloud.Deal.getDealsByNameOrBigId",
"data": { "para": {
"totalNum": "1", "cond": {
"deals": [ "name": pobj.actionBody.interface.para.dealName,
{ "ownerUin": pobj.actionBody.interface.para.uin,
"dealId": "6138696",
"dealName": "20190919188291",
"bigDealId": "20190919188291",
"goodsCategoryId": "101630",
"goodsDetail": pobj.actionBody.interface.para.goodsDetail,
"ownerUin": "100000013569",
"platform": "1",
"regionId": "1",
"appId": "1254105646",
"goodsNum": "1",
"goodsPrice": {
"activitySpecifiedPrice": 1,
"price": 13800,
"totalCost": 13800,
"policy": 7,
"realTotalCost": 1000,
"policyDetail": {
"total": 7,
"user": 100,
"common": 7
},
"timeSpan": 1,
"timeUnit": "y",
"goodsNum": 1,
"unitPrice": 13800,
"formula": "新配置价格10.8 - 老配置单价5.4"
},
"creater": "100001050256",
"creatTime": "2017-08-29 20:59:14",
"overdueTime": "2017-09-13 20:59:14",
"payer": "100001050256",
"billId": "20170829030000071201512598909616",
"endTime": "2017-08-29 21:01:29",
"cartRecId": "0",
"payStartTime": "2017-08-29 20:59:15",
"payEndTime": "2017-08-29 20:59:15",
"taskStartTime": "2017-08-29 21:01:04",
"taskEndTime": "2017-08-29 21:01:29",
"taskDetail": {
"flowId": 345420,
"resourceIds": [
374594
]
},
"status": "4",
"reserved": "0",
"retry": "0",
"reportFlag": "0",
"payMode": "1",
"voucherDecline": null,
"voucherId": null,
"projectId": "0",
"payerMode": "0",
"agentPayer": null,
"dealType": "0",
"activityId": "1986",
"phone": "",
"ticket": "",
"goodsExpiredTime": null,
"updateTime": "2017-08-29 21:01:29",
"zoneId": "0",
"providerOwnerUin": ""
} }
]
} }
},
"seqId": "647ea242-f654-965d-a62a-eabe0289d954",
"spanId": "https://buy.qcloud.com;61911"
}
var txorderinfo = await this.execPostByTimeOut(selobj, "http://trade.sandbox.com/interfaces/interface.php");
if (txorderinfo.status < 0) {
return system.getResultFail(-101, "post is error");
} }
txorder = txorderinfo.data;
console.log(txorder)
// var txorder = {
// "version": 1,
// "componentName": "trade",
// "timestamp": 1506343680,
// "eventId": 642681313,
// "returnValue": 0,
// "returnCode": 0,
// "returnMessage": "ok",
// "data": {
// "totalNum": "1",
// "deals": [
// {
// "dealId": "6138696",
// "dealName": "20190919188291",
// "bigDealId": "20190919188291",
// "goodsCategoryId": "101630",
// "goodsDetail": pobj.actionBody.interface.para.goodsDetail,
// "ownerUin": "100000013569",
// "platform": "1",
// "regionId": "1",
// "appId": "1254105646",
// "goodsNum": "1",
// "goodsPrice": {
// "activitySpecifiedPrice": 1,
// "price": 13800,
// "totalCost": 13800,
// "policy": 7,
// "realTotalCost": 1000,
// "policyDetail": {
// "total": 7,
// "user": 100,
// "common": 7
// },
// "timeSpan": 1,
// "timeUnit": "y",
// "goodsNum": 1,
// "unitPrice": 13800,
// "formula": "新配置价格10.8 - 老配置单价5.4"
// },
// "creater": "100001050256",
// "creatTime": "2017-08-29 20:59:14",
// "overdueTime": "2017-09-13 20:59:14",
// "payer": "100001050256",
// "billId": "20170829030000071201512598909616",
// "endTime": "2017-08-29 21:01:29",
// "cartRecId": "0",
// "payStartTime": "2017-08-29 20:59:15",
// "payEndTime": "2017-08-29 20:59:15",
// "taskStartTime": "2017-08-29 21:01:04",
// "taskEndTime": "2017-08-29 21:01:29",
// "taskDetail": {
// "flowId": 345420,
// "resourceIds": [
// 374594
// ]
// },
// "status": "4",
// "reserved": "0",
// "retry": "0",
// "reportFlag": "0",
// "payMode": "1",
// "voucherDecline": null,
// "voucherId": null,
// "projectId": "0",
// "payerMode": "0",
// "agentPayer": null,
// "dealType": "0",
// "activityId": "1986",
// "phone": "",
// "ticket": "",
// "goodsExpiredTime": null,
// "updateTime": "2017-08-29 21:01:29",
// "zoneId": "0",
// "providerOwnerUin": ""
// }
// ]
// }
// }
if (txorder.status < 0) { if (txorder.status < 0) {
return system.getResultFail(-101, "post is error"); return system.getResultFail(-101, "post is error");
} }
...@@ -308,7 +334,7 @@ class OrderInfoService extends ServiceBase { ...@@ -308,7 +334,7 @@ class OrderInfoService extends ServiceBase {
return system.getResultSuccess(); return system.getResultSuccess();
}); });
if (corder.status > 0) { if (corder.status > 0) {
await self.txPushLogDao.update({ id: pobj.logId, push_status: 1 }); await self.txPushLogDao.update({ id: pobj.actionBody.logId, push_status: 1 });
} }
if (!ispush) { if (!ispush) {
return system.getResultSuccess(); return system.getResultSuccess();
...@@ -589,47 +615,47 @@ class OrderInfoService extends ServiceBase { ...@@ -589,47 +615,47 @@ class OrderInfoService extends ServiceBase {
"url": "https://buy.cloud.tencent.com/order/check", "url": "https://buy.cloud.tencent.com/order/check",
"param": so "param": so
} }
await this.test(so); // await this.test(so);
return system.getResultSuccess(robj); return system.getResultSuccess(robj);
} }
async test(pobj) { // async test(pobj) {
var p = { // var p = {
"eventId": 697271589, // "eventId": 697271589,
"componentName": "BillingRoute", // "componentName": "BillingRoute",
"seqId": "unknown", // "seqId": "unknown",
"spanId": "http://trade.tencentyun.com;1", // "spanId": "http://trade.tencentyun.com;1",
"interface": { // "interface": {
"interfaceName": "qcloud.cbs.CreateCbsInstance", // "interfaceName": "qcloud.cbs.CreateCbsInstance",
"para": { // "para": {
"appId": 123, // "appId": 123,
"tranId": "20190919188290", // "tranId": "20190919188290",
"dealName": Date.now(), // "dealName": Date.now(),
"bigDealId": Date.now(), // "bigDealId": Date.now(),
"uin": "100000013569", // "uin": "100000013569",
"type": "cbs", // "type": "cbs",
"region": 6, // "region": 6,
"operateUin": "100000013569", // "operateUin": "100000013569",
"payMode": 1, // "payMode": 1,
"projectId": 1019190, // "projectId": 1019190,
"zoneId": 400001, // "zoneId": 400001,
"goodsDetail": pobj.itemDetails.raw_goodsData[0].goodsDetail // "goodsDetail": pobj.itemDetails.raw_goodsData[0].goodsDetail
} // }
} // }
} // }
await this.execPostByTimeOut(p, "http://192.168.1.113:4011/api/action/txapi/springBoard"); // await this.execPostByTimeOut(p, "http://192.168.1.113:4011/api/action/txapi/springBoard");
if (pobj.itemDetails.raw_goodsData.length == 2) { // if (pobj.itemDetails.raw_goodsData.length == 2) {
p.interface.para.dealName = Date.now(); // p.interface.para.dealName = Date.now();
p.interface.para.goodsDetail = pobj.itemDetails.raw_goodsData[1].goodsDetail; // p.interface.para.goodsDetail = pobj.itemDetails.raw_goodsData[1].goodsDetail;
await this.execPostByTimeOut(p, "http://192.168.1.113:4011/api/action/txapi/springBoard"); // await this.execPostByTimeOut(p, "http://192.168.1.113:4011/api/action/txapi/springBoard");
} // }
if (pobj.itemDetails.raw_goodsData.length == 3) { // if (pobj.itemDetails.raw_goodsData.length == 3) {
p.interface.para.dealName = Date.now(); // p.interface.para.dealName = Date.now();
p.interface.para.goodsDetail = pobj.itemDetails.raw_goodsData[2].goodsDetail; // p.interface.para.goodsDetail = pobj.itemDetails.raw_goodsData[2].goodsDetail;
await this.execPostByTimeOut(p, "http://192.168.1.113:4011/api/action/txapi/springBoard"); // await this.execPostByTimeOut(p, "http://192.168.1.113:4011/api/action/txapi/springBoard");
} // }
return system.getResultSuccess(); // return system.getResultSuccess();
} // }
//退款 //退款
async refundOrder(pobj) { async refundOrder(pobj) {
...@@ -644,9 +670,9 @@ class OrderInfoService extends ServiceBase { ...@@ -644,9 +670,9 @@ class OrderInfoService extends ServiceBase {
if (!orderProduct) { if (!orderProduct) {
return system.getResultFail(-101, "orderProduct is empty"); return system.getResultFail(-101, "orderProduct is empty");
} }
var productType="p_business_registration"; var productType = "p_business_registration";
if(orderProduct.dataValues.product_type.indexOf("/qcfw/")>-1){ if (orderProduct.dataValues.product_type.indexOf("/qcfw/") > -1) {
productType="p_vat"; productType = "p_vat";
} }
; ;
var o = { var o = {
...@@ -724,7 +750,7 @@ class OrderInfoService extends ServiceBase { ...@@ -724,7 +750,7 @@ class OrderInfoService extends ServiceBase {
} }
//隔离 //隔离
async isolateResource(pobj){ async isolateResource(pobj) {
} }
......
var system = require("../../../system");
var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
class UtilsIcNameService extends AppServiceBase {
constructor() {
super();
}
/**
* 工商核名请求接口
* @param {*}
*/
async checkBusinessNameList(params) {
var result = await this.execPostByTimeOut(params,settings.hemingUrl());
return result;
}
}
module.exports = UtilsIcNameService;
\ No newline at end of file
...@@ -37,6 +37,13 @@ var settings = { ...@@ -37,6 +37,13 @@ var settings = {
return "http://tx.brg.tencentyun.com"; return "http://tx.brg.tencentyun.com";
} }
}, },
hemingUrl: function () {
if (this.env == "dev" || this.env == "test") {
return "http://192.168.1.131:15502/gsb/heming";
} else {
return "http://ic-name-service/gsb/heming";
}
},
redis: function () { redis: function () {
if (this.env == "dev" || this.env == "test") { if (this.env == "dev" || this.env == "test") {
var localsettings = require("./localsettings"); var localsettings = require("./localsettings");
......
<a name="menu" href="/doc">返回主目录</a>
1. [工商核名接口](#icname)
## **<a name="icname"> 工商核名接口</a>**
[返回到目录](#menu)
##### URL
[/api/action/icapi/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 Action:CheckBusinessNameList
``` javascript
{
"Action": "CheckBusinessNameList",
"ActionBody": {
"CityName": "北京", // Y 注册城市地区
"KeyWord": "天达11",// Y 公司字号
"BtName": "文化",// Y 行业类型
"OrgName": "",// Y 组织类型
"SearchType": 1,// N 检索方式:1.公司宝ES查询 2.企查查数据接口Appkey,查询数据库 3.混合两种查询
"SitCity": ""// N 1: cityname + keyword + btname + orgname
2: keyword + cityname + btname + orgname
3: keyword + btname + cityname +orgname
}
}
```
#### 返回结果
```javascript
{
"Response": {
"Status": 1,
"InstanceSet": {
"BrandList": "[]",
"CityList": "[]",
"Code": "200",
"IdenticalCityList": "[{\"id\":0,\"levels\":\"\",\"name\":\"北京<em>天达</em>文化传媒有限公司\",\"per\":66,\"pinyin\":\"\",\"title\":\"\",\"type\":\"\"}]",
"Level": "低",
"Msg": "查询完成",
"Point": 1100,
"SensitiveList": "[]",
"SimilarCityList": "[{\"id\":0,\"levels\":\"\",\"name\":\"北京星<em>天达</em>文化传播有限公司\",\"per\":63,\"pinyin\":\"\",\"title\":\"\",\"type\":\"\"},{\"id\":0,\"levels\":\"\",\"name\":\"北京金源<em>天达</em>文化发展中心\",\"per\":66,\"pinyin\":\"\",\"title\":\"\",\"type\":\"\"},{\"id\":0,\"levels\":\"\",\"name\":\"北京纬祺<em>天达</em>文化有限公司\",\"per\":66,\"pinyin\":\"\",\"title\":\"\",\"type\":\"\"},{\"id\":0,\"levels\":\"\",\"name\":\"北京圣<em>天达</em>文化交流有限公司\",\"per\":63,\"pinyin\":\"\",\"title\":\"\",\"type\":\"\"},{\"id\":0,\"levels\":\"\",\"name\":\"安艺<em>天达</em>(北京)文化传播有限公司\",\"per\":54,\"pinyin\":\"\",\"title\":\"\",\"type\":\"\"},{\"id\":0,\"levels\":\"\",\"name\":\"北京灵科<em>天达</em>文化用品中心\",\"per\":66,\"pinyin\":\"\",\"title\":\"\",\"type\":\"\"},{\"id\":0,\"levels\":\"\",\"name\":\"北京泽<em>天达</em>文化发展有限公司\",\"per\":63,\"pinyin\":\"\",\"title\":\"\",\"type\":\"\"},{\"id\":0,\"levels\":\"\",\"name\":\"北京佳境<em>天达</em>文化传媒有限公司\",\"per\":60,\"pinyin\":\"\",\"title\":\"\",\"type\":\"\"},{\"id\":0,\"levels\":\"\",\"name\":\"北京鑫业<em>天达</em>文化交流中心\",\"per\":66,\"pinyin\":\"\",\"title\":\"\",\"type\":\"\"},{\"id\":0,\"levels\":\"\",\"name\":\"北京智诚<em>天达</em>文化传媒有限公司\",\"per\":60,\"pinyin\":\"\",\"title\":\"\",\"type\":\"\"}]"
},
"RequestId": "ac3eea80-ba17-11ea-a2bb-c30cdcc6eddf"
}
}
```
返回参数说明:
```javascript
{
"Response": {
"Status": 1,
"InstanceSet": {
"brandList": [
{
"id": 0, // Int 保留,默认0
"levels": "中", // String 核名的相似度,“高”或“中”或“低”:1-29,低;30-69 中;70 以上高
"name": "", // String 商标名称
"per": 40, // Int 相似度评分,约值
"pinyin": "", // String 如是拼音相同,返回命中词的拼音;其他返回“”
"type": "" // String 保留,默认“”
}
],
"cityList": [
{
"id": 0, // Int 保留,默认0
"levels": "中", // String 核名的相似度,“高”或“中”或“低”:1-29,低;30-69 中;70 以上高
"name": "", // String 与字号相同的地区城市名词
"per": 40, // Int 相似度评分,约值
"pinyin": "", // String 如是拼音相同,返回命中词的拼音;其他返回“”
"title": "", // String 保留,默认“”
"type": "" // String 保留,默认“”
}
],
"code": "200",
"identicalCityList": [
{
"id": 0, // Int 保留,默认0
"levels": "中", // String 核名的相似度,“高”或“中”或“低”:1-29,低;30-69 中;70 以上高
"name": "<em>意欣</em>(北京)医药技术有限公司", // String 企业名称或敏感词
"per": 40, // Int 相似度评分,约值
"pinyin": "", // String 如是拼音相同,返回命中词的拼音;其他返回“”
"title": "", // String 保留,默认“”
"type": "" // String 保留,默认“”
}
],
"level": "低",
"msg": "查询完成",
"point": 800,
"sensitiveList": [
{
"id":0 , // Int 保留,默认0
"levels":"" , // String 核名的相似度,“高”或“中”或“低”:1-29,低;30-69 中;70 以上高
"name":"" , // String 企业名称或敏感词
"per": "", // Int 相似度评分,约值
"pinyin": "", // String 如是拼音相同,返回命中词的拼音;其他返回“”
"title": "", // String 保留,默认“”
"type": "" // String 保留,默认“”
}
],
"similarCityList": [
{
"id": 0, // Int 保留,默认0
"levels": "中", // String 核名的相似度,“高”或“中”或“低”:1-29,低;30-69 中;70 以上高
"name": "北京<em>意欣</em>千阳文化发展有限责任公司"", // String 企业名称或敏感词
"per": 36, // Int 相似度评分,约值
"pinyin": "", // String 如是拼音相同,返回命中词的拼音;其他返回“”
"title": "", // String 保留,默认“”
"type": "" // String 保留,默认“”
}
]
},
"RequestId": "ac3eea80-ba17-11ea-a2bb-c30cdcc6eddf"
}
}
Level 准则:
Point:0-49 分通过率为高
Point:50-99 分通过率为中
Point:100 以上通过率为低
```
\ No newline at end of file
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