Commit 3dcad1d3 by 兰国旗

baidu

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