Commit ed01bcd8 by 陈思聪

fix: 新资质产品接入

parent bfbe91ad
......@@ -4,6 +4,7 @@ const settings = require("../../../../config/settings");
const moment = require("moment");
// const pushTx = require("../../../utils/totxClient")
const pushQft = require("../../../utils/toqifutongClient")
const TOQFT = require("../../../utils/toQft");
class DeliverService extends ServiceBase {
......@@ -287,6 +288,19 @@ class DeliverService extends ServiceBase {
throw new Error("查不到交付单");
}
await this.qualificationDao.createOrUpdate(pobj);
if([system.SERVICECODE.EDI, system.SERVICECODE.ICP,system.SERVICECODE.IDC,system.SERVICECODE.ISP,
system.SERVICECODE.SP ,system.SERVICECODE.CCL,system.SERVICECODE.CDN,system.SERVICECODE.NCBI_AM,system.SERVICECODE.NCBI_lB,system.SERVICECODE.BC,
system.SERVICECODE.IEP,system.SERVICECODE.HRSL,system.SERVICECODE.LDP,system.SERVICECODE.RTPPOL, system.SERVICECODE.PBL_R, system.SERVICECODE.PBL_W,
system.SERVICECODE.CPL, system.SERVICECODE.ISO9001, system.SERVICECODE.ISO14001, system.SERVICECODE.ISO27001, system.SERVICECODE.ISO20000,
system.SERVICECODE.ISO45001,system.SERVICECODE.IONHTE, system.SERVICECODE.SISSM, system.SERVICECODE.SSGEI, system.SERVICECODE.DSCC, system.SERVICECODE.HTACS,
system.SERVICECODE.BL_TMD, system.SERVICECODE.BF_TMD, system.SERVICECODE.IDISL_B, system.SERVICECODE.IDISL_NB, system.SERVICECODE.LPE_2, system.SERVICECODE.LPE_3,
].includes(deliverData.product_code)){
// 新资质产品接入,如果资质信息变化,需要回传材料信息给企服通
if(!([system.SERVICECODE.ICP,system.SERVICECODE.EDI].includes(deliverData.product_code) && ['aliCloud','zc360','baidu','ename'].includes(deliverData.source_number))){
await TOQFT.getClientByTypeAndChannel(deliverData.product_code, deliverData.source_number).submitMaterials(pobj.username, deliverData, null);
}
}
return "SUCCESS"
}
......
......@@ -75,7 +75,12 @@ class NewdeliverService extends ServiceBase {
if (!deliverData) {
throw new Error("查不到此交付单");
}
if ([system.SERVERSESTATUS.COLLECTING, system.SERVERSESTATUS.USERCONFIRMATIONREJECT, system.SERVERSESTATUS.FILLING].includes(deliverData.delivery_status)) {
if([system.SERVICECODE.ICP,system.SERVICECODE.EDI,system.SERVICECODE.WANGWEN,system.SERVICECODE.GUANGBO].includes(deliverData.product_code) && ['aliCloud','zc360','baidu','ename'].includes(deliverData.source_number)){
if ([system.SERVERSESTATUS.COLLECTING, system.SERVERSESTATUS.USERCONFIRMATIONREJECT, system.SERVERSESTATUS.FILLING].includes(deliverData.delivery_status)) {
await TOQFT.getClientByTypeAndChannel(deliverData.product_code, deliverData.source_number).submitMaterials(pobj.username, deliverData, pobj.cache_info);
}
}else{
await TOQFT.getClientByTypeAndChannel(deliverData.product_code, deliverData.source_number).submitMaterials(pobj.username, deliverData, pobj.cache_info);
}
......@@ -130,19 +135,19 @@ class NewdeliverService extends ServiceBase {
let status;
switch (deliverData.delivery_status) {
case system.SERVERSESTATUS.USERCONFIRMATIONRESOLVE:
case system.SERVERSESTATUS.COLLECTSUCCESS:
case system.SERVERSESTATUS.COLLECTSUCCESS: // 完成收集材料
status = system.SERVERSESTATUS.ACCOUNTREGISTRATION;
break
case system.SERVERSESTATUS.ACCOUNTREGISTRATION:
case system.SERVERSESTATUS.ACCOUNTREGISTRATION: // 完成账号注册
status = system.SERVERSESTATUS.SUBMITING;
break
case system.SERVERSESTATUS.SUBMITING:
case system.SERVERSESTATUS.SUBMITING: // 完成递交材料
status = system.SERVERSESTATUS.DISPOSEING;
break
case system.SERVERSESTATUS.DISPOSEING:
case system.SERVERSESTATUS.DISPOSEING: // 工信部已受理
status = system.SERVERSESTATUS.THROUGH;
break
case system.SERVERSESTATUS.THROUGH:
case system.SERVERSESTATUS.THROUGH: // 工信部已通过
status = system.SERVERSESTATUS.SUCCESS;
break
default:
......
......@@ -343,8 +343,40 @@ System.SERVICECODE = {
ICCHANGECASE: "icChangeCase",// 工商变更
OPENBANKACCOUNTCASE: "openBankAccountCase",// 银行开户
REGADDRCASE1: "regAddrCase1",// 注册地址服务(一年期)
AGENTCASE1: "agentCase1" // 代理记账(一年期)
AGENTCASE1: "agentCase1", // 代理记账(一年期)
// 新增资质类产品 start 20220518
IDC: "IDC", // IDC许可证
ISP: "ISP", // ISP许可证
SP : "SP", // SP许可证
CCL: "CCL", // 呼叫中心许可证
CDN: "CDN", // CDN许可证
NCBI_AM: "NCBI_AM" ,// 网络文化经营许可证(动漫、音乐类)
NCBI_lB: "NCBI_lB",// 网络文化经营许可证(直播类)
BC: "BC", // 条形码
IEP: "IEP", // 进出口权
HRSL: "HRSL", // 人力资源服务许可证
LDP: "LDP", // 劳务派遣许可证
RTPPOL: "RTPPOL", // 广播电视节目制作经营许可证
PBL_R: "PBL_R", // 出版物经营许可证(零售)
PBL_W: "PBL_W", // 出版物经营许可证(批发)
CPL: "CPL", // 营业性演出许可证
ISO9001: "ISO9001", // ISO9001质量管理认证体系
ISO14001: "ISO14001", // ISO14001环境管理体系
ISO27001: "ISO27001", // ISO27001信息安全管理体系
ISO20000: "ISO20000", // ISO20000技术服务管理体系
ISO45001: "ISO45001", // ISO45001职业健康管理体系
IONHTE: "IONHTE", // 国家高新企业认定
SISSM: "SISSM", // 专精特新中小企业认定服务
SSGEI: "SSGEI", // 专精特新小巨人企业认定服务
DSCC: "DSCC", // 双软认证咨询
HTACS: "HTACS", // 中关村高新申报咨询服务
BL_TMD: "BL_TMD", // 三类医疗器械经营许可证
BF_TMD: "BF_TMD", // 二类医疗器械经营备案
IDISL_B: "IDISL_B", // 互联网药品信息服务许可证(经营性)
IDISL_NB: "IDISL_NB", // 互联网药品信息服务许可证(非经营性)
LPE_2: "LPE_2", // 等级保护评测(二级)
LPE_3: "LPE_3", // 等级保护评测(三级)
// 新增资质类产品 end 20220518
}
// 商机状态
System.BUSSTATUS = {
......
......@@ -50,6 +50,29 @@ class CommonVatClient extends BaseClient {
let acceptNotifyFileUrl = ''; // 受理通知书url
let certificateFileUrl = ''; // 证书文件url
let status;
switch (deliverData.delivery_status) {
case system.SERVERSESTATUS.COLLECTING: // 收集材料中
case system.SERVERSESTATUS.USERCONFIRMATIONRESOLVE:
case system.SERVERSESTATUS.COLLECTSUCCESS: // 完成材料收集
case system.SERVERSESTATUS.ACCOUNTREGISTRATION: // 完成账号注册
status = this.CIRCUITSTATUS.ACCOUNTREGISTRATION // =>507
break
case system.SERVERSESTATUS.SUBMITING: // 完成递交材料
status = this.CIRCUITSTATUS.SUBMITING // =>508
break
case system.SERVERSESTATUS.DISPOSEING: // 工信部已受理
status = this.CIRCUITSTATUS.THROUGH // => 509
break
case system.SERVERSESTATUS.THROUGH: // 工信部已通过
case system.SERVERSESTATUS.SUCCESS: // 服务已完成
status = this.CIRCUITSTATUS.THROUGH // => 511
break
default:
throw new Error("状态错误");
}
if(!materials || Object.keys(materials).length == 0){
const materialData = await this.newmaterialDao.findOne({
deliver_id: deliverData.id,
......@@ -66,6 +89,18 @@ class CommonVatClient extends BaseClient {
if(materialData && materialData.materialInfo && materialData.materialInfo.materialFile && materialData.materialInfo.materialFile.applyMaterial){
applyMaterial = materialData.materialInfo.materialFile.applyMaterial;
}
}else{
if( materials.businessLicense){
businessLicense = materials.businessLicense;
}
if( materials.recipientInfo){
recipientInfo = materials.recipientInfo;
}
if(materials.materialFile && materials.materialFile.applyMaterial){
applyMaterial = materials.materialFile.applyMaterial;
}
}
const qualificationData = await this.qualificationDao.findOne({
......@@ -73,23 +108,28 @@ class CommonVatClient extends BaseClient {
});
if(qualificationData){
acceptNotifyFileUrl = qualificationData.acceptNotifyFile;
certificateFileUrl = qualificationData.file
if(qualificationData.acceptNotifyFile&&qualificationData.acceptNotifyFile.url){
acceptNotifyFileUrl = qualificationData.acceptNotifyFile.url;
}
if(qualificationData.file&&qualificationData.file.url){
certificateFileUrl = qualificationData.file.url
}
}
const pushParams = {
orderNo: deliverData.delivery_code,
companyName: businessLicense.name != undefined ? businessLicense.name: null,
applyMaterial: applyMaterial.url != undefined ? applyMaterial.url: null,
companyName: businessLicense.name != null && businessLicense.name != undefined && businessLicense.name != '' ? businessLicense.name: null,
applyMaterial: applyMaterial.url !=null && applyMaterial.url != undefined && applyMaterial.url!=''? applyMaterial.url: null,
user: {
name: recipientInfo.name != undefined ? recipientInfo.name: null,
phone: recipientInfo.phone != undefined ? recipientInfo.phone: null,
addr: recipientInfo.addr != undefined ? recipientInfo.addr: null,
name: recipientInfo.name != null && recipientInfo.name != undefined && recipientInfo.name !=''? recipientInfo.name: null,
phone: recipientInfo.phone != null && recipientInfo.phone != undefined && recipientInfo.phone !='' ? recipientInfo.phone: null,
addr: recipientInfo.addr != null &&recipientInfo.addr != undefined && recipientInfo.addr !=''? recipientInfo.addr: null,
},
acceptNotifyFile: acceptNotifyFileUrl != undefined?acceptNotifyFileUrl:null, // 受理通知书
certificateFile: certificateFileUrl!=undefined?certificateFileUrl:null,// 证书文件
expressNum: recipientInfo.expressNum!=undefined?recipientInfo.expressNum:null,
status: null,
acceptNotifyFile: acceptNotifyFileUrl != null && acceptNotifyFileUrl != undefined && acceptNotifyFileUrl != '' ? acceptNotifyFileUrl:null, // 受理通知书
certificateFile: certificateFileUrl!=null && certificateFileUrl!=undefined && certificateFileUrl != '' ? certificateFileUrl:null,// 证书文件
expressNum: recipientInfo.expressNum!=null && recipientInfo.expressNum!=undefined && recipientInfo.expressNum != '' ? recipientInfo.expressNum:null,
status: status,
};
console.log(`【commonVatClient-submitMaterials】开始调用启服通 递交材料 接口(deliveryId=${deliverData.id}),请求参数:`+JSON.stringify(pushParams))
......@@ -120,17 +160,17 @@ class CommonVatClient extends BaseClient {
let status;
switch (deliverData.delivery_status) {
case system.SERVERSESTATUS.USERCONFIRMATIONRESOLVE:
case system.SERVERSESTATUS.COLLECTSUCCESS:
status = this.CIRCUITSTATUS.ACCOUNTREGISTRATION
case system.SERVERSESTATUS.COLLECTSUCCESS: // 完成收集材料 变更为 完成账号注册
status = this.CIRCUITSTATUS.ACCOUNTREGISTRATION // =>507
break
case system.SERVERSESTATUS.ACCOUNTREGISTRATION:
status = this.CIRCUITSTATUS.SUBMITING
case system.SERVERSESTATUS.ACCOUNTREGISTRATION: // 完成账号注册 变更为 完成递交材料
status = this.CIRCUITSTATUS.SUBMITING // => 508
break
case system.SERVERSESTATUS.SUBMITING:
status = this.CIRCUITSTATUS.DISPOSEING
case system.SERVERSESTATUS.SUBMITING: // 完成递交材料 变更为 工信部已受理
status = this.CIRCUITSTATUS.DISPOSEING // => 509
break
case system.SERVERSESTATUS.DISPOSEING:
status = this.CIRCUITSTATUS.THROUGH
case system.SERVERSESTATUS.DISPOSEING: // 工信部已受理 变更为 工信部已通过
status = this.CIRCUITSTATUS.THROUGH // => 511
break
case system.SERVERSESTATUS.THROUGH:
return "SUCCESS"
......@@ -168,22 +208,27 @@ class CommonVatClient extends BaseClient {
});
if(qualificationData){
acceptNotifyFileUrl = qualificationData.acceptNotifyFile;
certificateFileUrl = qualificationData.file
if(qualificationData.acceptNotifyFile&&qualificationData.acceptNotifyFile.url){
acceptNotifyFileUrl = qualificationData.acceptNotifyFile.url;
}
if(qualificationData.file&&qualificationData.file.url){
certificateFileUrl = qualificationData.file.url
}
}
const pushParams = {
orderNo: deliverData.delivery_code,
companyName: businessLicense.name != undefined ? businessLicense.name: null,
applyMaterial: applyMaterial.url != undefined ? applyMaterial.url: null,
companyName: businessLicense.name != null && businessLicense.name != undefined && businessLicense.name != '' ? businessLicense.name: null,
applyMaterial: applyMaterial.url !=null && applyMaterial.url != undefined && applyMaterial.url!='' ? applyMaterial.url: null,
user: {
name: recipientInfo.name != undefined ? recipientInfo.name: null,
phone: recipientInfo.phone != undefined ? recipientInfo.phone: null,
addr: recipientInfo.addr != undefined ? recipientInfo.addr: null,
name: recipientInfo.name != null && recipientInfo.name != undefined && recipientInfo.name !=''? recipientInfo.name: null,
phone: recipientInfo.phone != null && recipientInfo.phone != undefined && recipientInfo.phone !='' ? recipientInfo.phone: null,
addr: recipientInfo.addr != null &&recipientInfo.addr != undefined && recipientInfo.addr !=''? recipientInfo.addr: null,
},
acceptNotifyFile: acceptNotifyFileUrl != undefined?acceptNotifyFileUrl:null, // 受理通知书
certificateFile: certificateFileUrl!=undefined?certificateFileUrl:null,// 证书文件
expressNum: recipientInfo.expressNum!=undefined?recipientInfo.expressNum:null,
acceptNotifyFile: acceptNotifyFileUrl != null && acceptNotifyFileUrl != undefined && acceptNotifyFileUrl != '' ? acceptNotifyFileUrl:null, // 受理通知书
certificateFile: certificateFileUrl!=null && certificateFileUrl!=undefined && certificateFileUrl != '' ? certificateFileUrl:null,// 证书文件
expressNum: recipientInfo.expressNum!=null && recipientInfo.expressNum!=undefined && recipientInfo.expressNum != '' ? recipientInfo.expressNum:null,
status: status
};
......
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