Commit 6754fa2d by 庄冰

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

parents 2138cf7e b7c64480
...@@ -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,// 渠道产品编码
......
...@@ -140,6 +140,7 @@ class OrderInfoService extends ServiceBase { ...@@ -140,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,// 渠道产品编码
...@@ -293,6 +294,7 @@ class OrderInfoService extends ServiceBase { ...@@ -293,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,// 渠道产品编码
...@@ -1296,22 +1298,22 @@ class OrderInfoService extends ServiceBase { ...@@ -1296,22 +1298,22 @@ class OrderInfoService extends ServiceBase {
*/ */
async getOrdersStatisticsByUappId(pobj) { async getOrdersStatisticsByUappId(pobj) {
let ac = pobj.actionBody; let ac = pobj.actionBody;
let sql = `SELECT uapp_id,count(*) count,DATE_FORMAT(created_at,'%Y-%m-%d') time FROM c_order_info WHERE deleted_at is null `; let sql = `SELECT a.uapp_id,count(*) count,DATE_FORMAT(a.created_at,'%Y-%m-%d') time FROM c_order_info a INNER JOIN c_order_product b ON a.orderNo = b.sourceOrderNo WHERE a.deleted_at is null `;
let whereParam = {}; let whereParam = {};
if (ac.start && ac.end) { if (ac.start && ac.end) {
sql += ` AND created_at >= :start AND created_at <= :end`; sql += ` AND a.created_at >= :start AND a.created_at <= :end`;
whereParam.start = ac.start; whereParam.start = ac.start;
whereParam.end = ac.end; whereParam.end = ac.end;
} }
if (ac.type_code) { if(ac.pathName){
sql += ` AND typeCode = :type_code`; sql += ` AND b.pathName = :pathName`;
whereParam.type_code = ac.type_code; whereParam.pathName = ac.pathName;
} }
if (ac.status) { if (ac.status) {
sql += ` AND orderStatus = :status`; sql += ` AND orderStatus = :status`;
whereParam.status = ac.status; whereParam.status = ac.status;
} }
sql += ` GROUP BY uapp_id,DATE_FORMAT(created_at,'%Y-%m-%d') ORDER BY created_at ASC` sql += ` GROUP BY a.uapp_id,DATE_FORMAT(a.created_at,'%Y-%m-%d') ORDER BY a.created_at ASC`
let result = await this.customQuery(sql, whereParam); let result = await this.customQuery(sql, whereParam);
return system.getResultSuccess(result); return system.getResultSuccess(result);
} }
...@@ -1323,14 +1325,14 @@ class OrderInfoService extends ServiceBase { ...@@ -1323,14 +1325,14 @@ class OrderInfoService extends ServiceBase {
*/ */
async getOrdersStatisticsByProduct(pobj) { async getOrdersStatisticsByProduct(pobj) {
let ac = pobj.actionBody; let ac = pobj.actionBody;
let sql = `SELECT b.channelItemName typeCode,a.uapp_id,count( DISTINCT(a.orderNo)) count FROM c_order_info a left join c_order_product b on a.orderNo = b.sourceOrderNo WHERE a.deleted_at is null and b.itemCode is not null `; let sql = `SELECT b.pathName,a.uapp_id,count( DISTINCT(a.orderNo)) count FROM c_order_info a left join c_order_product b on a.orderNo = b.sourceOrderNo WHERE a.deleted_at is null and b.pathName is not null `;
let whereParams = {}; let whereParams = {};
if (ac.start && ac.end) { if (ac.start && ac.end) {
sql += ` and a.created_at >= :start and a.created_at <= :end `; sql += ` and a.created_at >= :start and a.created_at <= :end `;
whereParams.start = ac.start; whereParams.start = ac.start;
whereParams.end = ac.end; whereParams.end = ac.end;
} }
sql += ` GROUP BY b.channelItemName,a.uapp_id`; sql += ` GROUP BY b.pathName,a.uapp_id`;
let result = await this.customQuery(sql, whereParams); let result = await this.customQuery(sql, whereParams);
return system.getResultSuccess(result); return system.getResultSuccess(result);
} }
...@@ -1395,6 +1397,7 @@ class OrderInfoService extends ServiceBase { ...@@ -1395,6 +1397,7 @@ class OrderInfoService extends ServiceBase {
b.itemName, b.itemName,
a.totalSum, a.totalSum,
a.orderStatusName, a.orderStatusName,
a.notes,
c.contactName, c.contactName,
c.mobile, c.mobile,
a.isPushNum, a.isPushNum,
...@@ -2538,6 +2541,7 @@ class OrderInfoService extends ServiceBase { ...@@ -2538,6 +2541,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,// 渠道产品编码
......
...@@ -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 || [];
...@@ -717,7 +717,7 @@ class AliyunQcService { ...@@ -717,7 +717,7 @@ class AliyunQcService {
}); });
solutionContent.status = "USER_UPLOADED"; solutionContent.status = "USER_UPLOADED";
solutionContent.statusName = this.icpSolutionStatusReference.USER_UPLOADED; solutionContent.statusName = this.icpSolutionStatusReference.USER_UPLOADED;
} else if (ab.status == "4") {//⽤户已确认 } else if (ab.status == "4") {//⽤户已确认,3为资料未确认(暂时不用做处理)
if (solutionContent.status != "MATERIAL_UNCONFIRM") { if (solutionContent.status != "MATERIAL_UNCONFIRM") {
return system.getResultFail(-113, "操作失败,服务商递交⽂件后才能执行此操作"); return system.getResultFail(-113, "操作失败,服务商递交⽂件后才能执行此操作");
} }
...@@ -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;
......
var settings={ var settings={
redis:{ redis:{
host: "39.107.234.14", host: "59.110.125.77",
port: 6379, port: 30479,
password: "123123", password: "havzMSYc3aBZXOjpG3",
db:9, db: 5,
}, },
database:{ database:{
dbname : "center_order", dbname : "center_order",
......
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