Commit 08c64fe6 by 王栋源

Merge branch 'center-order' of gitlab.gongsibao.com:jiangyong/zhichan into center-order

parents 3ccb9b2b d0eb9e2b
...@@ -76,7 +76,7 @@ class NeedsolutionService extends ServiceBase { ...@@ -76,7 +76,7 @@ class NeedsolutionService extends ServiceBase {
} }
//获取需求信息 //获取需求信息
var needinfo = await this.needinfoDao.model.findOne({ var needinfo = await this.needinfoDao.model.findOne({
where:{needNo:ab.needNo},raw:true where:{channelNeedNo:ab.needNo},raw:true
}); });
if(!needinfo || !needinfo.id){ if(!needinfo || !needinfo.id){
return system.getResultFail(-201,"未知需求信息"); return system.getResultFail(-201,"未知需求信息");
...@@ -90,6 +90,7 @@ class NeedsolutionService extends ServiceBase { ...@@ -90,6 +90,7 @@ class NeedsolutionService extends ServiceBase {
ab.solutionContent = JSON.stringify(ab.solutionContent); ab.solutionContent = JSON.stringify(ab.solutionContent);
var self = this; var self = this;
return await this.db.transaction(async function (t) { return await this.db.transaction(async function (t) {
ab["needNo"] = needinfo.needNo;
var od = await self.dao.create(ab,t); var od = await self.dao.create(ab,t);
if(od && od.id){ if(od && od.id){
var pushflag = 0;//推送标志 值为1推送小记 var pushflag = 0;//推送标志 值为1推送小记
...@@ -116,7 +117,7 @@ class NeedsolutionService extends ServiceBase { ...@@ -116,7 +117,7 @@ class NeedsolutionService extends ServiceBase {
} }
await self.needinfoDao.update(needObj,t); await self.needinfoDao.update(needObj,t);
needinfo = await self.needinfoDao.model.findOne({ needinfo = await self.needinfoDao.model.findOne({
where:{needNo:ab.needNo},raw:true where:{id:needinfo.id},raw:true
}); });
needinfo["pushflag"]=pushflag; needinfo["pushflag"]=pushflag;
return system.getResultSuccess({needinfo:needinfo,needsolution:od}); return system.getResultSuccess({needinfo:needinfo,needsolution:od});
...@@ -171,8 +172,8 @@ class NeedsolutionService extends ServiceBase { ...@@ -171,8 +172,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,createUserId:user.id},raw:true, where:{needNo:needinfo.needNo,createUserId:user.id},raw:true,
attributes:["needNo","solutionNo","orderNo","solutionContent","status","statusName"] attributes:["needNo","solutionNo","channelSolutionNo","orderNo","solutionContent","status","statusName"]
}); });
return system.getResultSuccess(ns); return system.getResultSuccess(ns);
} }
...@@ -284,7 +285,7 @@ class NeedsolutionService extends ServiceBase { ...@@ -284,7 +285,7 @@ class NeedsolutionService extends ServiceBase {
if(!ns || !ns.id){ if(!ns || !ns.id){
return system.getResultFail(-103,"未知方案"); return system.getResultFail(-103,"未知方案");
} }
var solutionContent = ns.solutionContent?JSON.parse(ns.solutionContent):""; var solutionContent = ns.solutionContent;
var status = ""; var status = "";
if(ab.operateType=="INVALID"){// INVALID:作废 if(ab.operateType=="INVALID"){// INVALID:作废
status="yzf"; status="yzf";
...@@ -330,7 +331,11 @@ class NeedsolutionService extends ServiceBase { ...@@ -330,7 +331,11 @@ class NeedsolutionService extends ServiceBase {
return system.getResultFail(-103,"方案状态错误,只能废弃待确认方案"); return system.getResultFail(-103,"方案状态错误,只能废弃待确认方案");
} }
await this.dao.update({id:ns.id,status:"yzf"});//方案废弃 await this.dao.update({id:ns.id,status:"yzf"});//方案废弃
return system.getResultSuccess(); //获取方案信息
ns = await this.dao.model.findOne({
where:{solutionNo:ab.solutionNo,createUserId:user.id},raw:true
});
return system.getResultSuccess(ns);
} }
//根据需求关闭方案(关闭需求后调用) //根据需求关闭方案(关闭需求后调用)
async abolishProgrammeByNeed(pobj){ async abolishProgrammeByNeed(pobj){
...@@ -344,7 +349,7 @@ class NeedsolutionService extends ServiceBase { ...@@ -344,7 +349,7 @@ class NeedsolutionService extends ServiceBase {
} }
//获取需求信息 //获取需求信息
var needinfo = await this.needinfoDao.model.findOne({ var needinfo = await this.needinfoDao.model.findOne({
where:{channelNeedNo:ab.intentionBizId,uapp_id:app.uapp_id},raw:true where:{channelNeedNo:ab.intentionBizId},raw:true
}); });
if(!needinfo || !needinfo.id){ if(!needinfo || !needinfo.id){
return system.getResultFail(-201,"未知需求信息"); return system.getResultFail(-201,"未知需求信息");
...@@ -475,7 +480,7 @@ module.exports = NeedsolutionService; ...@@ -475,7 +480,7 @@ module.exports = NeedsolutionService;
// }).then(needsolutioninfo=>{ // }).then(needsolutioninfo=>{
// console.log(needsolutioninfo,"1111111111111111111111111"); // console.log(needsolutioninfo,"1111111111111111111111111");
// var solutionContent = needsolutioninfo.solutionContent; // var solutionContent = needsolutioninfo.solutionContent;
// console.log(solutionContent,"222222222222222222222"); // console.log(typeof(solutionContent),"222222222222222222222");
// // var so = JSON.parse(solutionContent); // // var so = JSON.parse(solutionContent);
// console.log(solutionContent.bizType,"333333333333333333333"); // console.log(solutionContent.bizType,"333333333333333333333");
// }); // });
......
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