Commit cb7a1291 by 宋毅

Merge branch 'center-channel' of gitlab.gongsibao.com:jiangyong/zhichan into center-channel

parents adbf38ca dd0902a1
...@@ -25,6 +25,7 @@ class ProductAPI extends WEBBase { ...@@ -25,6 +25,7 @@ class ProductAPI extends WEBBase {
async opActionProcess(pobj, action_type, req) { async opActionProcess(pobj, action_type, req) {
pobj.requestId = req.requestId; pobj.requestId = req.requestId;
var opResult = null; var opResult = null;
console.log("11111",opResult)
switch (action_type) { switch (action_type) {
case "tmAccept"://2020 0828 lin 新增 ali商标交易 创建订单接口 case "tmAccept"://2020 0828 lin 新增 ali商标交易 创建订单接口
opResult = await this.utilsOrderSve.tmAccept(pobj, pobj.actionBody); opResult = await this.utilsOrderSve.tmAccept(pobj, pobj.actionBody);
...@@ -39,6 +40,7 @@ class ProductAPI extends WEBBase { ...@@ -39,6 +40,7 @@ class ProductAPI extends WEBBase {
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
} }
console.log(opResult)
return opResult; return opResult;
} }
......
let WEBBase = require("../../web.base");
let system = require("../../../system");
class brand extends WEBBase {
constructor() {
super();
this.utilsNeedSve = system.getObject("service.utilsSve.utilsNeedSve");
}
async springBoard(pobj, qobj, req) {
return await this.opActionProcess(pobj, pobj.actionType, req);
}
async opActionProcess(pobj, action_type, req) {
let opResult = null;
switch (action_type) {
case "QueryTradeIntentionUserList":// 查询咨询客户列表
let endtime = Date.now();
let starttime = Date.now() - 30 * 60 * 1000;//30分钟(毫秒)
pobj.actionBody = {
Begin: starttime,
End: endtime
};
opResult = await this.utilsNeedSve.queryTradeIntentionUserList(pobj);
break;
}
return opResult;
}
}
module.exports = brand;
\ No newline at end of file
...@@ -14,7 +14,7 @@ class GatewaypushlogService extends ServiceBase { ...@@ -14,7 +14,7 @@ class GatewaypushlogService extends ServiceBase {
var sql = "select * from gateway_pushlog where pushStatus='wts' and pushtimes<4" var sql = "select * from gateway_pushlog where pushStatus='wts' and pushtimes<4"
var icloginfos = await this.customQuery(sql); var icloginfos = await this.customQuery(sql);
if (icloginfos.length > 0) { if (icloginfos.length > 0) {
var count = 10; var count = 100;
if (icloginfos.length < count) { if (icloginfos.length < count) {
count = icloginfos.length; count = icloginfos.length;
} }
......
...@@ -75,7 +75,7 @@ class PushlogService extends ServiceBase { ...@@ -75,7 +75,7 @@ class PushlogService extends ServiceBase {
return system.getResultSuccess(); return system.getResultSuccess();
} }
async getPublicServiceLogList() { async getPublicServiceLogList() {
var sql = "SELECT id,appkey,`pushUrl`,pushContent,pushNumber,clientIp FROM `center_channel_public_servicelog` WHERE pushNumber<10 LIMIT 200"; var sql = "SELECT id,appkey,`pushUrl`,pushContent,pushNumber,clientIp FROM `center_channel_public_servicelog` WHERE pushNumber<10 LIMIT 10";
var list = await this.pushfaillogDao.customQuery(sql); var list = await this.pushfaillogDao.customQuery(sql);
var result = system.getResultSuccess(list); var result = system.getResultSuccess(list);
return result; return result;
......
...@@ -19,8 +19,8 @@ class UtilsNeedService extends AppServiceBase { ...@@ -19,8 +19,8 @@ class UtilsNeedService extends AppServiceBase {
/** /**
* 提交需求 * 提交需求
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody * @param {*} actionBody
*/ */
async submitNeed(pobj, actionBody) { async submitNeed(pobj, actionBody) {
if (!actionBody.intentionBizId) { if (!actionBody.intentionBizId) {
...@@ -41,6 +41,25 @@ class UtilsNeedService extends AppServiceBase { ...@@ -41,6 +41,25 @@ class UtilsNeedService extends AppServiceBase {
pobj.actionBody.type_name = data.data.type_name; pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code; pobj.actionBody.channel_type_code = data.data.channel_type_code;
pobj.actionBody.channel_type_name = data.data.channel_type_name; pobj.actionBody.channel_type_name = data.data.channel_type_name;
if (pobj.actionBody.channel_type_code == 5) {
pobj.actionBody.type = "ali.icp";
} else {
pobj.actionBody.type = "ali.edi";
}
if (pobj.actionBody.description.indexOf("#备#") < 0) {
pobj.actionBody.level = "A";
} else {
var levelurl = "http://106.13.228.212:8000/recProbability";
var levelresult = await this.restPostUrl({ intentionBizId: pobj.actionBody.intentionBizId, type: pobj.actionBody.type, note: pobj.actionBody.description }, levelurl);
if (levelresult.status == 0) {
pobj.actionBody.level = levelresult.data.level;
pobj.actionBody.probability = levelresult.data.per;
} else {
pobj.actionBody.level = "C"
}
}
pobj.actionType = "submitNeed"; pobj.actionType = "submitNeed";
var reqUrl = this.centerOrderUrl + "action/need/springBoard"; var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl); var result = await this.restPostUrl(pobj, reqUrl);
...@@ -48,17 +67,17 @@ class UtilsNeedService extends AppServiceBase { ...@@ -48,17 +67,17 @@ class UtilsNeedService extends AppServiceBase {
if (pobj.actionBody.channel_type_code == "esp.companyreg") { if (pobj.actionBody.channel_type_code == "esp.companyreg") {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness"); this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness");
} else { } else {
if (pobj.actionBody.channel_type_code == 5) {
pobj.actionBody.type = "ali.icp";
} else {
pobj.actionBody.type = "ali.edi";
}
var reqParams = { var reqParams = {
actionBody: pobj.actionBody, actionBody: pobj.actionBody,
appInfo: pobj.appInfo appInfo: pobj.appInfo
} }
this.utilsPushSve.aliBusiness2Delivery(reqParams, "addChance"); this.utilsPushSve.aliBusiness2Delivery(reqParams, "addChance");
pobj.actionBody.description = pobj.actionBody.description + " 成交概率:" + pobj.actionBody.level
if (pobj.actionBody.probability) {
pobj.actionBody.description = pobj.actionBody.description + "(" + pobj.actionBody.probability + ") "
}
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedICPBusiness"); this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedICPBusiness");
} }
} }
...@@ -75,7 +94,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -75,7 +94,7 @@ class UtilsNeedService extends AppServiceBase {
} }
var self = this; var self = this;
pobj.actionType = "receiveIcpFeedback"; pobj.actionType = "receiveIcpFeedback";
// 2020 0803 lin 修改; // 2020 0803 lin 修改;
if (pobj.intentionStatus) { if (pobj.intentionStatus) {
// 如果需求当前字段为5(已关闭)则通知fq // 如果需求当前字段为5(已关闭)则通知fq
if (pobj.intentionStatus == 5) { if (pobj.intentionStatus == 5) {
...@@ -129,7 +148,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -129,7 +148,7 @@ class UtilsNeedService extends AppServiceBase {
/** /**
* 获取需求详情 * 获取需求详情
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody needNo 需求号 * @param {*} actionBody needNo 需求号
*/ */
async getItemByNeedNo(pobj, actionBody) { async getItemByNeedNo(pobj, actionBody) {
...@@ -142,7 +161,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -142,7 +161,7 @@ class UtilsNeedService extends AppServiceBase {
} }
/** /**
* 获取需求详情 * 获取需求详情
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody needNo 需求号 * @param {*} actionBody needNo 需求号
*/ */
async getItemByChannelNeedNo(pobj, actionBody) { async getItemByChannelNeedNo(pobj, actionBody) {
...@@ -155,7 +174,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -155,7 +174,7 @@ class UtilsNeedService extends AppServiceBase {
} }
/** /**
* 获取需求详情 * 获取需求详情
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody bizId 渠道方案号 * @param {*} actionBody bizId 渠道方案号
*/ */
async getItemByChannelSolutionNo(pobj, actionBody) { async getItemByChannelSolutionNo(pobj, actionBody) {
...@@ -168,8 +187,8 @@ class UtilsNeedService extends AppServiceBase { ...@@ -168,8 +187,8 @@ class UtilsNeedService extends AppServiceBase {
} }
/** /**
* 关闭需求 * 关闭需求
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody * @param {*} actionBody
*/ */
async needClose(pobj, actionBody) { async needClose(pobj, actionBody) {
if (!actionBody.intentionBizId) { if (!actionBody.intentionBizId) {
...@@ -187,8 +206,8 @@ class UtilsNeedService extends AppServiceBase { ...@@ -187,8 +206,8 @@ class UtilsNeedService extends AppServiceBase {
/** /**
* icp关闭需求 * icp关闭需求
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody * @param {*} actionBody
*/ */
async needCloseIcp(pobj, actionBody) { async needCloseIcp(pobj, actionBody) {
if (!actionBody.channelNeedNo) { if (!actionBody.channelNeedNo) {
...@@ -473,8 +492,8 @@ class UtilsNeedService extends AppServiceBase { ...@@ -473,8 +492,8 @@ class UtilsNeedService extends AppServiceBase {
/** /**
* 2020 0827 lin 新增 4.1 用户在公司宝前端提交需求 * 2020 0827 lin 新增 4.1 用户在公司宝前端提交需求
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody * @param {*} actionBody
*/ */
async submitIcpIntention(pobj, actionBody) { async submitIcpIntention(pobj, actionBody) {
// 校验文档上必填字段 // 校验文档上必填字段
...@@ -494,7 +513,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -494,7 +513,7 @@ class UtilsNeedService extends AppServiceBase {
var reqUrl = this.centerOrderUrl + "action/need/springBoard"; var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl); var result = await this.restPostUrl(pobj, reqUrl);
// 生成成功 通知ali // 生成成功 通知ali
if(result.status == 0) { if (result.status == 0) {
var aliResult = await this.aliclient.reqbyget({ action: "SubmitIcpIntention", reqbody: actionBody, apiVersion: "2019-05-08" }); var aliResult = await this.aliclient.reqbyget({ action: "SubmitIcpIntention", reqbody: actionBody, apiVersion: "2019-05-08" });
console.log(aliResult); console.log(aliResult);
} }
...@@ -503,8 +522,8 @@ class UtilsNeedService extends AppServiceBase { ...@@ -503,8 +522,8 @@ class UtilsNeedService extends AppServiceBase {
/** /**
* 2020 0827 lin 新增 4.2 需求列表查询 * 2020 0827 lin 新增 4.2 需求列表查询
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody * @param {*} actionBody
*/ */
async queryIntentionList(pobj, actionBody) { async queryIntentionList(pobj, actionBody) {
var aliResult = await self.aliclient.reqbyget({ action: "QueryIntentionList", reqbody: actionBody, apiVersion: "2019-05-08" }); var aliResult = await self.aliclient.reqbyget({ action: "QueryIntentionList", reqbody: actionBody, apiVersion: "2019-05-08" });
...@@ -517,8 +536,8 @@ class UtilsNeedService extends AppServiceBase { ...@@ -517,8 +536,8 @@ class UtilsNeedService extends AppServiceBase {
/** /**
* 2020 0827 lin 新增 4.3 用户需求确认 未测试 * 2020 0827 lin 新增 4.3 用户需求确认 未测试
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody * @param {*} actionBody
*/ */
async confirmIcpIntention(pobj, actionBody) { async confirmIcpIntention(pobj, actionBody) {
if (!actionBody.intentionBizId) { if (!actionBody.intentionBizId) {
...@@ -534,26 +553,51 @@ class UtilsNeedService extends AppServiceBase { ...@@ -534,26 +553,51 @@ class UtilsNeedService extends AppServiceBase {
} }
} }
async queryTradeIntentionUserList(pobj) { async queryTradeIntentionUserList(pobj) {
if (!pobj.actionBody.intentionBizId) { // if (!pobj.actionBody.intentionBizId) {
return system.getResult(null, "actionBody.intentionBizId can not be empty,100493"); // return system.getResult(null, "actionBody.intentionBizId can not be empty,100493");
} // }
if (!pobj.actionBody.userFeedBack) { // if (!pobj.actionBody.userFeedBack) {
return system.getResult(null, "actionBody.userFeedBack can not be empty,100494"); // return system.getResult(null, "actionBody.userFeedBack can not be empty,100494");
} // }
pobj.actionBody.data = [];
await this.queryByAli(pobj,1);
pobj.actionType = "getUnCreated";
let reqUrl = this.centerOrderUrl + "action/need/springBoard";
let result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
pobj.actionBody = {
type:"tmjy"
};
for (let item of result.data){
pobj.actionBody.intentionBizId=item.BizId;
pobj.actionBody.mobile=item.Mobile?item.Mobile:"";
pobj.actionBody.userName=item.UserName?item.UserName:"";
pobj.notes=`${item.RegisterNumber?"RegisterNumber:"+item.RegisterNumber:""}${item.Classification?"Classification:"+item.Classification:""}`;
let res = await this.submitNeed(JSON.parse(JSON.stringify(pobj)),{intentionBizId:item.BizId});
console.log(res)
}
return system.getResultSuccess();
}else {
return system.getResultFail(result.status,result.msg);
}
return system.getResultFail(res.status,res.msg);
}
async queryByAli(pobj,page){
let res = await this.aliclient.reqbyget({ let res = await this.aliclient.reqbyget({
action: "QueryTradeIntentionUserList", reqbody: { action: "QueryTradeIntentionUserList", reqbody: {
BeginTime: pobj.actionBody.BeginTime ? pobj.actionBody.BeginTime : "", Begin: pobj.actionBody.Begin ? pobj.actionBody.Begin : "",
EndTime: pobj.actionBody.EndTime ? pobj.actionBody.EndTime : "", End: pobj.actionBody.End ? pobj.actionBody.End : "",
BizId: pobj.actionBody.intentionBizId, PageNum: page,
UserFeedBack: pobj.actionBody.userFeedBack, PageSize: 10,
PageNum: pobj.actionBody.pageNum || 1, }, apiVersion: "2019-05-08"
PageSize: pobj.actionBody.pageSize || 10,
}, apiVersion: "2019-05-08"
}); });
console.log(res) if (res.status == 0) {
return system.getResultSuccess(res); pobj.actionBody.data.push(...res.data.Data);
if (page < res.data.TotalPageNum){
await this.queryByAli(pobj,page+1)
}
}
} }
async testsymq(pobj) { async testsymq(pobj) {
var a = null; var a = null;
try { try {
......
...@@ -800,15 +800,13 @@ class UtilsOrderService extends AppServiceBase { ...@@ -800,15 +800,13 @@ class UtilsOrderService extends AppServiceBase {
async tmAccept(pobj) {// 2020 0828 lin 新增 ali商标交易 创建订单接口 async tmAccept(pobj) {// 2020 0828 lin 新增 ali商标交易 创建订单接口
try { try {
var actionBody = pobj.actionBody; var actionBody = pobj.actionBody;
actionBody.channelItemCode = "sbjy"
actionBody.quantity = 1;
pobj.actionType = "getProductDetail"; pobj.actionType = "getProductDetail";
var url = settings.centerAppUrl() + "action/opProduct/springBoard"; var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemResult = await this.restPostUrl(pobj, url); var productItemResult = await this.restPostUrl(pobj, url);
if (productItemResult.status != 0) { if (productItemResult.status != 0) {
return productItemResult; return productItemResult;
} }
productItemResult.data.price_list[0]["price"] = actionBody.price;
pobj.actionBody.product_info = productItemResult.data; pobj.actionBody.product_info = productItemResult.data;
var verifyResult = await this.isOrderVerify(pobj, pobj.actionBody); var verifyResult = await this.isOrderVerify(pobj, pobj.actionBody);
if (verifyResult.status != 0) { if (verifyResult.status != 0) {
...@@ -821,32 +819,61 @@ class UtilsOrderService extends AppServiceBase { ...@@ -821,32 +819,61 @@ class UtilsOrderService extends AppServiceBase {
pobj.actionType = "addOrder"; pobj.actionType = "addOrder";
var reqUrl = this.centerOrderUrl + "action/order/springBoard"; var reqUrl = this.centerOrderUrl + "action/order/springBoard";
// console.log(pobj);
var result = await this.restPostUrl(pobj, reqUrl); var result = await this.restPostUrl(pobj, reqUrl);
result.totalSum = actionBody.totalSum;
return result;
if(result) { if(result) {
var result = { var tmResult = {
"errorCode": "error", "errorCode": "OK",
"errorMsg": orderinfo.msg, "errorMsg": "操作成功",
"module": { "orderId": "" }, "module": { "orderNumber": result.data.orderNo },
"requestId": req.requestId, "requestId": pobj.requestId,
"success": false "success": true
} }
return result; console.log("utils",tmResult)
return tmResult;
} }
} catch (e) { } catch (e) {
var result = { var result = {
"errorCode": "error", "errorCode": "error",
"errorMsg": e, "errorMsg": e,
"module": { "orderNumber": "" }, "module": { "orderNumber": "" },
"requestId": req.requestId, "requestId": pobj.requestId,
"success": false "success": false
} }
return result; return result;
} }
}
async tmRefuse(pobj) {// 2020 0828 lin 新增 ali商标交易 关闭订单接口
try {
var reqUrl = this.centerOrderUrl + "action/tmOrder/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
// 如果返回值正常
if(result.status == 0) {
var tmResult = {
"errorCode": "OK",
"errorMsg": "操作成功",
"requestId": pobj.requestId,
"success": true
}
return tmResult;
}
var tmResult = {
"errorCode": "error",
"errorMsg": result.msg,
"requestId": pobj.requestId,
"success": false
}
return tmResult;
} catch (e) {
var result = {
"ErrorCode": "error",
"ErrorMsg": e,
"Module": { "orderNumber": "" },
"RequestId": pobj.requestId,
"Success": false
}
return result;
}
} }
} }
module.exports = UtilsOrderService; module.exports = UtilsOrderService;
...@@ -248,7 +248,7 @@ module.exports = function (app) { ...@@ -248,7 +248,7 @@ module.exports = function (app) {
"getNeedListUser", "getNeedListUser",
"manualEvaluation", "diagnosisInfo", "check", "enterpriseInfo", "diagnosisDetail", "manualEvaluation", "diagnosisInfo", "check", "enterpriseInfo", "diagnosisDetail",
"submitIcpIntention", "queryIntentionList", "confirmIcpIntention", "submitIcpIntention", "queryIntentionList", "confirmIcpIntention",
"tmAccept", "tmRefuse", "tmStatus" "tmAccept", "tmStatus"
]; ];
if (lst.indexOf(req.body.actionType) >= 0) { if (lst.indexOf(req.body.actionType) >= 0) {
var userpin = req.headers["userpin"] || ""; var userpin = req.headers["userpin"] || "";
......
...@@ -161,13 +161,13 @@ ...@@ -161,13 +161,13 @@
"evidenceCon": "", // 证据内容 文件 "evidenceCon": "", // 证据内容 文件
"evidenceSend": "", // 送达证据 文件 "evidenceSend": "", // 送达证据 文件
}, },
"supData": { //补充材料 "supData": { //N 补充材料
"dir": "", // 补充证据目录 "dir": "", //N 补充证据目录
"con": "", // 补充证据内容 "con": "", //N 补充证据内容
}, },
"deliveryStatusName": "待完善材料" "deliveryStatusName": "待完善材料"
"recDate":"",//接单时间 "recDate":"",//N 接单时间
"askforDate":""//递交时间 "askforDate":""//N 递交时间
} }
} }
``` ```
...@@ -177,12 +177,7 @@ ...@@ -177,12 +177,7 @@
{ {
"status": 0,// 0为成功,否则失败 "status": 0,// 0为成功,否则失败
"msg": "success", "msg": "success",
"data": { "data": null,
"orderNo": "OT26202002151649kPgs",//订单号
"channelServiceNo": "OT26202002151649kPgs",//渠道服务单号
"channelOrderNo""OT26202002151649kPgs", //渠道订单号
"channelParams": ""//渠道参数
},
"requestId": "2f90fad8108b4933bb97c3d978b0fe10" "requestId": "2f90fad8108b4933bb97c3d978b0fe10"
} }
``` ```
......
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