Commit 6211ce9a by 任晓松

Merge remote-tracking branch 'origin/center-order' into center-order

parents 22238e1e 3fe54f92
...@@ -5,7 +5,8 @@ module.exports = (db, DataTypes) => { ...@@ -5,7 +5,8 @@ module.exports = (db, DataTypes) => {
return db.define("orderinfo", { return db.define("orderinfo", {
uapp_id :DataTypes.INTEGER,// uapp_id :DataTypes.INTEGER,//
// solutionId :DataTypes.STRING(128),// 方案ID // solutionId :DataTypes.STRING(128),// 方案ID
orderNo :DataTypes.STRING(128),// 订单号 orderNo :DataTypes.STRING(128),// 订单号
serviceNo :DataTypes.STRING(128),//
channelServiceNo :DataTypes.STRING(128),// 渠道服务单号 channelServiceNo :DataTypes.STRING(128),// 渠道服务单号
serviceOrderNo :DataTypes.STRING(128),// 服务单号 serviceOrderNo :DataTypes.STRING(128),// 服务单号
channelOrderNo :DataTypes.STRING(128),// 渠道订单号(页面中列表中显示该单号) channelOrderNo :DataTypes.STRING(128),// 渠道订单号(页面中列表中显示该单号)
......
...@@ -7,6 +7,7 @@ module.exports = (db, DataTypes) => { ...@@ -7,6 +7,7 @@ module.exports = (db, DataTypes) => {
sourceOrderNo :DataTypes.STRING(128),//来源单号 sourceOrderNo :DataTypes.STRING(128),//来源单号
productType_id :DataTypes.INTEGER,//产品类型Id productType_id :DataTypes.INTEGER,//产品类型Id
pathCode :DataTypes.STRING(512), //产品类型编码路径,如:1/2 pathCode :DataTypes.STRING(512), //产品类型编码路径,如:1/2
pathName :DataTypes.STRING(512), //产品类型路径名称,如:1/2
itemCode :DataTypes.STRING(64),//产品编码 itemCode :DataTypes.STRING(64),//产品编码
itemName :DataTypes.STRING(100),//产品名称 itemName :DataTypes.STRING(100),//产品名称
channelItemCode :DataTypes.STRING(100),// 渠道产品编码 channelItemCode :DataTypes.STRING(100),// 渠道产品编码
......
...@@ -68,6 +68,7 @@ class OrderInfoService extends ServiceBase { ...@@ -68,6 +68,7 @@ class OrderInfoService extends ServiceBase {
sourceOrderNo: orderNo, // 来源单号 sourceOrderNo: orderNo, // 来源单号
productType_id: actionBody.product_info.productType_id,//产品类型Id productType_id: actionBody.product_info.productType_id,//产品类型Id
pathCode: actionBody.product_info.path_code,//产品路径 pathCode: actionBody.product_info.path_code,//产品路径
pathName: actionBody.product_info.path_name,//产品路径名称
itemCode: actionBody.product_info.item_code,//产品编码 itemCode: actionBody.product_info.item_code,//产品编码
itemName: actionBody.product_info.item_name,//产品名称 itemName: actionBody.product_info.item_name,//产品名称
channelItemCode: actionBody.product_info.channel_item_code,// 渠道产品编码 channelItemCode: actionBody.product_info.channel_item_code,// 渠道产品编码
......
...@@ -16,6 +16,7 @@ class OrderInfoService extends ServiceBase { ...@@ -16,6 +16,7 @@ class OrderInfoService extends ServiceBase {
this.orderReceiptVoucherDao = system.getObject("db.dbcpay.orderreceiptvoucherDao"); this.orderReceiptVoucherDao = system.getObject("db.dbcpay.orderreceiptvoucherDao");
this.moneyJourneyDao = system.getObject("db.dbcpay.moneyjourneyDao"); this.moneyJourneyDao = system.getObject("db.dbcpay.moneyjourneyDao");
this.needsolutionDao = system.getObject("db.dbneed.needsolutionDao"); this.needsolutionDao = system.getObject("db.dbneed.needsolutionDao");
this.needinfoDao = system.getObject("db.dbneed.needinfoDao");
this.orderRegionDao = system.getObject("db.dbcorder.orderregionDao"); this.orderRegionDao = system.getObject("db.dbcorder.orderregionDao");
this.push360Sve = system.getObject('service.common.push360Sve'); this.push360Sve = system.getObject('service.common.push360Sve');
this.orderinfoDao = system.getObject('db.dbcorder.orderinfoDao'); this.orderinfoDao = system.getObject('db.dbcorder.orderinfoDao');
...@@ -139,6 +140,7 @@ class OrderInfoService extends ServiceBase { ...@@ -139,6 +140,7 @@ class OrderInfoService extends ServiceBase {
sourceOrderNo: orderNo, // 来源单号 sourceOrderNo: orderNo, // 来源单号
productType_id: actionBody.product_info.productType_id,//产品类型Id productType_id: actionBody.product_info.productType_id,//产品类型Id
pathCode: actionBody.product_info.path_code,//产品路径 pathCode: actionBody.product_info.path_code,//产品路径
pathName: actionBody.product_info.path_name,//产品路径名称
itemCode: actionBody.product_info.item_code,//产品编码 itemCode: actionBody.product_info.item_code,//产品编码
itemName: actionBody.product_info.item_name,//产品名称 itemName: actionBody.product_info.item_name,//产品名称
channelItemCode: actionBody.product_info.channel_item_code,// 渠道产品编码 channelItemCode: actionBody.product_info.channel_item_code,// 渠道产品编码
...@@ -292,6 +294,7 @@ class OrderInfoService extends ServiceBase { ...@@ -292,6 +294,7 @@ class OrderInfoService extends ServiceBase {
sourceOrderNo: orderNo, // 来源单号 sourceOrderNo: orderNo, // 来源单号
productType_id: actionBody.product_info.productType_id,//产品类型Id productType_id: actionBody.product_info.productType_id,//产品类型Id
pathCode: actionBody.product_info.path_code,//产品路径 pathCode: actionBody.product_info.path_code,//产品路径
pathName: actionBody.product_info.path_name,//产品路径名称
itemCode: actionBody.product_info.item_code,//产品编码 itemCode: actionBody.product_info.item_code,//产品编码
itemName: actionBody.product_info.item_name,//产品名称 itemName: actionBody.product_info.item_name,//产品名称
channelItemCode: actionBody.product_info.channel_item_code,// 渠道产品编码 channelItemCode: actionBody.product_info.channel_item_code,// 渠道产品编码
...@@ -2537,6 +2540,7 @@ class OrderInfoService extends ServiceBase { ...@@ -2537,6 +2540,7 @@ class OrderInfoService extends ServiceBase {
sourceOrderNo: orderNo, // 来源单号 sourceOrderNo: orderNo, // 来源单号
productType_id: productInfo.productType_id,//产品类型Id productType_id: productInfo.productType_id,//产品类型Id
pathCode: productInfo.path_code,//产品路径 pathCode: productInfo.path_code,//产品路径
pathName: productInfo.path_name,//产品路径名称
itemCode: productInfo.item_code,//产品编码 itemCode: productInfo.item_code,//产品编码
itemName: productInfo.item_name,//产品名称 itemName: productInfo.item_name,//产品名称
channelItemCode: productInfo.channel_item_code,// 渠道产品编码 channelItemCode: productInfo.channel_item_code,// 渠道产品编码
...@@ -2554,10 +2558,14 @@ class OrderInfoService extends ServiceBase { ...@@ -2554,10 +2558,14 @@ class OrderInfoService extends ServiceBase {
serviceItemSnapshot: JSON.stringify(productInfo), //产品快照 serviceItemSnapshot: JSON.stringify(productInfo), //产品快照
orderSnapshot: JSON.stringify(ab)// 2020 1110 lin 新增 增加订单快照 orderSnapshot: JSON.stringify(ab)// 2020 1110 lin 新增 增加订单快照
}; };
ab.pushStatus=3;
ab.isPushNum=1;
var self = this; var self = this;
return await self.db.transaction(async function (t) { return await self.db.transaction(async function (t) {
var o = await self.dao.create(ab, t); var o = await self.dao.create(ab, t);
var orderProduct = await self.orderproductDao.create(orderProductObj, t);//订单产品 var orderProduct = await self.orderproductDao.create(orderProductObj, t);//订单产品
await self.needinfoDao.model.update({status:"ycd"},{ where: { channelNeedNo: ab.needNo }, transaction: t });
return system.getResultSuccess(o); return system.getResultSuccess(o);
}) })
...@@ -2605,7 +2613,7 @@ class OrderInfoService extends ServiceBase { ...@@ -2605,7 +2613,7 @@ class OrderInfoService extends ServiceBase {
ab.channelNeedNo = ab.needNo; ab.channelNeedNo = ab.needNo;
ab.channelUserId = userInfo.channel_userid; ab.channelUserId = userInfo.channel_userid;
ab.ownerUserId = userInfo.channel_userid; ab.ownerUserId = userInfo.channel_userid;
ab.payTime = ab.payTime || new Date(); ab.payTime = ab.payTime;
ab.orderStatus = 2; ab.orderStatus = 2;
ab.totalSum = ab.price; ab.totalSum = ab.price;
ab.payTotalSum = ab.price; ab.payTotalSum = ab.price;
...@@ -2638,7 +2646,7 @@ class OrderInfoService extends ServiceBase { ...@@ -2638,7 +2646,7 @@ class OrderInfoService extends ServiceBase {
} }
orderInfo.refundSum = pobj.actionBody.refundSum || orderInfo.payTotalSum; orderInfo.refundSum = pobj.actionBody.refundSum || orderInfo.payTotalSum;
orderInfo.orderStatus = 16; orderInfo.orderStatus = 16;
orderInfo.refundTime = pobj.actionBody.refundTime || new Date(); orderInfo.refundTime = pobj.actionBody.refundTime;
await this.dao.update(orderInfo); await this.dao.update(orderInfo);
return system.getResultSuccess(); return system.getResultSuccess();
......
...@@ -185,21 +185,41 @@ class NeedinfoService extends ServiceBase { ...@@ -185,21 +185,41 @@ class NeedinfoService extends ServiceBase {
} }
async getItemByChannelSolutionNo(pobj) { async getItemByChannelSolutionNo(pobj) {
console.log('getItemByChannelSolutionNo+++pobj--',pobj)
var solutionitem = await this.needsolutionDao.findOne({ channelSolutionNo: pobj.actionBody.bizId }); var solutionitem = await this.needsolutionDao.findOne({ channelSolutionNo: pobj.actionBody.bizId });
if (!solutionitem) { if (!solutionitem) {
return system.getResult(null, "方案数据为空,30210"); return system.getResult(null, "方案数据为空,30210");
} }
var item = await this.dao.getItemByNeedNo(solutionitem.needNo); var item = await this.dao.getItemByNeedNo(solutionitem.needNo);
console.log('ename---item---',item)
if (!item) { if (!item) {
return system.getResult(null, "需求数据为空,30210"); return system.getResult(null, "需求数据为空,30210");
} }
let uappId;
if(item && item.uapp_id){
uappId = item.uapp_id
}
let ActionType
// fixme 阿里直购需要更改 // fixme 阿里直购需要更改
if (!pobj.actionBody.bizId.startsWith("TM_")) {//商标不需要 if (!pobj.actionBody.bizId.startsWith("TM_")) {//商标不需要
item.solutionProvince = solutionitem.solutionContent.solution.Area || solutionitem.solutionContent.solution.area; if(uappId == '52'){//易名区分申请续期
//item.solutionProvince = solutionitem.solutionContent.solution.Area + `(${solutionitem.solutionContent.solution.actionType})`//北京(新办); ActionType = solutionitem.solutionContent.solution.ActionType
item.solutionContent = solutionitem.solutionContent if(ActionType && ActionType == "新办"){
item.channelSolutionNo = solutionitem.channelSolutionNo ActionType = "申请"
}
item.solutionProvince = solutionitem.solutionContent.solution.Area || solutionitem.solutionContent.solution.area;
item.solutionProvince = item.solutionProvince + "-" + ActionType
//item.solutionProvince = solutionitem.solutionContent.solution.Area + `(${solutionitem.solutionContent.solution.actionType})`//北京(新办);
item.solutionContent = solutionitem.solutionContent
item.channelSolutionNo = solutionitem.channelSolutionNo
}else{
item.solutionProvince = solutionitem.solutionContent.solution.Area || solutionitem.solutionContent.solution.area;
//item.solutionProvince = solutionitem.solutionContent.solution.Area + `(${solutionitem.solutionContent.solution.actionType})`//北京(新办);
item.solutionContent = solutionitem.solutionContent
item.channelSolutionNo = solutionitem.channelSolutionNo
}
} }
console.log('item.solutionProvince---',item.solutionProvince)
return system.getResultSuccess(item); return system.getResultSuccess(item);
} }
...@@ -415,7 +435,4 @@ class NeedinfoService extends ServiceBase { ...@@ -415,7 +435,4 @@ class NeedinfoService extends ServiceBase {
} }
module.exports = NeedinfoService; module.exports = NeedinfoService;
\ No newline at end of file
// var a=new NeedinfoService();
// var b=a.getItemByChannelSolutionNo({actionBody:{bizId:"1593141330846"}});
\ No newline at end of file
...@@ -392,7 +392,7 @@ class NeedsolutionService extends ServiceBase { ...@@ -392,7 +392,7 @@ class NeedsolutionService extends ServiceBase {
return system.getResultFail(-105, "该方案需求状态为" + needinfo.statusName + ",不能执行此操作"); return system.getResultFail(-105, "该方案需求状态为" + needinfo.statusName + ",不能执行此操作");
} }
if (ns.status != "dqr") { if (ns.status != "dqr") {
return system.getResultFail(-103, "方案状态错误,只能废弃待确认方案"); return system.getResultFail(-103, "方案状态错误,只能废弃待确认方案-1");
} }
await this.dao.update({ id: ns.id, status: "yzf" });//方案废弃 await this.dao.update({ id: ns.id, status: "yzf" });//方案废弃
//获取方案信息 //获取方案信息
...@@ -428,7 +428,7 @@ class NeedsolutionService extends ServiceBase { ...@@ -428,7 +428,7 @@ class NeedsolutionService extends ServiceBase {
for (var i = 0; i < ns.length; i++) { for (var i = 0; i < ns.length; i++) {
var fa = ns[i]; var fa = ns[i];
if (fa.status == "ywc") { if (fa.status == "ywc") {
return system.getResultFail(-103, "方案状态错误,不能废弃已完成方案"); return system.getResultFail(-103, "方案状态错误,不能废弃已完成方案-1");
} }
} }
await this.dao.model.update({ status: "yzf",isInvalid:1 }, { where: { needNo: needinfo.needNo } });//方案废弃 await this.dao.model.update({ status: "yzf",isInvalid:1 }, { where: { needNo: needinfo.needNo } });//方案废弃
...@@ -990,7 +990,7 @@ class NeedsolutionService extends ServiceBase { ...@@ -990,7 +990,7 @@ class NeedsolutionService extends ServiceBase {
return system.getResultFail(-105, "该方案需求状态为" + needinfo.statusName + ",不能执行此操作"); return system.getResultFail(-105, "该方案需求状态为" + needinfo.statusName + ",不能执行此操作");
} }
if (ns.status != "dqr") { if (ns.status != "dqr") {
return system.getResultFail(-103, "方案状态错误,只能废弃待确认方案"); return system.getResultFail(-103, "方案状态错误,只能废弃待确认方案-2");
} }
var solutionContent = ns.solutionContent; var solutionContent = ns.solutionContent;
if (!solutionContent.status || ["USER_UPLOADED", "MATERIAL_UNCONFIRM", "USER_CONFIRMED", "ACCOUNT_REGISTERED", "MATERIAL_SUBMITTED"].indexOf(solutionContent.status) < 0) { if (!solutionContent.status || ["USER_UPLOADED", "MATERIAL_UNCONFIRM", "USER_CONFIRMED", "ACCOUNT_REGISTERED", "MATERIAL_SUBMITTED"].indexOf(solutionContent.status) < 0) {
...@@ -1035,7 +1035,7 @@ class NeedsolutionService extends ServiceBase { ...@@ -1035,7 +1035,7 @@ class NeedsolutionService extends ServiceBase {
return system.getResultFail(-105, "该方案需求状态为" + needinfo.statusName + ",不能执行此操作"); return system.getResultFail(-105, "该方案需求状态为" + needinfo.statusName + ",不能执行此操作");
} }
if (ns.status != "dqr" && ns.status != "yzf") { if (ns.status != "dqr" && ns.status != "yzf") {
return system.getResultFail(-103, "方案状态错误,不能作废已完成方案"); return system.getResultFail(-103, "方案状态错误,不能作废已完成方案-1");
} }
var solutionContent = ns.solutionContent; var solutionContent = ns.solutionContent;
//方案流程列表 //方案流程列表
......
...@@ -97,7 +97,7 @@ class AliyunQcService { ...@@ -97,7 +97,7 @@ class AliyunQcService {
}); });
if (ns && ns.id) { if (ns && ns.id) {
if (ns.status == "ywc") { if (ns.status == "ywc") {
return system.getResultFail(-103, "方案状态错误,不能废弃已完成方案"); return system.getResultFail(-103, "方案状态错误,不能废弃已完成方案-3");
} }
var flowStatus = ns.solutionContent && ns.solutionContent.status ? ns.solutionContent.status : ""; var flowStatus = ns.solutionContent && ns.solutionContent.status ? ns.solutionContent.status : "";
if (flowStatus && ["GXB_REFUSE", "CLOSE"].indexOf(flowStatus) < 0) { if (flowStatus && ["GXB_REFUSE", "CLOSE"].indexOf(flowStatus) < 0) {
...@@ -370,7 +370,7 @@ class AliyunQcService { ...@@ -370,7 +370,7 @@ class AliyunQcService {
// } // }
var solutionContent = ns.solutionContent; var solutionContent = ns.solutionContent;
if (!solutionContent.status || ["USER_UPLOADED", "MATERIAL_UNCONFIRM", "USER_CONFIRMED", "ACCOUNT_REGISTERED", "MATERIAL_SUBMITTED"].indexOf(solutionContent.status) < 0) { if (!solutionContent.status || ["USER_UPLOADED", "MATERIAL_UNCONFIRM", "USER_CONFIRMED", "ACCOUNT_REGISTERED", "MATERIAL_SUBMITTED"].indexOf(solutionContent.status) < 0) {
return system.getResultFail(-302, "方案流程状态错误,不能执行此操作"); return system.getResultFail(-302, "方案流程状态错误,不能执行此操作-1");
} }
solutionContent.serviceProviderNote = ab.Note; solutionContent.serviceProviderNote = ab.Note;
var solutionFlowList = solutionContent.solutionFlowList || []; var solutionFlowList = solutionContent.solutionFlowList || [];
...@@ -733,7 +733,7 @@ class AliyunQcService { ...@@ -733,7 +733,7 @@ class AliyunQcService {
solutionContent.status = "CLOSE"; solutionContent.status = "CLOSE";
solutionContent.statusName = this.icpSolutionStatusReference.CLOSE; solutionContent.statusName = this.icpSolutionStatusReference.CLOSE;
} else { } else {
return system.getResultFail(-110, "状态错误"); return system.getResultFail(-110, "状态错误-2");
} }
solutionContent.solutionFlowList = solutionFlowList; solutionContent.solutionFlowList = solutionFlowList;
...@@ -1078,7 +1078,7 @@ class AliyunQcService { ...@@ -1078,7 +1078,7 @@ class AliyunQcService {
solutionContent.status = "ABC_CLOSE_PRODUCE"; solutionContent.status = "ABC_CLOSE_PRODUCE";
solutionContent.statusName = this.ediSolutionStatusReference.ABC_CLOSE_PRODUCE; solutionContent.statusName = this.ediSolutionStatusReference.ABC_CLOSE_PRODUCE;
} else { } else {
return system.getResultFail(-110, "状态错误"); return system.getResultFail(-110, "状态错误-3");
} }
solutionContent.solutionFlowList = solutionFlowList; solutionContent.solutionFlowList = solutionFlowList;
......
...@@ -152,7 +152,7 @@ class BaiduQcService { ...@@ -152,7 +152,7 @@ class BaiduQcService {
solutionContent.status = "CLOSE"; solutionContent.status = "CLOSE";
solutionContent.statusName = this.icpSolutionStatusReference.CLOSE; solutionContent.statusName = this.icpSolutionStatusReference.CLOSE;
} else { } else {
return system.getResultFail(-110, "状态错误"); return system.getResultFail(-110, "状态错误-4");
} }
solutionContent.solutionFlowList = solutionFlowList; solutionContent.solutionFlowList = solutionFlowList;
......
...@@ -85,7 +85,7 @@ class BaseQcService { ...@@ -85,7 +85,7 @@ class BaseQcService {
if (ns && ns.id) { if (ns && ns.id) {
if (ns.status == "ywc") { if (ns.status == "ywc") {
return system.getResultFail(-103, "方案状态错误,不能废弃已完成方案"); return system.getResultFail(-103, "方案状态错误,不能废弃已完成方案-2");
} }
var flowStatus = ns.solutionContent && ns.solutionContent.status ? ns.solutionContent.status : ""; var flowStatus = ns.solutionContent && ns.solutionContent.status ? ns.solutionContent.status : "";
if (flowStatus && [ if (flowStatus && [
...@@ -1130,7 +1130,7 @@ class BaseQcService { ...@@ -1130,7 +1130,7 @@ class BaseQcService {
solutionContent.status = "ABC_CLOSE_PRODUCE"; solutionContent.status = "ABC_CLOSE_PRODUCE";
solutionContent.statusName = this.ediSolutionStatusReference.ABC_CLOSE_PRODUCE; solutionContent.statusName = this.ediSolutionStatusReference.ABC_CLOSE_PRODUCE;
} else { } else {
return system.getResultFail(-110, "状态错误"); return system.getResultFail(-110, "状态错误-1");
} }
solutionContent.solutionFlowList = solutionFlowList; solutionContent.solutionFlowList = solutionFlowList;
......
...@@ -576,7 +576,7 @@ class NcService { ...@@ -576,7 +576,7 @@ class NcService {
// var newFlowStatus = []; // var newFlowStatus = [];
if (ns && ns.id) { if (ns && ns.id) {
if (ns.status == "ywc") { if (ns.status == "ywc") {
return system.getResultFail(-103, "方案状态错误,不能废弃已完成方案"); return system.getResultFail(-103, "方案状态错误,不能废弃已完成方案-4");
} }
var flowStatus = ns.solutionContent && ns.solutionContent.status ? ns.solutionContent.status : ""; var flowStatus = ns.solutionContent && ns.solutionContent.status ? ns.solutionContent.status : "";
if (flowStatus && ["NOT_ACCEPTED","CLOSE"].indexOf(flowStatus) < 0) { if (flowStatus && ["NOT_ACCEPTED","CLOSE"].indexOf(flowStatus) < 0) {
......
...@@ -338,7 +338,7 @@ class RegCenterOrderService{ ...@@ -338,7 +338,7 @@ class RegCenterOrderService{
solutionContent.status = "CLOSE"; solutionContent.status = "CLOSE";
solutionContent.statusName = this.regSolutionStatus.CLOSE; solutionContent.statusName = this.regSolutionStatus.CLOSE;
} else { } else {
return system.getResultFail(-110, "状态错误"); return system.getResultFail(-110, "状态错误-5");
} }
solutionContent.solutionFlowList = solutionFlowList; solutionContent.solutionFlowList = solutionFlowList;
......
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