Commit 896bd7ad by 兰国旗

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

parents 3dcad1d3 199b0fcb
...@@ -5,6 +5,7 @@ const uuidv4 = require('uuid/v4'); ...@@ -5,6 +5,7 @@ const uuidv4 = require('uuid/v4');
const md5 = require("MD5"); const md5 = require("MD5");
class APIBase { class APIBase {
constructor() { constructor() {
this.execClientNew = system.getObject("util.execClientNew");
this.logCtl = system.getObject("service.common.oplogSve"); this.logCtl = system.getObject("service.common.oplogSve");
this.exTime = 2 * 3600;//缓存过期时间,2小时 this.exTime = 2 * 3600;//缓存过期时间,2小时
} }
...@@ -44,43 +45,49 @@ class APIBase { ...@@ -44,43 +45,49 @@ class APIBase {
isPassResult.requestId = ""; isPassResult.requestId = "";
return isPassResult; return isPassResult;
} }
var rtn = await this[methodname](pobj, query, req); var result = await this[methodname](pobj, query, req);
if (!result.requestId) {
result.requestId = pobj.RequestId ? pobj.RequestId : pobj.requestId || req.requestId;
}
this.logCtl.createDb({ this.logCtl.createDb({
appid: pobj.appInfo ? pobj.appInfo.uapp_id : "", appid: pobj.appInfo ? pobj.appInfo.uapp_id : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key : "", appkey: pobj.appInfo ? pobj.appInfo.uapp_key : "",
requestId: req.requestId, requestId: req.requestId,
op: req.classname + "/" + methodname, op: req.classname + "/" + methodname,
content: JSON.stringify(pobj), content: JSON.stringify(pobj),
resultInfo: JSON.stringify(rtn), resultInfo: JSON.stringify(result),
clientIp: req.clientIp, clientIp: req.clientIp,
agent: req.uagent, agent: req.uagent,
opTitle: "api服务提供方appKey:" + settings.appKey, opTitle: "api服务提供方appKey:" + settings.appKey,
}); });
rtn.requestId = req.requestId; var tmpResult = pobj.actionType && pobj.actionType.indexOf("List") < 0 ? result : { status: result.status, message: result.message, requestId: result.requestId };
return rtn; this.execClientNew.execLogs("center-order-doexecMethod-reqPath:" + req.path, pobj, "center-order-doexecMethod", tmpResult, null);
return result;
} catch (e) { } catch (e) {
console.log(e.stack, "api调用出现异常,请联系管理员..........") const stackStr = e.stack ? e.stack : JSON.stringify(e);
console.log(stackStr, "api调用出现异常,请联系管理员..........")
this.logCtl.createDb({ this.logCtl.createDb({
appid: pobj.appInfo ? pobj.appInfo.uapp_id : "", appid: pobj.appInfo ? pobj.appInfo.uapp_id : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key : "", appkey: pobj.appInfo ? pobj.appInfo.uapp_key : "",
requestId: req.requestId, requestId: req.requestId,
op: req.classname + "/" + methodname, op: req.classname + "/" + methodname,
content: JSON.stringify(pobj), content: JSON.stringify(pobj),
resultInfo: JSON.stringify(e.stack), resultInfo: stackStr,
clientIp: req.clientIp, clientIp: req.clientIp,
agent: req.uagent, agent: req.uagent,
opTitle: "api调用出现异常,请联系管理员error,appKey:" + settings.appKey, opTitle: "api调用出现异常,请联系管理员error,appKey:" + settings.appKey,
}); });
this.logCtl.error({ // this.logCtl.error({
appid: pobj.appInfo ? pobj.appInfo.uapp_id : "", // appid: pobj.appInfo ? pobj.appInfo.uapp_id : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key : "", // appkey: pobj.appInfo ? pobj.appInfo.uapp_key : "",
requestId: req.requestId, // requestId: req.requestId,
op: req.classname + "/" + methodname, // op: req.classname + "/" + methodname,
content: e.stack, // content: e.stack,
clientIp: pobj.clientIp, // clientIp: pobj.clientIp,
agent: req.uagent, // agent: req.uagent,
optitle: "api调用出现异常,请联系管理员", // optitle: "api调用出现异常,请联系管理员",
}); // });
this.execClientNew.execLogs("center-order-doexecMethod-reqPath异常:" + req.path, pobj, "center-channel-doexecMethod", null, stackStr);
var rtnerror = system.getResultFail(-200, "出现异常,error:" + e.stack); var rtnerror = system.getResultFail(-200, "出现异常,error:" + e.stack);
rtnerror.requestId = req.requestId; rtnerror.requestId = req.requestId;
return rtnerror; return rtnerror;
......
...@@ -5,6 +5,7 @@ class IcAPI extends APIBase { ...@@ -5,6 +5,7 @@ class IcAPI extends APIBase {
constructor() { constructor() {
super(); super();
this.needinfoSve = system.getObject("service.dbneed.needinfoSve"); this.needinfoSve = system.getObject("service.dbneed.needinfoSve");
this.needsolutionSve = system.getObject("service.dbneed.needsolutionSve");
} }
/** /**
* 接口跳转-POST请求 * 接口跳转-POST请求
...@@ -63,6 +64,9 @@ class IcAPI extends APIBase { ...@@ -63,6 +64,9 @@ class IcAPI extends APIBase {
case "getUnCreated":// 获取需求列表 case "getUnCreated":// 获取需求列表
opResult = await this.needinfoSve.getUnCreated(pobj, pobj.actionBody, req); opResult = await this.needinfoSve.getUnCreated(pobj, pobj.actionBody, req);
break; break;
case "createSolution"://创建方案
opResult = await this.needsolutionSve.createNewSolution(pobj);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -26,16 +26,17 @@ class OrderAPI extends APIBase { ...@@ -26,16 +26,17 @@ class OrderAPI extends APIBase {
var opResult = null; var opResult = null;
switch (action_type) { switch (action_type) {
case "addOrder"://创建订单 case "addOrder"://创建订单
this.execClientNew.execLogs("center-order-addOrder-info-1:" + req.path, pobj, "center-order-doexecMethod", null, null);
opResult = await this.addOrder(pobj, pobj.actionBody); opResult = await this.addOrder(pobj, pobj.actionBody);
break; break;
case "getOrderInfo"://获取订单列表信息 case "getOrderInfo"://获取订单列表信息
opResult = await this.orderinfoSve.getOrderInfo(pobj, pobj.actionBody); opResult = await this.orderinfoSve.getOrderInfo(pobj, pobj.actionBody);
break; break;
case "getOrderListByOrderServiceNo"://根据合同号获取子订单 case "getOrderListByOrderServiceNo"://根据合同号获取子订单
opResult = await this.orderinfoSve.getOrderListByOrderServiceNo(pobj,pobj.actionBody); opResult = await this.orderinfoSve.getOrderListByOrderServiceNo(pobj, pobj.actionBody);
break; break;
case "getOrderServiceNoByOrderNo"://根据订单号获取合同号 case "getOrderServiceNoByOrderNo"://根据订单号获取合同号
opResult = await this.orderinfoSve.getOrderServiceNoByOrderNo(pobj,pobj.actionBody); opResult = await this.orderinfoSve.getOrderServiceNoByOrderNo(pobj, pobj.actionBody);
break; break;
case "getOrderDetails"://获取订单详情信息 case "getOrderDetails"://获取订单详情信息
opResult = await this.orderinfoSve.getOrderDetails(pobj, pobj.actionBody); opResult = await this.orderinfoSve.getOrderDetails(pobj, pobj.actionBody);
...@@ -64,8 +65,11 @@ class OrderAPI extends APIBase { ...@@ -64,8 +65,11 @@ class OrderAPI extends APIBase {
case "updateOrderStatusById":// 2020 0923 lin 新增 根据id修改orderStatus,目前用来商标交易更新订单状态 case "updateOrderStatusById":// 2020 0923 lin 新增 根据id修改orderStatus,目前用来商标交易更新订单状态
opResult = await this.orderinfoSve.updateOrderStatusById(pobj, pobj.actionBody); opResult = await this.orderinfoSve.updateOrderStatusById(pobj, pobj.actionBody);
break; break;
case "getOrderByChannelOrderNo":// 2020 1106 lin 新增 根据渠道订单号获取订单
opResult = await this.orderinfoSve.getOrderByChannelOrderNo(pobj, pobj.actionBody);
break;
case "updateOrder": case "updateOrder":
opResult = await this.orderinfoSve.updateOrderById(pobj,pobj.actionBody); opResult = await this.orderinfoSve.updateOrderById(pobj, pobj.actionBody);
break; break;
case "channeldelOrder"://阿里工商注册退款 case "channeldelOrder"://阿里工商注册退款
opResult = await this.orderinfoSve.channeldelOrder(pobj, pobj.actionBody); opResult = await this.orderinfoSve.channeldelOrder(pobj, pobj.actionBody);
...@@ -139,6 +143,7 @@ class OrderAPI extends APIBase { ...@@ -139,6 +143,7 @@ class OrderAPI extends APIBase {
return system.getResult(null, "产品接口参数方法信息有误,20050"); return system.getResult(null, "产品接口参数方法信息有误,20050");
} }
var params = [pobj]; var params = [pobj];
this.execClientNew.execLogs("center-order-addOrder-reflexAction-info-2:", params, "center-order-doexecMethod", null, null);
refResult = await invokeObj[interface_info.method_name].apply(invokeObj, params); refResult = await invokeObj[interface_info.method_name].apply(invokeObj, params);
} }
else if (interface_info.interface_type == "yc") { else if (interface_info.interface_type == "yc") {
......
...@@ -112,6 +112,12 @@ class QcAPI extends APIBase { ...@@ -112,6 +112,12 @@ class QcAPI extends APIBase {
case "receiveOrderStatusNotify"://接收订单状态推送 百度icp 2.3 case "receiveOrderStatusNotify"://接收订单状态推送 百度icp 2.3
opResult = await this.baiduqcSve.receiveOrderStatusNotify(pobj); opResult = await this.baiduqcSve.receiveOrderStatusNotify(pobj);
break; break;
case "icpOrderClose"://关闭ICP订单 百度icp 2.4
opResult = await this.baiduqcSve.icpOrderClose(pobj);
break;
case "addIcpSalesmanInfo"://添加业务员信息,用于直接下单的icp订单
opResult = await this.baiduqcSve.addIcpSalesmanInfo(pobj);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -15,6 +15,7 @@ class OrderInfoDao extends Dao { ...@@ -15,6 +15,7 @@ class OrderInfoDao extends Dao {
"orderNo", "orderNo",
"channelServiceNo", "channelServiceNo",
"channelOrderNo", "channelOrderNo",
"orderServiceNo",
"channelUserId", "channelUserId",
"ownerUserId", "ownerUserId",
"payTime", "payTime",
...@@ -49,5 +50,10 @@ class OrderInfoDao extends Dao { ...@@ -49,5 +50,10 @@ class OrderInfoDao extends Dao {
}; };
return await this.delete(sqlWhere); return await this.delete(sqlWhere);
} }
async addOrderDelivery(data, orderNo, t) {//新增交付信息
const sql = "INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('" +
orderNo + "','" + JSON.stringify(data) + "')";
await this.customInsert(sql, null, t);
}
} }
module.exports = OrderInfoDao; module.exports = OrderInfoDao;
...@@ -4,6 +4,7 @@ const settings = require("../../config/settings"); ...@@ -4,6 +4,7 @@ const settings = require("../../config/settings");
const md5 = require("MD5"); const md5 = require("MD5");
class AppServiceBase { class AppServiceBase {
constructor() { constructor() {
this.execClientNew = system.getObject("util.execClientNew");
this.restClient = system.getObject("util.restClient"); this.restClient = system.getObject("util.restClient");
this.execClient = system.getObject("util.execClient"); this.execClient = system.getObject("util.execClient");
this.cacheManager = system.getObject("db.common.cacheManager"); this.cacheManager = system.getObject("db.common.cacheManager");
...@@ -57,5 +58,18 @@ class AppServiceBase { ...@@ -57,5 +58,18 @@ class AppServiceBase {
var result = JSON.parse(rtn.stdout); var result = JSON.parse(rtn.stdout);
return result; return result;
} }
/**
* 带超时时间的post请求
* @param {*} req 请求信息
* @param {*} params 请求数据-json格式
* @param {*} url 请求地址
* @param {*} ContentType 请求头类型,默认application/json
* @param {*} headData 请求头内容-json格式,如:请求头中传递token,格式:{token:"9098902q849q0434q09439"}
* @param {*} timeOut 超时时间
*/
async execPostByTimeOut(req, params, url, ContentType, headData, timeOut = 60) {
const result = await this.execClientNew.execPostTimeOutByBusiness('app.base', params, url, ContentType, headData, timeOut, req);
return result;
}
} }
module.exports = AppServiceBase; module.exports = AppServiceBase;
const system = require("../../../system"); const system = require("../../../system");
const ServiceBase = require("../../sve.base"); const AppBase = require("../../app.base");
var settings = require("../../../../config/settings"); var settings = require("../../../../config/settings");
class Push360Service { class Push360Service extends AppBase{
constructor() { constructor() {
this.pushlogDao = system.getObject("db.common.pushlogDao"); super()
this.ordercontactsDao = system.getObject("db.dbcorder.ordercontactsDao"); this.ordercontactsDao = system.getObject("db.dbcorder.ordercontactsDao");
this.orderinfoDao = system.getObject("db.dbcorder.orderinfoDao");
this.push360Url = settings.push360Url(); this.push360Url = settings.push360Url();
this.auth360Url = settings.auth360Url(); this.auth360Url = settings.auth360Url();
} }
//推送数据至360 //推送数据至360
async pushTmStatus(actionBody) { async pushTmStatus(actionBody,req) {
let status = 0; let status = 30;
if (actionBody.tmStatus == "WAITCOMMIT" || actionBody.tmStatus == "ddj") { if (actionBody.tmStatus == 3 || actionBody.tmStatus == "ROBOTPAY") {
status = 30;
}
if (actionBody.tmStatus == "ROBOT") {
status = 40; status = 40;
} }
let order_id = actionBody.orderNo; let order_id = actionBody.orderNo;
var result, pushObj, url;
try { try {
var rc = system.getObject("util.execClient"); let rtn = await this.execClient.exec360GetToken(this.auth360Url)
let rtn = await rc.exec360GetToken(this.auth360Url)
if (!rtn || !rtn.stdout) { if (!rtn || !rtn.stdout) {
return system.getResult(null, "restPost data is empty"); return system.getResult(null, "restPost data is empty");
} }
let tokenResult = JSON.parse(rtn.stdout); let tokenResult = JSON.parse(rtn.stdout);
let token = tokenResult.access_token; let token = tokenResult.access_token;
let url = this.push360Url + '/api/v1/eshop/GsbOrderUpdate?token=' + token; url = this.push360Url + 'api/v1/eshop/GsbOrderUpdate?token=' + token;
let pushObj = { pushObj = {
order_id: order_id, order_id: order_id,
status: status status: status
} }
let result = await rc.execPost(pushObj, url); result = await this.execPostByTimeOut(null,pushObj, url);
var logObj = { console.log(result,'--------------result')
appid: "", if (result.status != 0) {
appkey: "", return result;
op: url, }
content: JSON.stringify(actionBody), if (result.data.code != 200) {
resultInfo: result ? JSON.stringify(result) : "" return result.data;
};
if (!result || !result.stdout) {
logObj["returnType"] = "0";
logObj["opTitle"] = "数据推送ali返回失败";
this.pushlogDao.create(logObj);
return system.getResultFail(-502, "execPost data is empty");
} else {
logObj["returnType"] = "1";
logObj["opTitle"] = "数据推送ali返回成功";
this.pushlogDao.create(logObj);
let stdout = JSON.parse(result.stdout);
return system.getResultSuccess(stdout);
} }
return system.getResultSuccess(result.data.data);
} catch (e) { } catch (e) {
this.pushlogDao.create({ this.execClientNew.execLogs({
appid: "", opTitle:"360订单状态推送",
appkey: "", params:actionBody.orderNo,
logLevel: "3", identifyCode: "360TmStatus",
op: this.push360Url, resultInfo:"",
content: JSON.stringify(actionBody), errorInfo: e.stack
resultInfo: JSON.stringify(e.stack), })
returnType: "0",
opTitle: "数据推送360---异常"
});
return system.getResultFail(-500, JSON.stringify(e.stack)); return system.getResultFail(-500, JSON.stringify(e.stack));
} }
} }
...@@ -72,6 +56,12 @@ class Push360Service { ...@@ -72,6 +56,12 @@ class Push360Service {
async sendMessage(actionBody) { async sendMessage(actionBody) {
try { try {
let orderNo = actionBody.orderNo; let orderNo = actionBody.orderNo;
if(!actionBody.registNumInfo){
return system.getResultFail(-1,'')
}
if(!actionBody.officialInfo){
return system.getResultFail(-1,'')
}
//获取联系人信息 //获取联系人信息
let item = await this.ordercontactsDao.getItemByOrderNo(actionBody.orderNo); let item = await this.ordercontactsDao.getItemByOrderNo(actionBody.orderNo);
let deliveryInfo = actionBody.deliveryInfo; let deliveryInfo = actionBody.deliveryInfo;
...@@ -84,60 +74,45 @@ class Push360Service { ...@@ -84,60 +74,45 @@ class Push360Service {
let uploadFileName = actionBody.officialInfo.uploadFileName;//文件名 let uploadFileName = actionBody.officialInfo.uploadFileName;//文件名
let oneNcl = deliveryInfo.nclones[0].code;//大类 let oneNcl = deliveryInfo.nclones[0].code;//大类
let templateId = 1; let templateId = 1;
let failType = { // let failType = {
"2": "商标注册申请补正通知书", // "2": "商标注册申请补正通知书",
"4": "商标注册申请不予受理通知书", // "4": "商标注册申请不予受理通知书",
"5": "商标注册同日申请补送使用证据通知书", // "5": "商标注册同日申请补送使用证据通知书",
"7": "商标驳回通知书", // "7": "商标驳回通知书",
"8": "商标部分驳回通知书", // "8": "商标部分驳回通知书",
"201": "超时未补正" // "201": "超时未补正"
} // }
//
if (failType.hasOwnProperty(actionBody.tmStatus)) { // if (failType.hasOwnProperty(actionBody.tmStatus)) {
templateId = 2; // templateId = 2;
} // }
var rc = system.getObject("util.execClient"); let rtn = await this.execClient.exec360GetToken(this.auth360Url)
let rtn = await rc.exec360GetToken(this.auth360Url)
if (!rtn || !rtn.stdout) { if (!rtn || !rtn.stdout) {
return system.getResult(null, "restPost data is empty"); return system.getResult(null, "restPost data is empty");
} }
let tokenResult = JSON.parse(rtn.stdout); let tokenResult = JSON.parse(rtn.stdout);
let token = tokenResult.access_token; let token = tokenResult.access_token;
let url = this.push360Url + '/api/v1/GsbSendsms'; let url = this.push360Url + 'api/v1/GsbSendsms';
let params = tmName + "|" + oneNcl + "|" + tmRegistNum + "|" + uploadFileName; let params = tmName + "|" + oneNcl + "|" + tmRegistNum + "|" + uploadFileName;
let subData = "token=" + token + "&mobile=" + mobile + "&templated=" + templateId + "&replaceContent=" + params; let subData = "token=" + token + "&mobile=" + mobile + "&templated=" + templateId + "&replaceContent=" + params;
let result = await rc.execGet(subData, url); let result = await this.execClient.execGet(subData, url);
var logObj = { this.execClientNew.execLogs({
appid: "", opTitle:"360短信推送",
appkey: "", params:params,
op: url, identifyCode: "360Message",
content: JSON.stringify(actionBody), resultInfo:result.data,
resultInfo: result ? JSON.stringify(result) : "" errorInfo: ""
}; })
if (!result || !result.stdout) { return system.getResultSuccess()
logObj["returnType"] = "0";
logObj["opTitle"] = "数据推送360返回失败";
this.pushlogDao.create(logObj);
return system.getResultFail(-502, "execPost data is empty");
} else {
logObj["returnType"] = "1";
logObj["opTitle"] = "数据推送360返回成功";
this.pushlogDao.create(logObj);
let stdout = JSON.parse(result.stdout);
return system.getResultSuccess(stdout);
}
} catch (e) { } catch (e) {
this.pushlogDao.create({ this.execClientNew.execLogs({
appid: "", opTitle:"360短信推送",
appkey: "", params:actionBody.orderNo,
logLevel: "3", identifyCode: "360Message",
op: this.push360Url, resultInfo:"",
content: JSON.stringify(actionBody), errorInfo: e.stack
resultInfo: JSON.stringify(e.stack), })
returnType: "0",
opTitle: "数据推送360短信---异常"
});
return system.getResultFail(-500, JSON.stringify(e.stack)); return system.getResultFail(-500, JSON.stringify(e.stack));
} }
} }
......
...@@ -4,67 +4,67 @@ const uuidv4 = require('uuid/v4'); ...@@ -4,67 +4,67 @@ const uuidv4 = require('uuid/v4');
class InternalCallsNotifyService { class InternalCallsNotifyService {
constructor() { constructor() {
this.orderinfoDao = system.getObject("db.dbcorder.orderinfoDao"); this.orderinfoDao = system.getObject("db.dbcorder.orderinfoDao");
this.delivery_status={ this.delivery_status = {
"dqrfa": "待确认方案", "dqrfa": "待确认方案",
"fabtg": "方案不通过", "fabtg": "方案不通过",
"dfwsfw": "待服务", "dfwsfw": "待服务",
"dsccl": "待上传材料", "dsccl": "待上传材料",
"dsh": "待审核", "dsh": "待审核",
"ddj": "待递交", "ddj": "待递交",
"ydj": "已递交", "ydj": "已递交",
"ywc": "已完成" "ywc": "已完成"
}; };
this.statusContrast={ this.statusContrast = {
"WAITCONFIRM":{name:"待确认方案",value:"dqrfa"}, "WAITCONFIRM": { name: "待确认方案", value: "dqrfa" },
"CONFIRMFAIL":{name:"方案不通过",value:"fabtg"}, "CONFIRMFAIL": { name: "方案不通过", value: "fabtg" },
"READY":{name:"待上传材料",value:"dsccl"}, "READY": { name: "待上传材料", value: "dsccl" },
"WAITCOMMIT":{name:"待递交",value:"ddj"}, "WAITCOMMIT": { name: "待递交", value: "ddj" },
"WAITARTIFICIALEXAMINE":{name:"待审核",value:"dsh"}, "WAITARTIFICIALEXAMINE": { name: "待审核", value: "dsh" },
"DOCFINISH": {name:"待审核",value:"dsh"}, "DOCFINISH": { name: "待审核", value: "dsh" },
"AWAITCHECK": {name:"待审核",value:"dsh"}, "AWAITCHECK": { name: "待审核", value: "dsh" },
"COMMITED": {name:"已递交",value:"ydj"}, "COMMITED": { name: "已递交", value: "ydj" },
"ROBOT": {name:"已递交",value:"ydj"}, "ROBOT": { name: "已递交", value: "ydj" },
"ROBOTPAY": {name:"已递交",value:"ydj"}, "ROBOTPAY": { name: "已递交", value: "ydj" },
"RECVCOMMIT": {name:"已递交",value:"ydj"}, "RECVCOMMIT": { name: "已递交", value: "ydj" },
}; };
} }
//接收辅助、担保商标注册信息 //接收辅助、担保商标注册信息
async receiveAssistTmData(pobj){ async receiveAssistTmData(pobj) {
var checkRes = await this.checkParams(pobj); var checkRes = await this.checkParams(pobj);
if(checkRes.status==0){ if (checkRes.status == 0) {
var deliveryData = await this.packagingTmDeliveryData(pobj,null); var deliveryData = await this.packagingTmDeliveryData(pobj, null);
//获取交付信息 //获取交付信息
var orderdeliveryRes = await this.getOrderDelivery(pobj.sourceOrderNo,pobj.serviceNo); var orderdeliveryRes = await this.getOrderDelivery(pobj.sourceOrderNo, pobj.serviceNo);
if(orderdeliveryRes && orderdeliveryRes.length>0){ if (orderdeliveryRes && orderdeliveryRes.length > 0) {
return system.getResult(null,"保存商标订单交付信息失败,存在重复交付信息,不能重复提交,10300"); return system.getResult(null, "保存商标订单交付信息失败,存在重复交付信息,不能重复提交,10300");
} }
this.addOrderDelivery(deliveryData,deliveryData.sourceOrderNo); await this.orderinfoDao.addOrderDelivery(deliveryData, deliveryData.sourceOrderNo);
await this.orderinfoDao.model.update({isSolution:1}, { where: { orderNo: pobj.sourceOrderNo }}); await this.orderinfoDao.model.update({ isSolution: 1 }, { where: { orderNo: pobj.sourceOrderNo } });
return system.getResultSuccess(); return system.getResultSuccess();
}else{ } else {
return checkRes; return checkRes;
} }
} }
//接收辅助、担保商标注册修改信息 //接收辅助、担保商标注册修改信息
async receiveEditAssistTmData(pobj){ async receiveEditAssistTmData(pobj) {
var checkRes = await this.checkParams(pobj); var checkRes = await this.checkParams(pobj);
if(checkRes.status==0){ if (checkRes.status == 0) {
//获取交付信息 //获取交付信息
var orderdeliveryRes = await this.getOrderDelivery(pobj.sourceOrderNo,pobj.serviceNo); var orderdeliveryRes = await this.getOrderDelivery(pobj.sourceOrderNo, pobj.serviceNo);
if(!orderdeliveryRes || orderdeliveryRes.length<1){ if (!orderdeliveryRes || orderdeliveryRes.length < 1) {
return system.getResult(null,"未知交付信息,10150"); return system.getResult(null, "未知交付信息,10150");
} }
var orderdelivery = orderdeliveryRes[0]; var orderdelivery = orderdeliveryRes[0];
var deliveryData = await this.packagingTmDeliveryData(pobj,orderdelivery.deliveryContent); var deliveryData = await this.packagingTmDeliveryData(pobj, orderdelivery.deliveryContent);
this.putOrderDelivery(deliveryData,deliveryData.sourceOrderNo,deliveryData.serviceNo); this.putOrderDelivery(deliveryData, deliveryData.sourceOrderNo, deliveryData.serviceNo);
await this.orderinfoDao.model.update({isSolution:1}, { where: { orderNo: pobj.sourceOrderNo }}); await this.orderinfoDao.model.update({ isSolution: 1 }, { where: { orderNo: pobj.sourceOrderNo } });
return system.getResultSuccess(); return system.getResultSuccess();
}else{ } else {
return checkRes; return checkRes;
} }
} }
//----------------------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------------------
async checkParams(pobj){//参数校验 async checkParams(pobj) {//参数校验
if (!pobj.serviceNo) { if (!pobj.serviceNo) {
return system.getResult(null, "业务单号不能为空不能为空,10100"); return system.getResult(null, "业务单号不能为空不能为空,10100");
} }
...@@ -72,9 +72,9 @@ class InternalCallsNotifyService { ...@@ -72,9 +72,9 @@ class InternalCallsNotifyService {
return system.getResult(null, "来源单号不能为空,10110"); return system.getResult(null, "来源单号不能为空,10110");
} }
var orderinfo = await this.orderinfoDao.model.findOne({ var orderinfo = await this.orderinfoDao.model.findOne({
where:{orderNo:pobj.sourceOrderNo},raw:true where: { orderNo: pobj.sourceOrderNo }, raw: true
}); });
if(!orderinfo || !orderinfo.id){ if (!orderinfo || !orderinfo.id) {
return system.getResult(null, "未知订单,10120"); return system.getResult(null, "未知订单,10120");
} }
if (!pobj.tm) { if (!pobj.tm) {
...@@ -124,15 +124,15 @@ class InternalCallsNotifyService { ...@@ -124,15 +124,15 @@ class InternalCallsNotifyService {
} }
return system.getResultSuccess(pobj); return system.getResultSuccess(pobj);
} }
async packagingTmDeliveryData(pobj,deliveryData) {//重新组装商标交付信息 async packagingTmDeliveryData(pobj, deliveryData) {//重新组装商标交付信息
var deliveryStatusList = []; var deliveryStatusList = [];
if(deliveryData && deliveryData.deliveryStatusList){ if (deliveryData && deliveryData.deliveryStatusList) {
deliveryStatusList = deliveryData.deliveryStatusList; deliveryStatusList = deliveryData.deliveryStatusList;
} }
var nclOne = pobj.nclones[0]; var nclOne = pobj.nclones[0];
if(nclOne.tmStatus){ if (nclOne.tmStatus) {
var deliveryStatusObj = this.statusContrast[nclOne.tmStatus]; var deliveryStatusObj = this.statusContrast[nclOne.tmStatus];
if(deliveryStatusObj && deliveryStatusObj.value){ if (deliveryStatusObj && deliveryStatusObj.value) {
var deliveryStatus = deliveryStatusObj.value; var deliveryStatus = deliveryStatusObj.value;
var deliveryStatusName = deliveryStatusObj.name; var deliveryStatusName = deliveryStatusObj.name;
deliveryStatusList.push({ deliveryStatusList.push({
...@@ -142,7 +142,7 @@ class InternalCallsNotifyService { ...@@ -142,7 +142,7 @@ class InternalCallsNotifyService {
}); });
pobj.deliveryStatus = deliveryStatus; pobj.deliveryStatus = deliveryStatus;
pobj.deliveryStatusName = deliveryStatusName; pobj.deliveryStatusName = deliveryStatusName;
}else{ } else {
deliveryStatusList.push({ deliveryStatusList.push({
deliveryStatus: nclOne.tmStatus, deliveryStatus: nclOne.tmStatus,
deliveryStatusName: nclOne.tmStatus, deliveryStatusName: nclOne.tmStatus,
...@@ -150,23 +150,23 @@ class InternalCallsNotifyService { ...@@ -150,23 +150,23 @@ class InternalCallsNotifyService {
}); });
} }
} }
pobj.deliveryStatusList = deliveryStatusList; pobj.deliveryStatusList = deliveryStatusList;
pobj.opNotes = ""; //操作备注 pobj.opNotes = ""; //操作备注
return pobj; return pobj;
} }
putOrderDelivery(data, orderNo, channelOrderNo) {//修改交付信息 putOrderDelivery(data, orderNo, channelOrderNo) {//修改交付信息
var sql = "UPDATE `c_order_delivery` SET deliveryContent ='" + JSON.stringify(data) + "' where sourceOrderNo='" + orderNo + "'"; var sql = "UPDATE `c_order_delivery` SET deliveryContent ='" + JSON.stringify(data) + "' where sourceOrderNo='" + orderNo + "'";
sql = sql + " and deliveryContent->'$.serviceNo' = '"+channelOrderNo+"'"; sql = sql + " and deliveryContent->'$.serviceNo' = '" + channelOrderNo + "'";
this.orderinfoDao.customUpdate(sql); this.orderinfoDao.customUpdate(sql);
} }
addOrderDelivery(data, orderNo) {//新增交付信息 addOrderDelivery(data, orderNo) {//新增交付信息--废弃,调用dao中的,20201102-sy
var sql = "INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('" + var sql = "INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('" +
orderNo + "','" + JSON.stringify(data) + "')"; orderNo + "','" + JSON.stringify(data) + "')";
this.orderinfoDao.customQuery(sql); this.orderinfoDao.customQuery(sql);
} }
async getOrderDelivery(orderNo,channelOrderNo) {//查询交付信息 async getOrderDelivery(orderNo, channelOrderNo) {//查询交付信息
var sql = "select * from `c_order_delivery` where sourceOrderNo='" + orderNo + "'"; var sql = "select * from `c_order_delivery` where sourceOrderNo='" + orderNo + "'";
sql = sql + " and deliveryContent->'$.serviceNo' = '"+channelOrderNo+"'"; sql = sql + " and deliveryContent->'$.serviceNo' = '" + channelOrderNo + "'";
return await this.orderinfoDao.customQuery(sql); return await this.orderinfoDao.customQuery(sql);
} }
//---------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------
......
...@@ -6,6 +6,7 @@ class OrderInfoService extends ServiceBase { ...@@ -6,6 +6,7 @@ class OrderInfoService extends ServiceBase {
constructor() { constructor() {
super("dbcorder", ServiceBase.getDaoName(OrderInfoService)); super("dbcorder", ServiceBase.getDaoName(OrderInfoService));
this.flowlogDao = system.getObject("db.dbcorder.flowlogDao"); this.flowlogDao = system.getObject("db.dbcorder.flowlogDao");
this.orderinfoDao = system.getObject("db.dbcorder.orderinfoDao");
this.orderproductDao = system.getObject("db.dbcorder.orderproductDao"); this.orderproductDao = system.getObject("db.dbcorder.orderproductDao");
this.ordercontactsDao = system.getObject("db.dbcorder.ordercontactsDao"); this.ordercontactsDao = system.getObject("db.dbcorder.ordercontactsDao");
this.orderReceiptVoucherDao = system.getObject("db.dbcpay.orderreceiptvoucherDao"); this.orderReceiptVoucherDao = system.getObject("db.dbcpay.orderreceiptvoucherDao");
...@@ -82,7 +83,7 @@ class OrderInfoService extends ServiceBase { ...@@ -82,7 +83,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.deliveryData.apply) orderSnapshot: JSON.stringify(actionBody.deliveryData.apply)
}; };
var orderProduct = await this.orderproductDao.create(orderProductObj, t);//订单产品 var orderProduct = await this.orderproductDao.create(orderProductObj, t);//订单产品
var orderReceiptVoucherObj = { var orderReceiptVoucherObj = {
...@@ -118,7 +119,7 @@ class OrderInfoService extends ServiceBase { ...@@ -118,7 +119,7 @@ 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 count = await self.dao.findCount({ where: { channelOrderNo: pobj.actionBody.channelOrder.channelOrderNo } });
if (count > 0) { if (count > 0) {
return system.getResultFail(-1, "订单不能重复创建s"); return system.getResultFail(-1, "订单不能重复创建s");
} }
...@@ -149,7 +150,7 @@ class OrderInfoService extends ServiceBase { ...@@ -149,7 +150,7 @@ 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("re" + pobj.appInfo.uapp_id); var orderNo = await self.getBusUid("re" + pobj.appInfo.uapp_id);
var item = await self.createOrder(pobj, orderNo, t); var item = await self.createOrder(pobj, orderNo, t);
self.addOrderDelivery(pobj.actionBody.deliveryData, orderNo); await self.orderinfoDao.addOrderDelivery(pobj.actionBody.deliveryData, orderNo, t);
return system.getResultSuccess({ return system.getResultSuccess({
orderNo: orderNo, orderNo: orderNo,
channelServiceNo: pobj.actionBody.channelOrder.channelServiceNo || orderNo, channelServiceNo: pobj.actionBody.channelOrder.channelServiceNo || orderNo,
...@@ -202,17 +203,17 @@ class OrderInfoService extends ServiceBase { ...@@ -202,17 +203,17 @@ class OrderInfoService extends ServiceBase {
} }
/** /**
* 新增交付信息 * 新增交付信息--废弃,从dao中调用,20201102-sy
* @param data * @param data
* @param orderNo * @param orderNo
*/ */
addOrderDelivery(data, orderNo) { addOrderDelivery(data, orderNo, t) {
try{ try {
var sql = "INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('" + var sql = "INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('" +
orderNo + "','" + JSON.stringify(data) + "')"; orderNo + "','" + JSON.stringify(data) + "')";
this.customQuery(sql); await this.customInsert(sql);
return system.getResultSuccess(); return system.getResultSuccess();
}catch (e) { } catch (e) {
return system.getResultFail(); return system.getResultFail();
} }
...@@ -225,7 +226,7 @@ class OrderInfoService extends ServiceBase { ...@@ -225,7 +226,7 @@ class OrderInfoService extends ServiceBase {
* @returns {Promise<{msg: *, data: (*|null), status: number}>} * @returns {Promise<{msg: *, data: (*|null), status: number}>}
*/ */
async submitReview(pobj, actionBody) { async submitReview(pobj, actionBody) {
try{ try {
var packagingTmResult = await this.packagingTmReDeliveryData(pobj, pobj.actionBody); var packagingTmResult = await this.packagingTmReDeliveryData(pobj, pobj.actionBody);
if (packagingTmResult.status != 0) { if (packagingTmResult.status != 0) {
return packagingTmResult; return packagingTmResult;
...@@ -236,7 +237,7 @@ class OrderInfoService extends ServiceBase { ...@@ -236,7 +237,7 @@ class OrderInfoService extends ServiceBase {
sql = sql.replace('\n', ''); sql = sql.replace('\n', '');
const result = await this.customUpdate(sql); const result = await this.customUpdate(sql);
return system.getResultSuccess(); return system.getResultSuccess();
}catch (e) { } catch (e) {
return system.getResultFail(); return system.getResultFail();
} }
} }
...@@ -296,11 +297,11 @@ class OrderInfoService extends ServiceBase { ...@@ -296,11 +297,11 @@ class OrderInfoService extends ServiceBase {
sql += ` and json_extract(deliveryContent,'$.apply.askforId')='${actionBody.askforId}'`; sql += ` and json_extract(deliveryContent,'$.apply.askforId')='${actionBody.askforId}'`;
sqlCount += ` and json_extract(deliveryContent,'$.apply.askforId')='${actionBody.askforId}'`; sqlCount += ` and json_extract(deliveryContent,'$.apply.askforId')='${actionBody.askforId}'`;
} }
if(actionBody.applicantName){ if (actionBody.applicantName) {
sql += ` and json_extract(deliveryContent,'$.applyUser.applicantName') like '%${actionBody.applicantName}%'`; sql += ` and json_extract(deliveryContent,'$.applyUser.applicantName') like '%${actionBody.applicantName}%'`;
sqlCount += ` and json_extract(deliveryContent,'$.applyUser.applicantName') like '%${actionBody.applicantName}%'`; sqlCount += ` and json_extract(deliveryContent,'$.applyUser.applicantName') like '%${actionBody.applicantName}%'`;
} }
if(actionBody.status){ if (actionBody.status) {
sql += ` and json_extract(deliveryContent,'$.deliveryStatusName')='${actionBody.status}'`; sql += ` and json_extract(deliveryContent,'$.deliveryStatusName')='${actionBody.status}'`;
sqlCount += ` and json_extract(deliveryContent,'$.deliveryStatusName')='${actionBody.status}'`; sqlCount += ` and json_extract(deliveryContent,'$.deliveryStatusName')='${actionBody.status}'`;
} }
...@@ -332,7 +333,7 @@ class OrderInfoService extends ServiceBase { ...@@ -332,7 +333,7 @@ class OrderInfoService extends ServiceBase {
* @param actionBody * @param actionBody
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
async getOfficialList(pobj,actionBody){ async getOfficialList(pobj, actionBody) {
let pageSize = Number(actionBody.pageSize || 20); let pageSize = Number(actionBody.pageSize || 20);
if (pageSize > 50) { if (pageSize > 50) {
pageSize = 50; pageSize = 50;
...@@ -355,11 +356,11 @@ class OrderInfoService extends ServiceBase { ...@@ -355,11 +356,11 @@ class OrderInfoService extends ServiceBase {
sql += ` and json_extract(officialInfo,'$.askforId')='${actionBody.askforId}'`; sql += ` and json_extract(officialInfo,'$.askforId')='${actionBody.askforId}'`;
sqlCount += ` and json_extract(officialInfo,'$.askforId')='${actionBody.askforId}'`; sqlCount += ` and json_extract(officialInfo,'$.askforId')='${actionBody.askforId}'`;
} }
if (actionBody.applicantName){ if (actionBody.applicantName) {
sql += ` and json_extract(officialInfo,'$.applicantName') like '%${actionBody.applicantName}%'`; sql += ` and json_extract(officialInfo,'$.applicantName') like '%${actionBody.applicantName}%'`;
sqlCount += ` and json_extract(officialInfo,'$.applicantName') like'%${actionBody.applicantName}%'`; sqlCount += ` and json_extract(officialInfo,'$.applicantName') like'%${actionBody.applicantName}%'`;
} }
if(actionBody.fileType){ if (actionBody.fileType) {
sql += ` and json_extract(officialInfo,'$.fileType')='${actionBody.fileType}'`; sql += ` and json_extract(officialInfo,'$.fileType')='${actionBody.fileType}'`;
sqlCount += ` and json_extract(officialInfo,'$.fileType')='${actionBody.fileType}'`; sqlCount += ` and json_extract(officialInfo,'$.fileType')='${actionBody.fileType}'`;
} }
...@@ -390,11 +391,11 @@ class OrderInfoService extends ServiceBase { ...@@ -390,11 +391,11 @@ class OrderInfoService extends ServiceBase {
* @param actionBody * @param actionBody
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
async addOfficial(pobj,actionBody){ async addOfficial(pobj, actionBody) {
if(!actionBody.orderNo){ if (!actionBody.orderNo) {
return system.getResult(null,'orderNo can not be empty'); return system.getResult(null, 'orderNo can not be empty');
} }
try{ try {
let orderSql = `select channelUserId from c_order_info where orderNo = '${actionBody.orderNo}'`; let orderSql = `select channelUserId from c_order_info where orderNo = '${actionBody.orderNo}'`;
let list = await this.customQuery(orderSql); let list = await this.customQuery(orderSql);
if (!list || list.length == 0) { if (!list || list.length == 0) {
...@@ -403,14 +404,14 @@ class OrderInfoService extends ServiceBase { ...@@ -403,14 +404,14 @@ class OrderInfoService extends ServiceBase {
let orderItem = list[0]; let orderItem = list[0];
let data = { let data = {
serviceNo: actionBody.orderNo, serviceNo: actionBody.orderNo,
channelUserId:orderItem.channelUserId, channelUserId: orderItem.channelUserId,
officialInfo: actionBody.officialData, officialInfo: actionBody.officialData,
created_at: new Date(), created_at: new Date(),
updated_at: new Date() updated_at: new Date()
} }
await this.officialDao.create(data); await this.officialDao.create(data);
return system.getResultSuccess(); return system.getResultSuccess();
}catch (e) { } catch (e) {
return system.getResultFail(); return system.getResultFail();
} }
......
...@@ -1251,7 +1251,54 @@ class NeedsolutionService extends ServiceBase { ...@@ -1251,7 +1251,54 @@ class NeedsolutionService extends ServiceBase {
} }
// --------------庄冰2020.10.23-------百度Icp接入使用--------end------------------ // --------------庄冰2020.10.23-------百度Icp接入使用--------end------------------
//创建方案信息
async createNewSolution(pobj){
let ab = pobj.actionBody;
let app = pobj.appInfo;
if (!app || !app.uapp_id) {
return system.getResultFail(-100, "未知渠道");
}
if (!ab.channelSolutionNo) {
return system.getResultFail(-101, "渠道方案编号不能为空");
}
let newNsObj={
orderNo:ab.orderNo,channelSolutionNo:ab.channelSolutionNo,solutionNo:ab.channelSolutionNo,
needNo:ab.bizId,channelNeedNo:ab.bizId,status:"ywc"
};
let newSolutionCount = {
"status": "USER_UPLOADED",
"bizType": ab.product_info && ab.product_info.channel_item_code?ab.product_info.channel_item_code:"",
"solution": {
"Area": ab.product_info.price_item.price_desc || "",
"IcpType": '',
"CompanyName": ab.companyName || "",
"CompanyAddress": ab.area || ""
},
"totalSum": ab.order_info.totalSum || "",
"typeCode": ab.product_info && ab.product_info.channel_item_code?ab.product_info.channel_item_code:"",
"typeName": ab.product_info && ab.product_info.channel_item_name?ab.product_info.channel_item_name:"",
"needStatus": "3",
"statusName": "用户支付",
"customerInfo": {
"publishName": "",
"publishMobile": ""
},
"customerRemark": "",
"needStatusName": "处理中",
"customerMaterial": {},
"solutionFlowList": [
{
"status": "PAID",
"statusName": "用户支付",
"updated_at": new Date()
}
]
};
newNsObj.solutionContent = JSON.stringify(newSolutionCount);
let ns = await this.dao.create(newNsObj);
return system.getResultSuccess(ns)
}
} }
module.exports = NeedsolutionService; module.exports = NeedsolutionService;
// var task = new NeedsolutionService(); // var task = new NeedsolutionService();
......
...@@ -425,9 +425,9 @@ class AliyunQcService { ...@@ -425,9 +425,9 @@ class AliyunQcService {
if (!needsolutioninfo || !needsolutioninfo.id) { if (!needsolutioninfo || !needsolutioninfo.id) {
return system.getResultFail(-400, "未知方案"); return system.getResultFail(-400, "未知方案");
} }
if (!needsolutioninfo.needNo) { // if (!needsolutioninfo.needNo) {
return system.getResultFail(-401, "方案需求信息有误"); // return system.getResultFail(-401, "方案需求信息有误");
} // }
var solutionContent = needsolutioninfo.solutionContent; var solutionContent = needsolutioninfo.solutionContent;
if (!solutionContent) { if (!solutionContent) {
return system.getResultFail(-402, "方案交付信息有误"); return system.getResultFail(-402, "方案交付信息有误");
...@@ -436,16 +436,16 @@ class AliyunQcService { ...@@ -436,16 +436,16 @@ class AliyunQcService {
return system.getResultFail(-403, "用户未上传材料,不能执行此操作"); return system.getResultFail(-403, "用户未上传材料,不能执行此操作");
} }
//获取需求信息 //获取需求信息
var needinfo = await this.needinfoDao.model.findOne({ // var needinfo = await this.needinfoDao.model.findOne({
where: { needNo: needsolutioninfo.needNo }, raw: true // where: { needNo: needsolutioninfo.needNo }, raw: true
}); // });
if (!needinfo || !needinfo.id) { // if (!needinfo || !needinfo.id) {
return system.getResultFail(-201, "未知需求信息"); // return system.getResultFail(-201, "未知需求信息");
} // }
// if (needinfo.status == "ycd" || needinfo.status == "ygb") { // if (needinfo.status == "ycd" || needinfo.status == "ygb") {
if (needinfo.status == "ygb") { // if (needinfo.status == "ygb") {
return system.getResultFail(-202, "该方案需求状态为" + needinfo.statusName + ",不能执行此操作"); // return system.getResultFail(-202, "该方案需求状态为" + needinfo.statusName + ",不能执行此操作");
} // }
var material = ab.material; var material = ab.material;
if (!material.Domain) { if (!material.Domain) {
return system.getResultFail(-101, "备案域名不能为空"); return system.getResultFail(-101, "备案域名不能为空");
...@@ -539,12 +539,14 @@ class AliyunQcService { ...@@ -539,12 +539,14 @@ class AliyunQcService {
if (!solutionContent) { if (!solutionContent) {
return system.getResultFail(-402, "方案交付信息有误"); return system.getResultFail(-402, "方案交付信息有误");
} }
if (solutionContent.applicationStatus && solutionContent.applicationStatus > ab.ApplicationStatus) { // if (solutionContent.applicationStatus && solutionContent.applicationStatus > ab.ApplicationStatus) {
return system.getResultFail(-403, "操作失败,交付流程未按顺序执行"); // return system.getResultFail(-403, "操作失败,交付流程未按顺序执行");
} // }
if (solutionContent.ApplicationStatus && solutionContent.ApplicationStatus == ab.ApplicationStatus) { // if (solutionContent.ApplicationStatus && solutionContent.ApplicationStatus == ab.ApplicationStatus) {
return system.getResultFail(-405, "操作失败,该流程状态已提交,不能重复提交"); // return system.getResultFail(-405, "操作失败,该流程状态已提交,不能重复提交");
} // }
//获取需求信息 //获取需求信息
// var needinfo = await this.needinfoDao.model.findOne({ // var needinfo = await this.needinfoDao.model.findOne({
// where: { needNo: needsolutioninfo.needNo }, raw: true // where: { needNo: needsolutioninfo.needNo }, raw: true
...@@ -558,9 +560,9 @@ class AliyunQcService { ...@@ -558,9 +560,9 @@ class AliyunQcService {
// } // }
var solutionFlowList = solutionContent.solutionFlowList || []; var solutionFlowList = solutionContent.solutionFlowList || [];
if (ab.ApplicationStatus == 507) {//完成账户注册 if (ab.ApplicationStatus == 507) {//完成账户注册
if (solutionContent.status != "USER_CONFIRMED") { // if (solutionContent.status != "USER_CONFIRMED") {
return system.getResultFail(-508, "交付流程错误,用户确认递交⽂件后才能执行此操作"); // return system.getResultFail(-508, "交付流程错误,用户确认递交⽂件后才能执行此操作");
} // }
solutionContent.ApplicationStatus = 507; solutionContent.ApplicationStatus = 507;
solutionFlowList.push({ solutionFlowList.push({
file: ab.OfficialFileURL || "", file: ab.OfficialFileURL || "",
...@@ -570,9 +572,9 @@ class AliyunQcService { ...@@ -570,9 +572,9 @@ class AliyunQcService {
solutionContent.statusName = this.icpSolutionStatusReference.ACCOUNT_REGISTERED; solutionContent.statusName = this.icpSolutionStatusReference.ACCOUNT_REGISTERED;
} }
if (ab.ApplicationStatus == 508) {//"服务商完成提交资料到⼯信部 if (ab.ApplicationStatus == 508) {//"服务商完成提交资料到⼯信部
if (solutionContent.status != "ACCOUNT_REGISTERED") { // if (solutionContent.status != "ACCOUNT_REGISTERED") {
return system.getResultFail(-508, "交付流程错误,请先完成账户注册"); // return system.getResultFail(-508, "交付流程错误,请先完成账户注册");
} // }
solutionFlowList.push({ solutionFlowList.push({
file: ab.OfficialFileURL || "", file: ab.OfficialFileURL || "",
status: "MATERIAL_SUBMITTED", statusName: this.icpSolutionStatusReference.MATERIAL_SUBMITTED, updated_at: new Date() status: "MATERIAL_SUBMITTED", statusName: this.icpSolutionStatusReference.MATERIAL_SUBMITTED, updated_at: new Date()
...@@ -581,9 +583,9 @@ class AliyunQcService { ...@@ -581,9 +583,9 @@ class AliyunQcService {
solutionContent.statusName = this.icpSolutionStatusReference.MATERIAL_SUBMITTED; solutionContent.statusName = this.icpSolutionStatusReference.MATERIAL_SUBMITTED;
} }
if (ab.ApplicationStatus == 509) {//⼯商部已受理 if (ab.ApplicationStatus == 509) {//⼯商部已受理
if (solutionContent.status != "MATERIAL_SUBMITTED") { // if (solutionContent.status != "MATERIAL_SUBMITTED") {
return system.getResultFail(-509, "交付流程错误,请先完成资料递交"); // return system.getResultFail(-509, "交付流程错误,请先完成资料递交");
} // }
solutionFlowList.push({ solutionFlowList.push({
file: ab.OfficialFileURL || "", file: ab.OfficialFileURL || "",
status: "GXB_ACCEPT", statusName: this.icpSolutionStatusReference.GXB_ACCEPT, updated_at: new Date() status: "GXB_ACCEPT", statusName: this.icpSolutionStatusReference.GXB_ACCEPT, updated_at: new Date()
...@@ -592,9 +594,9 @@ class AliyunQcService { ...@@ -592,9 +594,9 @@ class AliyunQcService {
solutionContent.statusName = this.icpSolutionStatusReference.GXB_ACCEPT; solutionContent.statusName = this.icpSolutionStatusReference.GXB_ACCEPT;
} }
if (ab.ApplicationStatus == 510) {//⼯商部不予受理 if (ab.ApplicationStatus == 510) {//⼯商部不予受理
if (solutionContent.status != "MATERIAL_SUBMITTED") { // if (solutionContent.status != "MATERIAL_SUBMITTED") {
return system.getResultFail(-510, "交付流程错误,请先完成资料递交"); // return system.getResultFail(-510, "交付流程错误,请先完成资料递交");
} // }
solutionFlowList.push({ solutionFlowList.push({
file: ab.OfficialFileURL || "", file: ab.OfficialFileURL || "",
status: "GXB_REFUSE", statusName: this.icpSolutionStatusReference.GXB_REFUSE, updated_at: new Date() status: "GXB_REFUSE", statusName: this.icpSolutionStatusReference.GXB_REFUSE, updated_at: new Date()
...@@ -604,9 +606,9 @@ class AliyunQcService { ...@@ -604,9 +606,9 @@ class AliyunQcService {
solutionContent.statusName = this.icpSolutionStatusReference.GXB_REFUSE; solutionContent.statusName = this.icpSolutionStatusReference.GXB_REFUSE;
} }
if (ab.ApplicationStatus == 511) {//⼯商部通过 if (ab.ApplicationStatus == 511) {//⼯商部通过
if (solutionContent.status != "GXB_ACCEPT") { // if (solutionContent.status != "GXB_ACCEPT") {
return system.getResultFail(-511, "交付流程错误,⼯信部已受理后才能执行此操作"); // return system.getResultFail(-511, "交付流程错误,⼯信部已受理后才能执行此操作");
} // }
solutionFlowList.push({ solutionFlowList.push({
file: ab.OfficialFileURL || "", file: ab.OfficialFileURL || "",
status: "GXB_SUCCESS", statusName: this.icpSolutionStatusReference.GXB_SUCCESS, updated_at: new Date() status: "GXB_SUCCESS", statusName: this.icpSolutionStatusReference.GXB_SUCCESS, updated_at: new Date()
...@@ -616,9 +618,9 @@ class AliyunQcService { ...@@ -616,9 +618,9 @@ class AliyunQcService {
solutionContent.statusName = this.icpSolutionStatusReference.GXB_SUCCESS; solutionContent.statusName = this.icpSolutionStatusReference.GXB_SUCCESS;
} }
if (ab.ApplicationStatus == 512) {//⼯信部未通过 if (ab.ApplicationStatus == 512) {//⼯信部未通过
if (solutionContent.status != "GXB_ACCEPT") { // if (solutionContent.status != "GXB_ACCEPT") {
return system.getResultFail(-512, "交付流程错误,⼯信部已受理后才能执行此操作"); // return system.getResultFail(-512, "交付流程错误,⼯信部已受理后才能执行此操作");
} // }
solutionFlowList.push({ solutionFlowList.push({
file: ab.OfficialFileURL || "", file: ab.OfficialFileURL || "",
status: "GXB_FAIL", statusName: this.icpSolutionStatusReference.GXB_FAIL, updated_at: new Date() status: "GXB_FAIL", statusName: this.icpSolutionStatusReference.GXB_FAIL, updated_at: new Date()
......
...@@ -20,6 +20,13 @@ var settings = { ...@@ -20,6 +20,13 @@ var settings = {
usertimeout: 3600,//单位秒 usertimeout: 3600,//单位秒
basepath: path.normalize(path.join(__dirname, '../..')), basepath: path.normalize(path.join(__dirname, '../..')),
port: process.env.NODE_PORT || 4011, port: process.env.NODE_PORT || 4011,
//记录日志地址
opNewLogUrl() {
if (this.env == 'dev') {
return "http://43.247.184.94:7200/center_order_req_log/_doc?pretty";
}
return "http://43.247.184.94:7200/center_order_req_log/_doc?pretty";
},
reqTransferurl: function () { reqTransferurl: function () {
if (this.env == "dev") { if (this.env == "dev") {
return "http://192.168.18.61:3003/"; return "http://192.168.18.61:3003/";
...@@ -42,15 +49,15 @@ var settings = { ...@@ -42,15 +49,15 @@ var settings = {
return "http://gsb.qifu.gongsibao.com:4012/"; return "http://gsb.qifu.gongsibao.com:4012/";
} }
}, },
push360Url:function(){ push360Url: function () {
if(this.env == 'dev'){ if (this.env == 'dev') {
return "http://180.163.239.98:38086/"; return "http://180.163.239.98:38086/";
} else { } else {
return "http://180.163.239.98:38086/"; return "https://tobadminapi.e.360.cn/";
} }
}, },
auth360Url:function(){ auth360Url: function () {
if(this.env == 'dev'){ if (this.env == 'dev') {
return "https://oauth2.e.360.cn/site/token"; return "https://oauth2.e.360.cn/site/token";
} else { } else {
return "https://oauth2.e.360.cn/site/token"; return "https://oauth2.e.360.cn/site/token";
...@@ -64,7 +71,7 @@ var settings = { ...@@ -64,7 +71,7 @@ var settings = {
return 1; return 1;
}, },
}, },
homePage: function () { homePage: function () {
if (this.env == "dev") { if (this.env == "dev") {
var localsettings = require("./localsettings"); var localsettings = require("./localsettings");
...@@ -114,8 +121,8 @@ var settings = { ...@@ -114,8 +121,8 @@ var settings = {
}; };
} }
}, },
addArr: function() { addArr: function () {
return ["南海诸岛", "北京", "天津", "上海", "重庆", "河北", "河南", "云南", "辽宁", "黑龙江", "湖南", "安徽", "山东", "新疆", "江苏", "浙江", "江西", "湖北", "广西", "甘肃", "山西", "内蒙古", "陕西", "吉林", "福建", "贵州", "广东", "青海", "西藏", "四川", "宁夏", "海南", "台湾", "香港", "澳门"] return ["南海诸岛", "北京", "天津", "上海", "重庆", "河北", "河南", "云南", "辽宁", "黑龙江", "湖南", "安徽", "山东", "新疆", "江苏", "浙江", "江西", "湖北", "广西", "甘肃", "山西", "内蒙古", "陕西", "吉林", "福建", "贵州", "广东", "青海", "西藏", "四川", "宁夏", "海南", "台湾", "香港", "澳门"]
} }
}; };
module.exports = settings; module.exports = settings;
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
"after": "^0.8.2", "after": "^0.8.2",
"ali-oss": "^4.12.2", "ali-oss": "^4.12.2",
"aliyun-api-gateway": "^1.1.6", "aliyun-api-gateway": "^1.1.6",
"axios": "^0.21.0",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"base64id": "^1.0.0", "base64id": "^1.0.0",
"bluebird": "^3.5.1", "bluebird": "^3.5.1",
...@@ -57,4 +58,4 @@ ...@@ -57,4 +58,4 @@
"element-theme": "^2.0.1", "element-theme": "^2.0.1",
"element-theme-chalk": "^2.4.0" "element-theme-chalk": "^2.4.0"
} }
} }
\ No newline at end of file
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