Commit 7d3ac2cd by 宋毅

tj

parents c74f6a04 20743871
...@@ -80,6 +80,9 @@ class OrderAPI extends APIBase { ...@@ -80,6 +80,9 @@ class OrderAPI extends APIBase {
case "delOrder"://删除订单 case "delOrder"://删除订单
opResult = await this.orderinfoSve.delOrder(pobj, pobj.actionBody); opResult = await this.orderinfoSve.delOrder(pobj, pobj.actionBody);
break; break;
case "delENameOrder"://删除易名订单
opResult = await this.orderinfoSve.delENameOrder(pobj, pobj.actionBody);
break;
case "queryVOrderByOrderStatusAndItemCode":// 2020 0918 lin 新增 根据OrderStatus查询订单 case "queryVOrderByOrderStatusAndItemCode":// 2020 0918 lin 新增 根据OrderStatus查询订单
opResult = await this.orderinfoSve.queryVOrderByOrderStatusAndItemCode(pobj, pobj.actionBody); opResult = await this.orderinfoSve.queryVOrderByOrderStatusAndItemCode(pobj, pobj.actionBody);
break; break;
...@@ -109,6 +112,12 @@ class OrderAPI extends APIBase { ...@@ -109,6 +112,12 @@ class OrderAPI extends APIBase {
case "bulkCreateOrders": case "bulkCreateOrders":
opResult = await this.orderinfoSve.bulkCreateOrders(pobj, req); opResult = await this.orderinfoSve.bulkCreateOrders(pobj, req);
break; break;
case "receiveAliTmOrder"://接收阿里商标订单
opResult = await this.orderinfoSve.receiveAliTmOrder(pobj);
break;
case "receiveAliTmOrderRefund"://接收阿里商标订单退款信息
opResult = await this.orderinfoSve.receiveAliTmOrderRefund(pobj);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -131,10 +131,13 @@ class QcAPI extends APIBase { ...@@ -131,10 +131,13 @@ class QcAPI extends APIBase {
case "addIcpSalesmanInfo"://添加业务员信息,用于直接下单的icp订单 case "addIcpSalesmanInfo"://添加业务员信息,用于直接下单的icp订单
opResult = await this.baiduqcSve.addIcpSalesmanInfo(pobj); opResult = await this.baiduqcSve.addIcpSalesmanInfo(pobj);
break; break;
case "tmFeedbackSubmit"://商标用户反馈 case "tmFeedbackSubmit"://商标用户反馈
opResult = await this.aliyunqcSve.tmFeedbackSubmit(pobj); opResult = await this.aliyunqcSve.tmFeedbackSubmit(pobj);
break; break;
// case "eNameCloseOrder"://易名退款
// opResult = await this.baiduqcSve.eNameCloseOrder(pobj);
// 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 OpNeedSolution extends APIBase {
//内部通知调用
constructor() {
super();
this.internalCallsNotifySve = system.getObject("service.dbcorder.internalCallsNotifySve");
}
//接收辅助、担保商标注册方案信息
async nbtzreceiveAssistTmData(pobj, qobj, req) {
return await this.internalCallsNotifySve.receiveAssistTmSolutionData(pobj);
}
//接收辅助、担保商标注册修改方案信息
async nbtzreceiveEditAssistTmData(pobj, qobj, req) {
return await this.internalCallsNotifySve.receiveEditAssistTmSolutionData(pobj);
}
//提交方案确认
async submitTmConfirm(pobj, qobj, req) {
return await this.internalCallsNotifySve.submitTmConfirm(pobj);
}
/**
* 关闭注册⽅案
*/
async closeSolution(pobj,obj,req){
return await this.internalCallsNotifySve.closeSolution(pobj);
}
}
module.exports = OpNeedSolution;
\ No newline at end of file
...@@ -44,6 +44,13 @@ class OrderInfoDao extends Dao { ...@@ -44,6 +44,13 @@ class OrderInfoDao extends Dao {
}; };
return await this.delete(sqlWhere); return await this.delete(sqlWhere);
} }
async delOrderByOrderNoEname(orderNo) {
var sqlWhere = {
orderNo: orderNo
};
return await this.delete(sqlWhere);
}
async channeldelOrder(channelOrderNo, uapp_id) { async channeldelOrder(channelOrderNo, uapp_id) {
var sqlWhere = { var sqlWhere = {
channelOrderNo: channelOrderNo, channelOrderNo: channelOrderNo,
......
...@@ -6,7 +6,8 @@ module.exports = (db, DataTypes) => { ...@@ -6,7 +6,8 @@ module.exports = (db, DataTypes) => {
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),// 订单号
channelServiceNo :DataTypes.STRING(128),// 渠道服务单号 channelServiceNo :DataTypes.STRING(128),// 渠道服务单号
serviceOrderNo :DataTypes.STRING(128),// 服务单号
channelOrderNo :DataTypes.STRING(128),// 渠道订单号(页面中列表中显示该单号) channelOrderNo :DataTypes.STRING(128),// 渠道订单号(页面中列表中显示该单号)
channelNeedNo :DataTypes.STRING(128), //渠道需求号(页面中列表中显示该需求号) channelNeedNo :DataTypes.STRING(128), //渠道需求号(页面中列表中显示该需求号)
needNo :DataTypes.STRING(128), //需求号--用于服务商或需求表中创建订单 needNo :DataTypes.STRING(128), //需求号--用于服务商或需求表中创建订单
......
const system = require("../../../system"); const system = require("../../../system");
const uuidv4 = require('uuid/v4'); const uuidv4 = require('uuid/v4');
const moment = require('moment');
//内部通知调用 //内部通知调用
class InternalCallsNotifyService { class InternalCallsNotifyService {
constructor() { constructor() {
this.orderinfoDao = system.getObject("db.dbcorder.orderinfoDao"); this.orderinfoDao = system.getObject("db.dbcorder.orderinfoDao");
this.needinfoDao = system.getObject("db.dbneed.needinfoDao");
this.needsolutionDao = system.getObject("db.dbneed.needsolutionDao");
this.delivery_status = { this.delivery_status = {
"dqrfa": "待确认方案", "dqrfa": "待确认方案",
"fabtg": "方案不通过", "fabtg": "方案不通过",
...@@ -170,5 +173,227 @@ class InternalCallsNotifyService { ...@@ -170,5 +173,227 @@ class InternalCallsNotifyService {
return await this.orderinfoDao.customQuery(sql); return await this.orderinfoDao.customQuery(sql);
} }
//---------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------
async checkParams2(pobj) {//参数校验
if (!pobj.proxyCode) {
return system.getResult(null, "proxyCode不能为空");
}
if (!pobj.IntentionBizId) {
return system.getResult(null, "渠道需求号不能为空");
}
pobj.IntentionBizId ="20201217132620000001";
var needInfo = await this.needinfoDao.model.findOne({
attributes:["id","needNo","channelNeedNo","uapp_id"],
where:{channelNeedNo:pobj.IntentionBizId,channelTypeCode:2},
raw:true
});
if(!needInfo || !needInfo.needNo){
return system.getResult(null, "未知需求信息,10280");
}
pobj.needInfo = needInfo;
return system.getResultSuccess(pobj);
}
//接收辅助、担保商标注册信息
async receiveAssistTmSolutionData(pobj) {
var checkRes = await this.checkParams2(pobj);
if (checkRes.status == 0) {
var needInfo = pobj.needInfo;
//获取方案信息
var ns = await this.needsolutionDao.model.findOne({
where:{needNo:needInfo.needNo,channelNeedNo:needInfo.channelNeedNo,solutionNo:pobj.proxyCode,isInvalid:0}
});
if (ns) {
return system.getResult(null, "保存商标方案信息失败,存在重复方案信息,不能重复提交,10300");
}
//方案流程
var flowList=[{
date:new Date(),flowName:"提交方案"
}];
pobj.flowList = flowList;
var nsObj = {
needNo:needInfo.needNo,channelNeedNo:needInfo.channelNeedNo,solutionNo:pobj.proxyCode,orderNo:pobj.serviceNo,
solutionContent:JSON.stringify(pobj)
}
var needSolution = await this.needsolutionDao.create(nsObj);
return system.getResultSuccess(needSolution);
} else {
return checkRes;
}
}
//接收辅助、担保商标注册修改信息
async receiveEditAssistTmSolutionData(pobj) {
if (!pobj.BizId) {
return system.getResult(null, "BizId不能为空");
}
var checkRes = await this.checkParams2(pobj);
if (checkRes.status == 0) {
var needInfo = pobj.needInfo;
//获取方案信息
var ns = await this.needsolutionDao.model.findOne({
where:{channelNeedNo:needInfo.channelNeedNo,channelSolutionNo:pobj.BizId}
});
if (!ns) {
return system.getResult(null, "渠道方案号:"+pobj.BizId+"的方案不存在,10300");
}else{
var flowObj={
date:new Date(),flowName:"方案修改"
};
var oldSolutionContent = ns.solutionContent;
if(oldSolutionContent){
if(typeof oldSolutionContent === 'string'){
oldSolutionContent = JSON.parse(oldSolutionContent)
}
var flowList = oldSolutionContent.flowList || [];
flowList.push(flowObj);
pobj.flowList = flowList;
}else{
pobj.flowList = [flowObj];
}
var nsUpdateObj = {
id:ns.id,solutionNo:pobj.proxyCode,
solutionContent:JSON.stringify(pobj)
}
await this.needsolutionDao.update(nsUpdateObj);
var needSolution = await this.needsolutionDao.model.findOne({
where:{channelNeedNo:needInfo.channelNeedNo,channelSolutionNo:pobj.BizId}
});
return system.getResultSuccess(needSolution);
}
} else {
return checkRes;
}
}
/*
返回20位业务订单号
prefix:业务前缀
*/
async getBusUid(prefix) {
prefix = (prefix || "");
if (prefix) {
prefix = prefix.toUpperCase();
}
var prefixlength = prefix.length;
var subLen = 8 - prefixlength;
var uidStr = "";
if (subLen > 0) {
uidStr = await this.getUidInfo(subLen, 60);
}
var timStr = moment().format("YYYYMMDDHHmm");
return prefix + timStr + uidStr;
}
/*
len:返回长度
radix:参与计算的长度,最大为62
*/
async getUidInfo(len, radix) {
var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');//长度62,到yz长度为长36
var uuid = [], i;
radix = radix || chars.length;
if (len) {
for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
} else {
var r;
uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
uuid[14] = '4';
for (i = 0; i < 36; i++) {
if (!uuid[i]) {
r = 0 | Math.random() * 16;
uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
}
}
}
return uuid.join('');
}
//提交方案确认
async submitTmConfirm(pobj) {
if (!pobj.IntentionBizId) {
return self.getResultFail("IntentionBizId不能为空");
}
//获取方案信息
var nsList = await this.needsolutionDao.model.findAll({
attributes:["id","status","solutionContent"],
where:{channelNeedNo:pobj.IntentionBizId}
});
if (!nsList || nsList.length<1) {
return system.getResult(null, "渠道需求号:"+pobj.IntentionBizId+"的方案不存在,10300");
}else{
var flowObj={
date:new Date(),flowName:"提交确认注册⽅案,待用户确认"
};
await this.db.transaction(async function (t) {
await this.updateSolution(nsList, flowObj,2, t);
})
return system.getResultSuccess();
}
}
async updateSolution(nsList, flowObj,needStatus, t) {
var intentionStatusList = ["未知", "⽅案待服务商确认", "⽅案待⽤户确认", "处理中", "已完成", "已关闭"];
for (var i = 0; i < nsList.length; i++) {
var ns = nsList[i];
if (ns && ns.id) {
var updateObj = {
id: ns.id
};
var solutionContent = ns.solutionContent || {};
if (typeof ns.solutionContent === 'string') {
ns.solutionContent = JSON.parse(ns.solutionContent);
}
solutionContent.needStatus = needStatus;
solutionContent.needStatusName = intentionStatusList[needStatus];
if(needStatus==2){
// updateObj["status"] = "ybh";
}
if(needStatus==5){
updateObj["status"] = "yzf";
}
var flowList = ns.solutionContent.flowList || [];
flowList.push(flowObj);
ns.solutionContent.flowList = flowList;
ns.solutionContent = JSON.stringify(ns.solutionContent);
await this.needsolutionDao.update(ns, t);
}
}
}
/**
* 关闭注册⽅案
*/
async closeSolution(pobj){
if (!pobj.BizId) {
return system.getResult(null, "BizId不能为空");
}
if (!pobj.IntentionBizId) {
return self.getResultFail("IntentionBizId不能为空");
}
//获取方案信息
var ns = await this.needsolutionDao.model.findOne({
attributes:["id","status","solutionContent"],
where:{channelNeedNo:pobj.IntentionBizId,channelSolutionNo:pobj.BizId}
});
if (!ns) {
return system.getResult(null, "渠道方案号:"+pobj.BizId+"的方案不存在,10300");
}else{
var flowObj={
date:new Date(),flowName:"关闭方案"
};
ns.solutionContent = ns.solutionContent || {};
if(typeof ns.solutionContent === 'string'){
ns.solutionContent = JSON.parse(ns.solutionContent)
}
var flowList = ns.solutionContent.flowList || [];
flowList.push(flowObj);
ns.solutionContent.needStatus = 5;
ns.solutionContent.needStatusName = "已关闭";
ns.solutionContent.flowList = flowList;
ns.solutionContent = JSON.stringify(ns.solutionContent);
ns.status="yzf";
await this.needsolutionDao.update(ns);
return system.getResultSuccess();
}
}
} }
module.exports = InternalCallsNotifyService; module.exports = InternalCallsNotifyService;
\ No newline at end of file
...@@ -1069,6 +1069,11 @@ class OrderInfoService extends ServiceBase { ...@@ -1069,6 +1069,11 @@ class OrderInfoService extends ServiceBase {
return system.getResultSuccess(); return system.getResultSuccess();
} }
async delENameOrder(pobj, actionBody) {//删除易名订单
let res = await this.dao.delOrderByOrderNoEname(actionBody.orderNo);
console.log("delENameOrder res----",system.getResultSuccess(res))
return system.getResultSuccess(res);
}
//baidureg关闭订单 2020-12-20 //baidureg关闭订单 2020-12-20
async delOrders(pobj, actionBody) {//删除订单 async delOrders(pobj, actionBody) {//删除订单
var i; var i;
...@@ -1316,7 +1321,7 @@ class OrderInfoService extends ServiceBase { ...@@ -1316,7 +1321,7 @@ 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( * ) count FROM c_order_info a left join c_order_product b on a.orderNo = b.sourceOrderNo WHERE b.itemCode is not null `; 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 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 `;
...@@ -1333,9 +1338,9 @@ class OrderInfoService extends ServiceBase { ...@@ -1333,9 +1338,9 @@ class OrderInfoService extends ServiceBase {
* @param pobj * @param pobj
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
async getOrdersComparison(pobj) { async getOrdersComparison(pobj){
let ab = pobj.actionBody; let ab =pobj.actionBody;
let sql1 = `select count(*) count from c_order_info a left join c_order_product b on a.orderNo = b.sourceOrderNo where a.deleted_at is null `; let sql1 = `select 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 `;
let whereParams = {}; let whereParams = {};
if (ab.startNow && ab.endNow) { if (ab.startNow && ab.endNow) {
sql1 += ` and a.created_at >= :start and a.created_at <= :end`; sql1 += ` and a.created_at >= :start and a.created_at <= :end`;
...@@ -2510,6 +2515,133 @@ class OrderInfoService extends ServiceBase { ...@@ -2510,6 +2515,133 @@ class OrderInfoService extends ServiceBase {
} }
return system.getResult(updateRet) return system.getResult(updateRet)
} }
/**
* 接收阿里云商标订单信息
* @param {*} pobj
*/
async receiveAliTmOrder(pobj){
var res = await this.checkAndPackageAliTmOrderParams(pobj);
if(!res || res.status!=0){
return res;
}
var orderNo = await this.getBusUid("tm" + pobj.appInfo.uapp_id);
var ab = pobj.actionBody;
var productInfo = pobj.productInfo;
ab.orderNo = orderNo;
//订单产品
var orderProductObj = {
uapp_id: pobj.appInfo.uapp_id,
sourceOrderNo: orderNo, // 来源单号
productType_id: productInfo.productType_id,//产品类型Id
pathCode: productInfo.path_code,//产品路径
itemCode: productInfo.item_code,//产品编码
itemName: productInfo.item_name,//产品名称
channelItemCode: productInfo.channel_item_code,// 渠道产品编码
channelItemName: productInfo.channel_item_name,// 渠道产品名称
channelItemAppendName: ab.channelItemAppendName || "",//服务商产品附加名称
serviceItemCode: productInfo.service_item_code,// 服务商产品编码
payAfterJumpH5Url: productInfo.pay_after_jump_h5url || "",
payAfterJumpPcUrl: productInfo.pay_after_jump_pcurl || "",
picUrl: productInfo.pic_url,// 产品图片地址
price: productInfo.price_item.price,//定价
priceDesc: productInfo.price_item.price_desc,//定价描述
priceTypeName: productInfo.price_item.price_type_name,//定价类型名称
quantity: ab.quantity,// 订单数量(即产品的倍数,默认值为1)
opPayType: "00",// 操作付款类型:00: 创建订单, 10: 补单
serviceItemSnapshot: JSON.stringify(productInfo), //产品快照
orderSnapshot: JSON.stringify(ab)// 2020 1110 lin 新增 增加订单快照
};
var self = this;
return await self.db.transaction(async function (t) {
var o = await self.dao.create(ab,t);
var orderProduct = await self.orderproductDao.create(orderProductObj, t);//订单产品
return system.getResultSuccess(o);
})
}
/**
* 检查封装阿里商标订单参数
* @param {*} pobj
*/
async checkAndPackageAliTmOrderParams(pobj){
if(!pobj || !pobj.actionBody){
return system.getResult(null, "订单参数不能为空,100100");
}
if(!pobj.appInfo){
return system.getResult(null, "未知用应信息,100200");
}
if(!pobj.userInfo){
return system.getResult(null, "未知用户信息,100300");
}
if(!pobj.productInfo){
return system.getResult(null, "未知用户信息,100500");
}
if(!pobj.actionBody.channelOrderNo){
return system.getResult(null, "阿里订单号不能为空,100110");
}
if(!pobj.actionBody.serviceOrderNo){
return system.getResult(null, "蜂擎订单号不能为空,100120");
}
if(!pobj.actionBody.serviceNo){
return system.getResult(null, "服务单号不能为空,100130");
}
if(!pobj.actionBody.needNo){
return system.getResult(null, "阿里需求号不能为空,100110");
}
var orderInfo = await this.dao.model.findOne({
where:{channelOrderNo:pobj.actionBody.channelOrderNo,uapp_id:pobj.appInfo.uapp_id},raw:true
});
if(orderInfo && orderInfo.id){
return system.getResult(null, "阿里订单号:"+pobj.actionBody.channelOrderNo+"的订单已存在,100140");
}
var ab = pobj.actionBody;
var appInfo = pobj.appInfo;
var userInfo = pobj.userInfo;
ab.uapp_id = appInfo.uapp_id;
ab.channelNeedNo = ab.needNo;
ab.channelUserId = userInfo.channel_userid;
ab.ownerUserId = userInfo.channel_userid;
ab.payTime = ab.payTime || new Date();
ab.orderStatus = 2;
ab.totalSum = ab.price;
ab.payTotalSum = ab.price;
return system.getResultSuccess();
}
/**
* 接收阿里商标订单退款信息
* @param {*} pobj
*/
async receiveAliTmOrderRefund(pobj){
if(!pobj || !pobj.actionBody){
return system.getResult(null, "订单参数不能为空,100100");
}
if(!pobj.appInfo){
return system.getResult(null, "未知用应信息,100200");
}
if(!pobj.userInfo){
return system.getResult(null, "未知用户信息,100300");
}
if(!pobj.actionBody.channelOrderNo){
return system.getResult(null, "阿里订单号不能为空,100110");
}
var orderInfo = await this.dao.model.findOne({
attributes:["id","channelOrderNo","payTotalSum"],
where:{channelOrderNo:pobj.actionBody.channelOrderNo,uapp_id:pobj.appInfo.uapp_id},raw:true
});
if(!orderInfo || !orderInfo.id){
return system.getResult(null, "阿里订单号:"+pobj.actionBody.channelOrderNo+"的订单不存在,100140");
}
orderInfo.refundSum = pobj.actionBody.refundSum || orderInfo.payTotalSum;
orderInfo.orderStatus = 16;
orderInfo.refundTime = pobj.actionBody.refundTime || new Date();
await this.dao.update(orderInfo);
return system.getResultSuccess();
}
} }
module.exports = OrderInfoService; module.exports = OrderInfoService;
...@@ -844,43 +844,69 @@ class AliyunQcService { ...@@ -844,43 +844,69 @@ class AliyunQcService {
//接收tm用户方案反馈 //接收tm用户方案反馈
async tmFeedbackSubmit(pobj) { async tmFeedbackSubmit(pobj) {
var ab = pobj.actionBody; try {
if (!ab.intentionBizId) { var ab = pobj.actionBody;
return system.getResultFail(-101, "渠道需求编号错误"); if (!ab.intentionBizId) {
} return system.getResultFail(-101, "渠道需求编号错误");
if (!ab.description) { }
return system.getResultFail(-102, "问题描述不能为空"); if (!ab.description) {
} return system.getResultFail(-102, "问题描述不能为空");
//获取需求信息 }
var needinfo = await this.needinfoDao.model.findOne({ //获取需求信息
where: { channelNeedNo: ab.intentionBizId }, raw: true var needinfo = await this.needinfoDao.model.findOne({
}); where: { channelNeedNo: ab.intentionBizId }, raw: true
if (!needinfo) { });
return system.getResultFail(-104, "未知方案需求"); if (!needinfo) {
} return system.getResultFail(-104, "未知方案需求");
if (needinfo.status == "ygb") { }
return system.getResultFail(-105, "该方案需求状态为" + needinfo.statusName + ",不能执行此操作"); if (needinfo.status == "ygb") {
} return system.getResultFail(-105, "该方案需求状态为" + needinfo.statusName + ",不能执行此操作");
//获取方案信息 }
var ns = await this.needsolutionDao.model.findOne({ //获取方案信息
where: { channelNeedNo: ab.intentionBizId, isInvalid: 0 }, raw: true var nsList = await this.needsolutionDao.model.findAll({
}); where: { channelNeedNo: ab.intentionBizId, isInvalid: 0 }, raw: true
if (!ns) { });
return system.getResultSuccess(); if (!nsList || nsList.length<1) {
return system.getResultSuccess();
}
await this.needsolutionDao.db.transaction(async function (t) {
var flowObj={
date:new Date(),flowName:"用户驳回方案,反馈信息"
};
await this.updateSolution(nsList, ab, flowObj,t);
})
return system.getResultSuccess(needinfo);
} catch (e) {
return system.getResultFail(-200,"error异常");
} }
}
async updateSolution(nsList, ab, flowObj,t) {
var intentionStatusList = ["未知", "⽅案待服务商确认", "⽅案待⽤户确认", "处理中", "已完成", "已关闭"]; var intentionStatusList = ["未知", "⽅案待服务商确认", "⽅案待⽤户确认", "处理中", "已完成", "已关闭"];
var updateObj = { for (var i = 0; i < nsList.length; i++) {
id: ns.id var ns = nsList[i];
}; var updateObj = {
var solutionContent = ns.solutionContent; id: ns.id
solutionContent.customerRemark = ab.description; };
solutionContent.needStatus = 1; var solutionContent = ns.solutionContent || {};
updateObj["status"] = "ybh"; if (typeof solutionContent === 'string') {
solutionContent.needStatusName = intentionStatusList[ab.intentionStatus]; solutionContent = JSON.parse(solutionContent);
solutionContent = JSON.stringify(solutionContent); }
updateObj["solutionContent"] = solutionContent; solutionContent.customerRemark = ab.description;
await this.needsolutionDao.update(updateObj);//方案状态修改 solutionContent.needStatus = 1;
return system.getResultSuccess(needinfo); updateObj["status"] = "ybh";
solutionContent.needStatusName = intentionStatusList[1];
var flowList = solutionContent.flowList || [];
flowList.push(flowObj);
solutionContent.flowList = flowList;
solutionContent = JSON.stringify(solutionContent);
updateObj["solutionContent"] = solutionContent;
await this.needsolutionDao.update(updateObj, t);
}
} }
//接收方案编号(方案推送至阿里后,接收保存方案信息) //接收方案编号(方案推送至阿里后,接收保存方案信息)
......
...@@ -277,5 +277,29 @@ class BaiduQcService { ...@@ -277,5 +277,29 @@ class BaiduQcService {
return system.getResultSuccess(solutionContent); return system.getResultSuccess(solutionContent);
} }
// //易名退款2021-3-23
// async eNameCloseOrder(pobj){
// console.log('order----eNameCloseOrder',pobj)
// let orderNo
// let note
// orderNo = pobj.actionBody.orderNo
// note = pobj.actionBody.note
// if(!orderNo){
// return system.getResultFail(-1011, "订单号不能为空");
// }
// if(!note){
// return system.getResultFail(-1012, "订单关闭理由不能为空");
// }
// let orderInfo = await this.orderinfoDao.model.findOne({
// where: { channelOrderNo: orderNo }, raw: true
// });
// let UpdateObj = {
// id: orderInfo.id,
// orderStatus: 16,
// orderStatusName:"已退款"
// }
// let res = await this.orderinfoDao.update(UpdateObj);//更新订单
// }
} }
module.exports = BaiduQcService; module.exports = BaiduQcService;
...@@ -250,9 +250,9 @@ class BaseQcService { ...@@ -250,9 +250,9 @@ class BaseQcService {
} else if (needinfo.channelTypeCode == "5") {//icp } else if (needinfo.channelTypeCode == "5") {//icp
ab.solutionContent.solution.IcpType = 1; ab.solutionContent.solution.IcpType = 1;
} else if (needinfo.channelTypeCode == "icpnb") {//icpnb } else if (needinfo.channelTypeCode == "icpnb") {//icpnb
ab.solutionContent.solution.IcpType = 4;
} else if (needinfo.channelTypeCode == "edinb") {//edinb
ab.solutionContent.solution.IcpType = 3; ab.solutionContent.solution.IcpType = 3;
} else if (needinfo.channelTypeCode == "edinb") {//edinb
ab.solutionContent.solution.IcpType = 4;
} else { } else {
return system.getResultFail(-208, "需求业务类型有误"); return system.getResultFail(-208, "需求业务类型有误");
} }
...@@ -549,13 +549,13 @@ class BaseQcService { ...@@ -549,13 +549,13 @@ class BaseQcService {
ab["OfficialFileURL"] = ab.officialFileURL; ab["OfficialFileURL"] = ab.officialFileURL;
} }
//2021-3-18 addNew //2021-3-18 addNew
if (ab.officialFileURL) { if (ab.certificateNumber) {
ab["CertificateNumber"] = ab.certificateNumber; ab["CertificateNumber"] = ab.certificateNumber;
} }
if (ab.officialFileURL) { if (ab.certificateStartTime) {
ab["CertificateStartTime"] = ab.certificateStartTime; ab["CertificateStartTime"] = ab.certificateStartTime;
} }
if (ab.officialFileURL) { if (ab.certificateEndTime) {
ab["CertificateEndTime"] = ab.certificateEndTime; ab["CertificateEndTime"] = ab.certificateEndTime;
} }
...@@ -697,10 +697,20 @@ class BaseQcService { ...@@ -697,10 +697,20 @@ class BaseQcService {
if (solutionContent.status != "GXB_ACCEPT") { if (solutionContent.status != "GXB_ACCEPT") {
return system.getResultFail(-511, "交付流程错误,⼯信部已受理后才能执行此操作"); return system.getResultFail(-511, "交付流程错误,⼯信部已受理后才能执行此操作");
} }
solutionFlowList.push({ if(uappId == "18"){
file: ab.OfficialFileURL || "", solutionFlowList.push({
status: "GXB_SUCCESS", statusName: this.icpSolutionStatusReference.GXB_SUCCESS, updated_at: new Date() file: ab.OfficialFileURL || "", status: "GXB_SUCCESS",
}); statusName: this.icpSolutionStatusReference.GXB_SUCCESS, updated_at: new Date(),
CertificateNumber:ab.CertificateNumber,
CertificateStartTime:ab.CertificateStartTime,
CertificateEndTime:ab.CertificateEndTime
});
}else{
solutionFlowList.push({
file: ab.OfficialFileURL || "",
status: "GXB_SUCCESS", statusName: this.icpSolutionStatusReference.GXB_SUCCESS, updated_at: new Date()
});
}
needsolutioninfo.status = "ywc"; needsolutioninfo.status = "ywc";
solutionContent.status = "GXB_SUCCESS"; solutionContent.status = "GXB_SUCCESS";
solutionContent.statusName = this.icpSolutionStatusReference.GXB_SUCCESS; solutionContent.statusName = this.icpSolutionStatusReference.GXB_SUCCESS;
...@@ -719,16 +729,25 @@ class BaseQcService { ...@@ -719,16 +729,25 @@ class BaseQcService {
} }
solutionContent.solutionFlowList = solutionFlowList; solutionContent.solutionFlowList = solutionFlowList;
var applicationStatusList = solutionContent.applicationStatusList || []; var applicationStatusList = solutionContent.applicationStatusList || [];
var statusObj = { if(uappId == "18"){
"OfficialFileURL": ab.OfficialFileURL || "", var statusObj = {
"ApplicationStatus": ab.ApplicationStatus, "OfficialFileURL": ab.OfficialFileURL || "",
"ApplicationStatusName": this.icpApplicationStatusReference[ab.ApplicationStatus], "ApplicationStatus": ab.ApplicationStatus,
"created_at": new Date(), "ApplicationStatusName": this.icpApplicationStatusReference[ab.ApplicationStatus],
//2021-3-18 addNew "created_at": new Date(),
"CertificateNumber":ab.CertificateNumber || "",//证书编号 //2021-3-18 addNew
"CertificateStartTime":ab.CertificateStartTime || "",//证书有效期 开始时间 "CertificateNumber":ab.CertificateNumber || "",//证书编号
"CertificateEndTime":ab.CertificateEndTime || ""//证书有效期 结束时间 "CertificateStartTime":ab.CertificateStartTime || "",//证书有效期 开始时间
}; "CertificateEndTime":ab.CertificateEndTime || ""//证书有效期 结束时间
};
}else{
var statusObj = {
"OfficialFileURL": ab.OfficialFileURL || "",
"ApplicationStatus": ab.ApplicationStatus,
"ApplicationStatusName": this.icpApplicationStatusReference[ab.ApplicationStatus],
"created_at": new Date()
};
}
applicationStatusList.push(statusObj); applicationStatusList.push(statusObj);
solutionContent.applicationStatusList = applicationStatusList; solutionContent.applicationStatusList = applicationStatusList;
solutionContent.applicationStatus = ab.ApplicationStatus; solutionContent.applicationStatus = ab.ApplicationStatus;
......
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