Commit 566b68c9 by 兰国旗

huifu

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