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 {
async opActionProcess(pobj, action_type, req) {
var opResult = null;
switch (action_type) {
case "submitIcpProgramme"://icp方案提交
opResult = await this.needsolutionSve.submitIcpProgramme(pobj);
break;
case "submitIcpMaterial"://icp材料提交
opResult = await this.needsolutionSve.submitIcpMaterial(pobj);
break;
case "acceptIcpPartnerNotification"://icp通知状态变更
opResult = await this.needsolutionSve.acceptIcpPartnerNotification(pobj);
break;
case "abolishIcpProgramme"://服务商icp方案关闭
opResult = await this.needsolutionSve.abolishIcpProgramme(pobj);
break;
case "getIcpProgrammeDetail"://获取icp方案
opResult = await this.needsolutionSve.getIcpProgrammeDetail(pobj);
break;
case "getNeedSolutionDetailByUser"://获取方案详情
opResult = await this.needsolutionSve.getNeedSolutionDetailByUser(pobj);
break;
case "receiveIcpStatusNotify"://接收渠道方案状态变更通知
opResult = await this.needsolutionSve.receiveIcpStatusNotify(pobj);
break;
case "receiveIcpFeedback"://接收icp用户方案反馈
opResult = await this.needsolutionSve.receiveIcpFeedback(pobj);
break;
case "getIcpProgrammeDetail"://获取方案详情(内部调用)
opResult = await this.needsolutionSve.getIcpProgrammeDetail(pobj);
break;
case "getProgrammeInfoByChannelNeedNo"://获取需求方案列表
opResult = await this.needsolutionSve.getProgrammeInfoByChannelNeedNo(pobj);
break;
// case "submitIcpProgramme"://icp方案提交
// opResult = await this.needsolutionSve.submitIcpProgramme(pobj);
// break;
// case "submitIcpMaterial"://icp材料提交
// opResult = await this.needsolutionSve.submitIcpMaterial(pobj);
// break;
// case "acceptIcpPartnerNotification"://icp通知状态变更
// opResult = await this.needsolutionSve.acceptIcpPartnerNotification(pobj);
// break;
// case "abolishIcpProgramme"://服务商icp方案关闭
// opResult = await this.needsolutionSve.abolishIcpProgramme(pobj);
// break;
// case "getIcpProgrammeDetail"://获取icp方案
// opResult = await this.needsolutionSve.getIcpProgrammeDetail(pobj);
// break;
// case "getNeedSolutionDetailByUser"://获取方案详情
// opResult = await this.needsolutionSve.getNeedSolutionDetailByUser(pobj);
// break;
// case "receiveIcpStatusNotify"://接收渠道方案状态变更通知
// opResult = await this.needsolutionSve.receiveIcpStatusNotify(pobj);
// break;
// case "receiveIcpFeedback"://接收icp用户方案反馈
// opResult = await this.needsolutionSve.receiveIcpFeedback(pobj);
// break;
// case "getIcpProgrammeDetail"://获取方案详情(内部调用)
// opResult = await this.needsolutionSve.getIcpProgrammeDetail(pobj);
// break;
// case "getProgrammeInfoByChannelNeedNo"://获取需求方案列表
// opResult = await this.needsolutionSve.getProgrammeInfoByChannelNeedNo(pobj);
// break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -36,9 +36,9 @@ class QcAPI extends APIBase {
case "submitIcpProgramme"://icp方案提交
opResult = await this.aliyunqcSve.submitIcpProgramme(pobj);
break;
case "submitIcpMaterial"://icp材料提交
opResult = await this.aliyunqcSve.submitIcpMaterial(pobj);
break;
// case "submitIcpMaterial"://icp材料提交
// opResult = await this.aliyunqcSve.submitIcpMaterial(pobj);
// break;
case "acceptIcpPartnerNotification"://icp通知状态变更
opResult = await this.aliyunqcSve.acceptIcpPartnerNotification(pobj);
break;
......@@ -51,10 +51,10 @@ class QcAPI extends APIBase {
case "getNeedSolutionDetailByUser"://获取方案详情
opResult = await this.aliyunqcSve.getNeedSolutionDetailByUser(pobj);
break;
case "receiveIcpStatusNotify"://接收渠道方案状态变更通知
case "receiveIcpStatusNotify"://接收渠道方案状态变更通知2.3
opResult = await this.aliyunqcSve.receiveIcpStatusNotify(pobj);
break;
case "receiveIcpFeedback"://接收icp用户方案反馈
case "receiveIcpFeedback"://接收icp用户方案反馈2.2
opResult = await this.aliyunqcSve.receiveIcpFeedback(pobj);
break;
case "getIcpProgrammeDetail"://获取方案详情(内部调用)
......@@ -63,7 +63,7 @@ class QcAPI extends APIBase {
case "getProgrammeInfoByChannelNeedNo"://获取需求方案列表
opResult = await this.aliyunqcSve.getProgrammeInfoByChannelNeedNo(pobj);
break;
case "serviceProviderSubmitMaterial"://交付商提交材料信息
opResult = await this.aliyunqcSve.serviceProviderSubmitMaterial(pobj);
break;
......@@ -73,7 +73,12 @@ class QcAPI extends APIBase {
case "closeOrderDelivery"://交付商关闭交付单
opResult = await this.aliyunqcSve.closeOrderDelivery(pobj);
break;
case "abolishIcpProgrammeByNeed"://前端关闭ICP需求及方案
opResult = await this.aliyunqcSve.abolishIcpProgrammeByNeed(pobj);
break;
case "receiveIcpConfirmUrl"://前端关闭ICP需求及方案
opResult = await this.aliyunqcSve.receiveIcpConfirmUrl(pobj);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
const system = require("../../../system");
const Dao = require("../../dao.base");
class OrderdeliveryofficialDao extends Dao {
class OrderOfficialDao extends Dao {
constructor() {
super(Dao.getModelName(OrderdeliveryofficialDao));
super(Dao.getModelName(OrderOfficialDao));
}
}
module.exports = OrderdeliveryofficialDao;
module.exports = OrderOfficialDao;
......@@ -2,8 +2,8 @@ const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("orderOfficial", {
sourceNo: DataTypes.STRING(128), // 订单号
return db.define("orderofficial", {
serviceNo: DataTypes.STRING(128), // 订单号
channelUserId: DataTypes.STRING(128), // 用户id
officialInfo: DataTypes.JSON // 官文信息
}, {
......@@ -12,7 +12,7 @@ module.exports = (db, DataTypes) => {
version: true,
freezeTableName: true,
timestamps: true,
updatedAt: true,
updated_at: true,
tableName: 'c_delivery_official',
validate: {
......
......@@ -21,6 +21,7 @@ module.exports = (db, DataTypes) => {
},
statusName: DataTypes.STRING(50), //状态名称
createUserId: DataTypes.INTEGER, //创建者id
isInvalid:DataTypes.INTEGER, //是否废弃的无效的方案
}, {
paranoid: true,//假的删除
underscored: true,
......
......@@ -246,7 +246,7 @@ class OrderInfoService extends ServiceBase {
quantity: actionBody.quantity,// 订单数量(即产品的倍数,默认值为1)
opPayType: "00",// 操作付款类型:00: 创建订单, 10: 补单
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 orderReceiptVoucherObj = {
......@@ -525,12 +525,17 @@ class OrderInfoService extends ServiceBase {
return await self.db.transaction(async function (t) {
var orderNo = await self.getBusUid("ot" + pobj.appInfo.uapp_id);
if (pobj.actionBody.channelOrder && pobj.actionBody.channelOrder.channelOrderNo) {
var count = await self.dao.findCount({ where: { channelOrderNo: pobj.actionBody.channelOrder.channelOrderNo } });
if (count > 0) {
return system.getResultFail(-1, "订单不能重复创建s");
var rtn = await self.dao.findOne({ channelOrderNo: pobj.actionBody.channelOrder.channelOrderNo }, t);
if (rtn) {
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({
orderNo: orderNo,
channelServiceNo: pobj.actionBody.channelOrder.channelServiceNo || orderNo,
......@@ -541,7 +546,7 @@ class OrderInfoService extends ServiceBase {
}
async createH5Order(pobj){
async createH5Order(pobj) {
var self = this;
if (!pobj.actionBody.registerData) {
return system.getResult(null, "注册信息为空");
......@@ -625,8 +630,8 @@ class OrderInfoService extends ServiceBase {
orderStatus: 2
}
var item = await self.createOrder(pobj, orderNo, t);
needsolutioninfo.status = "ywc";
await self.needsolutionDao.update(needsolutioninfo, t);
// needsolutioninfo.status = "ywc";
await self.needsolutionDao.update({ id: needsolutioninfo.id, status: "dqr" }, t);
self.addOrderDelivery(pobj.actionBody.deliveryData, orderNo);
return system.getResultSuccess({
orderNo: orderNo,
......@@ -1086,21 +1091,21 @@ class OrderInfoService extends ServiceBase {
var list = await this.customQuery(sql, paramWhere);
// 2020 0714 lin 新增 用来处理订单列表的进入详情权限
for(let i = 0;i < list.length;i++) {
// 如果没有交付信息跳出
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;
}
for (let i = 0; i < list.length; i++) {
// 如果没有交付信息跳出
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;
delete list[i]["deliveryContent"];
}
var result = system.getResultSuccess(list);
......@@ -1518,20 +1523,20 @@ class OrderInfoService extends ServiceBase {
if (deliveryInfoResult && deliveryInfoResult.status == 0) {
resultParams.delivery_content = deliveryInfoResult.data;
// 2020 0717 lin新增 在回调处增加客户销售分布地区统计
if(deliveryInfoResult.data.apply) {
if(deliveryInfoResult.data.apply.applyAddr) {
if (deliveryInfoResult.data.apply) {
if (deliveryInfoResult.data.apply.applyAddr) {
var applyAddr = deliveryInfoResult.data.apply.applyAddr
// 获取地址数组 该setting数组 与orderRegion province相同
var addArr = settings.addArr();
for(var i = 0;i < addArr.length;i++) {
if(applyAddr.indexOf(addArr[i]) >= 0 ){
var sql = "update c_order_region set count=count+1 where province=:province";
// 修改条件 省名字相同,appid相同
var paramWhere = { where:{province: addArr[i],uapp_id:item.uapp_id}};
var updateFields = {
count: sequelize.literal('count+1')
}
await this.orderRegionDao.updateByWhere(updateFields, paramWhere)
for (var i = 0; i < addArr.length; i++) {
if (applyAddr.indexOf(addArr[i]) >= 0) {
var sql = "update c_order_region set count=count+1 where province=:province";
// 修改条件 省名字相同,appid相同
var paramWhere = { where: { province: addArr[i], uapp_id: item.uapp_id } };
var updateFields = {
count: sequelize.literal('count+1')
}
await this.orderRegionDao.updateByWhere(updateFields, paramWhere)
}
}
}
......
......@@ -413,7 +413,7 @@ class NeedsolutionService extends ServiceBase {
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();
}
......@@ -474,7 +474,7 @@ class NeedsolutionService extends ServiceBase {
// return system.getResultFail(-102,"状态不能为空");
// }
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) {
return system.getResultFail(-400, "未知方案");
......@@ -493,7 +493,7 @@ class NeedsolutionService extends ServiceBase {
}
await this.dao.update(needsolutioninfo);
var ns = await this.dao.model.findOne({
where: { channelSolutionNo: ab.channelSolutionNo }, raw: true
where: { id: needsolutioninfo.id }, raw: true
});
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