Commit f0582082 by 兰国旗

状态/材料逻辑处理

parent a6e5f221
...@@ -1116,7 +1116,180 @@ class RegCenterOrderService { ...@@ -1116,7 +1116,180 @@ class RegCenterOrderService {
var deliveryFlowList = []; var deliveryFlowList = [];
let deliveryContent = {}; let deliveryContent = {};
if (ab.consultType == "GSREG") {//获取交付信息 原始公司注册 var orderInfo = await this.orderinfoDao.model.findOne({
attributes: ["uapp_id", "channelOrderNo"],
where: { orderNo: ab.orderNo }, raw: true
})
console.log("orderInfo+++", orderInfo)
if (orderInfo) {
var uappId = orderInfo.uapp_id;
var channelOrderNo = orderInfo.channelOrderNo
}
//2021-5-18 新增百度公司注册与公司注册套餐区分 start
if (ab.consultType && ab.consultType == "GSREG") {//公司注册
if (ab.ApplicationStatus == 702) {//材料收集环节
if (needsolutioninfo.solutionContent.status != "PAID") {
return system.getResultFail(-702, "交付流程错误,请先完成支付");
}
deliveryContent['ApplicationStatus'] = 702;
solutionFlowList.push({
file: ab.OfficialFileURL || "",
status: "COLLECTING", statusName: this.regSolutionStatus.COLLECTING, updated_at: new Date()
});
deliveryContent.status = "COLLECTING";
deliveryContent.statusName = this.regSolutionStatus.COLLECTING;
}
if (ab.ApplicationStatus == 703) {//工商审核环节
var afterStatusList = [//用户支付后的流程状态
"COLLECTING", "AUDITING", "ENGRAVING", "SUCCESS"
];
if (!deliveryContent.status || afterStatusList.indexOf(deliveryContent.status) < 0) {
return system.getResultFail(-703, "交付流程错误,请先完成材料收集");
}
if (deliveryContent.status == "SUCCESS") {
return system.getResultFail(-706, "该方案已完成,不可更改");
}
deliveryContent['ApplicationStatus'] = 703;
solutionFlowList.push({
file: ab.OfficialFileURL || "",
status: "AUDITING", statusName: this.regSolutionStatus.AUDITING, updated_at: new Date()
});
deliveryContent.status = "AUDITING";
deliveryContent.statusName = this.regSolutionStatus.AUDITING;
console.log('deliveryContent-----sss---', deliveryContent)
console.log('deliveryContent-----ss+++', typeof (deliveryContent))
deliveryContent['deliveryContent'] = deliveryContents
}
if (ab.ApplicationStatus == 704) {//刻章环节
var afterStatusList = [//用户支付后的流程状态
"COLLECTING", "AUDITING", "ENGRAVING", "SUCCESS"
];
if (!deliveryContent.status || afterStatusList.indexOf(deliveryContent.status) < 0) {
return system.getResultFail(-704, "交付流程错误,请先工商审核");
}
if (deliveryContent.status == "SUCCESS") {
return system.getResultFail(-707, "该方案已完成,不可更改");
}
deliveryContent['ApplicationStatus'] = 704;
solutionFlowList.push({
file: ab.OfficialFileURL || "",
status: "ENGRAVING", statusName: this.regSolutionStatus.ENGRAVING, updated_at: new Date()
});
deliveryContent.status = "ENGRAVING";
deliveryContent.statusName = this.regSolutionStatus.ENGRAVING;
}
if (ab.ApplicationStatus == 705) {//已完成
if (deliveryContent.status != "ENGRAVING") {
return system.getResultFail(-705, "交付流程错误,请先刻章");
}
if (deliveryContent.status == "SUCCESS") {
return system.getResultFail(-708, "该方案已完成,不可更改");
}
deliveryContent['ApplicationStatus'] = 705;
solutionFlowList.push({
file: ab.OfficialFileURL || "",
status: "SUCCESS", statusName: this.regSolutionStatus.SUCCESS, updated_at: new Date()
});
deliveryContent.status = "SUCCESS";
needsolutioninfo.status = "ywc";
deliveryContent.statusName = this.regSolutionStatus.SUCCESS;
}
}
if (ab.consultType && ab.consultType == "QYJYTC1" || ab.consultType && ab.consultType == "QYJYTC2") {//公司注册套餐1和公司注册套餐2
if (ab.productType && ab.productType == "GSZZ") {//工商执照
if (ab.ApplicationStatus == 702) {//材料收集环节
if (needsolutioninfo.solutionContent.status != "PAID") {
return system.getResultFail(-702, "交付流程错误,请先完成支付");
}
}
if (ab.ApplicationStatus == 703) {//工商审核环节
var afterStatusList = [//用户支付后的流程状态
"COLLECTING", "AUDITING", "ENGRAVING", "SUCCESS"
];
if (!deliveryContent[ab.productType].channelStatus || afterStatusList.indexOf(deliveryContent[ab.productType].channelStatus) < 0) {
return system.getResultFail(-703, "交付流程错误,请先完成材料收集");
}
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") {
return system.getResultFail(-706, "该方案已完成,不可更改");
}
}
if (ab.ApplicationStatus == 704) {//刻章环节
var afterStatusList = [//用户支付后的流程状态
"COLLECTING", "AUDITING", "ENGRAVING", "SUCCESS"
];
if (!deliveryContent[ab.productType].channelStatus || afterStatusList.indexOf(deliveryContent[ab.productType].channelStatus) < 0) {
return system.getResultFail(-704, "交付流程错误,请先工商审核");
}
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") {
return system.getResultFail(-707, "该方案已完成,不可更改");
}
}
if (ab.ApplicationStatus == 705) {//已完成
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus != "ENGRAVING") {
return system.getResultFail(-705, "交付流程错误,请先刻章");
}
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") {
return system.getResultFail(-708, "该方案已完成,不可更改");
}
}
}
if (ab.productType && ab.productType == "DZFW") {//地址服务
if (ab.ApplicationStatus == 702) {//材料收集环节
if (needsolutioninfo.solutionContent.status != "PAID") {
return system.getResultFail(-702, "交付流程错误,请先完成支付");
}
}
if (ab.ApplicationStatus == 703) {//工商审核环节
var afterStatusList = [//用户支付后的流程状态
"COLLECTING", "AUDITING", "ENGRAVING", "SUCCESS"
];
if (!deliveryContent[ab.productType].channelStatus || afterStatusList.indexOf(deliveryContent[ab.productType].channelStatus) < 0) {
return system.getResultFail(-703, "交付流程错误,请先完成材料收集");
}
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") {
return system.getResultFail(-706, "该方案已完成,不可更改");
}
}
if (ab.ApplicationStatus == 706) {//服务中
var afterStatusList = [//用户支付后的流程状态
"COLLECTING", "AUDITING", "SUCCESS"
];
if (!deliveryContent[ab.productType].channelStatus || afterStatusList.indexOf(deliveryContent[ab.productType].channelStatus) < 0) {
return system.getResultFail(-704, "交付流程错误,请先工商审核");
}
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") {
return system.getResultFail(-707, "该方案已完成,不可更改");
}
}
if (ab.ApplicationStatus == 705) {//已完成
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus != "ACTIVE") {
return system.getResultFail(-705, "交付流程错误,请先变更状态为服务中");
}
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") {
return system.getResultFail(-708, "该方案已完成,不可更改");
}
}
}
if (ab.productType && ab.productType == "YHKH" || ab.productType == "SWBD") {//银行开户、税务报道:有已接单,已完成状态
if (ab.ApplicationStatus == 705) {//服务中
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") {
return system.getResultFail(-707, "该方案已完成,不可更改");
}
}
}
if (ab.productType && ab.productType == "DLJZ") {//代理记账:有已接单,服务中,已完成状态
if (ab.ApplicationStatus == 706) {//服务中
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") {
return system.getResultFail(-707, "该方案已完成,不可更改");
}
}
}
}
//2021-5-18 新增百度公司注册与公司注册套餐区分 end
if (ab.consultType && ab.consultType == "GSREG") {
if (orderdeliveryInfo[0] && orderdeliveryInfo[0].deliveryContent) {//如果存在交付信息的话就去进行逻辑判断 if (orderdeliveryInfo[0] && orderdeliveryInfo[0].deliveryContent) {//如果存在交付信息的话就去进行逻辑判断
deliveryContent = orderdeliveryInfo[0].deliveryContent; deliveryContent = orderdeliveryInfo[0].deliveryContent;
if (deliveryContent && deliveryContent.status && deliveryContent.ApplicationStatus && deliveryContent.solutionFlowList) { if (deliveryContent && deliveryContent.status && deliveryContent.ApplicationStatus && deliveryContent.solutionFlowList) {
...@@ -1132,7 +1305,19 @@ class RegCenterOrderService { ...@@ -1132,7 +1305,19 @@ class RegCenterOrderService {
deliveryContent = needsolutioninfo.solutionContent; deliveryContent = needsolutioninfo.solutionContent;
solutionFlowList = needsolutioninfo.solutionContent.solutionFlowList solutionFlowList = needsolutioninfo.solutionContent.solutionFlowList
} }
} else {//获取交付信息 公司注册套餐1和公司注册套餐2 大类 deliveryContent.solutionFlowList = solutionFlowList;
let applicationStatusList = deliveryContent.applicationStatusList || [];
let statusObj = {
"OfficialFileURL": ab.OfficialFileURL || "",
"ApplicationStatus": ab.ApplicationStatus,
"ApplicationStatusName": this.regSolutionStatus[ab.ApplicationStatus],
"created_at": new Date().Format("yyyy-MM-dd hh:mm:ss")
};
applicationStatusList.push(statusObj);
deliveryContent.applicationStatusList = applicationStatusList;
deliveryContent["applicationStatus"] = ab.applicationStatus;
}
else {
if (orderdeliveryInfo[0] && orderdeliveryInfo[0].deliveryContent) {//如果存在交付信息的话就去进行逻辑判断 if (orderdeliveryInfo[0] && orderdeliveryInfo[0].deliveryContent) {//如果存在交付信息的话就去进行逻辑判断
deliveryContent = orderdeliveryInfo[0].deliveryContent; deliveryContent = orderdeliveryInfo[0].deliveryContent;
if (deliveryContent && deliveryContent[ab.productType] && deliveryContent[ab.productType].status && deliveryContent[ab.productType].deliveryFlowList) { if (deliveryContent && deliveryContent[ab.productType] && deliveryContent[ab.productType].status && deliveryContent[ab.productType].deliveryFlowList) {
...@@ -1316,196 +1501,6 @@ class RegCenterOrderService { ...@@ -1316,196 +1501,6 @@ class RegCenterOrderService {
break; break;
} }
} }
}
var orderInfo = await this.orderinfoDao.model.findOne({
attributes: ["uapp_id", "channelOrderNo"],
where: { orderNo: ab.orderNo }, raw: true
})
console.log("orderInfo+++", orderInfo)
if (orderInfo) {
var uappId = orderInfo.uapp_id;
var channelOrderNo = orderInfo.channelOrderNo
}
//2021-5-18 新增百度公司注册与公司注册套餐区分 start
if (ab.consultType && ab.consultType == "GSREG") {//公司注册
if (ab.ApplicationStatus == 702) {//材料收集环节
if (needsolutioninfo.solutionContent.status != "PAID") {
return system.getResultFail(-702, "交付流程错误,请先完成支付");
}
deliveryContent['ApplicationStatus'] = 702;
solutionFlowList.push({
file: ab.OfficialFileURL || "",
status: "COLLECTING", statusName: this.regSolutionStatus.COLLECTING, updated_at: new Date()
});
deliveryContent.status = "COLLECTING";
deliveryContent.statusName = this.regSolutionStatus.COLLECTING;
}
if (ab.ApplicationStatus == 703) {//工商审核环节
var afterStatusList = [//用户支付后的流程状态
"COLLECTING", "AUDITING", "ENGRAVING", "SUCCESS"
];
if (!deliveryContent.status || afterStatusList.indexOf(deliveryContent.status) < 0) {
return system.getResultFail(-703, "交付流程错误,请先完成材料收集");
}
if (deliveryContent.status == "SUCCESS") {
return system.getResultFail(-706, "该方案已完成,不可更改");
}
deliveryContent['ApplicationStatus'] = 703;
solutionFlowList.push({
file: ab.OfficialFileURL || "",
status: "AUDITING", statusName: this.regSolutionStatus.AUDITING, updated_at: new Date()
});
deliveryContent.status = "AUDITING";
deliveryContent.statusName = this.regSolutionStatus.AUDITING;
console.log('deliveryContent-----sss---', deliveryContent)
console.log('deliveryContent-----ss+++', typeof (deliveryContent))
deliveryContent['deliveryContent'] = deliveryContents
}
if (ab.ApplicationStatus == 704) {//刻章环节
var afterStatusList = [//用户支付后的流程状态
"COLLECTING", "AUDITING", "ENGRAVING", "SUCCESS"
];
if (!deliveryContent.status || afterStatusList.indexOf(deliveryContent.status) < 0) {
return system.getResultFail(-704, "交付流程错误,请先工商审核");
}
if (deliveryContent.status == "SUCCESS") {
return system.getResultFail(-707, "该方案已完成,不可更改");
}
deliveryContent['ApplicationStatus'] = 704;
solutionFlowList.push({
file: ab.OfficialFileURL || "",
status: "ENGRAVING", statusName: this.regSolutionStatus.ENGRAVING, updated_at: new Date()
});
deliveryContent.status = "ENGRAVING";
deliveryContent.statusName = this.regSolutionStatus.ENGRAVING;
}
if (ab.ApplicationStatus == 705) {//已完成
if (deliveryContent.status != "ENGRAVING") {
return system.getResultFail(-705, "交付流程错误,请先刻章");
}
if (deliveryContent.status == "SUCCESS") {
return system.getResultFail(-708, "该方案已完成,不可更改");
}
deliveryContent['ApplicationStatus'] = 705;
solutionFlowList.push({
file: ab.OfficialFileURL || "",
status: "SUCCESS", statusName: this.regSolutionStatus.SUCCESS, updated_at: new Date()
});
deliveryContent.status = "SUCCESS";
needsolutioninfo.status = "ywc";
deliveryContent.statusName = this.regSolutionStatus.SUCCESS;
}
}
if (ab.consultType && ab.consultType == "QYJYTC1" || ab.consultType && ab.consultType == "QYJYTC2") {//公司注册套餐1和公司注册套餐2
if (ab.productType && ab.productType == "GSZZ") {//工商执照
if (ab.ApplicationStatus == 702) {//材料收集环节
if (needsolutioninfo.solutionContent.status != "PAID") {
return system.getResultFail(-702, "交付流程错误,请先完成支付");
}
}
if (ab.ApplicationStatus == 703) {//工商审核环节
var afterStatusList = [//用户支付后的流程状态
"COLLECTING", "AUDITING", "ENGRAVING", "SUCCESS"
];
if (!deliveryContent[ab.productType].channelStatus || afterStatusList.indexOf(deliveryContent[ab.productType].channelStatus) < 0) {
return system.getResultFail(-703, "交付流程错误,请先完成材料收集");
}
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") {
return system.getResultFail(-706, "该方案已完成,不可更改");
}
}
if (ab.ApplicationStatus == 704) {//刻章环节
var afterStatusList = [//用户支付后的流程状态
"COLLECTING", "AUDITING", "ENGRAVING", "SUCCESS"
];
if (!deliveryContent[ab.productType].channelStatus || afterStatusList.indexOf(deliveryContent[ab.productType].channelStatus) < 0) {
return system.getResultFail(-704, "交付流程错误,请先工商审核");
}
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") {
return system.getResultFail(-707, "该方案已完成,不可更改");
}
}
if (ab.ApplicationStatus == 705) {//已完成
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus != "ENGRAVING") {
return system.getResultFail(-705, "交付流程错误,请先刻章");
}
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") {
return system.getResultFail(-708, "该方案已完成,不可更改");
}
}
}
if (ab.productType && ab.productType == "DZFW") {//地址服务
if (ab.ApplicationStatus == 702) {//材料收集环节
if (needsolutioninfo.solutionContent.status != "PAID") {
return system.getResultFail(-702, "交付流程错误,请先完成支付");
}
}
if (ab.ApplicationStatus == 703) {//工商审核环节
var afterStatusList = [//用户支付后的流程状态
"COLLECTING", "AUDITING", "ENGRAVING", "SUCCESS"
];
if (!deliveryContent[ab.productType].channelStatus || afterStatusList.indexOf(deliveryContent[ab.productType].channelStatus) < 0) {
return system.getResultFail(-703, "交付流程错误,请先完成材料收集");
}
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") {
return system.getResultFail(-706, "该方案已完成,不可更改");
}
}
if (ab.ApplicationStatus == 706) {//服务中
var afterStatusList = [//用户支付后的流程状态
"COLLECTING", "AUDITING", "SUCCESS"
];
if (!deliveryContent[ab.productType].channelStatus || afterStatusList.indexOf(deliveryContent[ab.productType].channelStatus) < 0) {
return system.getResultFail(-704, "交付流程错误,请先工商审核");
}
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") {
return system.getResultFail(-707, "该方案已完成,不可更改");
}
}
if (ab.ApplicationStatus == 705) {//已完成
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus != "ACTIVE") {
return system.getResultFail(-705, "交付流程错误,请先变更状态为服务中");
}
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") {
return system.getResultFail(-708, "该方案已完成,不可更改");
}
}
}
if (ab.productType && ab.productType == "YHKH" || ab.productType == "SWBD") {//银行开户、税务报道:有已接单,已完成状态
if (ab.ApplicationStatus == 705) {//服务中
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") {
return system.getResultFail(-707, "该方案已完成,不可更改");
}
}
}
if (ab.productType && ab.productType == "DLJZ") {//代理记账:有已接单,服务中,已完成状态
if (ab.ApplicationStatus == 706) {//服务中
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") {
return system.getResultFail(-707, "该方案已完成,不可更改");
}
}
}
}
//2021-5-18 新增百度公司注册与公司注册套餐区分 end
if (ab.consultType && ab.consultType == "GSREG") {
deliveryContent.solutionFlowList = solutionFlowList;
let applicationStatusList = deliveryContent.applicationStatusList || [];
let statusObj = {
"OfficialFileURL": ab.OfficialFileURL || "",
"ApplicationStatus": ab.ApplicationStatus,
"ApplicationStatusName": this.regSolutionStatus[ab.ApplicationStatus],
"created_at": new Date().Format("yyyy-MM-dd hh:mm:ss")
};
applicationStatusList.push(statusObj);
deliveryContent.applicationStatusList = applicationStatusList;
deliveryContent["applicationStatus"] = ab.applicationStatus;
}
else {
deliveryContent[ab.productType].deliveryFlowList.push({ deliveryContent[ab.productType].deliveryFlowList.push({
status: ab.ApplicationStatus, status: ab.ApplicationStatus,
statusName: this.regDeliveryStatusName[ab.ApplicationStatus], statusName: this.regDeliveryStatusName[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