Commit 8c51d77f by Sxy

优化关闭逻辑

parent 9193b921
......@@ -295,15 +295,17 @@ class DeliverService extends ServiceBase {
if (!deliverData) {
throw new Error('查不到交付单');
}
// if (![system.SERVERSESTATUS.RECEIVED, system.SERVERSESTATUS.COLLECTING].includes(deliverData.delivery_status)) {
// throw new Error('该交付单状态下不可提交');
// }
// 推送 关闭交付
await pushTx.pushChangeOrder(pushTx.TXSTATUS.CLOSED, deliverData.delivery_code, {
close_reason: pobj.close_reason,
refund_close: deliverData.delivery_status === system.SERVERSESTATUS.SUCCESS ? "refund_close" : undefined
});
// 推送 退费
await pushTx.returnPremium(deliverData.delivery_code);
// 递交材料之前 关闭 进行退费 ,后面 不退费
if ([system.SERVERSESTATUS.RECEIVED, system.SERVERSESTATUS.COLLECTING].includes(deliverData.delivery_status)) {
// 推送 退费
await pushTx.returnPremium(deliverData.delivery_code);
}
// 年报逻辑
let annualReportData;
if (deliverData.master_source_number) {
......@@ -317,9 +319,13 @@ class DeliverService extends ServiceBase {
if (annualReportData) {
await pushTx.pushChangeOrder(pushTx.TXSTATUS.CLOSED, annualReportData.delivery_code, {
close_reason: '对应的资质交付关闭了',
refund_close: deliverData.delivery_status === system.SERVERSESTATUS.SUCCESS ? "refund_close" : undefined
});
// 推送 年报退费
await pushTx.returnPremium(annualReportData.delivery_code);
// 递交材料之前 关闭 进行退费 ,后面 不退费
if ([system.SERVERSESTATUS.RECEIVED, system.SERVERSESTATUS.COLLECTING].includes(deliverData.delivery_status)) {
// 推送 年报退费
await pushTx.returnPremium(annualReportData.delivery_code);
}
}
}
return this.db.transaction(async (t) => {
......
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