Commit 837ff72c by 庄冰

abolishProgrammeByNeed

parent 4f759f86
......@@ -298,7 +298,36 @@ class NeedsolutionService extends ServiceBase {
await this.dao.update({id:ns.id,status:"yzf"});//方案废弃
return system.getResultSuccess();
}
//根据需求关闭方案(关闭需求后调用)
async abolishProgrammeByNeed(pobj){
var ab = pobj.actionBody;
var app = pobj.appInfo;
if(!app || !app.uapp_id){
return system.getResultFail(-100,"未知渠道");
}
if(!ab.intentionBizId){
return system.getResultFail(-101,"需求编号不能为空");
}
//获取需求信息
var needinfo = await this.needinfoDao.model.findOne({
where:{channelNeedNo:ab.intentionBizId,uapp_id:app.uapp_id},raw:true
});
if(!needinfo || !needinfo.id){
return system.getResultFail(-201,"未知需求信息");
}
//获取方案信息
var ns = await this.dao.model.findAll({
where:{needNo:needinfo.needNo},raw:true
});
for(var i=0;i<ns.length;i++){
var fa = ns[i];
if(fa.status=="ywc"){
return system.getResultFail(-103,"方案状态错误,不能废弃已完成方案");
}
}
await this.dao.model.update({status:"yzf"}, { where: {needNo:needinfo.needNo} });//方案废弃
return system.getResultSuccess();
}
......
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