Commit fb7f0af6 by 任晓松

tj

parent 0842707f
......@@ -5,6 +5,7 @@ class IcAPI extends APIBase {
constructor() {
super();
this.needinfoSve = system.getObject("service.dbneed.needinfoSve");
this.needsolutionSve = system.getObject("service.dbneed.needsolutionSve");
}
/**
* 接口跳转-POST请求
......@@ -63,6 +64,9 @@ class IcAPI extends APIBase {
case "getUnCreated":// 获取需求列表
opResult = await this.needinfoSve.getUnCreated(pobj, pobj.actionBody, req);
break;
case "createSolution"://创建方案
opResult = await this.needsolutionSve.createNewSolution(pobj);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -1251,7 +1251,54 @@ class NeedsolutionService extends ServiceBase {
}
// --------------庄冰2020.10.23-------百度Icp接入使用--------end------------------
//创建方案信息
async createNewSolution(pobj){
let ab = pobj.actionBody;
let app = pobj.appInfo;
if (!app || !app.uapp_id) {
return system.getResultFail(-100, "未知渠道");
}
if (!ab.channelSolutionNo) {
return system.getResultFail(-101, "渠道方案编号不能为空");
}
let newNsObj={
orderNo:ab.orderNo,channelSolutionNo:ab.channelSolutionNo,solutionNo:ab.channelSolutionNo,
needNo:ab.bizId,channelNeedNo:ab.bizId,status:"ywc"
};
let newSolutionCount = {
"status": "PAID",
"bizType": ab.product_info && ab.product_info.channel_item_code?ab.product_info.channel_item_code:"",
"solution": {
"Area": ab.product_info.price_item.price_desc || "",
"IcpType": '',
"CompanyName": ab.companyName || "",
"CompanyAddress": ab.area || ""
},
"totalSum": ab.order_info.totalSum || "",
"typeCode": ab.product_info && ab.product_info.channel_item_code?ab.product_info.channel_item_code:"",
"typeName": ab.product_info && ab.product_info.channel_item_name?ab.product_info.channel_item_name:"",
"needStatus": "3",
"statusName": "用户支付",
"customerInfo": {
"publishName": "",
"publishMobile": ""
},
"customerRemark": "",
"needStatusName": "处理中",
"customerMaterial": {},
"solutionFlowList": [
{
"status": "PAID",
"statusName": "用户支付",
"updated_at": new Date()
}
]
};
newNsObj.solutionContent = JSON.stringify(newSolutionCount);
let ns = await this.dao.create(newNsObj);
return system.getResultSuccess(ns)
}
}
module.exports = NeedsolutionService;
// var task = new NeedsolutionService();
......
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