Commit 4cf33156 by 庄冰

ic

parent 57f71c3c
...@@ -34,6 +34,9 @@ class IcAPI extends APIBase { ...@@ -34,6 +34,9 @@ class IcAPI extends APIBase {
case "submitProgramme"://提交公司注册方案 case "submitProgramme"://提交公司注册方案
opResult = await this.needsolutionSve.submitProgramme(pobj); opResult = await this.needsolutionSve.submitProgramme(pobj);
break; break;
case "receiveProgrammeNo"://接收方案编号(方案推送至阿里后,接收保存方案信息)
opResult = await this.needsolutionSve.receiveProgrammeNo(pobj);
break;
case "getProgrammeInfoByNeedNo"://根据需求查看方案列表 case "getProgrammeInfoByNeedNo"://根据需求查看方案列表
opResult = await this.needsolutionSve.getProgrammeInfoByNeedNo(pobj); opResult = await this.needsolutionSve.getProgrammeInfoByNeedNo(pobj);
break; break;
......
...@@ -7,7 +7,7 @@ module.exports = (db, DataTypes) => { ...@@ -7,7 +7,7 @@ module.exports = (db, DataTypes) => {
channelNeedNo: DataTypes.STRING(128), //渠道需求号(页面中列表中显示该需求号) channelNeedNo: DataTypes.STRING(128), //渠道需求号(页面中列表中显示该需求号)
needNo: DataTypes.STRING(128), //需求号--用于服务商或需求表中创建订单 needNo: DataTypes.STRING(128), //需求号--用于服务商或需求表中创建订单
channelUserId: DataTypes.INTEGER,//发布者id channelUserId: DataTypes.INTEGER,//发布者id
publisherName: DataTypes.STRING,//发布者姓名 publishName: DataTypes.STRING,//发布者姓名
publisherOnlyCode: DataTypes.STRING(50),//发布者唯一码 publisherOnlyCode: DataTypes.STRING(50),//发布者唯一码
publishContent: DataTypes.STRING,//发布内容 publishContent: DataTypes.STRING,//发布内容
publishMobile: DataTypes.STRING,//发布者手机号 publishMobile: DataTypes.STRING,//发布者手机号
......
...@@ -41,22 +41,32 @@ class NeedsolutionService extends ServiceBase { ...@@ -41,22 +41,32 @@ class NeedsolutionService extends ServiceBase {
var solutionNo = await this.getBusUid("ns"); var solutionNo = await this.getBusUid("ns");
ab["solutionNo"] = solutionNo; ab["solutionNo"] = solutionNo;
ab["status"] = "ytj"; ab["status"] = "ytj";
ab.solutionContent = JSON.stringify(ab.solutionContent);
var od = await this.dao.create(ab); var od = await this.dao.create(ab);
if(od && od.id){ if(od && od.id){
// //推送数据至阿里(暂无) return system.getResultSuccess({needinfo:needinfo,needsolution:od});
// var pushObj = {
// intentionBizId:needinfo.channelNeedNo,bizType:bizType,solution:ab.solutionContent.solution
// };
// var pushRes = await this.push2aliSve.pushData2Ali({url:"xxx/xxx/asdasd",pushObj:pushObj,appInfo:pobj.appInfo});
// //推送后获取方案id 存到方案
// if(pushRes && pushRes.status==0 && pushRes.data && pushRes.data.SolutionBizId){
// await this.dao.update({channelSolutionNo:pushRes.data.SolutionBizId,id:od.id});//保存渠道方案id
// }
return system.getResultSuccess(od);
}else{ }else{
return system.getResultFail(-202, "提交方案失败"); return system.getResultFail(-202, "提交方案失败");
} }
} }
//接收方案编号(方案推送至阿里后,接收保存方案信息)
async receiveProgrammeNo(pobj){
var ab = pobj.actionBody;
if(!ab.solutionBizId){
return system.getResultFail(-101,"渠道方案业务编号不能为空");
}
if(!ab.solutionNo){
return system.getResultFail(-102,"方案业务编号不能为空");
}
var ns = await this.dao.model.findOne({
where:{solutionNo:ab.solutionNo},raw:true
});
if(!ns || !ns.id){
return system.getResultFail(-103,"未知方案");
}
await this.dao.model.update({channelSolutionNo:ab.solutionBizId}, { where: { id: ns.id }});//修改方案信息
return system.getResultSuccess();
}
//根据需求查看方案列表 //根据需求查看方案列表
async getProgrammeInfoByNeedNo(pobj){ async getProgrammeInfoByNeedNo(pobj){
var ab = pobj.actionBody; var ab = pobj.actionBody;
...@@ -71,7 +81,8 @@ class NeedsolutionService extends ServiceBase { ...@@ -71,7 +81,8 @@ class NeedsolutionService extends ServiceBase {
return system.getResultFail(-102,"未知需求信息"); return system.getResultFail(-102,"未知需求信息");
} }
var ns = await this.dao.model.findAll({ var ns = await this.dao.model.findAll({
where:{needNo:ab.needNo},raw:true where:{needNo:ab.needNo},raw:true,
attributes:["needNo","solutionNo","orderNo","solutionContent","status","statusName"]
}); });
return system.getResultSuccess(ns); return system.getResultSuccess(ns);
} }
...@@ -129,11 +140,6 @@ class NeedsolutionService extends ServiceBase { ...@@ -129,11 +140,6 @@ class NeedsolutionService extends ServiceBase {
return system.getResultFail(-102,"未知方案"); return system.getResultFail(-102,"未知方案");
} }
await this.dao.update({id:ns.id,status:"yzf"});//方案废弃 await this.dao.update({id:ns.id,status:"yzf"});//方案废弃
// //推送至阿里
// var pushObj = {
// solutionBizId:ns.channelSolutionNo,note:ab.note||""
// };
// var pushRes = await this.push2aliSve.pushData2Ali({url:"xxx/xxx/asdasd",pushObj:pushObj,appInfo:pobj.appInfo});
return system.getResultSuccess(); 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