Commit 3e0f17d4 by 庄冰

zhuangbing

parent ca2a44bb
......@@ -60,6 +60,15 @@ class IcAPI extends APIBase {
case "solutionClose"://需求关闭
opResult = await this.needinfoSve.solutionClose(pobj);
break;
case "abolishProgrammeByNeed"://根据需求关闭方案(关闭需求后调用)
opResult = await this.needsolutionSve.abolishProgrammeByNeed(pobj);
break;
case "createSolutionByOrder"://立即支付下单保存方案
opResult = await this.needsolutionSve.createSolutionByOrder(pobj);
break;
case "receiveSolutionPayInfo"://接收方案状态及支付信息(方案支付后创建订单时调用)
opResult = await this.needinfoSve.receiveSolutionPayInfo(pobj);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -415,7 +415,35 @@ class NeedsolutionService extends ServiceBase {
await this.dao.create(reqObj);
return system.getResultSuccess();
}
//接收方案状态及支付信息
async receiveSolutionPayInfo(pobj){
var ab = pobj.actionBody;
var app = pobj.appInfo;
if(!app || !app.uapp_id){
return system.getResultFail(-100,"未知渠道");
}
if(!ab.channelSolutionNo){
return system.getResultFail(-101,"渠道方案编号不能为空");
}
// if(!ab.status){
// return system.getResultFail(-102,"状态不能为空");
// }
var needsolutioninfo = await this.dao.findOne({ channelSolutionNo: ab.channelSolutionNo,uapp_id:app.uapp_id });
if(!needsolutioninfo || !needsolutioninfo.id){
return system.getResultFail(-400,"未知方案");
}
var solutionContent = needsolutioninfo.solutionContent;
if(ab.orderPrice){
solutionContent = JSON.parse(solutionContent);
solutionContent["totalSum"] = ab.orderPrice;
needsolutioninfo.solutionContent = JSON.stringify(solutionContent);
}
if(ab.status){
needsolutioninfo.status = ab.status;
}
await this.dao.update(needsolutioninfo);
return system.getResultSuccess();
}
}
module.exports = NeedsolutionService;
......
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