Commit 8dd7c747 by 庄冰

check status

parent e7c95d63
...@@ -717,6 +717,9 @@ class NeedsolutionService extends ServiceBase { ...@@ -717,6 +717,9 @@ class NeedsolutionService extends ServiceBase {
if(!solutionContent){ if(!solutionContent){
return system.getResultFail(-402,"方案交付信息有误"); return system.getResultFail(-402,"方案交付信息有误");
} }
if(solutionContent.status!="USER_UPLOADED"){
return system.getResultFail(-403,"用户未上传材料,不能执行此操作");
}
//获取需求信息 //获取需求信息
var needinfo = await this.needinfoDao.model.findOne({ var needinfo = await this.needinfoDao.model.findOne({
where:{needNo:needsolutioninfo.needNo},raw:true where:{needNo:needsolutioninfo.needNo},raw:true
...@@ -887,7 +890,7 @@ class NeedsolutionService extends ServiceBase { ...@@ -887,7 +890,7 @@ class NeedsolutionService extends ServiceBase {
return system.getResultFail(-101,"渠道方案号不能为空"); return system.getResultFail(-101,"渠道方案号不能为空");
} }
if(!ab.Note){ if(!ab.Note){
return system.getResultFail(-105,"关闭理由不能为空"); return system.getResultFail(-106,"关闭理由不能为空");
} }
//获取方案信息 //获取方案信息
var ns = await this.dao.model.findOne({ var ns = await this.dao.model.findOne({
...@@ -909,6 +912,9 @@ class NeedsolutionService extends ServiceBase { ...@@ -909,6 +912,9 @@ class NeedsolutionService extends ServiceBase {
return system.getResultFail(-103,"方案状态错误,只能废弃待确认方案"); return system.getResultFail(-103,"方案状态错误,只能废弃待确认方案");
} }
var solutionContent = ns.solutionContent; var solutionContent = ns.solutionContent;
if(!solutionContent.status || ["USER_UPLOADED","MATERIAL_UNCONFIRM","USER_CONFIRMED","ACCOUNT_REGISTERED","MATERIAL_SUBMITTED"].indexOf(solutionContent.status)<0 ){
return system.getResultFail(-108,"方案流程状态错误,不能执行此操作");
}
solutionContent.solution.Note = ab.Note; solutionContent.solution.Note = ab.Note;
solutionContent = JSON.stringify(solutionContent); solutionContent = JSON.stringify(solutionContent);
await this.dao.update({id:ns.id,status:"yzf",solutionContent:solutionContent});//方案废弃 await this.dao.update({id:ns.id,status:"yzf",solutionContent:solutionContent});//方案废弃
......
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