Commit cb2750ac by 兰国旗

状态逻辑整理

parent ff75d910
...@@ -1117,6 +1117,7 @@ class RegCenterOrderService { ...@@ -1117,6 +1117,7 @@ class RegCenterOrderService {
let solutionFlowList = []; let solutionFlowList = [];
var deliveryFlowList = []; var deliveryFlowList = [];
let deliveryContent = {}; let deliveryContent = {};
var applicationStatusList
var orderInfo = await this.orderinfoDao.model.findOne({ var orderInfo = await this.orderinfoDao.model.findOne({
attributes: ["uapp_id", "channelOrderNo"], attributes: ["uapp_id", "channelOrderNo"],
...@@ -1127,306 +1128,373 @@ class RegCenterOrderService { ...@@ -1127,306 +1128,373 @@ class RegCenterOrderService {
var uappId = orderInfo.uapp_id; var uappId = orderInfo.uapp_id;
var channelOrderNo = orderInfo.channelOrderNo var channelOrderNo = orderInfo.channelOrderNo
} }
// if (orderdeliveryInfo[0] && orderdeliveryInfo[0].deliveryContent) {//如果存在交付信息的话就去进行逻辑判断
// deliveryContent = orderdeliveryInfo[0].deliveryContent;
// } else {
// if (ab.consultType == "QYJYTC1") {
// bizTypeName = "企业经营套餐一"
// }
// if (ab.consultType == "QYJYTC2") {
// bizTypeName = "企业经营套餐二"
// }
// switch (productType) { //判断是否有交付信息
// case "GSZZ": if (orderdeliveryInfo[0] && orderdeliveryInfo[0].deliveryContent) {
// deliveryContent['GSZZ'] = { deliveryContent = orderdeliveryInfo[0].deliveryContent;
// bizType: ab.consultType, //判断大类是否是套餐
// bizTypeName: bizTypeName, if (ab.consultType && ab.consultType == "GSREG") {//非套餐
// productType: productType, if (deliveryContent && deliveryContent.status && deliveryContent.ApplicationStatus && deliveryContent.solutionFlowList) {
// productTypeName: "工商执照", // if (this.regStatus[deliveryContent.status] && this.regStatus[deliveryContent.status] > ab.ApplicationStatus) {
// status: ab.ApplicationStatus, // return system.getResultFail(-403, "操作失败,交付流程未按顺序执行");
// statusName: this.regDeliveryStatusName[ab.ApplicationStatus], // }
// channelStatus: this.regDeliveryStatus[ab.ApplicationStatus], if (this.regStatus[deliveryContent.ApplicationStatus] && this.regStatus[deliveryContent.ApplicationStatus] == ab.ApplicationStatus && ab.ApplicationStatus == 705) {
// customerInfo: needsolutioninfo.solutionContent.customerInfo, return system.getResultFail(-405, "操作失败,该方案已完成,不能更改");
// update_at: new Date().Format("yyyy-MM-dd hh:mm:ss"), }
// officialFile: ab.officialFile || "", if (ab.ApplicationStatus == 702) {//材料收集环节
// deliveryFlowList: [] if (needsolutioninfo.solutionContent.status != "PAID") {
// } return system.getResultFail(-702, "交付流程错误,请先完成支付");
// break; }
deliveryContent['ApplicationStatus'] = 702;
// case "YHKH": solutionFlowList.push({
// deliveryContent['YHKH'] = { file: ab.OfficialFileURL || "",
// bizType: ab.consultType, status: "COLLECTING", statusName: this.regSolutionStatus.COLLECTING, updated_at: new Date()
// bizTypeName: bizTypeName, });
// productType: productType, deliveryContent.status = "COLLECTING";
// productTypeName: "银行开户", deliveryContent.statusName = this.regSolutionStatus.COLLECTING;
// status: ab.ApplicationStatus, }
// statusName: this.regDeliveryStatusName[ab.ApplicationStatus], if (ab.ApplicationStatus == 703) {//工商审核环节
// channelStatus: this.regDeliveryStatus[ab.ApplicationStatus], var afterStatusList = [//用户支付后的流程状态
// update_at: new Date().Format("yyyy-MM-dd hh:mm:ss"), "COLLECTING", "AUDITING", "ENGRAVING", "SUCCESS"
// officialFile: ab.officialFile || "", ];
// deliveryFlowList: [] if (!deliveryContent.status || afterStatusList.indexOf(deliveryContent.status) < 0) {
// } return system.getResultFail(-703, "交付流程错误,请先完成材料收集");
// break; }
if (deliveryContent.status == "SUCCESS") {
// case "SWBD": return system.getResultFail(-706, "该方案已完成,不可更改");
// deliveryContent['SWBD'] = { }
// bizType: ab.consultType, deliveryContent['ApplicationStatus'] = 703;
// bizTypeName: bizTypeName, solutionFlowList.push({
// productType: productType, file: ab.OfficialFileURL || "",
// productTypeName: "税务报道", status: "AUDITING", statusName: this.regSolutionStatus.AUDITING, updated_at: new Date()
// status: ab.ApplicationStatus, });
// statusName: this.regDeliveryStatusName[ab.ApplicationStatus], deliveryContent.status = "AUDITING";
// channelStatus: this.regDeliveryStatus[ab.ApplicationStatus], deliveryContent.statusName = this.regSolutionStatus.AUDITING;
// update_at: new Date().Format("yyyy-MM-dd hh:mm:ss"), console.log('deliveryContent-----sss---', deliveryContent)
// officialFile: ab.officialFile || "", console.log('deliveryContent-----ss+++', typeof (deliveryContent))
// deliveryFlowList: [] deliveryContent['deliveryContent'] = deliveryContents
// } }
// break; if (ab.ApplicationStatus == 704) {//刻章环节
var afterStatusList = [//用户支付后的流程状态
// case "DLJZ": "COLLECTING", "AUDITING", "ENGRAVING", "SUCCESS"
// deliveryContent['DLJZ'] = { ];
// bizType: ab.consultType, if (!deliveryContent.status || afterStatusList.indexOf(deliveryContent.status) < 0) {
// bizTypeName: bizTypeName, return system.getResultFail(-704, "交付流程错误,请先工商审核");
// productType: productType, }
// productTypeName: "代理记账", if (deliveryContent.status == "SUCCESS") {
// status: ab.ApplicationStatus, return system.getResultFail(-707, "该方案已完成,不可更改");
// statusName: this.regDeliveryStatusName[ab.ApplicationStatus], }
// channelStatus: this.regDeliveryStatus[ab.ApplicationStatus], deliveryContent['ApplicationStatus'] = 704;
// update_at: new Date().Format("yyyy-MM-dd hh:mm:ss"), solutionFlowList.push({
// officialFile: ab.officialFile || "", file: ab.OfficialFileURL || "",
// deliveryFlowList: [] status: "ENGRAVING", statusName: this.regSolutionStatus.ENGRAVING, updated_at: new Date()
// } });
// break; deliveryContent.status = "ENGRAVING";
deliveryContent.statusName = this.regSolutionStatus.ENGRAVING;
// case "DZFW": }
// deliveryContent['DZFW'] = { if (ab.ApplicationStatus == 705) {//已完成
// bizType: ab.consultType, if (deliveryContent.status != "ENGRAVING") {
// bizTypeName: bizTypeName, return system.getResultFail(-705, "交付流程错误,请先刻章");
// productType: productType, }
// productTypeName: "地址服务", if (deliveryContent.status == "SUCCESS") {
// status: ab.ApplicationStatus, return system.getResultFail(-708, "该方案已完成,不可更改");
// statusName: this.regDeliveryStatusName[ab.ApplicationStatus], }
// channelStatus: this.regDeliveryStatus[ab.ApplicationStatus], deliveryContent['ApplicationStatus'] = 705;
// update_at: new Date().Format("yyyy-MM-dd hh:mm:ss"), solutionFlowList.push({
// officialFile: ab.officialFile || "", file: ab.OfficialFileURL || "",
// deliveryFlowList: [] status: "SUCCESS", statusName: this.regSolutionStatus.SUCCESS, updated_at: new Date()
// } });
// break; deliveryContent.status = "SUCCESS";
// } needsolutioninfo.status = "ywc";
// } deliveryContent.statusName = this.regSolutionStatus.SUCCESS;
//2021-5-18 新增百度公司注册与公司注册套餐区分 start }
if (ab.consultType && ab.consultType == "GSREG") {//公司注册 solutionFlowList = deliveryContent.solutionFlowList || [];
if (ab.ApplicationStatus == 702) {//材料收集环节 applicationStatusList = deliveryContent.applicationStatusList || [];
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 (ab.consultType && ab.consultType == "QYJYTC1" || ab.consultType && ab.consultType == "QYJYTC2") {//公司注册套餐1和公司注册套餐2
if (deliveryContent.status != "ENGRAVING") { if (ab.productType && ab.productType == "GSZZ") {//工商执照
return system.getResultFail(-705, "交付流程错误,请先刻章"); 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] || 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 (deliveryContent.status == "SUCCESS") { if (ab.productType && ab.productType == "DZFW") {//地址服务
return system.getResultFail(-708, "该方案已完成,不可更改"); 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, "该方案已完成,不可更改");
}
}
} }
deliveryContent['ApplicationStatus'] = 705; if (ab.productType && ab.productType == "YHKH" || ab.productType == "SWBD") {//银行开户、税务报道:有已接单,已完成状态
solutionFlowList.push({ if (ab.ApplicationStatus == 705) {//已完成
file: ab.OfficialFileURL || "", if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") {
status: "SUCCESS", statusName: this.regSolutionStatus.SUCCESS, updated_at: new Date() return system.getResultFail(-707, "该方案已完成,不可更改");
}); }
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) {//工商审核环节 if (ab.productType && ab.productType == "DLJZ") {//代理记账:有已接单,服务中,已完成状态
var afterStatusList = [//用户支付后的流程状态 if (ab.ApplicationStatus == 706) {//服务中
"COLLECTING", "AUDITING", "ENGRAVING", "SUCCESS" if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "ACTIVE") {
]; return system.getResultFail(-707, "该交付单已在服务中,不能重复提交");
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") { if (ab.ApplicationStatus == 705) {//已完成
return system.getResultFail(-706, "该方案已完成,不可更改"); if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") {
return system.getResultFail(-707, "该交付单已在服务中,不能重复提交");
}
} }
} }
if (ab.ApplicationStatus == 704) {//刻章环节 //如果存在交付信息的话就去进行逻辑判断
var afterStatusList = [//用户支付后的流程状态 if (deliveryContent && deliveryContent[ab.productType] && deliveryContent[ab.productType].status && deliveryContent[ab.productType].deliveryFlowList) {
"COLLECTING", "AUDITING", "ENGRAVING", "SUCCESS" if (this.regStatus[deliveryContent.ApplicationStatus] && this.regStatus[deliveryContent.ApplicationStatus] == ab.ApplicationStatus && ab.ApplicationStatus == 705) {
]; return system.getResultFail(-406, "操作失败,该交付已完成,不能更改");
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") { deliveryFlowList = deliveryContent[ab.productType].solutionFlowList || [];
return system.getResultFail(-707, "该方案已完成,不可更改"); } else {//如果交付信息不存在的话就去进行赋值
let startTime
let endTime
if (ab.startTime) {
startTime = (new Date(ab.startTime * 1000)).Format("yyyy-MM-dd hh:mm:ss")
} }
} if (ab.startTime) {
if (ab.ApplicationStatus == 705) {//已完成 endTime = (new Date(ab.endTime * 1000)).Format("yyyy-MM-dd hh:mm:ss")
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") { if (ab.consultType == "QYJYTC1") {
return system.getResultFail(-708, "该方案已完成,不可更改"); bizTypeName = "企业经营套餐一"
}
if (ab.consultType == "QYJYTC2") {
bizTypeName = "企业经营套餐二"
}
switch (productType) {
case "GSZZ":
deliveryContent['GSZZ'] = {
bizType: ab.consultType,
bizTypeName: bizTypeName,
productType: productType,
productTypeName: "工商执照",
status: ab.ApplicationStatus,
statusName: this.regDeliveryStatusName[ab.ApplicationStatus],
channelStatus: this.regDeliveryStatus[ab.ApplicationStatus],
customerInfo: needsolutioninfo.solutionContent.customerInfo,
update_at: new Date().Format("yyyy-MM-dd hh:mm:ss"),
officialFile: ab.officialFile || "",
deliveryFlowList: []
}
break;
case "YHKH":
deliveryContent['YHKH'] = {
bizType: ab.consultType,
bizTypeName: bizTypeName,
productType: productType,
productTypeName: "银行开户",
status: ab.ApplicationStatus,
statusName: this.regDeliveryStatusName[ab.ApplicationStatus],
channelStatus: this.regDeliveryStatus[ab.ApplicationStatus],
update_at: new Date().Format("yyyy-MM-dd hh:mm:ss"),
officialFile: ab.officialFile || "",
deliveryFlowList: []
}
break;
case "SWBD":
deliveryContent['SWBD'] = {
bizType: ab.consultType,
bizTypeName: bizTypeName,
productType: productType,
productTypeName: "税务报道",
status: ab.ApplicationStatus,
statusName: this.regDeliveryStatusName[ab.ApplicationStatus],
channelStatus: this.regDeliveryStatus[ab.ApplicationStatus],
update_at: new Date().Format("yyyy-MM-dd hh:mm:ss"),
officialFile: ab.officialFile || "",
deliveryFlowList: []
}
break;
case "DLJZ":
deliveryContent['DLJZ'] = {
bizType: ab.consultType,
bizTypeName: bizTypeName,
productType: productType,
productTypeName: "代理记账",
startTime: startTime || "",
endTime: endTime || "",
status: ab.ApplicationStatus,
statusName: this.regDeliveryStatusName[ab.ApplicationStatus],
channelStatus: this.regDeliveryStatus[ab.ApplicationStatus],
update_at: new Date().Format("yyyy-MM-dd hh:mm:ss"),
officialFile: ab.officialFile || "",
deliveryFlowList: []
}
break;
case "DZFW":
deliveryContent['DZFW'] = {
bizType: ab.consultType,
bizTypeName: bizTypeName,
productType: productType,
productTypeName: "地址服务",
startTime: startTime || "",
endTime: endTime || "",
status: ab.ApplicationStatus,
statusName: this.regDeliveryStatusName[ab.ApplicationStatus],
channelStatus: this.regDeliveryStatus[ab.ApplicationStatus],
update_at: new Date().Format("yyyy-MM-dd hh:mm:ss"),
officialFile: ab.officialFile || "",
deliveryFlowList: []
}
break;
} }
} }
deliveryContent[ab.productType].deliveryFlowList.push({
status: ab.ApplicationStatus,
statusName: this.regDeliveryStatusName[ab.ApplicationStatus],
file: ab.officialFile || "",
update_at: new Date().Format("yyyy-MM-dd hh:mm:ss")
});
deliveryContent[ab.productType].status = ab.ApplicationStatus
deliveryContent[ab.productType].statusName = this.regDeliveryStatusName[ab.ApplicationStatus]
deliveryContent[ab.productType].channelStatus = this.regDeliveryStatus[ab.ApplicationStatus]
} }
if (ab.productType && ab.productType == "DZFW") {//地址服务 } else {//如果交付信息不存在
if (ab.consultType && ab.consultType == "GSREG") {//非套餐
solutionFlowList = needsolutioninfo.solutionContent.solutionFlowList
deliveryContent.solutionFlowList = solutionFlowList;
deliveryContent = needsolutioninfo.solutionContent;
deliveryContent['ApplicationStatus'] = ab.ApplicationStatus
applicationStatusList = deliveryContent.applicationStatusList || [];
if (ab.ApplicationStatus == 702) {//材料收集环节 if (ab.ApplicationStatus == 702) {//材料收集环节
if (needsolutioninfo.solutionContent.status != "PAID") { if (needsolutioninfo.solutionContent.status != "PAID") {
return system.getResultFail(-702, "交付流程错误,请先完成支付"); 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) {//工商审核环节 if (ab.ApplicationStatus == 703) {//工商审核环节
var afterStatusList = [//用户支付后的流程状态 var afterStatusList = [//用户支付后的流程状态
"COLLECTING", "AUDITING", "ENGRAVING", "SUCCESS" "COLLECTING", "AUDITING", "ENGRAVING", "SUCCESS"
]; ];
if (!deliveryContent[ab.productType].channelStatus || afterStatusList.indexOf(deliveryContent[ab.productType].channelStatus) < 0) { if (!deliveryContent.status || afterStatusList.indexOf(deliveryContent.status) < 0) {
return system.getResultFail(-703, "交付流程错误,请先完成材料收集"); return system.getResultFail(-703, "交付流程错误,请先完成材料收集");
} }
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") { if (deliveryContent.status == "SUCCESS") {
return system.getResultFail(-706, "该方案已完成,不可更改"); 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 == 706) {//服务中 if (ab.ApplicationStatus == 704) {//刻章环节
var afterStatusList = [//用户支付后的流程状态 var afterStatusList = [//用户支付后的流程状态
"COLLECTING", "AUDITING", "SUCCESS" "COLLECTING", "AUDITING", "ENGRAVING", "SUCCESS"
]; ];
if (!deliveryContent[ab.productType].channelStatus || afterStatusList.indexOf(deliveryContent[ab.productType].channelStatus) < 0) { if (!deliveryContent.status || afterStatusList.indexOf(deliveryContent.status) < 0) {
return system.getResultFail(-704, "交付流程错误,请先工商审核"); return system.getResultFail(-704, "交付流程错误,请先工商审核");
} }
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") { if (deliveryContent.status == "SUCCESS") {
return system.getResultFail(-707, "该方案已完成,不可更改"); 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 (ab.ApplicationStatus == 705) {//已完成
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus != "ACTIVE") { if (deliveryContent.status != "ENGRAVING") {
return system.getResultFail(-705, "交付流程错误,请先变更状态为服务中"); return system.getResultFail(-705, "交付流程错误,请先刻章");
} }
if (deliveryContent[ab.productType] && deliveryContent[ab.productType].channelStatus && deliveryContent[ab.productType].channelStatus == "SUCCESS") { if (deliveryContent.status == "SUCCESS") {
return system.getResultFail(-708, "该方案已完成,不可更改"); 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.productType && ab.productType == "YHKH" || ab.productType == "SWBD") {//银行开户、税务报道:有已接单,已完成状态 if (ab.consultType && ab.consultType == "QYJYTC1" || ab.consultType && ab.consultType == "QYJYTC2") {//公司注册套餐1和公司注册套餐2
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 == "ACTIVE") {
return system.getResultFail(-707, "该交付单已在服务中,不能重复提交");
}
}
if (ab.ApplicationStatus == 705) {//已完成
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) {//如果存在交付信息的话就去进行逻辑判断
deliveryContent = orderdeliveryInfo[0].deliveryContent;
if (deliveryContent && deliveryContent.status && deliveryContent.ApplicationStatus && deliveryContent.solutionFlowList) {
// if (this.regStatus[deliveryContent.status] && this.regStatus[deliveryContent.status] > ab.ApplicationStatus) {
// return system.getResultFail(-403, "操作失败,交付流程未按顺序执行");
// }
if (this.regStatus[deliveryContent.ApplicationStatus] && this.regStatus[deliveryContent.ApplicationStatus] == ab.ApplicationStatus && ab.ApplicationStatus == 705) {
return system.getResultFail(-405, "操作失败,该方案已完成,不能更改");
}
solutionFlowList = deliveryContent.solutionFlowList || [];
}
}
// else {//如果交付信息不存在的话就去进行赋值
// deliveryContent = needsolutioninfo.solutionContent;
// solutionFlowList = needsolutioninfo.solutionContent.solutionFlowList
// }
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 (deliveryContent && deliveryContent[ab.productType] && deliveryContent[ab.productType].status && deliveryContent[ab.productType].deliveryFlowList) {
if (this.regStatus[deliveryContent.ApplicationStatus] && this.regStatus[deliveryContent.ApplicationStatus] == ab.ApplicationStatus && ab.ApplicationStatus == 705) {
return system.getResultFail(-406, "操作失败,该交付已完成,不能更改");
}
deliveryFlowList = deliveryContent[ab.productType].solutionFlowList || [];
}
else {//如果交付信息不存在的话就去进行赋值
let startTime
let endTime
if (ab.startTime) {
startTime = (new Date(ab.startTime * 1000)).Format("yyyy-MM-dd hh:mm:ss")
}
if (ab.startTime) {
endTime = (new Date(ab.endTime * 1000)).Format("yyyy-MM-dd hh:mm:ss")
}
if (ab.consultType == "QYJYTC1") { if (ab.consultType == "QYJYTC1") {
bizTypeName = "企业经营套餐一" bizTypeName = "企业经营套餐一"
} }
...@@ -1486,8 +1554,6 @@ class RegCenterOrderService { ...@@ -1486,8 +1554,6 @@ class RegCenterOrderService {
bizTypeName: bizTypeName, bizTypeName: bizTypeName,
productType: productType, productType: productType,
productTypeName: "代理记账", productTypeName: "代理记账",
startTime: startTime || "",
endTime: endTime || "",
status: ab.ApplicationStatus, status: ab.ApplicationStatus,
statusName: this.regDeliveryStatusName[ab.ApplicationStatus], statusName: this.regDeliveryStatusName[ab.ApplicationStatus],
channelStatus: this.regDeliveryStatus[ab.ApplicationStatus], channelStatus: this.regDeliveryStatus[ab.ApplicationStatus],
...@@ -1503,8 +1569,6 @@ class RegCenterOrderService { ...@@ -1503,8 +1569,6 @@ class RegCenterOrderService {
bizTypeName: bizTypeName, bizTypeName: bizTypeName,
productType: productType, productType: productType,
productTypeName: "地址服务", productTypeName: "地址服务",
startTime: startTime || "",
endTime: endTime || "",
status: ab.ApplicationStatus, status: ab.ApplicationStatus,
statusName: this.regDeliveryStatusName[ab.ApplicationStatus], statusName: this.regDeliveryStatusName[ab.ApplicationStatus],
channelStatus: this.regDeliveryStatus[ab.ApplicationStatus], channelStatus: this.regDeliveryStatus[ab.ApplicationStatus],
...@@ -1515,15 +1579,6 @@ class RegCenterOrderService { ...@@ -1515,15 +1579,6 @@ class RegCenterOrderService {
break; break;
} }
} }
deliveryContent[ab.productType].deliveryFlowList.push({
status: ab.ApplicationStatus,
statusName: this.regDeliveryStatusName[ab.ApplicationStatus],
file: ab.officialFile || "",
update_at: new Date().Format("yyyy-MM-dd hh:mm:ss")
});
deliveryContent[ab.productType].status = ab.ApplicationStatus
deliveryContent[ab.productType].statusName = this.regDeliveryStatusName[ab.ApplicationStatus]
deliveryContent[ab.productType].channelStatus = this.regDeliveryStatus[ab.ApplicationStatus]
} }
deliveryContent = JSON.stringify(deliveryContent); deliveryContent = JSON.stringify(deliveryContent);
let orderdeliveryData = { let orderdeliveryData = {
......
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