Commit 15ce8f2e by linboxuan

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

parents f10e68f9 0af15996
...@@ -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;
......
...@@ -36,9 +36,9 @@ class QcAPI extends APIBase { ...@@ -36,9 +36,9 @@ class QcAPI extends APIBase {
case "submitIcpProgramme"://icp方案提交 case "submitIcpProgramme"://icp方案提交
opResult = await this.aliyunqcSve.submitIcpProgramme(pobj); opResult = await this.aliyunqcSve.submitIcpProgramme(pobj);
break; break;
case "submitIcpMaterial"://icp材料提交 // case "submitIcpMaterial"://icp材料提交
opResult = await this.aliyunqcSve.submitIcpMaterial(pobj); // opResult = await this.aliyunqcSve.submitIcpMaterial(pobj);
break; // break;
case "acceptIcpPartnerNotification"://icp通知状态变更 case "acceptIcpPartnerNotification"://icp通知状态变更
opResult = await this.aliyunqcSve.acceptIcpPartnerNotification(pobj); opResult = await this.aliyunqcSve.acceptIcpPartnerNotification(pobj);
break; break;
...@@ -51,10 +51,10 @@ class QcAPI extends APIBase { ...@@ -51,10 +51,10 @@ class QcAPI extends APIBase {
case "getNeedSolutionDetailByUser"://获取方案详情 case "getNeedSolutionDetailByUser"://获取方案详情
opResult = await this.aliyunqcSve.getNeedSolutionDetailByUser(pobj); opResult = await this.aliyunqcSve.getNeedSolutionDetailByUser(pobj);
break; break;
case "receiveIcpStatusNotify"://接收渠道方案状态变更通知 case "receiveIcpStatusNotify"://接收渠道方案状态变更通知2.3
opResult = await this.aliyunqcSve.receiveIcpStatusNotify(pobj); opResult = await this.aliyunqcSve.receiveIcpStatusNotify(pobj);
break; break;
case "receiveIcpFeedback"://接收icp用户方案反馈 case "receiveIcpFeedback"://接收icp用户方案反馈2.2
opResult = await this.aliyunqcSve.receiveIcpFeedback(pobj); opResult = await this.aliyunqcSve.receiveIcpFeedback(pobj);
break; break;
case "getIcpProgrammeDetail"://获取方案详情(内部调用) case "getIcpProgrammeDetail"://获取方案详情(内部调用)
...@@ -63,7 +63,7 @@ class QcAPI extends APIBase { ...@@ -63,7 +63,7 @@ class QcAPI extends APIBase {
case "getProgrammeInfoByChannelNeedNo"://获取需求方案列表 case "getProgrammeInfoByChannelNeedNo"://获取需求方案列表
opResult = await this.aliyunqcSve.getProgrammeInfoByChannelNeedNo(pobj); opResult = await this.aliyunqcSve.getProgrammeInfoByChannelNeedNo(pobj);
break; break;
case "serviceProviderSubmitMaterial"://交付商提交材料信息 case "serviceProviderSubmitMaterial"://交付商提交材料信息
opResult = await this.aliyunqcSve.serviceProviderSubmitMaterial(pobj); opResult = await this.aliyunqcSve.serviceProviderSubmitMaterial(pobj);
break; break;
...@@ -73,7 +73,12 @@ class QcAPI extends APIBase { ...@@ -73,7 +73,12 @@ class QcAPI extends APIBase {
case "closeOrderDelivery"://交付商关闭交付单 case "closeOrderDelivery"://交付商关闭交付单
opResult = await this.aliyunqcSve.closeOrderDelivery(pobj); opResult = await this.aliyunqcSve.closeOrderDelivery(pobj);
break; break;
case "abolishIcpProgrammeByNeed"://前端关闭ICP需求及方案
opResult = await this.aliyunqcSve.abolishIcpProgrammeByNeed(pobj);
break;
case "receiveIcpConfirmUrl"://前端关闭ICP需求及方案
opResult = await this.aliyunqcSve.receiveIcpConfirmUrl(pobj);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
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;
...@@ -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,
......
...@@ -246,7 +246,7 @@ class OrderInfoService extends ServiceBase { ...@@ -246,7 +246,7 @@ class OrderInfoService extends ServiceBase {
quantity: actionBody.quantity,// 订单数量(即产品的倍数,默认值为1) quantity: actionBody.quantity,// 订单数量(即产品的倍数,默认值为1)
opPayType: "00",// 操作付款类型:00: 创建订单, 10: 补单 opPayType: "00",// 操作付款类型:00: 创建订单, 10: 补单
serviceItemSnapshot: JSON.stringify(actionBody.product_info),//产品快照 serviceItemSnapshot: JSON.stringify(actionBody.product_info),//产品快照
orderSnapshot:JSON.stringify(actionBody.registerData) orderSnapshot: JSON.stringify(actionBody.registerData)
}; };
var orderProduct = await this.orderproductDao.create(orderProductObj, t);//订单产品 var orderProduct = await this.orderproductDao.create(orderProductObj, t);//订单产品
var orderReceiptVoucherObj = { var orderReceiptVoucherObj = {
...@@ -525,12 +525,17 @@ class OrderInfoService extends ServiceBase { ...@@ -525,12 +525,17 @@ class OrderInfoService extends ServiceBase {
return await self.db.transaction(async function (t) { return await self.db.transaction(async function (t) {
var orderNo = await self.getBusUid("ot" + pobj.appInfo.uapp_id); var orderNo = await self.getBusUid("ot" + pobj.appInfo.uapp_id);
if (pobj.actionBody.channelOrder && pobj.actionBody.channelOrder.channelOrderNo) { if (pobj.actionBody.channelOrder && pobj.actionBody.channelOrder.channelOrderNo) {
var count = await self.dao.findCount({ where: { channelOrderNo: pobj.actionBody.channelOrder.channelOrderNo } }); var rtn = await self.dao.findOne({ channelOrderNo: pobj.actionBody.channelOrder.channelOrderNo }, t);
if (count > 0) { if (rtn) {
return system.getResultFail(-1, "订单不能重复创建s"); return system.getResultSuccess({
orderNo: rtn.orderNo,
channelServiceNo: pobj.actionBody.channelOrder.channelServiceNo || rtn.orderNo,
channelOrderNo: pobj.actionBody.channelOrder.channelOrderNo || rtn.orderNo,
channelParams: pobj.actionBody.channelOrder.channelParams || ""
});
} }
var item = await self.createOrder(pobj, orderNo, t);
} }
var item = await self.createOrder(pobj, orderNo, t);
return system.getResultSuccess({ return system.getResultSuccess({
orderNo: orderNo, orderNo: orderNo,
channelServiceNo: pobj.actionBody.channelOrder.channelServiceNo || orderNo, channelServiceNo: pobj.actionBody.channelOrder.channelServiceNo || orderNo,
...@@ -541,7 +546,7 @@ class OrderInfoService extends ServiceBase { ...@@ -541,7 +546,7 @@ class OrderInfoService extends ServiceBase {
} }
async createH5Order(pobj){ async createH5Order(pobj) {
var self = this; var self = this;
if (!pobj.actionBody.registerData) { if (!pobj.actionBody.registerData) {
return system.getResult(null, "注册信息为空"); return system.getResult(null, "注册信息为空");
...@@ -625,8 +630,8 @@ class OrderInfoService extends ServiceBase { ...@@ -625,8 +630,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,
...@@ -1086,21 +1091,21 @@ class OrderInfoService extends ServiceBase { ...@@ -1086,21 +1091,21 @@ class OrderInfoService extends ServiceBase {
var list = await this.customQuery(sql, paramWhere); var list = await this.customQuery(sql, paramWhere);
// 2020 0714 lin 新增 用来处理订单列表的进入详情权限 // 2020 0714 lin 新增 用来处理订单列表的进入详情权限
for(let i = 0;i < list.length;i++) { for (let i = 0; i < list.length; i++) {
// 如果没有交付信息跳出 // 如果没有交付信息跳出
if(!list[i]["deliveryContent"]){ if (!list[i]["deliveryContent"]) {
list[i]["isDetail"] = 0;
delete list[i]["deliveryContent"];
continue;
}
// 如果交付信息状态不等于 待确认方案 || 方案不通过 判断为可进入详情
if(list[i]["deliveryContent"]["deliveryStatus"] != "dqrfa" && list[i]["deliveryContent"]["deliveryStatus"] != "fabtg") {
list[i]["isDetail"] = 1;
delete list[i]["deliveryContent"];
continue;
}
list[i]["isDetail"] = 0; list[i]["isDetail"] = 0;
delete list[i]["deliveryContent"]; delete list[i]["deliveryContent"];
continue;
}
// 如果交付信息状态不等于 待确认方案 || 方案不通过 判断为可进入详情
if (list[i]["deliveryContent"]["deliveryStatus"] != "dqrfa" && list[i]["deliveryContent"]["deliveryStatus"] != "fabtg") {
list[i]["isDetail"] = 1;
delete list[i]["deliveryContent"];
continue;
}
list[i]["isDetail"] = 0;
delete list[i]["deliveryContent"];
} }
var result = system.getResultSuccess(list); var result = system.getResultSuccess(list);
...@@ -1518,20 +1523,20 @@ class OrderInfoService extends ServiceBase { ...@@ -1518,20 +1523,20 @@ class OrderInfoService extends ServiceBase {
if (deliveryInfoResult && deliveryInfoResult.status == 0) { if (deliveryInfoResult && deliveryInfoResult.status == 0) {
resultParams.delivery_content = deliveryInfoResult.data; resultParams.delivery_content = deliveryInfoResult.data;
// 2020 0717 lin新增 在回调处增加客户销售分布地区统计 // 2020 0717 lin新增 在回调处增加客户销售分布地区统计
if(deliveryInfoResult.data.apply) { if (deliveryInfoResult.data.apply) {
if(deliveryInfoResult.data.apply.applyAddr) { if (deliveryInfoResult.data.apply.applyAddr) {
var applyAddr = deliveryInfoResult.data.apply.applyAddr var applyAddr = deliveryInfoResult.data.apply.applyAddr
// 获取地址数组 该setting数组 与orderRegion province相同 // 获取地址数组 该setting数组 与orderRegion province相同
var addArr = settings.addArr(); var addArr = settings.addArr();
for(var i = 0;i < addArr.length;i++) { for (var i = 0; i < addArr.length; i++) {
if(applyAddr.indexOf(addArr[i]) >= 0 ){ if (applyAddr.indexOf(addArr[i]) >= 0) {
var sql = "update c_order_region set count=count+1 where province=:province"; var sql = "update c_order_region set count=count+1 where province=:province";
// 修改条件 省名字相同,appid相同 // 修改条件 省名字相同,appid相同
var paramWhere = { where:{province: addArr[i],uapp_id:item.uapp_id}}; var paramWhere = { where: { province: addArr[i], uapp_id: item.uapp_id } };
var updateFields = { var updateFields = {
count: sequelize.literal('count+1') count: sequelize.literal('count+1')
} }
await this.orderRegionDao.updateByWhere(updateFields, paramWhere) await this.orderRegionDao.updateByWhere(updateFields, paramWhere)
} }
} }
} }
......
...@@ -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