Commit 9d7261f2 by 兰国旗

laolan

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