Commit 6a378872 by 庄冰

submitProgramme

parent da74c651
...@@ -85,12 +85,32 @@ class NeedsolutionService extends ServiceBase { ...@@ -85,12 +85,32 @@ class NeedsolutionService extends ServiceBase {
ab["solutionNo"] = solutionNo; ab["solutionNo"] = solutionNo;
ab["status"] = "dqr"; ab["status"] = "dqr";
ab.solutionContent = JSON.stringify(ab.solutionContent); ab.solutionContent = JSON.stringify(ab.solutionContent);
var od = await this.dao.create(ab); return await this.db.transaction(async function (t) {
if(od && od.id){ var od = await this.dao.create(ab,t);
return system.getResultSuccess({needinfo:needinfo,needsolution:od}); if(od && od.id){
}else{ var followContent = {
return system.getResultFail(-202, "提交方案失败"); followDate:new Date(),
} content:"提交到方案"
};
followContent = JSON.stringify(followContent);
var needObj={
id:needinfo.id,
followManUserId: user.id,//跟进人id
followManName: user.channel_username,//跟进人姓名
followManMobile: user.mobile,//跟进人手机号(合伙人)
followManOnlyCode: user.channel_userid,//跟进者唯一码
followContent: followContent
};
await this.needinfoDao.update(needObj,t);
needinfo = await this.needinfoDao.model.findOne({
where:{needNo:ab.needNo},raw:true
});
return system.getResultSuccess({needinfo:needinfo,needsolution:od});
}else{
return system.getResultFail(-202, "提交方案失败");
}
})
} }
//接收方案编号(方案推送至阿里后,接收保存方案信息) //接收方案编号(方案推送至阿里后,接收保存方案信息)
async receiveProgrammeNo(pobj){ async receiveProgrammeNo(pobj){
......
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