Commit fda0a2a6 by 王悦

Revert "revert 直购"

This reverts commit 3848464f
parent 3848464f
...@@ -174,8 +174,7 @@ class NeedinfoService extends ServiceBase { ...@@ -174,8 +174,7 @@ class NeedinfoService extends ServiceBase {
return system.getResult(null, "需求数据为空,30210"); return system.getResult(null, "需求数据为空,30210");
} }
var item = await this.dao.getItemByNeedNo(solutionitem.needNo); var item = await this.dao.getItemByNeedNo(solutionitem.needNo);
item.solutionProvince = solutionitem.solutionContent.solution.Area; item.solutionProvince = solutionitem.solutionContent.solution.Area + `(${solutionitem.solutionContent.solution.ActionType})`//北京(新办);
//item.solutionProvince = solutionitem.solutionContent.solution.Area + `(${solutionitem.solutionContent.solution.ActionType})`//北京(新办);
item.solutionContent = solutionitem.solutionContent item.solutionContent = solutionitem.solutionContent
item.channelSolutionNo = solutionitem.channelSolutionNo item.channelSolutionNo = solutionitem.channelSolutionNo
if (!item) { if (!item) {
......
...@@ -485,37 +485,49 @@ class NeedsolutionService extends ServiceBase { ...@@ -485,37 +485,49 @@ class NeedsolutionService extends ServiceBase {
if (!app || !app.uapp_id) { if (!app || !app.uapp_id) {
return system.getResultFail(-100, "未知渠道"); return system.getResultFail(-100, "未知渠道");
} }
if (!ab.channelSolutionNo) { var ns
return system.getResultFail(-101, "渠道方案编号不能为空"); // 2020 1021 lin 修改 if (ab.isDirectBuy 为 ==true 原因 实际传的是字符串不是布尔
} if (ab.isDirectBuy === "true"){//直购先创建空方案
// if(!ab.status){ var solutionNo = await this.getBusUid("ns");
// return system.getResultFail(-102,"状态不能为空"); ns = await this.create({
// } solutionNo,
var needsolutioninfo = await this.dao.model.findOne({ ...ab,
attributes:["id","solutionContent","status","orderNo"], status:"ywc",
where: { channelSolutionNo: ab.channelSolutionNo,isInvalid:0 }, raw: true solutionContent:JSON.stringify({totalSum: Number(ab.orderPrice || "0")})
}); })
if (!needsolutioninfo || !needsolutioninfo.id) { }else {
return system.getResultFail(-400, "未知方案"); if (!ab.channelSolutionNo) {
} return system.getResultFail(-101, "渠道方案编号不能为空");
var solutionContent = needsolutioninfo.solutionContent; }
if (ab.orderPrice) { // if(!ab.status){
// solutionContent = JSON.parse(solutionContent); // return system.getResultFail(-102,"状态不能为空");
solutionContent["totalSum"] = Number(ab.orderPrice || "0"); // }
} var needsolutioninfo = await this.dao.model.findOne({
// 2020 1017 lin 新增去掉status的判断,生成订单这个方案才算完成,所以没必要再判断,另一个原因网文2.3每个状态都有不同status,所以不能以来有没有status来决定方案完成情况。 attributes: ["id", "solutionContent", "status", "orderNo"],
// if (ab.status) { where: {channelSolutionNo: ab.channelSolutionNo, isInvalid: 0}, raw: true
// needsolutioninfo.status = "ywc"; });
// } if (!needsolutioninfo || !needsolutioninfo.id) {
if (ab.orderNo) { return system.getResultFail(-400, "未知方案");
needsolutioninfo.orderNo = ab.orderNo; }
needsolutioninfo.status = "ywc"; var solutionContent = needsolutioninfo.solutionContent;
if (ab.orderPrice) {
// solutionContent = JSON.parse(solutionContent);
solutionContent["totalSum"] = Number(ab.orderPrice || "0");
}
// 2020 1017 lin 新增去掉status的判断,生成订单这个方案才算完成,所以没必要再判断,另一个原因网文2.3每个状态都有不同status,所以不能以来有没有status来决定方案完成情况。
// if (ab.status) {
// needsolutioninfo.status = "ywc";
// }
if (ab.orderNo) {
needsolutioninfo.orderNo = ab.orderNo;
needsolutioninfo.status = "ywc";
}
needsolutioninfo.solutionContent = JSON.stringify(solutionContent);
await this.dao.update(needsolutioninfo);
ns = await this.dao.model.findOne({
where: { id: needsolutioninfo.id }, raw: true
});
} }
needsolutioninfo.solutionContent = JSON.stringify(solutionContent);
await this.dao.update(needsolutioninfo);
var ns = await this.dao.model.findOne({
where: { id: needsolutioninfo.id }, raw: true
});
return system.getResultSuccess(ns); return system.getResultSuccess(ns);
} }
......
...@@ -251,9 +251,9 @@ class AliyunQcService { ...@@ -251,9 +251,9 @@ class AliyunQcService {
if (!solution.Area) { if (!solution.Area) {
return system.getResultFail(-107, "区域不能为空"); return system.getResultFail(-107, "区域不能为空");
} }
/* if (!solution.ActionType) { if (!solution.ActionType) {
return system.getResultFail(-108, "办理类型不能为空"); return system.getResultFail(-108, "办理类型不能为空");
}*/ }
var solutionFlowList = ab.solutionContent.solutionFlowList || []; var solutionFlowList = ab.solutionContent.solutionFlowList || [];
solutionFlowList.push({ solutionFlowList.push({
status: "SOLUTION_SUBMIT", statusName: this.icpSolutionStatusReference.SOLUTION_SUBMIT, updated_at: new Date() status: "SOLUTION_SUBMIT", statusName: this.icpSolutionStatusReference.SOLUTION_SUBMIT, updated_at: new Date()
......
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