Commit 518636fd by sxy

fix: 调整年报

parent 2d20359f
......@@ -197,12 +197,7 @@ class DeliverService extends ServiceBase {
}
// 推送年报信息
await pushTx.pushChangeOrder(pushTx.TXSTATUS.WAITDECLARE, annualReportData.delivery_code, {
annualReport: annualReportArry.map(item => {
return {
...item,
status: item.status === system.ANNUALREPORT.WAITDECLARE ? "待申报" : "已申报"
}
})
annualReport: annualReportArry
})
}
......@@ -261,7 +256,7 @@ class DeliverService extends ServiceBase {
});
// 推送 关闭交付 资质
if (annualReportData) {
await pushTx.pushChangeOrder(pushTx.TXSTATUS.CLOSED, annualReportData.demand_code, {
await pushTx.pushChangeOrder(pushTx.TXSTATUS.CLOSED, annualReportData.delivery_code, {
close_reason: "对应的资质交付关闭了"
});
}
......
......@@ -120,16 +120,23 @@ const pushDeclareReport = async (annualReport, deliverData) => {
const annualReports = await annualreportDao.findAll({
deliver_id: deliverData.id
});
let status = TXSTATUS.DECLARESUCCESS;
if (annualReports && annualReports.filter(item => {
return item.status === system.ANNUALREPORT.WAITDECLARE
}).length <= 0) {
status = TXSTATUS.SUCCESS;
}
const result = annualReports && annualReports.map((item) => {
if (item.id === annualReport.id) {
item.updated_at = new Date();
item.file = annualReport.file;
item.status = system.ANNUALREPORT.DECLARESUCCESS;
}
item.status = item.status === system.ANNUALREPORT.WAITDECLARE ? "待申报" : "已申报"
// item.status = item.status === system.ANNUALREPORT.WAITDECLARE ? "待申报" : "已申报"
return item
})
await pushChangeOrder(TXSTATUS.DECLARESUCCESS, deliverData.delivery_code, { annualReport: result })
await pushChangeOrder(status, deliverData.delivery_code, { annualReport: result })
}
......
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