Commit 0db1cac2 by 宋毅

增加备注

parents 84418eab 32765cbf
...@@ -15,7 +15,7 @@ class opLog extends WEBBase { ...@@ -15,7 +15,7 @@ class opLog extends WEBBase {
} }
/** /**
* 获取推送失败日志列表 * 获取channel推送失败日志列表
* @param pobj * @param pobj
* @param qobj * @param qobj
* @param req * @param req
...@@ -27,7 +27,7 @@ class opLog extends WEBBase { ...@@ -27,7 +27,7 @@ class opLog extends WEBBase {
} }
/** /**
* 重新推送 * channel重新推送
* @param pobj * @param pobj
* @param qobj * @param qobj
* @param req * @param req
...@@ -37,5 +37,29 @@ class opLog extends WEBBase { ...@@ -37,5 +37,29 @@ class opLog extends WEBBase {
let result = await this.pushlogSve.rePush(pobj.actionBody); let result = await this.pushlogSve.rePush(pobj.actionBody);
return result; return result;
} }
/**
* 获取gateway推送失败日志列表
* @param pobj
* @param qobj
* @param req
* @returns {Promise<void>}
*/
async getGatewayPushFailLogList(pobj,qobj,req){
let list = await this.pushlogSve.getGatewayPushFailLogList(pobj.actionBody);
return list;
}
/**
* gateway重新推送
* @param pobj
* @param qobj
* @param req
* @returns {Promise<void>}
*/
async reGatewayPush(pobj,qobj,req){
let result = await this.pushlogSve.reGatewayPush(pobj.actionBody);
return result;
}
} }
module.exports = opLog; module.exports = opLog;
\ No newline at end of file
...@@ -46,13 +46,6 @@ class OpNeed extends APIBase { ...@@ -46,13 +46,6 @@ class OpNeed extends APIBase {
case "test"://2020 0826 lin 测试使用 case "test"://2020 0826 lin 测试使用
opResult = await this.utilsOpNeedSve.test(pobj, pobj.actionBody); opResult = await this.utilsOpNeedSve.test(pobj, pobj.actionBody);
break; break;
// case "getItemByChannelNeedNo"://方案反馈
// opResult = await this.utilsOpNeedSve.getItemByChannelNeedNo(pobj, pobj.actionBody);
// break;
// case "receiveFeedback"://关闭方案
// opResult = await this.centerorderSve.reqCenterOrderApi(pobj);
// break;
//企服通统计页面接口----start //企服通统计页面接口----start
case "getStatisticsByUappId": case "getStatisticsByUappId":
opResult = await this.utilsOpNeedSve.getStatisticsByUappId(pobj); opResult = await this.utilsOpNeedSve.getStatisticsByUappId(pobj);
......
...@@ -2,62 +2,71 @@ var WEBBase = require("../../web.base"); ...@@ -2,62 +2,71 @@ var WEBBase = require("../../web.base");
var system = require("../../../system"); var system = require("../../../system");
var settings = require("../../../../config/settings"); var settings = require("../../../../config/settings");
class ProductAPI extends WEBBase { class ProductAPI extends WEBBase {
constructor() { constructor() {
super(); super();
this.utilsProductSve = system.getObject("service.utilsSve.utilsProductSve"); this.utilsProductSve = system.getObject("service.utilsSve.utilsProductSve");
this.utils360Sve = system.getObject("service.utilsSve.utils360Sve"); this.utils360Sve = system.getObject("service.utilsSve.utils360Sve");
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionProcess) {
return system.getResult(null, "actionProcess参数不能为空");
} }
/** if (!pobj.actionType) {
* 接口跳转-POST请求 return system.getResult(null, "actionType参数不能为空");
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionProcess) {
return system.getResult(null, "actionProcess参数不能为空");
}
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 result = await this.opActionProcess(pobj, pobj.actionType, req);
var opResult = null; return result;
switch (action_type) { }
case "getProductList"://通过产品类别编码路径获取产品列表 async opActionProcess(pobj, action_type, req) {
opResult = await this.utilsProductSve.getProductList(pobj, pobj.actionBody); var opResult = null;
break; switch (action_type) {
case "getProductListH5"://通过产品类别编码路径获取产品列表 case "getProductList"://通过产品类别编码路径获取产品列表
opResult = await this.utilsProductSve.getProductListH5(pobj, pobj.actionBody); opResult = await this.utilsProductSve.getProductList(pobj, pobj.actionBody);
break; break;
case "getProductDetail"://根据渠道产品编码获取产品详情 case "getProductListH5"://通过产品类别编码路径获取产品列表
opResult = await this.utilsProductSve.getProductDetail(pobj, pobj.actionBody); opResult = await this.utilsProductSve.getProductListH5(pobj, pobj.actionBody);
break; break;
case "getProductPrice": case "getProductDetail"://根据渠道产品编码获取产品详情
opResult = await this.utilsProductSve.getProductPrice(pobj,pobj.actionBody) opResult = await this.utilsProductSve.getProductDetail(pobj, pobj.actionBody);
break; break;
case "getProductRecommend": case "getProductPrice":
opResult = await this.utilsProductSve.getProductRecommend(pobj,pobj.actionBody); opResult = await this.utilsProductSve.getProductPrice(pobj, pobj.actionBody)
break; break;
// case "updateProductPrice": case "getProductRecommend":
// opResult = await this.utilsProductSve.updateProductPrice(pobj,pobj.actionBody); opResult = await this.utilsProductSve.getProductRecommend(pobj, pobj.actionBody);
// break; break;
case "getGoodsLowestPrice": // case "updateProductPrice":
opResult = await this.utils360Sve.getGoodsLowestPrice(pobj.actionBody); // opResult = await this.utilsProductSve.updateProductPrice(pobj,pobj.actionBody);
break; // break;
case "getRegProducePrice": case "getGoodsLowestPrice":
opResult = await this.utilsProductSve.getRegProducePrice(pobj,pobj.actionBody) opResult = await this.utils360Sve.getGoodsLowestPrice(pobj.actionBody);
break; break;
case "getAllProducts": case "getRegProducePrice":
opResult = await this.utilsProductSve.getAllProducts(pobj); opResult = await this.utilsProductSve.getRegProducePrice(pobj, pobj.actionBody)
break; break;
default: case "getAllProducts":
opResult = system.getResult(null, "action_type参数错误"); opResult = await this.utilsProductSve.getAllProducts(pobj);
} break;
return opResult; case "getAllProductType":// 获取产品大类
opResult = await this.utilsProductSve.getAllProductType(pobj);
break;
case "submitProductType":// 创建产品大类
opResult = await this.utilsProductSve.submitProductType(pobj);
break;
case "editProductType":// 修改产品大类
opResult = await this.utilsProductSve.editProductType(pobj);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
} }
return opResult;
}
} }
module.exports = ProductAPI; module.exports = ProductAPI;
\ No newline at end of file
...@@ -17,13 +17,13 @@ class Consultation extends APIBase { ...@@ -17,13 +17,13 @@ class Consultation extends APIBase {
return regCfg.getResultFail("intentionBizId不能为空"); return regCfg.getResultFail("intentionBizId不能为空");
} }
if (!pobj.phone) { if (!pobj.phone) {
return regCfg.getResultFail("mobile不能为空"); return regCfg.getResultFail("phone不能为空");
} }
if (!pobj.consultType) { if (!pobj.consultType) {
return regCfg.getResultFail("consultType不能为空"); return regCfg.getResultFail("consultType不能为空");
} }
pobj.type = pobj.consultType; pobj.type = pobj.consultType;
pobj.mobile = pobj.phone; // pobj.mobile = pobj.phone;//百度公司注册提交需求根据geteway中regCenterOrderSve文件reqcenterchannel2方法判断隐藏mobile字段
pobj.action_type = "submitRegNeed"; pobj.action_type = "submitRegNeed";
if (pobj.area) { if (pobj.area) {
pobj.area = regCfg.baiduArea[pobj.area] pobj.area = regCfg.baiduArea[pobj.area]
......
...@@ -5,7 +5,6 @@ class AccessAuthAPI extends APIBase { ...@@ -5,7 +5,6 @@ class AccessAuthAPI extends APIBase {
constructor() { constructor() {
super(); super();
this.utilsAuthSve = system.getObject("service.utilsSve.utilsAuthSve"); this.utilsAuthSve = system.getObject("service.utilsSve.utilsAuthSve");
this.utilsNeedSve = system.getObject("service.utilsSve.utilsNeedSve");
} }
/** /**
* 接口跳转-POST请求 * 接口跳转-POST请求
......
...@@ -372,26 +372,6 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -372,26 +372,6 @@ class BaseCenterOrderService extends AppServiceBase {
return pushRes; return pushRes;
} }
//服务商icp方案关闭 2020-10-26 laolan
async abolishIcpProgramme(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息
var ab = pobj.actionBody;
if (typeof (ab.material) == "string") {
ab.material = JSON.parse(ab.material);
}
//推送数据至阿里
var pushObj = {
BizId: ab.BizId, Note: ab.Note
};
//关闭方案
this.aliclient.reqbyget({ action: "CloseIcpProduce", reqbody: pushObj, apiVersion: "2019-05-08" });
return system.getResultSuccess();
}
return res;
}
//队列推送材料 //队列推送材料
async serviceProviderSubmit2Material(pobj) { async serviceProviderSubmit2Material(pobj) {
console.log("serviceProviderSubmit2Material+++++pobj+++",pobj) console.log("serviceProviderSubmit2Material+++++pobj+++",pobj)
...@@ -876,22 +856,7 @@ class BaseCenterOrderService extends AppServiceBase { ...@@ -876,22 +856,7 @@ class BaseCenterOrderService extends AppServiceBase {
} }
return res; return res;
} }
//交付单关闭
async closeOrderDelivery(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息
var ab = pobj.actionBody;
//推送数据至阿里
var pushObj = {
BizId: needsolution.channelSolutionNo, Note: ab.note
};
//关闭方案
this.aliclient.reqbyget({ action: "CloseIcpProduce", reqbody: pushObj, apiVersion: "2019-05-08" });
return system.getResultSuccess();
}
return res;
}
//易名退款,关闭订单 2021-3-23 //易名退款,关闭订单 2021-3-23
async eNameCloseOrder(pobj){ async eNameCloseOrder(pobj){
......
...@@ -6,6 +6,7 @@ class PushlogService extends ServiceBase { ...@@ -6,6 +6,7 @@ class PushlogService extends ServiceBase {
super("common", ServiceBase.getDaoName(PushlogService)); super("common", ServiceBase.getDaoName(PushlogService));
this.logCtl = system.getObject("service.common.oplogSve"); this.logCtl = system.getObject("service.common.oplogSve");
this.pushfaillogDao = system.getObject("db.common.pushfaillogDao"); this.pushfaillogDao = system.getObject("db.common.pushfaillogDao");
this.gatewaypushlogDao = system.getObject("db.common.gatewaypushlogDao");
} }
async createDb(qobj) { async createDb(qobj) {
try { try {
...@@ -51,6 +52,7 @@ class PushlogService extends ServiceBase { ...@@ -51,6 +52,7 @@ class PushlogService extends ServiceBase {
return result; return result;
} }
//获取channel推送失败记录
async getPushFailLogList(actionBody) { async getPushFailLogList(actionBody) {
var sql = "SELECT id,appid,`content`,failType,pushNumber,opTitle,resultInfo,created_at FROM `center_channel_pushfaillog` WHERE pushNumber=10 "; var sql = "SELECT id,appid,`content`,failType,pushNumber,opTitle,resultInfo,created_at FROM `center_channel_pushfaillog` WHERE pushNumber=10 ";
let whereParams = {}; let whereParams = {};
...@@ -69,7 +71,7 @@ class PushlogService extends ServiceBase { ...@@ -69,7 +71,7 @@ class PushlogService extends ServiceBase {
} }
/** /**
* 重新推送 * channel重新推送
* @param actionBody * @param actionBody
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
...@@ -89,6 +91,45 @@ class PushlogService extends ServiceBase { ...@@ -89,6 +91,45 @@ class PushlogService extends ServiceBase {
return system.getResult(result); return system.getResult(result);
} }
//获取Gateway推送失败记录
async getGatewayPushFailLogList(actionBody) {
var sql = "SELECT id,requestUrl,requestjson,pushUrl,pushActionType,pushtimes,pushStatus,created_at,error FROM `gateway_pushlog` WHERE pushtimes=4 and pushStatus='wts'";
let whereParams = {};
if(actionBody.likeParams){
sql += " and requestjson like :likeParams";
whereParams.likeParams = "%"+ actionBody.likeParams +"%";
}
if(actionBody.likeError){
sql += " and error like :likeError";
whereParams.likeError = "%"+ actionBody.likeError +"%";
}
sql += " order by created_at desc"
var list = await this.gatewaypushlogDao.customQuery(sql,whereParams);
var result = system.getResultSuccess(list);
return result;
}
/**
* Gateway重新推送
* @param actionBody
* @returns {Promise<void>}
*/
async reGatewayPush(actionBody){
let content = actionBody.content;
let sql = 'update `gateway_pushlog` set pushtimes = :pushtimes';
let params = {
pushtimes: actionBody.pushNumber || 3
}
if(Object.keys(content).length>0){
sql += ',requestjson=:content';
params.content = JSON.stringify(actionBody.content);
}
sql += ' where id = :id';
params.id = actionBody.id;
let result = await this.customUpdate(sql,params);
return system.getResult(result);
}
async addPublicServiceLog(pobj, req) { async addPublicServiceLog(pobj, req) {
var sql = "INSERT INTO `igirl_api`.`center_channel_public_servicelog` (`appkey`,`pushUrl`,`pushContent`,`resultInfo`,`pushNumber`,`clientIp`,created_at)" + var sql = "INSERT INTO `igirl_api`.`center_channel_public_servicelog` (`appkey`,`pushUrl`,`pushContent`,`resultInfo`,`pushNumber`,`clientIp`,created_at)" +
......
...@@ -139,69 +139,6 @@ class QcCenterOrderService extends AppServiceBase { ...@@ -139,69 +139,6 @@ class QcCenterOrderService extends AppServiceBase {
return res; return res;
} }
//交付材料提交
async serviceProviderSubmitMaterial(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
var needsolution = res.data;//方案信息
var ab = pobj.actionBody;
if (typeof (ab.material) == "string") {
ab.material = JSON.parse(ab.material);
}
var material = ab.material;
//推送数据至阿里
var BizId = needsolution.channelSolutionNo;//⽅案业务ID
var pushObj = {
"BizId": BizId,
"Domain": material.Domain,
"CorporateName": material.CorporateName,
"IncludeForeignInvestment": material.IncludeForeignInvestment,
"PartnerBusinessLicense": material.PartnerBusinessLicense,
"PartnerIdCardList": material.PartnerIdCardList,
"PartnerDomainCertificate": material.PartnerDomainCertificate,
"PartnerPreviewOtherList": material.PartnerPreviewOtherList || [],
"PartnerPlan": material.PartnerPlan || "",
"PartnerForeignInvestment": material.PartnerForeignInvestment || "",
"PartnerLaw": material.PartnerLaw || "",
"PartnerStampOtherList": material.PartnerStampOtherList || [],
"PartnerSignOtherList": material.PartnerSignOtherList || [],
"PartnerSignAndStampOtherList": material.PartnerSignAndStampOtherList || []
};
var self = this;
//推送方案材料
if (pobj.appInfo.uapp_id == 18) {
self.aliclient.reqbyget({ action: "SavePartnerSubmitMaterial", reqbody: pushObj, apiVersion: "2019-05-08" });
}
return system.getResultSuccess();
}
return res;
}
//通知交付状态变更
async serviceProviderNotification(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
if (res && res.status == 0 && res.data) {
pobj.actionType = "getOrderByOrderNo";
let orderUrl = settings.centerOrderUrl() + "action/order/springBoard";
let orderResult = await this.restPostUrl(pobj, orderUrl);
if (orderResult.status != 0) {
return system.getResultFail(-1, '查询订单失败')
}
let uapp_id = orderResult.data.uapp_id;
pobj.appInfo = { uapp_id: uapp_id };
pobj.actionType = "getAppInterface";
var reqUrl = settings.centerAppUrl() + "action/opProduct/springBoard";
var productItemInterfaceResult = await this.restPostUrl(pobj, reqUrl);
if (productItemInterfaceResult.status != 0) {
system.getResultFail(-1, '获取接口参数失败')
}
pobj.interface_info = productItemInterfaceResult.data;
pobj.pushObj = res.data;
this.utilsPushSve.pushBusInfo(pobj, 'pushStatus', 1);
return system.getResultSuccess();
}
return res;
}
//交付单关闭 //交付单关闭
async closeOrderDelivery(pobj) { async closeOrderDelivery(pobj) {
var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard"); var res = await this.reqCenterOrderApi(pobj, "action/qcapi/springBoard");
......
...@@ -178,19 +178,6 @@ class RegCenterOrderService extends AppServiceBase { ...@@ -178,19 +178,6 @@ class RegCenterOrderService extends AppServiceBase {
var itemResult = await this.restPostUrl(pobj, reqUrl); var itemResult = await this.restPostUrl(pobj, reqUrl);
return itemResult; return itemResult;
} }
/**
* 获取方案详情
* @param {*} pobj
* @param {*} actionBody bizId 渠道方案号
*/
async getSolutionByChannelOrderNo(pobj, actionBody) {
if (!actionBody.orderNo) {
return system.getResult(null, "actionBody.orderNo can not be empty,100390");
}
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var itemResult = await this.restPostUrl(pobj, reqUrl);
return itemResult;
}
/** /**
* 获取需求详情 * 获取需求详情
......
...@@ -183,12 +183,12 @@ class TmqueryService { ...@@ -183,12 +183,12 @@ class TmqueryService {
orgname:queryobj.orgname, orgname:queryobj.orgname,
appkey:"5b29981785bd4272966b15ad8e8b9dd3" appkey:"5b29981785bd4272966b15ad8e8b9dd3"
} }
let url = settings.icNameUrl() + 'api/icName/CheckName' let url = settings.icNameUrl() + 'openPlatform/ic/match'
let result = await this.opReqResult(url, data, req); let result = await this.opReqResult(url, data, req);
if (result.Status!=200){ if (result.code!=200){
return system.getResult(-1,result.message); return system.getResult(-1,result.message);
} }
return system.getResult(result.data); return system.getResult(result);
} }
async opReqResult(reqUrl, queryobj, req) { async opReqResult(reqUrl, queryobj, req) {
......
...@@ -5,7 +5,7 @@ const fs = require("fs"); ...@@ -5,7 +5,7 @@ const fs = require("fs");
const {json} = require("sequelize"); const {json} = require("sequelize");
const {getResult, getResultSuccess} = require("../../../system"); const {getResult, getResultSuccess} = require("../../../system");
//需求操作类----操作类型-公用的 //需求操作类----操作类型-公用的--未用到
class UtilsNeedCommService extends AppServiceBase { class UtilsNeedCommService extends AppServiceBase {
constructor() { constructor() {
super(); super();
...@@ -15,7 +15,6 @@ class UtilsNeedCommService extends AppServiceBase { ...@@ -15,7 +15,6 @@ class UtilsNeedCommService extends AppServiceBase {
this.ossClient = system.getObject("util.ossClient"); this.ossClient = system.getObject("util.ossClient");
this.restClient = system.getObject("util.restClient"); this.restClient = system.getObject("util.restClient");
this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve"); this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve");
this.qcCenterOrderSve = system.getObject("service.common.qcCenterOrderSve");
this.opPushQueueUrl = settings.opPushQueueUrl(); this.opPushQueueUrl = settings.opPushQueueUrl();
this.utilsAuthSve = system.getObject("service.utilsSve.utilsAuthSve"); this.utilsAuthSve = system.getObject("service.utilsSve.utilsAuthSve");
} }
......
...@@ -428,79 +428,6 @@ class UtilsNeedService extends AppServiceBase { ...@@ -428,79 +428,6 @@ class UtilsNeedService extends AppServiceBase {
return result; return result;
} }
/**
* icp关闭需求
* @param {*} pobj
* @param {*} actionBody
*/
async needCloseIcp(pobj, actionBody) {
if (!actionBody.channelNeedNo) {
return system.getResult(null, "actionBody.channelNeedNo can not be empty,100395");
}
if (!actionBody.note) {
return system.getResult(null, "actionBody.note can not be empty,100395");
}
var self = this;
pobj.actionBody.intentionBizId = pobj.actionBody.channelNeedNo;
pobj.actionType = "abolishIcpProgrammeByNeed"
var reqUrl = this.centerOrderUrl + "action/qcapi/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
this.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/utilsNeedSve.js/needCloseIcp",
content: JSON.stringify(pobj),
resultInfo: JSON.stringify(result),
optitle: "abolishIcpProgrammeByNeed推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
if (result.status == 0) {
if (result.data) {
pobj.actionBody.orderNo = result.data;
var orderrtn = await self.utilsOrderSve.delOrder(pobj, pobj.actionBody);
if (orderrtn.status < 0) {
return system.getResultFail(-5022, "订单关闭失败");
}
}
//推送交付系统
var reqParams = {
actionBody: {
intentionBizId: pobj.actionBody.channelNeedNo,
status: "closeNeed"
},
opType: "updateChanceStatus",
appInfo: pobj.appInfo
}
self.utilsPushSve.business2Channel(reqParams, "updateChanceStatus");
//日志记录
self.logCtl.info({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "service/impl/utilsSve/utilsNeedSve.js/needCloseIcp",
content: JSON.stringify(reqParams),
resultInfo: "",
optitle: "updateChanceStatus推送蜂擎获取的接口信息->aliBusiness2Delivery",
});
// 推送ali
var a = await self.aliclient.reqbyget({ action: "CloseIntention", reqbody: { BizId: actionBody.channelNeedNo, Note: actionBody.note }, apiVersion: "2019-05-08" });
// console.log(a);//TODO:laolan添加日志记录
self.utilsPushSve.business2Channel(pobj, "pushCloseICPNeed");
}
return result
}
//查询需求详情
async getItemByNeedNo(pobj, actionBody) {
if (!actionBody.needNo) {
return system.getResult(null, "actionBody.needNo can not be empty,100395");
}
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
return result;
}
//状态更新 //状态更新
async icpNotify(pobj) { async icpNotify(pobj) {
var actionBody = pobj.actionBody; var actionBody = pobj.actionBody;
...@@ -1745,24 +1672,4 @@ class UtilsNeedService extends AppServiceBase { ...@@ -1745,24 +1672,4 @@ class UtilsNeedService extends AppServiceBase {
} }
} }
module.exports = UtilsNeedService; module.exports = UtilsNeedService;
\ No newline at end of file
// var a=new UtilsNeedService();
// a.queryExpertApplyCommunicationLogs({actionBody:{intentionBizId:"20200805103324000001",userFeedBack:true}});
// // var a=new UtilsNeedService();
// a.writeCommunicationLog({actionBody:{intentionBizId:"20200804200124000001",note:"测试反馈"}});
// var a=new UtilsNeedService();
// a.needCloseIcp({actionBody:{channelNeedNo:20200804200124000001,note:"ceshifankui"}},{channelNeedNo:20200803095203000001,note:"ceshifankui"});
// var a = new UtilsNeedService();
// a.queryTradeIntentionUserList({ actionBody: { intentionBizId: "20200803095203000001", userFeedBack: true } });
// var a = new UtilsNeedService();
// a.test();
// var a = new UtilsNeedService();
// a.ediNotify(null, {
// operationType:'USER_UPLOAD_PRODUCE',
// extInfo:"{\"businessLicense\":[\"https://companyreg-wangwen.oss-cn-shanghai.aliyuncs.com/business_license/1219541161213057/1603184928383/xk8suu62qo.jpg?Expires=1603193934&OSSAccessKeyId=hObpgEXoca42qH3V&Signature=BtHNsjWCN0Eqp2OQWwim8J62eWA%3D&response-content-disposition=fileName%3D%E8%90%A5%E4%B8%9A%E6%89%A7%E7%85%A7%3B\"],\"idCardList\":[\"https://companyreg-wangwen.oss-cn-shanghai.aliyuncs.com/card/1219541161213057/1603184933494/0m5epfgzhg79.jpg?Expires=1603193934&OSSAccessKeyId=hObpgEXoca42qH3V&Signature=5w%2FhkZuJ%2BxR5J9nC4QzkhqcrKy4%3D&response-content-disposition=fileName%3D%E7%9B%B8%E5%85%B3%E4%BA%BA%E5%91%98%E8%BA%AB%E4%BB%BD%E8%AF%81%3B\"]}"
// })
...@@ -65,20 +65,6 @@ class UtilsOpNeedService extends AppServiceBase { ...@@ -65,20 +65,6 @@ class UtilsOpNeedService extends AppServiceBase {
} }
/** /**
* 获取需求详情
* @param {*} pobj
* @param {*} actionBody needNo 需求号
*/
async getItemByNeedNo(pobj, actionBody) {
if (!actionBody.needNo) {
return system.getResult(null, "actionBody.needNo can not be empty,100385");
}
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var itemResult = await this.restPostUrl(pobj, reqUrl);
return itemResult;
}
/**
* 关闭需求 * 关闭需求
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody * @param {*} actionBody
...@@ -217,44 +203,6 @@ class UtilsOpNeedService extends AppServiceBase { ...@@ -217,44 +203,6 @@ class UtilsOpNeedService extends AppServiceBase {
return result; return result;
} }
async needDetailByChannelNo(pobj) {
if (!pobj.actionBody.bizId) {
return system.getResult(null, "actionBody.bizId can not be empty,100491");
}
var solutionobj = {
actionType: "getIcpProgrammeDetail",
actionBody: { BizId: pobj.actionBody.bizId },
appInfo: pobj.appInfo,
actionProcess: pobj.actionProcess
}
var url = this.centerOrderUrl + "action/icpapi/springBoard";
var solutionrtn = await this.execClient.execPost(solutionobj, url);
if (!solutionrtn || !solutionrtn.stdout) {
return system.getResultFail(-5011, "方案查询失败");
}
var solutiondata = JSON.parse(solutionrtn.stdout);
if (solutiondata.status != 0) {
return system.getResultFail(-5011, "方案查询失败");
}
if (solutiondata.data && solutiondata.data[0].channelNeedNo) {
pobj.actionBody.needNo = solutiondata.data[0].channelNeedNo;
pobj.actionBody.needId = solutiondata.data[0].channelNeedNo;
pobj.actionBody.channelSolutionNo = solutiondata.data[0].channelSolutionNo;
}
var sobj = {
actionType: "getItemByChannelNeedNo",
actionBody: pobj.actionBody,
appInfo: pobj.appInfo,
actionProcess: pobj.actionProcess
}
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var itemResult = await this.restPostUrl(sobj, reqUrl);
if (itemResult.status == 0) {
itemResult.data.channelSolutionNo = pobj.actionBody.channelSolutionNo;
}
return itemResult;
}
async writeCommunicationLog(pobj) { async writeCommunicationLog(pobj) {
if (!pobj.actionBody.intentionBizId) { if (!pobj.actionBody.intentionBizId) {
return system.getResult(null, "actionBody.intentionBizId can not be empty,100491"); return system.getResult(null, "actionBody.intentionBizId can not be empty,100491");
...@@ -550,14 +498,4 @@ class UtilsOpNeedService extends AppServiceBase { ...@@ -550,14 +498,4 @@ class UtilsOpNeedService extends AppServiceBase {
module.exports = UtilsOpNeedService; module.exports = UtilsOpNeedService;
// var a=new UtilsNeedService();
// a.queryExpertApplyCommunicationLogs({actionBody:{intentionBizId:"20200803095203000001",userFeedBack:true}});
// // var a=new UtilsNeedService();
// a.writeCommunicationLog({actionBody:{intentionBizId:"20200804200124000001",note:"测试反馈"}});
// var a=new UtilsNeedService();
// a.needCloseIcp({actionBody:{channelNeedNo:20200804200124000001,note:"ceshifankui"}},{channelNeedNo:20200803095203000001,note:"ceshifankui"});
...@@ -19,7 +19,7 @@ class UtilsProductService extends AppServiceBase { ...@@ -19,7 +19,7 @@ class UtilsProductService extends AppServiceBase {
if (!actionBody.pathCode) { if (!actionBody.pathCode) {
return system.getResult(null, "actionBody.pathCode can not be empty,100330"); return system.getResult(null, "actionBody.pathCode can not be empty,100330");
} }
if(actionBody.name){ if (actionBody.name) {
pobj.actionBody.productName = actionBody.name; pobj.actionBody.productName = actionBody.name;
} }
pobj.actionBody.pathCode = "/" + actionBody.pathCode + "/"; pobj.actionBody.pathCode = "/" + actionBody.pathCode + "/";
...@@ -41,15 +41,15 @@ class UtilsProductService extends AppServiceBase { ...@@ -41,15 +41,15 @@ class UtilsProductService extends AppServiceBase {
pobj.actionBody.pathCode = "/" + actionBody.pathCode + "/"; pobj.actionBody.pathCode = "/" + actionBody.pathCode + "/";
var url = settings.centerAppUrl() + "action/opProduct/springBoard"; var url = settings.centerAppUrl() + "action/opProduct/springBoard";
let list = await this.restPostUrl(pobj, url); let list = await this.restPostUrl(pobj, url);
if(!list.data){ if (!list.data) {
return system.getResult(null,'product data is empty') return system.getResult(null, 'product data is empty')
} }
for(let item of list.data){ for (let item of list.data) {
pobj.actionType = 'getMinPrice'; pobj.actionType = 'getMinPrice';
pobj.actionBody = { pobj.actionBody = {
product_id:item.product_id product_id: item.product_id
} }
let re = await this.restPostUrl(pobj,url); let re = await this.restPostUrl(pobj, url);
item.price = re.data ? re.data.price : 0; item.price = re.data ? re.data.price : 0;
} }
return list; return list;
...@@ -75,7 +75,7 @@ class UtilsProductService extends AppServiceBase { ...@@ -75,7 +75,7 @@ class UtilsProductService extends AppServiceBase {
* @param actionBody * @param actionBody
* @returns {Promise<{msg: *, data, bizmsg: *|string, status: number}>} * @returns {Promise<{msg: *, data, bizmsg: *|string, status: number}>}
*/ */
async getProductPrice(pobj,actionBody){ async getProductPrice(pobj, actionBody) {
pobj.actionType = 'getProductPrice' pobj.actionType = 'getProductPrice'
let url = settings.centerAppUrl() + "action/opProduct/springBoard"; let url = settings.centerAppUrl() + "action/opProduct/springBoard";
return await this.restPostUrl(pobj, url); return await this.restPostUrl(pobj, url);
...@@ -87,7 +87,7 @@ class UtilsProductService extends AppServiceBase { ...@@ -87,7 +87,7 @@ class UtilsProductService extends AppServiceBase {
* @param actionBody * @param actionBody
* @returns {Promise<{msg: *, data, bizmsg: *|string, status: number}>} * @returns {Promise<{msg: *, data, bizmsg: *|string, status: number}>}
*/ */
async getRegProducePrice(pobj,actionBody){ async getRegProducePrice(pobj, actionBody) {
pobj.actionType = 'getRegProducePrice' pobj.actionType = 'getRegProducePrice'
let url = settings.centerAppUrl() + "action/opProduct/springBoard"; let url = settings.centerAppUrl() + "action/opProduct/springBoard";
return await this.restPostUrl(pobj, url); return await this.restPostUrl(pobj, url);
...@@ -98,35 +98,35 @@ class UtilsProductService extends AppServiceBase { ...@@ -98,35 +98,35 @@ class UtilsProductService extends AppServiceBase {
* @param actionBody * @param actionBody
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
async getProductRecommend(pobj,actionBody){ async getProductRecommend(pobj, actionBody) {
const type = actionBody.type; const type = actionBody.type;
if(!type){ if (!type) {
return system.getResult(-1,'type can be not empty') return system.getResult(-1, 'type can be not empty')
} }
switch (type) { switch (type) {
case 1: case 1:
if(!actionBody.companyName){ if (!actionBody.companyName) {
return system.getResultFail(-1,'companyName can be not empty') return system.getResultFail(-1, 'companyName can be not empty')
} }
break; break;
case 2: case 2:
if(!actionBody.companyName){ if (!actionBody.companyName) {
return system.getResultFail(-1,'companyName can be not empty') return system.getResultFail(-1, 'companyName can be not empty')
} }
if(!actionBody.productCode){ if (!actionBody.productCode) {
return system.getResultFail(-1,'productCode can be not empty') return system.getResultFail(-1, 'productCode can be not empty')
} }
break; break;
case 3: case 3:
if(!actionBody.productCode){ if (!actionBody.productCode) {
return system.getResultFail(-1,'productCode can be not empty') return system.getResultFail(-1, 'productCode can be not empty')
} }
break; break;
default: default:
return system.getResultFail(-1,'type 参数错误'); return system.getResultFail(-1, 'type 参数错误');
} }
let url = settings.centerAppUrl() + "action/opProduct/springBoard"; let url = settings.centerAppUrl() + "action/opProduct/springBoard";
return await this.restPostUrl(pobj,url); return await this.restPostUrl(pobj, url);
} }
/** /**
...@@ -135,22 +135,55 @@ class UtilsProductService extends AppServiceBase { ...@@ -135,22 +135,55 @@ class UtilsProductService extends AppServiceBase {
* @param actionBody * @param actionBody
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
async updateProductPrice(pobj,actionBody){ async updateProductPrice(pobj, actionBody) {
if(!actionBody.data || actionBody.data.length == 0){ if (!actionBody.data || actionBody.data.length == 0) {
return system.getResultFail(-1,'data is empty!'); return system.getResultFail(-1, 'data is empty!');
} }
let url = settings.centerAppUrl() + "action/opProduct/springBoard"; let url = settings.centerAppUrl() + "action/opProduct/springBoard";
return await this.restPostUrl(pobj,url); return await this.restPostUrl(pobj, url);
} }
/** /**
* 获取全部产品 * 获取全部产品
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|any>} * @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|any>}
*/ */
async getAllProducts(pobj){ async getAllProducts(pobj) {
let url = settings.centerAppUrl() + 'action/opProduct/springBoard'; let url = settings.centerAppUrl() + 'action/opProduct/springBoard';
pobj.actionType = 'getAllProducts' pobj.actionType = 'getAllProducts'
let result = await this.restPostUrl(pobj,url); let result = await this.restPostUrl(pobj, url);
return result;
}
/**
* 获取全部产品大类
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|any>}
*/
async getAllProductType(pobj) {
let url = settings.centerAppUrl() + 'action/opProduct/springBoard';
pobj.actionType = 'getAllProductType'
let result = await this.restPostUrl(pobj, url);
return result;
}
/**
* 创建产品大类
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|any>}
*/
async submitProductType(pobj) {
let url = settings.centerAppUrl() + 'action/opProduct/springBoard';
pobj.actionType = 'submitProductType'
let result = await this.restPostUrl(pobj, url);
return result;
}
/**
* 修改产品大类
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|any>}
*/
async editProductType(pobj) {
let url = settings.centerAppUrl() + 'action/opProduct/springBoard';
pobj.actionType = 'editProductType'
let result = await this.restPostUrl(pobj, url);
return result; return result;
} }
...@@ -159,32 +192,32 @@ class UtilsProductService extends AppServiceBase { ...@@ -159,32 +192,32 @@ class UtilsProductService extends AppServiceBase {
* @param pobj * @param pobj
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|any>} * @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|any>}
*/ */
async getAllPathName(pobj){ async getAllPathName(pobj) {
let url = settings.centerAppUrl() + 'action/opProduct/springBoard'; let url = settings.centerAppUrl() + 'action/opProduct/springBoard';
pobj.actionType = 'getAllPathName'; pobj.actionType = 'getAllPathName';
let result = await this.restPostUrl(pobj,url); let result = await this.restPostUrl(pobj, url);
if(result.status !=0){ if (result.status != 0) {
return system.getResultFail(-1,'获取数据失败,请稍后再试!'); return system.getResultFail(-1, '获取数据失败,请稍后再试!');
} }
let data = result.data; let data = result.data;
let map = new Map(); let map = new Map();
for(let i =0;i<data.length;i++){ for (let i = 0; i < data.length; i++) {
let item = data[i]; let item = data[i];
let strs = item.path_name.split('/'); let strs = item.path_name.split('/');
let classOne = strs[1]; let classOne = strs[1];
let classTwo = strs[2]; let classTwo = strs[2];
if(map.has(classOne)){ if (map.has(classOne)) {
let val = map.get(classOne); let val = map.get(classOne);
val.push(classTwo) val.push(classTwo)
map.set(classOne,val); map.set(classOne, val);
}else{ } else {
let arr = []; let arr = [];
arr.push(classTwo) arr.push(classTwo)
map.set(classOne,arr); map.set(classOne, arr);
} }
} }
let resultData = []; let resultData = [];
map.forEach((v,k) =>{ map.forEach((v, k) => {
let obj = {}; let obj = {};
obj['key'] = k; obj['key'] = k;
obj['data'] = v; obj['data'] = v;
......
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