Commit 3dcad1d3 by 兰国旗

baidu

parent 814bc6da
......@@ -5,7 +5,7 @@ const settings = require("../../../../config/settings");
var moment = require('moment')
class NeedinfoService2 extends ServiceBase {
constructor() {
super("dbneed", ServiceBase.getDaoName(NeedinfoService));
super("dbneed", ServiceBase.getDaoName(NeedinfoService2));
this.execlient = system.getObject("util.execClient");
this.needsolutionSve = system.getObject("service.dbneed.needsolutionSve");
this.needsolutionDao = system.getObject("db.dbneed.needsolutionDao");
......@@ -212,13 +212,14 @@ class NeedinfoService2 extends ServiceBase {
var updateRes = await this.customUpdate(sql, paramWhere);
if (updateRes[1]) {
//2020-10-28 laolan start
var sql = "select uapp_id from n_need_ifno where channelNeedNo =:channelNeedNo ";
var sql = "select uapp_id from n_need_info where channelNeedNo = :channelNeedNo ";
var where = {
channelNeedNo:actionBody.intentionBizId
}
var uappIdInfo = await this.customQuery(sql,where);
console.log('uappIdInfo+++',uappIdInfo)
if(uappIdInfo){
var uappIds = uappIdInfo.data[0].uapp_id
var uappIds = uappIdInfo[0].uapp_id
}
return system.getResultSuccess(uappIds);
//2020-10-28 laolan end
......@@ -235,13 +236,13 @@ class NeedinfoService2 extends ServiceBase {
var updateRes = await this.customUpdate(sql, paramWhere);
if (updateRes[1]) {
//2020-10-28 laolan start
var sql = "select uapp_id from n_need_ifno where channelNeedNo =:channelNeedNo ";
var sql = "select uapp_id from n_need_info where channelNeedNo = :channelNeedNo ";
var where = {
channelNeedNo:actionBody.intentionBizId
}
var uappIdInfo = await this.customQuery(sql,where);
if(uappIdInfo){
var uappIds = uappIdInfo.data[0].uapp_id
var uappIds = uappIdInfo[0].uapp_id
}
return system.getResultSuccess(uappIds);
//2020-10-28 laolan end
......@@ -249,21 +250,24 @@ class NeedinfoService2 extends ServiceBase {
return system.getResult("添加记录失败");
}
}
//2020-10-28 laolan xin zeng 查询需求沟通记录
//2020-10-28 laolan 新增查询需求沟通记录
async queryExpertApplyCommunicationLogs(pobj){
console.log('query++pobj',pobj)
if (!pobj.actionBody.intentionBizId) {
return system.getResult(null, "actionBody.intentionBizId can not be empty,100493");
}
if (!pobj.actionBody.userFeedBack) {
return system.getResult(null, "actionBody.userFeedBack can not be empty,100494");
if(pobj.appInfo.uapp_id == 18){
if (!pobj.actionBody.userFeedBack) {
return system.getResult(null, "actionBody.userFeedBack can not be empty,100494");
}
}
var sql = "select uapp_id from n_need_ifno where channelNeedNo =:channelNeedNo ";
var sql = "select uapp_id from n_need_info where channelNeedNo = :channelNeedNo ";
var where = {
channelNeedNo:pobj.actionBody.intentionBizId
}
var uappIdInfo = await this.customQuery(sql,where);
if(uappIdInfo){
uappIdInfo = uappIdInfo.data[0];
uappIdInfo = uappIdInfo[0];
return system.getResultSuccess(uappIdInfo);
}
......
......@@ -185,6 +185,7 @@ class BaseQcService {
//提交方案
async submitIcpProgramme(pobj) {
console.log("pobj++++",pobj)
var ab = pobj.actionBody;
var user = pobj.userInfo;
if (!user || !user.id) {
......@@ -389,18 +390,12 @@ class BaseQcService {
var new_ns = await this.needsolutionDao.model.findOne({
where: { id: ns.id }, raw: true
});
//2020-10-26 laolan 添加渠道区分start
if(new_ns && needinfo){
new_ns['uapp_id'] = needinfo.uapp_id
}
//添加渠道区分end
return system.getResultSuccess(new_ns);
}
//交付商提交材料信息
async serviceProviderSubmitMaterial(pobj) {
var ab = pobj.actionBody;
console.log('ab++',ab)
if (!ab.orderNo) {
return system.getResultFail(-101, "订单号不能为空");
}
......@@ -417,6 +412,7 @@ class BaseQcService {
//提交icp材料信息
async submitIcpMaterial(pobj) {
var ab = pobj.actionBody;
console.log('ababab++',ab)
var user = pobj.userInfo;
if (!user || !user.id) {
return system.getResultFail(-100, "未知用户");
......@@ -430,9 +426,10 @@ class BaseQcService {
}
//获取方案信息
var needsolutioninfo = await this.needsolutionDao.model.findOne({
attributes: ["id", "needNo", "solutionContent"],
attributes: ["id", "needNo", "orderNo", "solutionContent"],
where: { channelSolutionNo: ab.BizId, isInvalid: 0 }, raw: true
});
console.log('needsolutioninfo+++',needsolutioninfo)
if (!needsolutioninfo || !needsolutioninfo.id) {
return system.getResultFail(-400, "未知方案");
}
......@@ -443,8 +440,17 @@ class BaseQcService {
if (!solutionContent) {
return system.getResultFail(-402, "方案交付信息有误");
}
if (solutionContent.status != "USER_UPLOADED") {
return system.getResultFail(-403, "用户未上传材料,不能执行此操作");
var orderInfo = await this.orderinfoDao.model.findOne({
attributes: ["uapp_id"],
where: {orderNo: needsolutioninfo.orderNo}, raw: true
})
if(orderInfo){
var uappId = orderInfo.uapp_id
}
if(uappId == "18"){//ali
if (solutionContent.status != "USER_UPLOADED") {
return system.getResultFail(-403, "用户未上传材料,不能执行此操作");
}
}
//获取需求信息
var needinfo = await this.needinfoDao.model.findOne({
......@@ -489,13 +495,19 @@ class BaseQcService {
where: { id: needsolutioninfo.id }, raw: true
});
//2020-10-27 laolan start
var needinfo = await this.needinfoDao.model.findOne({
var needinfo = await self.needinfoDao.model.findOne({
where: { needNo: new_needsolutioninfo.needNo }, raw: true
});
if(needinfo){
var uappIds = needinfo.uapp_id
}
new_needsolutioninfo['uapp_id'] = uappIds;
var orderInfo = await self.orderinfoDao.model.findOne({
where: {orderNo: ab.orderNo}, raw: true
})
if(orderInfo){
new_needsolutioninfo['orderChannelNo'] = orderInfo.channelOrderNo
}
//2020-10-27 laolan end
return system.getResultSuccess(new_needsolutioninfo);
......@@ -529,8 +541,12 @@ class BaseQcService {
}
//服务商通知状态变更
async acceptIcpPartnerNotification(pobj) {
console.log('服务商通知状态变更pobj++++',pobj)
var ab = pobj.actionBody;
var user = pobj.userInfo;
if(pobj.appInfo && pobj.appInfo.uapp_id){
var uappId = pobj.appInfo.uapp_id;
}
if (!user || !user.id) {
return system.getResultFail(-100, "未知用户");
}
......@@ -578,8 +594,10 @@ class BaseQcService {
}
var solutionFlowList = solutionContent.solutionFlowList || [];
if (ab.ApplicationStatus == 507) {//完成账户注册
if (solutionContent.status != "USER_CONFIRMED") {
return system.getResultFail(-508, "交付流程错误,用户确认递交⽂件后才能执行此操作");
if(uappId == '18'){
if (solutionContent.status != "USER_CONFIRMED") {
return system.getResultFail(-508, "交付流程错误,用户确认递交⽂件后才能执行此操作");
}
}
solutionContent.ApplicationStatus = 507;
solutionFlowList.push({
......@@ -659,13 +677,25 @@ class BaseQcService {
solutionContent.applicationStatusList = applicationStatusList;
solutionContent.applicationStatus = ab.ApplicationStatus;
needsolutioninfo.solutionContent = JSON.stringify(solutionContent);
console.log("ab.orderNo+++",ab.orderNo)
var self = this;
var orderInfo = await self.orderinfoDao.model.findOne({
attributes:["channelOrderNo"],
where: {orderNo: ab.orderNo}, raw: true
})
console.log("orderInfo+++",orderInfo)
if(orderInfo){
var channelOrderNo = orderInfo.channelOrderNo
}
return await this.needsolutionDao.db.transaction(async function (t) {
await self.needsolutionDao.update(needsolutioninfo, t);
statusObj["BizId"] = ab.BizId;
//2020-10-27 laolan start
var uappIds = needinfo.uapp_id
statusObj['uapp_id'] = uappIds;
statusObj['channelOrderNo'] = channelOrderNo;
console.log('statusObj++',statusObj)
//2020-10-27 laolan start
return system.getResultSuccess(statusObj);
})
......
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