Commit 0765a212 by 王栋源

wdy

parent 4cf33156
......@@ -6,6 +6,8 @@ class IcAPI extends APIBase {
super();
// this.utilsProductSve = system.getObject("service.utilsSve.utilsProductSve");
this.needsolutionSve = system.getObject("service.dbneed.needsolutionSve");
this.needinfoSve = system.getObject("service.dbneed.needinfoSve");
this.orderinfoSve = system.getObject("service.dbcorder.orderinfoSve");
}
/**
* 接口跳转-POST请求
......@@ -17,7 +19,7 @@ class IcAPI extends APIBase {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
if(pobj.actionType=='getPolicyNeedList' || pobj.actionType=='submitPolicyNeedNotes' ){
if (pobj.actionType == 'getPolicyNeedList' || pobj.actionType == 'submitPolicyNeedNotes') {
if (!pobj.userInfo) {
return system.getResult(system.noLogin, "user no login!");
}
......@@ -30,7 +32,7 @@ class IcAPI extends APIBase {
}
async opActionProcess(pobj, action_type, req) {
var opResult = null;
switch (action_type) {
switch (action_type) {
case "submitProgramme"://提交公司注册方案
opResult = await this.needsolutionSve.submitProgramme(pobj);
break;
......@@ -46,6 +48,15 @@ class IcAPI extends APIBase {
case "abolishProgramme"://服务商方案作废
opResult = await this.needsolutionSve.abolishProgramme(pobj);
break;
case "submitSolution"://提交需求
opResult = await this.needinfoSve.createicneedinfo(pobj);
break;
case "paySuccess"://支付成功回调
opResult = await this.orderinfoSve.createsolutionOrder(pobj);
break;
case "solutionClose"://需求关闭
opResult = await this.needinfoSve.solutionClose(pobj);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -69,7 +69,7 @@ module.exports = {
//凭单类型
"direction_type": { "sr": "收", "zc": "支" },
"push_return_type": { "0": "推送失败", "1": "推送成功" },
"push_chance_type": { "wts": "未推送", "yts": "已推送", "ygj": "已跟进", "ycd": "已成单" },
"push_chance_type": { "wts": "未推送", "yts": "已推送", "ygj": "已跟进", "ycd": "已成单","ygb" :"已关闭"},
"policy_type":{'fzbt':'租金减免','jrdk':'金融贷款','zdfc':'行政措施','ssjm':'税收优惠','rlzy':'人力资源'},
"customer_intention":{"dgj":"待跟进","yyx":"有意向","wyx":"无意向"},
"solution_status":{"ytj":"已提交","yfk":"已付款","yzf":"已作废","ytk":"已退款"},
......
......@@ -31,6 +31,10 @@ module.exports = (db, DataTypes) => {
},
city: DataTypes.STRING(50), // 城市
province: DataTypes.STRING(50), // 省份
typeCode: DataTypes.STRING(50), //类型编码',
typeName: DataTypes.STRING(50), //类型名称',
channelTypeCode: DataTypes.STRING(50), //渠道类型编码',
channelTypeName: DataTypes.STRING(50), //渠道类型名称',
}, {
paranoid: true,//假的删除
underscored: true,
......
......@@ -9,13 +9,13 @@ class NeedinfoService extends ServiceBase {
}
async needinfo2fq(pobj) {
pobj.actionBody.needNo=await this.getBusUid("n");
pobj.actionBody.uapp_id=pobj.appInfo.id;
pobj.actionBody.needNo = await this.getBusUid("n");
pobj.actionBody.uapp_id = pobj.appInfo.id;
var needinfo = await this.dao.create(pobj.actionBody);
var pobj = {
"idempotentId": needinfo.needNo,
"idempotentId": needinfo.needNo,
"idempotentSource": needinfo.chanceType_code,
"idempotentSourceName": pobj.appInfo.app_name+"_"+pobj.actionBody.chanceTypeName,
"idempotentSourceName": pobj.appInfo.app_name + "_" + pobj.actionBody.chanceTypeName,
"phone": needinfo.publishMobile,
"remark": needinfo.notes,
"customerName": needinfo.publishName
......@@ -32,6 +32,55 @@ class NeedinfoService extends ServiceBase {
// }
}
// intentionBizId
// mobile
// userName
// description
// area
// type
// ext
async createicneedinfo(pobj, actionBody) {
var needNo = await this.getBusUid("n");
if (actionBody.intentionBizId) {
return system.getResult(null, "intentionBizId不能为空");
}
if (actionBody.mobile) {
return system.getResult(null, "mobile不能为空");
}
if (actionBody.type) {
return system.getResult(null, "type不能为空");
}
var nobj = {
uapp_id: pobj.appInfo.uapp_id,
channelNeedNo: actionBody.intentionBizId,
needNo: needNo,
channelUserId: pobj.userInfo.channel_userid,
publishName: actionBody.userName,
publishContent: actionBody.description,
publishMobile: actionBody.mobile,
city: actionBody.area,
disposeNotes: actionBody.ext,
channelTypeCode: actionBody.type
}
return await this.dao.create(nobj);
}
async solutionClose(pobj) {
if (actionBody.intentionBizId) {
return system.getResult(null, "intentionBizId不能为空");
}
var needinfo = await this.findOne({ channelNeedNo: actionBody.intentionBizId });
needinfo.status = "ygb";
var self=this;
return await self.db.transaction(async function (t) {
await self.update(needinfo,t);
var needsolutioninfo = await self.needsolutionDao.findOne({ channelNeedNo: pobj.actionBody.intentionBizId }, t)
needsolutioninfo.status = "yzf";
await self.needsolutionDao.update(needsolutioninfo, t);
await
})
}
async flowinfo(obj) {
}
......
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