Commit 9d7261f2 by 兰国旗

laolan

parent 26066508
...@@ -65,6 +65,10 @@ class RegAPI extends APIBase { ...@@ -65,6 +65,10 @@ class RegAPI extends APIBase {
case "regNeedClose"://前端关闭reg需求及方案 case "regNeedClose"://前端关闭reg需求及方案
opResult = await this.regCenterOrderSve.regNeedClose(pobj); opResult = await this.regCenterOrderSve.regNeedClose(pobj);
break; break;
case "saveReginfo"://保存渠道方案及url
opResult = await this.regCenterOrderSve.saveReginfo(pobj);
break;
case "getRegInfoByChannelNeedNo"://获取需求方案列表 case "getRegInfoByChannelNeedNo"://获取需求方案列表
opResult = await this.regCenterOrderSve.reqCenterOrderApi(pobj); opResult = await this.regCenterOrderSve.reqCenterOrderApi(pobj);
break; break;
......
...@@ -66,7 +66,9 @@ class NeedinfoDao extends Dao { ...@@ -66,7 +66,9 @@ class NeedinfoDao extends Dao {
"channelTypeName", "channelTypeName",
"publisherOnlyCode", "publisherOnlyCode",
"followManName", "followManName",
"followManOnlyCode"], "followManOnlyCode",
"created_at"
],
raw: true raw: true
}); });
} }
......
...@@ -66,7 +66,9 @@ class RegCenterorderDao extends Dao { ...@@ -66,7 +66,9 @@ class RegCenterorderDao extends Dao {
"channelTypeName", "channelTypeName",
"publisherOnlyCode", "publisherOnlyCode",
"followManName", "followManName",
"followManOnlyCode"], "followManOnlyCode",
"created_at"
],
raw: true raw: true
}); });
} }
......
...@@ -312,7 +312,7 @@ class RegCenterOrderService extends ServiceBase { ...@@ -312,7 +312,7 @@ class RegCenterOrderService extends ServiceBase {
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
}); });
return system.getResultSuccess(ns); return system.getResultSuccess(new_ns);
} }
//接收方案状态及支付信息 //接收方案状态及支付信息
...@@ -744,7 +744,9 @@ class RegCenterOrderService extends ServiceBase { ...@@ -744,7 +744,9 @@ class RegCenterOrderService extends ServiceBase {
} }
//方案推送baidu后,接收保存方案编号/链接 //方案推送baidu后,接收保存方案编号/链接
async saveReginfo(pobj) { async saveReginfo(pobj) {
console.log('----pobj--',pobj)
var ab = pobj.actionBody; var ab = pobj.actionBody;
console.log('---ab---',ab)
if (!ab.infos) { if (!ab.infos) {
return system.getResultFail(-101, "渠道信息不能为空"); return system.getResultFail(-101, "渠道信息不能为空");
} }
...@@ -753,16 +755,15 @@ class RegCenterOrderService extends ServiceBase { ...@@ -753,16 +755,15 @@ class RegCenterOrderService extends ServiceBase {
var infosLength = ab.infos.length var infosLength = ab.infos.length
var solutionNos = []; var solutionNos = [];
var infoList = []; var infoList = [];
var nsLength = ns.length
for (i = 0; i < infosLength; i++) { for (i = 0; i < infosLength; i++) {
var solutionNo = { solutionNos.push(ab.infos[i].gsbBizId)
solutionNo: ab.infos[i].bizId
}
solutionNos.push(solutionNo)
} }
console.log('----solutionNos----',solutionNos)
var ns = await this.needsolutionDao.model.findAll({ var ns = await this.needsolutionDao.model.findAll({
where: { solutionNo: { [this.db.Op.in]: solutionNos }, isInvalid: 0 }, raw: true where: { solutionNo: { [this.db.Op.in]: solutionNos }, isInvalid: 0 }, raw: true
}); });
console.log("----ns----",ns)
var nsLength = ns.length
if (!ns) { if (!ns) {
return system.getResultFail(-103, "未知方案"); return system.getResultFail(-103, "未知方案");
} }
...@@ -775,8 +776,14 @@ class RegCenterOrderService extends ServiceBase { ...@@ -775,8 +776,14 @@ class RegCenterOrderService extends ServiceBase {
if (needinfo.status == "ycd" || needinfo.status == "ygb") { if (needinfo.status == "ycd" || needinfo.status == "ygb") {
return system.getResultFail(-105, "该方案需求状态为" + needinfo.statusName + ",不能执行此操作"); return system.getResultFail(-105, "该方案需求状态为" + needinfo.statusName + ",不能执行此操作");
} }
var confirmUrl = []
var str ;
for (j = 0; j < nsLength; j++) { for (j = 0; j < nsLength; j++) {
await this.needsolutionDao.model.update({ channelSolutionNo: ab.infos[j].bizId }, { where: { id: ns[j].id } });//修改方案信息 confirmUrl.push(ab.infos[j].confirmUrl)
ns[j].solutionContent['confirmUrl'] = ab.infos[j].confirmUrl
str = ns[j].solutionContent
str = JSON.stringify(str)
await this.needsolutionDao.model.update({ channelSolutionNo: ab.infos[j].bizId, solutionContent:str}, { where: { id: ns[j].id } });//修改方案信息
} }
return system.getResultSuccess(); return system.getResultSuccess();
} }
...@@ -918,8 +925,9 @@ class RegCenterOrderService extends ServiceBase { ...@@ -918,8 +925,9 @@ class RegCenterOrderService extends ServiceBase {
}); });
console.log('nnnsss-----', ns) console.log('nnnsss-----', ns)
var i; var i;
var nsLength = ns.length var needObj;
if (ns) { if (ns) {
var nsLength = ns.length
for (i = 0; i < nsLength; i++) { for (i = 0; i < nsLength; i++) {
if (ns[i].id) { if (ns[i].id) {
if (ns[i].status == "ywc") { if (ns[i].status == "ywc") {
...@@ -932,18 +940,25 @@ class RegCenterOrderService extends ServiceBase { ...@@ -932,18 +940,25 @@ class RegCenterOrderService extends ServiceBase {
} }
var self = this var self = this
await this.needsolutionDao.db.transaction(async function (t) { await this.needsolutionDao.db.transaction(async function (t) {
var needObj = { needObj = {
id: needinfo.id, status: "ygb", notes: ab.note id: needinfo.id, status: "ygb", notes: ab.note
}; };
await self.needinfoDao.update(needObj, t);//关闭需求 await this.needinfoDao.update(needObj, t);//关闭需求
await self.needsolutionDao.model.update({ status: "yzf", isInvalid: 1 }, { where: { id: ns.id }, transaction: t });//方案废弃 await self.needsolutionDao.model.update({ status: "yzf", isInvalid: 1 }, { where: { id: ns.id }, transaction: t });//方案废弃
// return system.getResultSuccess(ns.orderNo); // return system.getResultSuccess(ns.orderNo);
ns['uapp_id'] = needinfo.uapp_id;
console.log('guanbi ns +++', ns)
}) })
} }
} }
}else{
needObj = {
id: needinfo.id, status: "ygb", notes: ab.note
};
await this.needinfoDao.update(needObj)
ns['uapp_id'] = needinfo.uapp_id;
console.log('guanbi ns +++', ns)
} }
return system.getResultSuccess(ns); return system.getResultSuccess(ns);
} }
......
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