Commit c5d6b24c 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;
...@@ -24,11 +24,11 @@ class Need extends APIBase { ...@@ -24,11 +24,11 @@ class Need extends APIBase {
async opActionProcess(pobj, action_type, req) { async opActionProcess(pobj, action_type, req) {
var opResult = null; var opResult = null;
var verificationCodeList = [ var verificationCodeList = [
// "needSubmit" "needSubmit"
]; ];
var self = this; var self = this;
if (verificationCodeList.indexOf(action_type) > -1) { if (verificationCodeList.indexOf(action_type) > -1) {
if (!pobj.actionBody.contactsMoblie) { if (!pobj.actionBody.ContactsMoblie) {
opResult = system.getResult(null, "contactsMoblie参数错误"); opResult = system.getResult(null, "contactsMoblie参数错误");
return opResult; return opResult;
} }
...@@ -36,7 +36,7 @@ class Need extends APIBase { ...@@ -36,7 +36,7 @@ class Need extends APIBase {
opResult = system.getResult(null, "verificationCode参数错误"); opResult = system.getResult(null, "verificationCode参数错误");
return opResult; return opResult;
} }
var v = await self.utilsMsgSendSve.getVerificationCode(pobj.actionBody.contactsMoblie); var v = await self.utilsMsgSendSve.getVerificationCode(pobj.actionBody.ContactsMoblie);
if (v != pobj.actionBody.VerificationCode) { if (v != pobj.actionBody.VerificationCode) {
opResult = system.getResult(null, "验证码错误"); opResult = system.getResult(null, "验证码错误");
return opResult; return opResult;
...@@ -64,3 +64,4 @@ class Need extends APIBase { ...@@ -64,3 +64,4 @@ class Need extends APIBase {
} }
module.exports = Need; module.exports = Need;
...@@ -29,16 +29,20 @@ class Order extends APIBase { ...@@ -29,16 +29,20 @@ class Order extends APIBase {
async opActionProcess(pobj, action_type, req) { async opActionProcess(pobj, action_type, req) {
var opResult = null; var opResult = null;
var verificationCodeList = [ var verificationCodeList = [
// "submitGoodsinfo" "submitGoodsinfo"
]; ];
var self = this; var self = this;
if (verificationCodeList.indexOf(action_type) > -1) { if (verificationCodeList.indexOf(action_type) > -1) {
if (!pobj.actionBody.contactsMoblie) { if (!pobj.actionBody.Info) {
opResult = system.getResult(null, "contactsMoblie参数错误"); return system.getResultFail(-101, "Info is empty");
}
pobj.actionBody.Info = JSON.parse(pobj.actionBody.Info);
if (!pobj.actionBody.Info[0].formInfo.contactsPhone) {
opResult = system.getResult(null, "contactsPhone参数错误");
return opResult; return opResult;
} }
if (pobj.actionBody.VerificationCode) { if (pobj.actionBody.VerificationCode) {
var v = await self.utilsMsgSendSve.getVerificationCode(pobj.actionBody.contactsMoblie); var v = await self.utilsMsgSendSve.getVerificationCode(pobj.actionBody.Info[0].formInfo.contactsPhone);
if (v != pobj.actionBody.VerificationCode) { if (v != pobj.actionBody.VerificationCode) {
opResult = system.getResult(null, "验证码错误"); opResult = system.getResult(null, "验证码错误");
return opResult; return opResult;
......
...@@ -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 "+
......
...@@ -24,38 +24,44 @@ class TxPushLogService extends ServiceBase { ...@@ -24,38 +24,44 @@ class TxPushLogService extends ServiceBase {
if (!pobj.interface.para.dealName) { if (!pobj.interface.para.dealName) {
return self.returnTX(-1, "cgateway", "参数错误", null) return self.returnTX(-1, "cgateway", "参数错误", null)
} }
var loginfo = await this.findOne({ deal_name: pobj.interface.para.dealName, push_action_type: "orderPayNotify" }); try {
if (loginfo) { var loginfo = await this.findOne({ deal_name: pobj.interface.para.dealName, push_action_type: "orderPayNotify" });
return self.returnTX(1, "cgateway", "ok", { "flowId": loginfo.flow_id, "resourceIds": [pobj.interface.para.dealName] }) if (loginfo) {
} return self.returnTX(1, "cgateway", "ok", { "flowId": loginfo.flow_id, "resourceIds": [pobj.interface.para.dealName] })
var flow_id = await this.getBusUid("f"); }
var newobj = { var flow_id = await this.getBusUid("f");
flow_id: flow_id, var newobj = {
deal_name: pobj.interface.para.dealName, flow_id: flow_id,
request_url: "qcloud.PRODUCT_NAME.createResource", deal_name: pobj.interface.para.dealName,
requestjson: pobj, request_url: "qcloud.PRODUCT_NAME.createResource",
push_url: "/api/action/order/springBoard", requestjson: pobj,
push_action_type: "orderPayNotify", push_url: "/api/action/order/springBoard",
push_status: "2", push_action_type: "orderPayNotify",
} push_status: "2",
var creatlog = await this.create(newobj);
if (!creatlog) {
return self.returnTX(-1, "cgateway", "参数错误", null)
}
pobj.logId = creatlog.dataValues.id;
var pushobj = {
"actionType": "produceData",// Y 功能名称
"actionBody": {
notifyUrl: "",
actionType: "orderPayNotify",
pushUrl: "192.168.1.113:4011/api/action/order/springBoard",
messageBody: pobj,
identifyCode: "orderPayNotify"
} }
}; var creatlog = await this.create(newobj);
this.execPostByTimeOut(pushobj, settings.opPushUrl()); if (!creatlog) {
return self.returnTX(-1, "cgateway", "参数错误", null)
}
pobj.logId = creatlog.dataValues.id;
var pushobj = {
"actionType": "produceData",// Y 功能名称
"actionBody": {
notifyUrl: "",
actionType: "orderPayNotify",
pushUrl: "http://brguser.brg.tencentyun.com/api/action/order/springBoard",
messageBody: pobj,
identifyCode: "orderPayNotify"
}
};
var a = await this.execPostByTimeOut(pushobj, settings.opPushUrl());
return self.returnTX(1, "cgateway", "ok", { "flowId": creatlog.flow_id, "resourceIds": [pobj.interface.para.dealName] })
} catch (error) {
console.log(error);
return self.returnTX(-1, "cgateway", "请求失败", null)
}
return self.returnTX(1, "cgateway", "ok", { "flowId": creatlog.flow_id, "resourceIds": [pobj.interface.para.dealName] })
} }
//发货检查 //发货检查
...@@ -120,43 +126,87 @@ class TxPushLogService extends ServiceBase { ...@@ -120,43 +126,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) {
......
...@@ -110,7 +110,7 @@ class NeedInfoService extends ServiceBase { ...@@ -110,7 +110,7 @@ class NeedInfoService extends ServiceBase {
var pushobj = { var pushobj = {
"actionType": "produceData",// Y 功能名称 "actionType": "produceData",// Y 功能名称
"actionBody": { "actionBody": {
notifyUrl: "http://192.168.1.113:4011/api/receive/notifyApi/springBoard", notifyUrl: "http://brguser.brg.tencentyun.com/api/receive/notifyApi/springBoard",
actionType: "needSubmit", actionType: "needSubmit",
pushUrl: settings.deliveryUrl() + "/entService/consultation/springBoard", pushUrl: settings.deliveryUrl() + "/entService/consultation/springBoard",
messageBody: actionBody, messageBody: actionBody,
...@@ -128,6 +128,7 @@ class NeedInfoService extends ServiceBase { ...@@ -128,6 +128,7 @@ class NeedInfoService extends ServiceBase {
return system.getResultSuccess(); return system.getResultSuccess();
} catch (e) { } catch (e) {
return system.getResultFail(-510, e) return system.getResultFail(-510, e)
} }
} }
......
...@@ -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,
......
...@@ -12,7 +12,7 @@ class OrderInfoService extends ServiceBase { ...@@ -12,7 +12,7 @@ class OrderInfoService extends ServiceBase {
this.txPushLogDao = system.getObject("db.common.txPushLogDao"); this.txPushLogDao = system.getObject("db.common.txPushLogDao");
this.needInfoDao = system.getObject("db.need.needInfoDao"); this.needInfoDao = system.getObject("db.need.needInfoDao");
this.orderRefundDao = system.getObject("db.order.orderRefundDao"); this.orderRefundDao = system.getObject("db.order.orderRefundDao");
} }
//订单详情(客户查看订单进度) //订单详情(客户查看订单进度)
async getOrderDetail(pobj) { async getOrderDetail(pobj) {
...@@ -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) {
...@@ -93,7 +114,8 @@ class OrderInfoService extends ServiceBase { ...@@ -93,7 +114,8 @@ class OrderInfoService extends ServiceBase {
var result = await this.dao.getQcOrderList(ab); var result = await this.dao.getQcOrderList(ab);
return result; return result;
} }
//发货回调
async orderPayNotify(pobj) { async orderPayNotify(pobj) {
if (!pobj.actionBody.interface || !pobj.actionBody.interface.para) { if (!pobj.actionBody.interface || !pobj.actionBody.interface.para) {
return system.getResultFail(-101, "参数错误"); return system.getResultFail(-101, "参数错误");
...@@ -101,31 +123,217 @@ class OrderInfoService extends ServiceBase { ...@@ -101,31 +123,217 @@ 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 = {
"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 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);
if (txorder.status < 0) {
return system.getResultFail(-101, "post is error");
}
if (txorder.data.returnValue < 0) {
return system.getResultFail(-101, "txorder is error");
}
var txorderdetail = txorder.data.deals[0];
console.log(txorderdetail.goodsDetail, "....txorderdetail.goodsDetail.....1");
var self = this;
var isoldsolutionorder = false;
var ispush = true;
var corder = await this.db.transaction(async function (t) {
var oldorder = await self.findOne({ order_num: pobj.actionBody.interface.para.dealName, tx_orders_num: pobj.actionBody.interface.para.bigDealId }, t)
if (oldorder) {
ispush = false;
return system.getResultSuccess();
}
if (txorderdetail.goodsDetail.formInfo.solutionNum) {
var snobj = {
solutionNum: txorderdetail.goodsDetail.formInfo.solutionNum
}
var sql = "SELECT * FROM `b_order_product` where tx_order_snapshot->'$.goodsDetail.formInfo.solutionNum'=:solutionNum;"
var orderproductinfo = await self.customQuery(sql, snobj, t);
if (orderproductinfo && orderproductinfo.length > 0) {
if (orderproductinfo[0].tx_orders_num != pobj.actionBody.interface.para.bigDealId) {
ispush = false;
isoldsolutionorder = true;
}
} else {
await self.needInfoDao.updateByWhere({ status: 4 }, { where: { need_num: txorderdetail.goodsDetail.formInfo.needNum } }, t)
}
}
//创建订单
console.log(txorderdetail.goodsDetail, "....txorderdetail.goodsDetail...2");
var orderobj = {
tx_orders_num: pobj.actionBody.interface.para.bigDealId,
order_num: pobj.actionBody.interface.para.dealName,
need_num: txorderdetail.goodsDetail.formInfo.needNum || "",
user_id: pobj.actionBody.interface.para.uin,
user_name: "",
quantity: txorderdetail.goodsNum || 1,
total_sum: txorderdetail.goodsPrice.totalCost || 0,
discount_amount: Number(txorderdetail.goodsPrice.totalCost) - Number(txorderdetail.goodsPrice.realTotalCost),
pay_total_sum: txorderdetail.goodsPrice.realTotalCost || 0,
order_status: 1,
order_status_name: "已付款",
user_name: txorderdetail.goodsDetail.formInfo.userName,
pay_time: new Date(txorderdetail.payEndTime)
}
if (isoldsolutionorder) {
orderobj.order_status = 320;
orderobj.order_status_name = "已退款";
}
var orderinfo = await self.create(orderobj, t);
if (isoldsolutionorder) {
return system.getResultSuccess();
}
//创建订单产品
var orderProductobj = {
tx_orders_num: pobj.actionBody.interface.para.bigDealId,
order_num: pobj.actionBody.interface.para.dealName,
user_id: pobj.actionBody.interface.para.uin,
region_id: txorderdetail.goodsDetail.formInfo.serviceCode || 0,
region_name: txorderdetail.goodsDetail.formInfo.serviceArea || "",
product_icon: txorderdetail.goodsDetail.product.productIcon || 0,
product_type: txorderdetail.goodsDetail.product.productType || 0,
product_type_name: txorderdetail.goodsDetail.product.productTypeName || "",
order_snapshot: txorderdetail.goodsDetail.formInfo || {},
servicer_code: txorderdetail.goodsDetail.product.servicerCode || "",
servicer_name: txorderdetail.goodsDetail.product.servicerName || "",
tx_order_snapshot: txorderdetail,
created_at: new Date(txorderdetail.payEndTime),
user_name: txorderdetail.goodsDetail.formInfo.userName,
start_time: new Date(txorderdetail.payEndTime)
}
var orderProductinfo = await self.orderProductDao.entTimeCreate(orderProductobj, t);
//创建订单交付单
var orderDeliveryobj = {
tx_orders_num: pobj.actionBody.interface.para.bigDealId,
order_num: pobj.actionBody.interface.para.dealName,
user_id: pobj.actionBody.interface.para.uin,
delivery_status: 1,
user_name: txorderdetail.goodsDetail.formInfo.userName
}
var orderDeliveryinfo = await self.orderDeliveryDao.create(orderDeliveryobj, t);
var orderPayobj = {
tx_orders_num: pobj.actionBody.interface.para.bigDealId,
order_num: pobj.actionBody.interface.para.dealName,
user_id: pobj.actionBody.interface.para.uin,
op_type: 1,
op_type_name: "收",
pay_total_sum: txorderdetail.goodsPrice.realTotalCost,
created_at: new Date(txorderdetail.payEndTime),
user_name: txorderdetail.goodsDetail.formInfo.userName
}
await self.orderStatementDao.create(orderPayobj, t);
var txPushLoginfo = await self.txPushLogDao.findOne({ deal_name: pobj.actionBody.interface.para.dealName });
if (!txPushLoginfo) {
return system.getResultFail(-101, "txPushLoginfo is error");
}
txPushLoginfo.dataValues.push_status = 0;
await self.txPushLogDao.update(txPushLoginfo.dataValues, t);
return system.getResultSuccess();
});
if (corder.status > 0) {
await self.txPushLogDao.update({ id: pobj.actionBody.logId, push_status: 0 });
}
if (!ispush) {
return system.getResultSuccess();
}
//生产者------订单推送
var pushobj = {
"actionType": "produceData",// Y 功能名称
"actionBody": {
notifyUrl: "",
actionType: "orderSubmit",
pushUrl: settings.deliveryUrl() + "/entService/order/springBoard",
messageBody: {
"txOrderNum": pobj.actionBody.interface.para.bigDealId,
"orderNum": pobj.actionBody.interface.para.dealName,
"userId": pobj.actionBody.interface.para.uin,
"servicerCode": txorderdetail.goodsDetail.product.servicerCode,
"servicerName": txorderdetail.goodsDetail.product.servicerName,
"regionId": txorderdetail.goodsDetail.formInfo.serviceCode,
"regionName": txorderdetail.goodsDetail.formInfo.serviceArea,
"contactsName": txorderdetail.goodsDetail.formInfo.contactsName,
"contactsMoblie": txorderdetail.goodsDetail.formInfo.contactsMoblie,
"productType": txorderdetail.goodsDetail.product.productType,
"productTypeName": txorderdetail.goodsDetail.product.productTypeName,
"txPriceCode": txorderdetail.goodsDetail.product.txPriceCode,
"realTotalCost": txorderdetail.goodsPrice.realTotalCost,
"orderSnapshot": txorderdetail.goodsDetail.formInfo
},
identifyCode: "orderSubmit"
}
};
var r = await this.execPostByTimeOut(pushobj, settings.opPushUrl());
if (r.status < 1) {
return system.getResultFail(-102, "Post error");
}
return corder;
}
async orderPayNotifydev(pobj) {
if (!pobj.actionBody.interface || !pobj.actionBody.interface.para) {
return system.getResultFail(-101, "参数错误");
}
if (!pobj.actionBody.logId) {
return system.getResultFail(-101, "参数错误");
}
if (!pobj.actionBody.interface.para.dealName || !pobj.actionBody.interface.para.bigDealId) {
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 txorderinfo = await this.execPostByTimeOut(selobj, "http://trade.sandbox.com/interfaces/interface.php");
// if (txorderinfo.status < 0) {
// return system.getResultFail(-101, "post is error");
// }
pobj.actionBody.interface.para.bigDealId // txorder = txorderinfo.data;
// console.log(txorder)
var txorder = { var txorder = {
"version": 1, "version": 1,
"componentName": "trade", "componentName": "trade",
...@@ -251,7 +459,8 @@ class OrderInfoService extends ServiceBase { ...@@ -251,7 +459,8 @@ class OrderInfoService extends ServiceBase {
pay_total_sum: txorderdetail.goodsPrice.realTotalCost || 0, pay_total_sum: txorderdetail.goodsPrice.realTotalCost || 0,
order_status: 1, order_status: 1,
order_status_name: "已付款", order_status_name: "已付款",
user_name: txorderdetail.goodsDetail.formInfo.userName user_name: txorderdetail.goodsDetail.formInfo.userName,
pay_time: new Date(txorderdetail.payEndTime)
} }
if (isoldsolutionorder) { if (isoldsolutionorder) {
orderobj.order_status = 320; orderobj.order_status = 320;
...@@ -296,6 +505,7 @@ class OrderInfoService extends ServiceBase { ...@@ -296,6 +505,7 @@ class OrderInfoService extends ServiceBase {
op_type: 1, op_type: 1,
op_type_name: "收", op_type_name: "收",
pay_total_sum: txorderdetail.goodsPrice.realTotalCost, pay_total_sum: txorderdetail.goodsPrice.realTotalCost,
created_at: new Date(txorderdetail.payEndTime),
user_name: txorderdetail.goodsDetail.formInfo.userName user_name: txorderdetail.goodsDetail.formInfo.userName
} }
await self.orderStatementDao.create(orderPayobj, t); await self.orderStatementDao.create(orderPayobj, t);
...@@ -308,7 +518,7 @@ class OrderInfoService extends ServiceBase { ...@@ -308,7 +518,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: 0 });
} }
if (!ispush) { if (!ispush) {
return system.getResultSuccess(); return system.getResultSuccess();
...@@ -384,26 +594,8 @@ class OrderInfoService extends ServiceBase { ...@@ -384,26 +594,8 @@ class OrderInfoService extends ServiceBase {
} }
priceName = pobj.actionBody.WhetherType; priceName = pobj.actionBody.WhetherType;
} }
//银行开户
if (pobj.actionBody.PathCode == "/ic/bankopen/") {
if (!pobj.actionBody.RegisteredType) {
return system.getResultFail(-101, "RegisteredType is empty");
}
priceName = pobj.actionBody.RegisteredType;
}
//工商变更
if (pobj.actionBody.PathCode == "/ic/gschangs/") {
}
// //
var productstr = "p_business_registration"; var productstr = "p_business_registration";
if (pobj.actionBody.PathCode == "/ic/sksq/") {
productstr = "p_agent"
if (!pobj.actionBody.TaxpayerType) {
return system.getResultFail(-101, "TaxpayerType is empty");
}
priceName = pobj.actionBody.TaxpayerType;
}
if (pobj.actionBody.PathCode.indexOf("/qcfw/") > -1) { if (pobj.actionBody.PathCode.indexOf("/qcfw/") > -1) {
productstr = "p_vat"; productstr = "p_vat";
if (pobj.actionBody.Period) { if (pobj.actionBody.Period) {
...@@ -452,7 +644,7 @@ class OrderInfoService extends ServiceBase { ...@@ -452,7 +644,7 @@ class OrderInfoService extends ServiceBase {
"version": "1.0", "version": "1.0",
"componentName": "Market", "componentName": "Market",
"eventId": 4962132, "eventId": 4962132,
"timestamp": 1504077981203, "timestamp": Date.now(),
"seqId": "1212344513", "seqId": "1212344513",
"interface": { "interface": {
"interfaceName": "qcloud.price.getPrice", "interfaceName": "qcloud.price.getPrice",
...@@ -522,10 +714,10 @@ class OrderInfoService extends ServiceBase { ...@@ -522,10 +714,10 @@ class OrderInfoService extends ServiceBase {
} }
async submitGoodsinfo(pobj) { async submitGoodsinfo(pobj) {
if (!pobj.actionBody.Info) { // if (!pobj.actionBody.Info) {
return system.getResultFail(-101, "Info is empty"); // return system.getResultFail(-101, "Info is empty");
} // }
pobj.actionBody.Info = JSON.parse(pobj.actionBody.Info); // pobj.actionBody.Info = JSON.parse(pobj.actionBody.Info);
if (pobj.actionBody.Info.length < 1) { if (pobj.actionBody.Info.length < 1) {
return system.getResultFail(-101, "info is empty"); return system.getResultFail(-101, "info is empty");
} }
...@@ -589,7 +781,7 @@ class OrderInfoService extends ServiceBase { ...@@ -589,7 +781,7 @@ 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);
} }
...@@ -617,11 +809,11 @@ class OrderInfoService extends ServiceBase { ...@@ -617,11 +809,11 @@ class OrderInfoService extends ServiceBase {
} }
} }
} }
await this.execPostByTimeOut(p, "http://192.168.1.113:4011/api/action/txapi/springBoard"); var a=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"); var b=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();
...@@ -644,9 +836,9 @@ class OrderInfoService extends ServiceBase { ...@@ -644,9 +836,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 = {
...@@ -673,7 +865,7 @@ class OrderInfoService extends ServiceBase { ...@@ -673,7 +865,7 @@ class OrderInfoService extends ServiceBase {
// } // }
var self = this; var self = this;
return this.db.transaction(async function (t) { return this.db.transaction(async function (t) {
await self.update({ id: orderinfo.id, order_status: 4 }, t) await self.update({ id: orderinfo.id, order_status: 320 }, t)
var orderPayobj = { var orderPayobj = {
tx_orders_num: orderinfo.tx_orders_num, tx_orders_num: orderinfo.tx_orders_num,
order_num: orderinfo.order_num, order_num: orderinfo.order_num,
...@@ -724,8 +916,8 @@ class OrderInfoService extends ServiceBase { ...@@ -724,8 +916,8 @@ 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
...@@ -158,7 +158,7 @@ class UtilsMsgSendService extends AppServiceBase { ...@@ -158,7 +158,7 @@ class UtilsMsgSendService extends AppServiceBase {
if (sendResult.status == 1) { if (sendResult.status == 1) {
this.redisClient.setWithEx(shaStr, 1, setCacheEx); this.redisClient.setWithEx(shaStr, 1, setCacheEx);
} }
console.log(sendResult,"发送通知消息-----------------------------------------------"); console.log(sendResult, "发送通知消息-----------------------------------------------");
return sendResult; return sendResult;
} }
/** /**
...@@ -189,23 +189,48 @@ class UtilsMsgSendService extends AppServiceBase { ...@@ -189,23 +189,48 @@ class UtilsMsgSendService extends AppServiceBase {
"ownerUin": 798950673, "ownerUin": 798950673,
"themeId": 364, "themeId": 364,
"tplParams": { "tplParams": {
"titleTpl": obj.titleTpl, // "titleTpl": obj.titleTpl,
"smsTpl": obj.smsTpl, // "smsTpl": obj.smsTpl,
"siteTpl": obj.siteTpl, // "siteTpl": obj.siteTpl,
"wechatTpl": obj.wechatTpl, // "wechatTpl": obj.wechatTpl,
"emailTpl": obj.emailTpl // "emailTpl": obj.emailTpl
}, },
"receiver": { "receiver": {
"phoneList": obj.phoneList, // "phoneList": obj.phoneList,
"subAccountList": obj.subAccountList, // "subAccountList": obj.subAccountList,
"wechatList": obj.wechatList, // "wechatList": obj.wechatList,
"emailList": obj.emailList // "emailList": obj.emailList
}, },
"lang": "zh", "lang": "zh",
"sendChannel": 5 "sendChannel": 0
} }
} }
} }
var sendChannel = 0;//1站内信、2邮件、4短信、8微信
if (obj.titleTpl && obj.titleTpl.length > 0) {
params.interface.para.tplParams["titleTpl"] = obj.titleTpl;
}
if (obj.smsTpl && obj.smsTpl.length > 0 && obj.phoneList && obj.phoneList.length > 0) {
params.interface.para.tplParams["smsTpl"] = obj.smsTpl;
params.interface.para.receiver["phoneList"] = obj.phoneList;
sendChannel = sendChannel + 4;
}
if (obj.siteTpl && obj.siteTpl.length > 0 && obj.subAccountList && obj.subAccountList.length > 0) {
params.interface.para.tplParams["siteTpl"] = obj.siteTpl;
params.interface.para.receiver["subAccountList"] = obj.subAccountList;
sendChannel = sendChannel + 1;
}
if (obj.wechatTpl && obj.wechatTpl.length > 0 && obj.wechatList && obj.wechatList.length > 0) {
params.interface.para.tplParams["wechatTpl"] = obj.wechatTpl;
params.interface.para.receiver["wechatList"] = obj.wechatList;
sendChannel = sendChannel + 8;
}
if (obj.emailTpl && obj.emailTpl.length > 0 && obj.emailList && obj.emailList.length > 0) {
params.interface.para.tplParams["emailTpl"] = obj.emailTpl;
params.interface.para.receiver["emailList"] = obj.emailList;
sendChannel = sendChannel + 2;
}
params.interface.para.sendChannel = sendChannel;
var result = await this.execPostByTimeOut(params, "http://dev.message.tencentyun.com"); var result = await this.execPostByTimeOut(params, "http://dev.message.tencentyun.com");
if (result.status != 1 || !result.data || !result.data.codeDesc || result.data.codeDesc != "success") { if (result.status != 1 || !result.data || !result.data.codeDesc || result.data.codeDesc != "success") {
return system.getResult(null, "获取失败"); return system.getResult(null, "获取失败");
......
...@@ -34,7 +34,14 @@ var settings = { ...@@ -34,7 +34,14 @@ var settings = {
if (this.env == "dev" || this.env == "test") { if (this.env == "dev" || this.env == "test") {
return "http://tx.g.com:8000"; return "http://tx.g.com:8000";
} else { } else {
return "http://tx.brg.tencentyun.com"; return "http://paas-service";
}
},
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 () {
...@@ -61,6 +68,7 @@ var settings = { ...@@ -61,6 +68,7 @@ var settings = {
password: ENVINPUT.DB_PWD, password: ENVINPUT.DB_PWD,
config: { config: {
host: ENVINPUT.DB_HOST, host: ENVINPUT.DB_HOST,
port: ENVINPUT.DB_PORT,
dialect: 'mysql', dialect: 'mysql',
operatorsAliases: false, operatorsAliases: false,
pool: { pool: {
......
<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
...@@ -379,6 +379,16 @@ ...@@ -379,6 +379,16 @@
4.工商变更 /ic/gschangs/ 4.工商变更 /ic/gschangs/
税控申请  /ic/sksq/
社保开户 /ic/sbopen/
银行开户 /ic/bankopen/
税控申请 /ic/sksq/
税务报道 /ic/swbd/
| 参数名 | 必填 | 类型 | 描述 | | 参数名 | 必填 | 类型 | 描述 |
| ---- | ---- | ---- | ---- | | ---- | ---- | ---- | ---- |
| UserId | 否 | string | 用户id | | UserId | 否 | string | 用户id |
...@@ -386,17 +396,6 @@ ...@@ -386,17 +396,6 @@
| RegionName | 是 | string | 地区拼音 | | RegionName | 是 | string | 地区拼音 |
| PathCode | 是 | string | 产品类型 | | PathCode | 是 | string | 产品类型 |
5.税控申请  /ic/sksq/
|   参数名   | 必填  |  类型   | 描述  |
|  ----  | ----  |  ----  | ----  |
|| UserId | 否 | string | 用户id |
| RegionId | 是 | string | 地区代码 |
| RegionName | 是 | string | 地区拼音 |
| PathCode | 是 | string | 产品类型 |
| TaxpayerType  | 是 |  string   | 纳税人类型  |
| TimeSpan  | 是 |  string   | 计费数量  |
| TimeUnit  | 是 |  string   | 计费周期  |
6.icp /qcfw/icp/ 6.icp /qcfw/icp/
......
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