Commit da74c651 by 庄冰

zhuangbing

parent 5c41e79f
......@@ -36,7 +36,7 @@ class NeedsolutionService extends ServiceBase {
return system.getResultFail(-104,"业务方案信息不能为空");
}
var solution = ab.solutionContent.solution;
if(bizType=="companyreg"){//普通公司注册
if(bizType=="esp.companyreg"){//普通公司注册
if(!solution.companyName){
return system.getResultFail(-105,"公司名称不能为空");
}
......@@ -62,7 +62,7 @@ class NeedsolutionService extends ServiceBase {
return system.getResultFail(-112,"经营范围不能为空");
}
}
if(bizType=="companyreg_cloud"){//云上公司注册
if(bizType=="esp.companyreg_cloud"){//云上公司注册
if(!solution.park){
return system.getResultFail(-113,"注册园区不能为空");
}
......@@ -153,7 +153,7 @@ class NeedsolutionService extends ServiceBase {
if (pageSize > 500) {
pageSize = 500;
}
var bizType = ab.bizType || "companyreg";// companyreg_cloud
var bizType = ab.bizType || "esp.companyreg";// esp.companyreg_cloud
var pageIndex = Number(ab.pageIndex || 1);
var from = pageIndex == 1 ? 0 : Number((pageIndex - 1) * pageSize);
//select * from log where data->'$.id' = 142;
......@@ -179,7 +179,7 @@ class NeedsolutionService extends ServiceBase {
sqlCount += " and status = :status";
paramWhere.status = ab.status;
}
if(bizType=="companyreg"){//普通公司注册
if(bizType=="esp.companyreg"){//普通公司注册
if (ab.companyName) {//企业名称
sql = sql+" and solutionContent->'$.solution.companyName' = :companyName";
sqlCount = sqlCount+" and solutionContent->'$.solution.companyName' = :companyName";
......@@ -211,7 +211,7 @@ class NeedsolutionService extends ServiceBase {
paramWhere.companyCategory = ab.companyCategory;
}
}
if(bizType=="companyreg_cloud"){//云上公司注册
if(bizType=="esp.companyreg_cloud"){//云上公司注册
if (ab.park) {//注册园区
sql = sql+" and solutionContent->'$.solution.park' = :park";
sqlCount = sqlCount+" and solutionContent->'$.solution.park' = :park";
......@@ -329,52 +329,59 @@ class NeedsolutionService extends ServiceBase {
return system.getResultSuccess();
}
// //立即支付下单保存方案
// async createSolutionByOrder(pobj){
// var ab = pobj.actionBody;
// var app = pobj.appInfo;
// if(!app || !app.uapp_id){
// return system.getResultFail(-100,"未知渠道");
// }
// if(!ab.solutionBizid){
// 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(-102,"未知需求信息");
// }
// var solution = {
// "companyName":ab.companyName,
// "area":ab.area,
// "city": ab.city,
// "companyCategory": ab.companyCategory,
// "companyType": ab.companyType,
// "orgType" :ab.orgType,
// "industryType": ab,industryType,
// "scope": ab.scope,
// "remark":ab.remark
// };
// var {
// "notes":"方案备注",
// "bizType":"companyreg",
// "solution":{
// "area":"区",
// "city":"市",
// "scope":"经营范围",
// "remark":"方案备注",
// "orgType":"组织类型",
// "companyName":"测试公司名称",
// "companyType":"公司性质",
// "industryType":"行业",
// "companyCategory":"纳税人类型"
// }
// }
// var reqObj = {
// }
// }
//立即支付下单保存方案
async createSolutionByOrder(pobj){
var ab = pobj.actionBody;
var app = pobj.appInfo;
if(!app || !app.uapp_id){
return system.getResultFail(-100,"未知渠道");
}
if(!ab.solutionBizid){
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(-102,"未知需求信息");
}
var solution = "";
var bizType = "esp.companyreg";
if(ab.companyName){
solution = {
"companyName":ab.companyName,
"area":ab.area,
"city": ab.city,
"companyCategory": ab.companyCategory,
"companyType": ab.companyType,
"orgType" :ab.orgType,
"industryType": ab,industryType,
"scope": ab.scope,
"remark":ab.remark
};
}else if(ab.park){
solution = {
"park":ab.park,
"productType":ab.productType,
"remark":ab.remark
};
bizType = "esp.companyreg_cloud";
}
var solutionContent = {
"bizType":bizType,
"solution":solution
};
solutionContent = JSON.stringify(solutionContent);
// ab["channelNeedNo"] = needinfo.channelNeedNo;
// ab["solutionNo"] = solutionNo;
var solutionNo = await this.getBusUid("ns");
var reqObj = {
solutionContent:solutionContent,solutionNo:solutionNo,status:"ywc",needNo:needinfo.needNo,
channelNeedNo:needinfo.channelNeedNo,orderNo:ab.orderNo,createUserId:needinfo.followManUserId
};
await this.dao.create(reqObj);
return system.getResultSuccess();
}
}
module.exports = NeedsolutionService;
......@@ -391,4 +398,4 @@ module.exports = NeedsolutionService;
// industryType
// scope
// remark
// solutionBizid
\ No newline at end of file
// solutionBizidchannelNeedNo
\ No newline at end of file
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