Commit a9349f03 by 王栋源

Merge branch 'center-order' of gitlab.gongsibao.com:jiangyong/zhichan into center-order

parents 60cf842f b282c988
...@@ -33,36 +33,36 @@ class IcpAPI extends APIBase { ...@@ -33,36 +33,36 @@ class IcpAPI extends APIBase {
async opActionProcess(pobj, action_type, req) { async opActionProcess(pobj, action_type, req) {
var opResult = null; var opResult = null;
switch (action_type) { switch (action_type) {
case "submitIcpProgramme"://icp方案提交 // case "submitIcpProgramme"://icp方案提交
opResult = await this.needsolutionSve.submitIcpProgramme(pobj); // opResult = await this.needsolutionSve.submitIcpProgramme(pobj);
break; // break;
case "submitIcpMaterial"://icp材料提交 // case "submitIcpMaterial"://icp材料提交
opResult = await this.needsolutionSve.submitIcpMaterial(pobj); // opResult = await this.needsolutionSve.submitIcpMaterial(pobj);
break; // break;
case "acceptIcpPartnerNotification"://icp通知状态变更 // case "acceptIcpPartnerNotification"://icp通知状态变更
opResult = await this.needsolutionSve.acceptIcpPartnerNotification(pobj); // opResult = await this.needsolutionSve.acceptIcpPartnerNotification(pobj);
break; // break;
case "abolishIcpProgramme"://服务商icp方案关闭 // case "abolishIcpProgramme"://服务商icp方案关闭
opResult = await this.needsolutionSve.abolishIcpProgramme(pobj); // opResult = await this.needsolutionSve.abolishIcpProgramme(pobj);
break; // break;
case "getIcpProgrammeDetail"://获取icp方案 // case "getIcpProgrammeDetail"://获取icp方案
opResult = await this.needsolutionSve.getIcpProgrammeDetail(pobj); // opResult = await this.needsolutionSve.getIcpProgrammeDetail(pobj);
break; // break;
case "getNeedSolutionDetailByUser"://获取方案详情 // case "getNeedSolutionDetailByUser"://获取方案详情
opResult = await this.needsolutionSve.getNeedSolutionDetailByUser(pobj); // opResult = await this.needsolutionSve.getNeedSolutionDetailByUser(pobj);
break; // break;
case "receiveIcpStatusNotify"://接收渠道方案状态变更通知 // case "receiveIcpStatusNotify"://接收渠道方案状态变更通知
opResult = await this.needsolutionSve.receiveIcpStatusNotify(pobj); // opResult = await this.needsolutionSve.receiveIcpStatusNotify(pobj);
break; // break;
case "receiveIcpFeedback"://接收icp用户方案反馈 // case "receiveIcpFeedback"://接收icp用户方案反馈
opResult = await this.needsolutionSve.receiveIcpFeedback(pobj); // opResult = await this.needsolutionSve.receiveIcpFeedback(pobj);
break; // break;
case "getIcpProgrammeDetail"://获取方案详情(内部调用) // case "getIcpProgrammeDetail"://获取方案详情(内部调用)
opResult = await this.needsolutionSve.getIcpProgrammeDetail(pobj); // opResult = await this.needsolutionSve.getIcpProgrammeDetail(pobj);
break; // break;
case "getProgrammeInfoByChannelNeedNo"://获取需求方案列表 // case "getProgrammeInfoByChannelNeedNo"://获取需求方案列表
opResult = await this.needsolutionSve.getProgrammeInfoByChannelNeedNo(pobj); // opResult = await this.needsolutionSve.getProgrammeInfoByChannelNeedNo(pobj);
break; // break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -48,6 +48,9 @@ class IcAPI extends APIBase { ...@@ -48,6 +48,9 @@ class IcAPI extends APIBase {
case "getItemByChannelSolutionNo"://渠道方案号获取需求详情 case "getItemByChannelSolutionNo"://渠道方案号获取需求详情
opResult = await this.needinfoSve.getItemByChannelSolutionNo(pobj, pobj.actionBody, req); opResult = await this.needinfoSve.getItemByChannelSolutionNo(pobj, pobj.actionBody, req);
break; break;
case "writeCommunicationLog"://渠道方案号获取需求详情
opResult = await this.needinfoSve.writeCommunicationLog(pobj, pobj.actionBody, req);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
var APIBase = require("../../api.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
class QcAPI extends APIBase {
constructor() {
super();
this.aliyunqcSve = system.getObject("service.qcutils.aliyunqcSve");
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
if (pobj.actionType == 'getPolicyNeedList' || pobj.actionType == 'submitPolicyNeedNotes') {
if (!pobj.userInfo) {
return system.getResult(system.noLogin, "user no login!");
}
if (!pobj.appInfo) {
return system.getResult(system.noLogin, "app is null!");
}
}
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async opActionProcess(pobj, action_type, req) {
var opResult = null;
switch (action_type) {
case "receiveProgrammeNo"://接收方案编号(方案推送至阿里后,接收保存方案信息)
opResult = await this.aliyunqcSve.receiveProgrammeNo(pobj);
break;
case "submitIcpProgramme"://icp方案提交
opResult = await this.aliyunqcSve.submitIcpProgramme(pobj);
break;
// case "submitIcpMaterial"://icp材料提交
// opResult = await this.aliyunqcSve.submitIcpMaterial(pobj);
// break;
case "acceptIcpPartnerNotification"://icp通知状态变更
opResult = await this.aliyunqcSve.acceptIcpPartnerNotification(pobj);
break;
case "abolishIcpProgramme"://服务商icp方案关闭
opResult = await this.aliyunqcSve.abolishIcpProgramme(pobj);
break;
case "getIcpProgrammeDetail"://获取icp方案
opResult = await this.aliyunqcSve.getIcpProgrammeDetail(pobj);
break;
case "getNeedSolutionDetailByUser"://获取方案详情
opResult = await this.aliyunqcSve.getNeedSolutionDetailByUser(pobj);
break;
case "receiveIcpStatusNotify"://接收渠道方案状态变更通知2.3
opResult = await this.aliyunqcSve.receiveIcpStatusNotify(pobj);
break;
case "receiveIcpFeedback"://接收icp用户方案反馈2.2
opResult = await this.aliyunqcSve.receiveIcpFeedback(pobj);
break;
case "getIcpProgrammeDetail"://获取方案详情(内部调用)
opResult = await this.aliyunqcSve.getIcpProgrammeDetail(pobj);
break;
case "getProgrammeInfoByChannelNeedNo"://获取需求方案列表
opResult = await this.aliyunqcSve.getProgrammeInfoByChannelNeedNo(pobj);
break;
case "serviceProviderSubmitMaterial"://交付商提交材料信息
opResult = await this.aliyunqcSve.serviceProviderSubmitMaterial(pobj);
break;
case "serviceProviderNotification"://交付商通知状态变更
opResult = await this.aliyunqcSve.serviceProviderNotification(pobj);
break;
case "closeOrderDelivery"://交付商关闭交付单
opResult = await this.aliyunqcSve.closeOrderDelivery(pobj);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
}
module.exports = QcAPI;
\ No newline at end of file
const system = require("../../../system"); const system = require("../../../system");
const Dao = require("../../dao.base"); const Dao = require("../../dao.base");
class OrderdeliveryofficialDao extends Dao { class OrderOfficialDao extends Dao {
constructor() { constructor() {
super(Dao.getModelName(OrderdeliveryofficialDao)); super(Dao.getModelName(OrderOfficialDao));
} }
} }
module.exports = OrderdeliveryofficialDao; module.exports = OrderOfficialDao;
...@@ -73,7 +73,7 @@ module.exports = { ...@@ -73,7 +73,7 @@ module.exports = {
"push_chance_type": { "wts": "未推送", "yts": "已推送", "ygj": "已跟进", "ycd": "已成单", "ygb": "已关闭" }, "push_chance_type": { "wts": "未推送", "yts": "已推送", "ygj": "已跟进", "ycd": "已成单", "ygb": "已关闭" },
"policy_type": { 'fzbt': '租金减免', 'jrdk': '金融贷款', 'zdfc': '行政措施', 'ssjm': '税收优惠', 'rlzy': '人力资源' }, "policy_type": { 'fzbt': '租金减免', 'jrdk': '金融贷款', 'zdfc': '行政措施', 'ssjm': '税收优惠', 'rlzy': '人力资源' },
"customer_intention": { "dgj": "待跟进", "yyx": "有意向", "wyx": "无意向" }, "customer_intention": { "dgj": "待跟进", "yyx": "有意向", "wyx": "无意向" },
"solution_status": { "dqr": "待确认", "ywc": "已完成", "yzf": "已作废" }, "solution_status": { "dqr": "待确认","ybh":"用户驳回", "ywc": "已完成", "yzf": "已作废" },
}, },
} }
......
...@@ -2,8 +2,8 @@ const system = require("../../../system"); ...@@ -2,8 +2,8 @@ const system = require("../../../system");
const settings = require("../../../../config/settings"); const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey); const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => { module.exports = (db, DataTypes) => {
return db.define("orderOfficial", { return db.define("orderofficial", {
sourceNo: DataTypes.STRING(128), // 订单号 serviceNo: DataTypes.STRING(128), // 订单号
channelUserId: DataTypes.STRING(128), // 用户id channelUserId: DataTypes.STRING(128), // 用户id
officialInfo: DataTypes.JSON // 官文信息 officialInfo: DataTypes.JSON // 官文信息
}, { }, {
...@@ -12,7 +12,7 @@ module.exports = (db, DataTypes) => { ...@@ -12,7 +12,7 @@ module.exports = (db, DataTypes) => {
version: true, version: true,
freezeTableName: true, freezeTableName: true,
timestamps: true, timestamps: true,
updatedAt: true, updated_at: true,
tableName: 'c_delivery_official', tableName: 'c_delivery_official',
validate: { validate: {
......
...@@ -21,6 +21,7 @@ module.exports = (db, DataTypes) => { ...@@ -21,6 +21,7 @@ module.exports = (db, DataTypes) => {
}, },
statusName: DataTypes.STRING(50), //状态名称 statusName: DataTypes.STRING(50), //状态名称
createUserId: DataTypes.INTEGER, //创建者id createUserId: DataTypes.INTEGER, //创建者id
isInvalid:DataTypes.INTEGER, //是否废弃的无效的方案
}, { }, {
paranoid: true,//假的删除 paranoid: true,//假的删除
underscored: true, underscored: true,
......
...@@ -629,8 +629,8 @@ class OrderInfoService extends ServiceBase { ...@@ -629,8 +629,8 @@ class OrderInfoService extends ServiceBase {
orderStatus: 2 orderStatus: 2
} }
var item = await self.createOrder(pobj, orderNo, t); var item = await self.createOrder(pobj, orderNo, t);
needsolutioninfo.status = "ywc"; // needsolutioninfo.status = "ywc";
await self.needsolutionDao.update(needsolutioninfo, t); await self.needsolutionDao.update({id:needsolutioninfo.id,status:"dqr"}, t);
self.addOrderDelivery(pobj.actionBody.deliveryData, orderNo); self.addOrderDelivery(pobj.actionBody.deliveryData, orderNo);
return system.getResultSuccess({ return system.getResultSuccess({
orderNo: orderNo, orderNo: orderNo,
......
...@@ -2,12 +2,14 @@ const uuidv4 = require('uuid/v4'); ...@@ -2,12 +2,14 @@ const uuidv4 = require('uuid/v4');
const system = require("../../../system"); const system = require("../../../system");
const ServiceBase = require("../../sve.base"); const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings"); const settings = require("../../../../config/settings");
var moment = require('moment')
class NeedinfoService extends ServiceBase { class NeedinfoService extends ServiceBase {
constructor() { constructor() {
super("dbneed", ServiceBase.getDaoName(NeedinfoService)); super("dbneed", ServiceBase.getDaoName(NeedinfoService));
this.execlient = system.getObject("util.execClient"); this.execlient = system.getObject("util.execClient");
this.needsolutionSve = system.getObject("service.dbneed.needsolutionSve"); this.needsolutionSve = system.getObject("service.dbneed.needsolutionSve");
this.needsolutionDao = system.getObject("db.dbneed.needsolutionDao"); this.needsolutionDao = system.getObject("db.dbneed.needsolutionDao");
this.needinfoDao = system.getObject("db.dbneed.needinfoDao");
} }
async getItemByNeedNo(pobj) { async getItemByNeedNo(pobj) {
var item = await this.dao.getItemByNeedNo(pobj.actionBody.needNo); var item = await this.dao.getItemByNeedNo(pobj.actionBody.needNo);
...@@ -172,6 +174,41 @@ class NeedinfoService extends ServiceBase { ...@@ -172,6 +174,41 @@ class NeedinfoService extends ServiceBase {
return system.getResultSuccess(item); return system.getResultSuccess(item);
} }
async writeCommunicationLog(pobj,actionBody){
// 查询需求沟通记录
actionBody.Note = ["noteTime",moment().format("YYYY-MM-DD HH:mm:ss"),"note",actionBody.Note];
let needRes = await this.findOne({channelNeedNo:actionBody.BizId});
// 没有需求单直接返回
if(!needRes) {
return system.getResult("没有这个需求单");
}
// 有需求单但没有沟通记录 直接set
if(!needRes.followContent) {
var sql = "update n_need_info set followContent=JSON_OBJECT(:followContent) where channelNeedNo=:BizId"
var paramWhere = {
followContent: actionBody.Note,
BizId: actionBody.BizId
};
var updateRes = await this.customUpdate(sql,paramWhere);
if(updateRes[1]) {
return system.getResultSuccess();
}
return system.getResult("添加记录失败");
// 有需求单有沟通记录 json_array_append
} else {
var sql = "update n_need_info set followContent=json_array_append(followContent, '$', JSON_OBJECT(:Note)) where channelNeedNo=:BizId"
// var sql = "update n_need_info set followContent=json_array_append(followContent, '$', "+ "\"" + JSON.stringify(actionBody.Note) + "\""+") where channelNeedNo="+ "\"" +actionBody.BizId +"\"" +" "
var paramWhere = {
Note: actionBody.Note,
BizId: actionBody.BizId
};
var updateRes = await this.customUpdate(sql,paramWhere);
if(updateRes[1]) {
return system.getResultSuccess();
}
return system.getResult("添加记录失败");
}
}
} }
module.exports = NeedinfoService; module.exports = NeedinfoService;
......
...@@ -413,7 +413,7 @@ class NeedsolutionService extends ServiceBase { ...@@ -413,7 +413,7 @@ class NeedsolutionService extends ServiceBase {
return system.getResultFail(-103, "方案状态错误,不能废弃已完成方案"); return system.getResultFail(-103, "方案状态错误,不能废弃已完成方案");
} }
} }
await this.dao.model.update({ status: "yzf" }, { where: { needNo: needinfo.needNo } });//方案废弃 await this.dao.model.update({ status: "yzf",isInvalid:1 }, { where: { needNo: needinfo.needNo } });//方案废弃
return system.getResultSuccess(); return system.getResultSuccess();
} }
...@@ -474,7 +474,7 @@ class NeedsolutionService extends ServiceBase { ...@@ -474,7 +474,7 @@ class NeedsolutionService extends ServiceBase {
// return system.getResultFail(-102,"状态不能为空"); // return system.getResultFail(-102,"状态不能为空");
// } // }
var needsolutioninfo = await this.dao.model.findOne({ var needsolutioninfo = await this.dao.model.findOne({
where: { channelSolutionNo: ab.channelSolutionNo }, raw: true where: { channelSolutionNo: ab.channelSolutionNo,isInvalid:0 }, raw: true
}); });
if (!needsolutioninfo || !needsolutioninfo.id) { if (!needsolutioninfo || !needsolutioninfo.id) {
return system.getResultFail(-400, "未知方案"); return system.getResultFail(-400, "未知方案");
...@@ -493,7 +493,7 @@ class NeedsolutionService extends ServiceBase { ...@@ -493,7 +493,7 @@ class NeedsolutionService extends ServiceBase {
} }
await this.dao.update(needsolutioninfo); await this.dao.update(needsolutioninfo);
var ns = await this.dao.model.findOne({ var ns = await this.dao.model.findOne({
where: { channelSolutionNo: ab.channelSolutionNo }, raw: true where: { id: needsolutioninfo.id }, raw: true
}); });
return system.getResultSuccess(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