Commit 2d1416c2 by 王栋源

wdy

parent 52724d3c
......@@ -46,7 +46,7 @@ class IcAPI extends APIBase {
opResult = await this.needsolutionSve.getProgrammeInfoByNeedNo(pobj);
break;
case "receiveFeedback"://接收方案反馈信息(即方案作废)
opResult = await this.needsolutionSve.receiveFeedback(pobj);
opResult = await this.needsolutionSve.receiveFeedback(pobj, req);
break;
case "abolishProgramme"://服务商方案作废
opResult = await this.needsolutionSve.abolishProgramme(pobj);
......
......@@ -49,13 +49,28 @@ class NeedinfoService extends ServiceBase {
async submitNeed(pobj, actionBody, req) {
var needNo = await this.getBusUid("n");
if (!actionBody.intentionBizId) {
return system.getResult(null, "intentionBizId不能为空");
return {
"requestId": req.requestId,
"success": false,
"errorMsg": "intentionBizId不能为空",
"errorCode": "ok"
};
}
if (!actionBody.mobile) {
return system.getResult(null, "mobile不能为空");
return {
"requestId": req.requestId,
"success": false,
"errorMsg": "mobile不能为空",
"errorCode": "ok"
};
}
if (!actionBody.type) {
return system.getResult(null, "type不能为空");
return {
"requestId": req.requestId,
"success": false,
"errorMsg": "type不能为空",
"errorCode": "ok"
};
}
var ninfo = await this.findOne({ channelNeedNo: actionBody.intentionBizId });
if (ninfo) {
......
......@@ -267,19 +267,34 @@ class NeedsolutionService extends ServiceBase {
}
//接收方案反馈信息(即方案作废)
async receiveFeedback(pobj){
async receiveFeedback(pobj,req){
var ab = pobj.actionBody;
if(!ab.solutionBizId){
return system.getResultFail(-101,"方案业务编号不能为空");
return {
"requestId": req.requestId,
"success": false,
"errorMsg": "-101,方案业务编号不能为空",
"errorCode": "ok"
};
}
if(!ab.operateType){
return system.getResultFail(-102,"操作类型不能为空");
return {
"requestId": req.requestId,
"success": false,
"errorMsg": "-102,操作类型不能为空",
"errorCode": "ok"
};
}
var ns = await this.dao.model.findOne({
where:{channelSolutionNo:ab.solutionBizId},raw:true
});
if(!ns || !ns.id){
return system.getResultFail(-103,"未知方案");
return {
"requestId": req.requestId,
"success": false,
"errorMsg": "-103,未知方案",
"errorCode": "ok"
};
}
var solutionContent = ns.solutionContent?JSON.parse(ns.solutionContent):"";
var status = "";
......@@ -290,7 +305,12 @@ class NeedsolutionService extends ServiceBase {
}else if(ab.operateType=="PAID"){// PAID:支付
status="ywc";
}else{
return system.getResultFail(-104,"操作类型有误");
return {
"requestId": req.requestId,
"success": false,
"errorMsg": "-104,操作类型有误",
"errorCode": "ok"
};
}
var solution_status={"dqr":"待确认","ywc":"已完成","yzf":"已作废"};
solutionContent["deliveryStatus"] = status;
......@@ -304,7 +324,12 @@ class NeedsolutionService extends ServiceBase {
status:status,solutionContent:solutionContent
};
await this.dao.model.update(reqObj, { where: { id: ns.id }});//修改方案信息
return system.getResultSuccess();
return {
"requestId": req.requestId,
"success": true,
"errorMsg": "",
"errorCode": "ok"
};;
}
//服务商方案作废
async abolishProgramme(pobj){
......
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