Commit 7e497fca by 庄冰

关闭icp订单

parent d0bd12e6
......@@ -50,6 +50,9 @@ class IcAPI extends APIBase {
case "getItemByChannelSolutionNo"://渠道方案号获取需求详情
opResult = await this.needinfoSve.getItemByChannelSolutionNo(pobj, pobj.actionBody, req);
break;
case "getSolutionByChannelOrderNo"://渠道订单号获取方案详情
opResult = await this.needinfoSve.getSolutionByChannelOrderNo(pobj, pobj.actionBody, req);
break;
case "writeCommunicationLog"://渠道方案号获取需求详情
opResult = await this.needinfoSve.writeCommunicationLog(pobj, pobj.actionBody, req);
break;
......
......@@ -10,6 +10,7 @@ class NeedinfoService extends ServiceBase {
this.needsolutionSve = system.getObject("service.dbneed.needsolutionSve");
this.needsolutionDao = system.getObject("db.dbneed.needsolutionDao");
this.needinfoDao = system.getObject("db.dbneed.needinfoDao");
this.orderinfoDao = system.getObject("db.dbcorder.orderinfoDao");
}
async getItemByNeedNo(pobj) {
var item = await this.dao.getItemByNeedNo(pobj.actionBody.needNo);
......@@ -185,6 +186,20 @@ class NeedinfoService extends ServiceBase {
return system.getResultSuccess(item);
}
async getSolutionByChannelOrderNo(pobj){
var orderinfo = await this.orderinfoDao.findOne({ channelOrderNo: pobj.actionBody.orderNo });
if (!orderinfo || !orderinfo.orderNo) {
return system.getResult(null, "订单数据为空,30210");
}
var item = await this.needsolutionDao.model.findOne({
where:{orderNo:orderinfo.orderNo}
});
if (!item) {
return system.getResult(null, "方案数据为空,30210");
}
return system.getResultSuccess(item);
}
async writeCommunicationLog(pobj, actionBody) {
// 查询需求沟通记录
// 2020 0820 lin 修改channel传过来的参数 为 note/intentionBizId
......
......@@ -201,12 +201,12 @@ class BaiduQcService {
}
//关闭ICP订单 百度icp 2.4
async icpOrderClose(pobj) {
var ab = pobj;
if (!ab.channelOrderNo) {
var ab = pobj.actionBody;
if (!ab.orderNo) {
return system.getResultFail(-101, "渠道订单号不能为空");
}
var orderInfo = await this.orderinfoDao.model.findOne({
where:{channelOrderNo:ab.channelOrderNo},raw:true
where:{channelOrderNo:ab.orderNo},raw:true
});
if (!orderInfo || !orderInfo.id) {
return system.getResultFail(-103, "未知订单");
......
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