Commit ea3b6fea by 宋毅

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

parents b123328b 857dda5b
......@@ -43,7 +43,9 @@ class OpNeed extends APIBase {
case "getItemByNeedNo"://需求详情
opResult = await this.utilsOpNeedSve.getItemByNeedNo(pobj, pobj.actionBody);
break;
case "test"://2020 0826 lin 测试使用
opResult = await this.utilsOpNeedSve.test(pobj, pobj.actionBody);
break;
// case "getItemByChannelNeedNo"://方案反馈
// opResult = await this.utilsOpNeedSve.getItemByChannelNeedNo(pobj, pobj.actionBody);
......
......@@ -68,6 +68,9 @@ class TmToolsAPI extends WEBBase {
case "adjustWTSSize"://调整委托书
opResult = await this.toolSve.adjustWTSSize(action_body, req);
break;
case "getTmNclFilterSearch"://尼斯过滤
opResult = await this.toolSve.getTmNclFilterSearch(action_body, req);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -76,6 +76,15 @@ class Need extends APIBase {
case "getaliicpProduce"://方案询价
opResult = await this.centerorderSve.getaliicpProduce(pobj);
break;
case "submitIcpIntention":// 2020 0827 lin 新增 4.1 提交需求
opResult = await this.utilsNeedSve.submitIcpIntention(pobj, pobj.actionBody);
break;
case "queryIntentionList":// 2020 0827 lin 新增 4.2 需求列表查询
opResult = await this.utilsNeedSve.queryIntentionList(pobj, pobj.actionBody);
break;
case "confirmIcpIntention":// 2020 0827 lin 新增 4.3 用户需求确认
opResult = await this.utilsNeedSve.confirmIcpIntention(pobj, pobj.actionBody);
break;
case "testsymq":
opResult = await this.utilsNeedSve.testsymq(pobj);
break;
......
......@@ -72,6 +72,11 @@ class ToolService extends AppServiceBase {
var url = this.zcApiUrl + "api/trademark/tmqueryApi/icheming";
return await this.opReqResult(url, queryobj, req);
}
//尼斯过滤
async getTmNclFilterSearch(queryobj, req) {
var url = this.zcApiUrl + "api/tool/toolApi/getTmNclFilterSearch";
return await this.opReqResult(url, queryobj, req);
}
async opReqResult(reqUrl, queryobj, req) {
var rtn = await this.execClient.execPushDataPost(queryobj, reqUrl, req.headers["token"], req.headers["request-id"]);
var data = JSON.parse(rtn.stdout);
......
......@@ -16,7 +16,7 @@ class utilsDeliverSve extends AppServiceBase{
*/
async pushTmReDeliver(pobj){
try{
var verifyResult = await this.verifyParam(pobj);
var verifyResult = await this.verifyParam(pobj.actionBody);
if(verifyResult.status !=0){
return system.getResultFail();
}
......@@ -35,14 +35,13 @@ class utilsDeliverSve extends AppServiceBase{
* @returns {Promise<{msg: *, data, status: number}>}
*/
async verifyParam(actionBody) {
let verify = system.getResultSuccess();
let deliveryData ="";
let orderNo = "";
let tradeStatus = '';
let applicant ={};
if(actionBody.delivery_content){
deliveryData = actionBody.delivery_content[0].deliveryContent;
orderNo = actionBody.delivery_content[0].sourceOrderNo;
deliveryData = actionBody.delivery_content;
orderNo = actionBody.order_info.orderNo;
}
if(actionBody.deliveryData){
deliveryData = actionBody.deliveryData;
......@@ -89,8 +88,8 @@ class utilsDeliverSve extends AppServiceBase{
askForData:deliveryData.askForData,
supData:deliveryData.supData
}
verify.data = postData;
return verify;
return system.getResultSuccess(postData);
}
/**
......
......@@ -471,6 +471,68 @@ class UtilsNeedService extends AppServiceBase {
return system.getResultSuccess(res);
}
/**
* 2020 0827 lin 新增 4.1 用户在公司宝前端提交需求
* @param {*} pobj
* @param {*} actionBody
*/
async submitIcpIntention(pobj, actionBody) {
// 校验文档上必填字段
if (!actionBody.UserName) {
return system.getResult(null, "actionBody.UserName can not be empty,100400");
}
if (!actionBody.Description) {
return system.getResult(null, "actionBody.Description can not be empty,100405");
}
if (!actionBody.Area) {
return system.getResult(null, "actionBody.Area can not be empty,100410");
}
if (!actionBody.BizType) {
return system.getResult(null, "actionBody.BizType can not be empty,100415");
}
// 调用center-order 生成新的需求
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
// 生成成功 通知ali
if(result.status == 0) {
var aliResult = await this.aliclient.reqbyget({ action: "SubmitIcpIntention", reqbody: actionBody, apiVersion: "2019-05-08" });
console.log(aliResult);
}
return result;
}
/**
* 2020 0827 lin 新增 4.2 需求列表查询
* @param {*} pobj
* @param {*} actionBody
*/
async queryIntentionList(pobj, actionBody) {
var aliResult = await self.aliclient.reqbyget({ action: "QueryIntentionList", reqbody: actionBody, apiVersion: "2019-05-08" });
if (aliResult.code == 200) {
return system.getResultSuccess();
} else {
return system.getResult(null, "查询失败 10420");
}
}
/**
* 2020 0827 lin 新增 4.3 用户需求确认 未测试
* @param {*} pobj
* @param {*} actionBody
*/
async confirmIcpIntention(pobj, actionBody) {
if (!actionBody.intentionBizId) {
return system.getResult(null, "actionBody.intentionBizId can not be empty,100395");
}
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
this.utilsPushSve.aliBusiness2Fq(pobj, "pushCloseNeed");
return system.getResultSuccess();
} else {
return system.getResult(null, "推送失敗 100388");
}
}
async queryTradeIntentionUserList(pobj) {
if (!pobj.actionBody.intentionBizId) {
return system.getResult(null, "actionBody.intentionBizId can not be empty,100493");
......
......@@ -296,10 +296,13 @@ class UtilsOpNeedService extends AppServiceBase {
}
return jsonarr;
}
//  async opNeedDetailByChannelNo(pobj, actionBody){
// }
//2020 0826 lin 测试使用
async test(pobj, actionBody){
pobj.actionType = "receiveIcpStatusNotify";
var url = settings.centerOrderUrl() + "action/qcapi/springBoard";
var rtn = await this.restPostUrl(pobj, url);
return rtn;
}
}
module.exports = UtilsOpNeedService;
......
......@@ -246,7 +246,8 @@ module.exports = function (app) {
"getPaidLogoListByUser","getCollectibleLogoListByUser","collectLogo","getLogoMaterial","cancelCollectLogo","icpNotify","createName","getNameDetail","orderConfirm",
"orderTotalSum", "collect", "reg", "orderCheck","getReOrderList","getOfficalList","addReviewList","opSubmitNeed","opNeedClose","opNeedList","getItemByNeedNo","opNeedDetailByChannelNo",
"getNeedListUser",
"manualEvaluation", "diagnosisInfo", "check", "enterpriseInfo", "diagnosisDetail"
"manualEvaluation", "diagnosisInfo", "check", "enterpriseInfo", "diagnosisDetail",
"submitIcpIntention", "queryIntentionList", "confirmIcpIntention"
];
if (lst.indexOf(req.body.actionType) >= 0) {
var userpin = req.headers["userpin"] || "";
......@@ -340,7 +341,7 @@ module.exports = function (app) {
res.end(JSON.stringify(result));
return;
}
if (["getAppTokenByHosts", "getAppTokenByAppKey"].indexOf(req.body.actionType) >= 0) {
if (["getAppTokenByHosts", "getAppTokenByAppKey", "getTmNclFilterSearch"].indexOf(req.body.actionType) >= 0) {
req.body.actionBody.appHosts = req.host;
next();
return;
......
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