Commit 7f721985 by 庄冰

typecode

parent 23ffc6c0
...@@ -24,15 +24,34 @@ class NeedsolutionService extends ServiceBase { ...@@ -24,15 +24,34 @@ class NeedsolutionService extends ServiceBase {
if(!ab.solutionContent){ if(!ab.solutionContent){
return system.getResultFail(-102,"方案信息有误"); return system.getResultFail(-102,"方案信息有误");
} }
var bizType = ab.solutionContent.bizType || "";//业务类型 //获取需求信息
var needinfo = await this.needinfoDao.model.findOne({
where:{channelNeedNo:ab.needNo},raw:true
});
if(!needinfo || !needinfo.id){
return system.getResultFail(-201,"未知需求信息");
}
if(needinfo.status=="ycd" || needinfo.status=="ygb"){
return system.getResultFail(-202,"该方案需求状态为"+needinfo.statusName+",不能创建方案");
}
var bizType = ab.solutionContent.bizType;//业务类型
if(!bizType || !needinfo.typeCode || bizType!=needinfo.typeCode){
return system.getResultFail(-205,"方案类型错误");
}
if(bizType=="gszc"){//普通公司注册
ab.solutionContent.bizType="esp.companyreg";
bizType = "esp.companyreg";
}else if(bizType=="ysgszc"){//云上公司注册
ab.solutionContent.bizType="esp.companyreg_cloud";
bizType = "esp.companyreg_cloud";
}else{
return system.getResultFail(-206,"方案类型错误");
}
// bizType取值如下: // bizType取值如下:
// 商标交易:esp.trademark_trade // 商标交易:esp.trademark_trade
// 财税代账:esp.bookkeeping // 财税代账:esp.bookkeeping
// 普通公司注册:esp.companyreg // 普通公司注册:esp.companyreg
// 云上公司注册:esp.companyreg_cloud // 云上公司注册:esp.companyreg_cloud
if(!bizType){
return system.getResultFail(-103,"业务类型不能为空");
}
if(!ab.solutionContent.solution){ if(!ab.solutionContent.solution){
return system.getResultFail(-104,"业务方案信息不能为空"); return system.getResultFail(-104,"业务方案信息不能为空");
} }
...@@ -74,16 +93,7 @@ class NeedsolutionService extends ServiceBase { ...@@ -74,16 +93,7 @@ class NeedsolutionService extends ServiceBase {
return system.getResultFail(-115,"产品类型不能为空"); return system.getResultFail(-115,"产品类型不能为空");
} }
} }
//获取需求信息
var needinfo = await this.needinfoDao.model.findOne({
where:{channelNeedNo:ab.needNo},raw:true
});
if(!needinfo || !needinfo.id){
return system.getResultFail(-201,"未知需求信息");
}
if(needinfo.status=="ycd" || needinfo.status=="ygb"){
return system.getResultFail(-202,"该方案需求状态为"+needinfo.statusName+",不能创建方案");
}
ab["channelNeedNo"] = needinfo.channelNeedNo; ab["channelNeedNo"] = needinfo.channelNeedNo;
var solutionNo = await this.getBusUid("ns"); var solutionNo = await this.getBusUid("ns");
ab["solutionNo"] = solutionNo; ab["solutionNo"] = solutionNo;
......
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