Commit 566b68c9 by 兰国旗

huifu

parent 90f0c280
...@@ -33,29 +33,21 @@ class RegCenterOrderService{ ...@@ -33,29 +33,21 @@ class RegCenterOrderService{
// 获取需求详情 // 获取需求详情
async selectNeedInfo(pobj){ async selectNeedInfo(pobj){
pobj.actionType = "selectNeedInfo" pobj.actionType = "selectNeedInfo"
if(pobj.actionBody.orderNo){
var orderinfo = await this.orderinfoDao.findOne({ channelOrderNo: pobj.actionBody.orderNo }); var orderinfo = await this.orderinfoDao.findOne({ channelOrderNo: pobj.actionBody.orderNo });
if (!orderinfo || !orderinfo.orderNo) { if (!orderinfo || !orderinfo.orderNo) {
return system.getResult(null, "订单数据为空,30210"); return system.getResult(null, "订单数据为空,30210");
} }
var needsolution = await this.needsolutionDao.findOne({ orderNo: orderinfo.orderNo }); var needsolution = await this.needsolutionDao.findOne({ orderNo: orderinfo.orderNo });
if (!needsolution || !needsolution.channelSolutionNo) {
return system.getResult(null, "方案数据为空,30211");
}
var needinfo = await this.needinfoDao.findOne({ channelNeedNo: needsolution.channelNeedNo }); var needinfo = await this.needinfoDao.findOne({ channelNeedNo: needsolution.channelNeedNo });
if (!needinfo || !needinfo.channelNeedNo) { if (!needinfo && !needsolution) {
return system.getResult(null, "需求数据为空,30212"); return system.getResult(null, "需求/方案数据为空,30211");
}
}
if(pobj.actionBody.channelNeedNo){
var needinfo = await this.needinfoDao.findOne({ channelNeedNo: pobj.actionBody.channelNeedNo });
if (!needinfo || !needinfo.channelNeedNo) {
return system.getResult(null, "需求数据为空,30213");
} }
if(!needinfo && needsolution){
needinfo = {}
needinfo.publishMobile = needsolution.solutionContent.customerInfo.publishMobile
} }
return system.getResultSuccess(needinfo); return system.getResultSuccess(needinfo);
} }
//提交需求 //提交需求
async submitRegNeed(pobj, actionBody, req) { async submitRegNeed(pobj, actionBody, req) {
var needNo = await this.getBusUid("n"); var needNo = await this.getBusUid("n");
...@@ -224,18 +216,18 @@ class RegCenterOrderService{ ...@@ -224,18 +216,18 @@ class RegCenterOrderService{
return system.getResult(null, "方案数据为空,30210"); return system.getResult(null, "方案数据为空,30210");
} }
} }
if(pobj.actionBody.orderNo ){
var orderinfo = await this.orderinfoDao.findOne({ channelOrderNo: pobj.actionBody.orderNo }); var orderinfo = await this.orderinfoDao.findOne({ channelOrderNo: pobj.actionBody.orderNo });
var solutionitem = {}
if(orderinfo){ if(orderinfo){
var solutionitem = await this.needsolutionDao.findOne({ orderNo: orderinfo.orderNo }); var solutionitem = await this.needsolutionDao.findOne({ orderNo: orderinfo.orderNo });
} }
if (!solutionitem) {
return system.getResult(null, "方案数据为空,30210");
}
}
var item = await this.needinfoDao.getItemByNeedNo(solutionitem.needNo); var item = await this.needinfoDao.getItemByNeedNo(solutionitem.needNo);
if (!item) { if (!item && !solutionitem) {
return system.getResult(null, "需求数据为空,30210"); return system.getResult(null, "需求或者方案不存在,30211");
}
if (!item && solutionitem) {
item = {}
item.publishMobile = solutionitem.solutionContent.customerInfo.publishMobile
} }
item.solutionProvince = solutionitem.solutionContent.solution.area; item.solutionProvince = solutionitem.solutionContent.solution.area;
item.solutionContent = solutionitem.solutionContent item.solutionContent = solutionitem.solutionContent
......
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