Commit dd9d23d0 by 王悦

fix 阿里直购创建空需求

parent 0f131547
...@@ -489,16 +489,51 @@ class NeedsolutionService extends ServiceBase { ...@@ -489,16 +489,51 @@ class NeedsolutionService extends ServiceBase {
// 2020 1021 lin 修改 if (ab.isDirectBuy 为 ==true 原因 实际传的是字符串不是布尔 // 2020 1021 lin 修改 if (ab.isDirectBuy 为 ==true 原因 实际传的是字符串不是布尔
if (ab.isDirectBuy === "true"){//直购先创建空方案 if (ab.isDirectBuy === "true"){//直购先创建空方案
var solutionNo = await this.getBusUid("ns"); var solutionNo = await this.getBusUid("ns");
ns = await this.create({ var oldNs = await this.dao.model.findOne({
solutionNo, where: { orderNo: ab.orderNo }
...ab, });
status:"ywc", var solutionContent = {
solutionContent:JSON.stringify({ "status": "PAID",
totalSum: Number(ab.orderPrice || "0"), "bizType": ab.product_info && ab.product_info.item_code?ab.product_info.item_code:"",
"solution": {
"Area": ab.area || "",
"IcpType": ab.bizId.startsWith("EDI")?7:5,
"CompanyName": ab.companyName || "",
"CompanyAddress": ab.area || "",
actionType:ab.actionType, actionType:ab.actionType,
Source:ab.source Source:ab.source
},
"totalSum": ab.totalSum || Number(ab.orderPrice || "0"),
"typeCode": ab.product_info && ab.product_info.item_code?ab.product_info.item_code:"",
"typeName": ab.product_info && ab.product_info.item_name?ab.product_info.item_name:"",
"needStatus": "3",
"statusName": "用户支付",
"customerInfo": {
"publishName": pobj.userInfo.channel_nickname || "",
"publishMobile": pobj.userInfo.mobile || ""
},
"customerRemark": "",
"needStatusName": "处理中",
"customerMaterial": {},
"solutionFlowList": [
{
"status": "PAID",
"statusName": "用户支付",
"updated_at": new Date()
}
]
};
if (oldNs && oldNs.id ){
oldNs.solutionContent = JSON.stringify(solutionContent)
ns = await oldNs.save();
}else {
ns = await this.create({
solutionNo,
...ab,
status: "ywc",
solutionContent: JSON.stringify(solutionContent)
}) })
}) }
}else { }else {
if (!ab.channelSolutionNo) { if (!ab.channelSolutionNo) {
return system.getResultFail(-101, "渠道方案编号不能为空"); return system.getResultFail(-101, "渠道方案编号不能为空");
......
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