Selaa lähdekoodia

临时占地,安全生产,历史数据相关

MaiXinRong 3 vuotta sitten
vanhempi
commit
8bb99b8caf
2 muutettua tiedostoa jossa 16 lisäystä ja 0 poistoa
  1. 4 0
      app/service/stage.js
  2. 12 0
      app/service/stage_audit.js

+ 4 - 0
app/service/stage.js

@@ -373,6 +373,10 @@ module.exports = app => {
                     if (!jgclResult) throw '初始化甲供材料数据失败';
                     const otherResult = await this.ctx.service.stageOther.addInitialStageData(newStage, preStage, transaction);
                     if (!otherResult) throw '初始化其他台账数据失败';
+                    const safeResult = await this.ctx.service.stageSafeProd.addInitialStageData(newStage, preStage, transaction);
+                    if (!safeResult) throw '初始化其他台账数据失败';
+                    const tempResult = await this.ctx.service.stageTempLand.addInitialStageData(newStage, preStage, transaction);
+                    if (!tempResult) throw '初始化其他台账数据失败';
                 }
                 // 新增期拷贝报表相关配置/签名角色 等
                 if (preStage) {

+ 12 - 0
app/service/stage_audit.js

@@ -280,6 +280,8 @@ module.exports = app => {
                 await this.ctx.service.stageJgcl.updateHistory(this.ctx.stage, transaction);
                 await this.ctx.service.stageBonus.updateHistory(this.ctx.stage, transaction);
                 await this.ctx.service.stageOther.updateHistory(this.ctx.stage, transaction);
+                await this.ctx.service.stageSafeProd.updateHistory(this.ctx.stage, transaction);
+                await this.ctx.service.stageTempLand.updateHistory(this.ctx.stage, transaction);
                 // 更新期数据
                 const tpData = await this.ctx.service.stageBills.getSumTotalPrice(this.ctx.stage);
                 this.ctx.stage.tp_history.push({
@@ -406,6 +408,8 @@ module.exports = app => {
                     await this.ctx.service.stageJgcl.updateHistory(this.ctx.stage, transaction);
                     await this.ctx.service.stageBonus.updateHistory(this.ctx.stage, transaction);
                     await this.ctx.service.stageOther.updateHistory(this.ctx.stage, transaction);
+                    await this.ctx.service.stageSafeProd.updateHistory(this.ctx.stage, transaction);
+                    await this.ctx.service.stageTempLand.updateHistory(this.ctx.stage, transaction);
                     // 流程至下一审批人
                     await transaction.update(this.tableName, {
                         id: nextAudit.id,
@@ -608,6 +612,8 @@ module.exports = app => {
                 await this.ctx.service.stageJgcl.updateHistory(this.ctx.stage, transaction);
                 await this.ctx.service.stageBonus.updateHistory(this.ctx.stage, transaction);
                 await this.ctx.service.stageOther.updateHistory(this.ctx.stage, transaction);
+                await this.ctx.service.stageSafeProd.updateHistory(this.ctx.stage, transaction);
+                await this.ctx.service.stageTempLand.updateHistory(this.ctx.stage, transaction);
 
                 // 添加短信通知-审批退回提醒功能
                 // const mobile_array = [];
@@ -763,6 +769,8 @@ module.exports = app => {
                 await this.ctx.service.stageJgcl.updateHistory(this.ctx.stage, transaction);
                 await this.ctx.service.stageBonus.updateHistory(this.ctx.stage, transaction);
                 await this.ctx.service.stageOther.updateHistory(this.ctx.stage, transaction);
+                await this.ctx.service.stageSafeProd.updateHistory(this.ctx.stage, transaction);
+                await this.ctx.service.stageTempLand.updateHistory(this.ctx.stage, transaction);
 
                 // 多人协同数据确认删除本人和上一个审批人确认状态
                 await this.ctx.service.cooperationConfirm.delBycheckNoPre(audit.aid, this.ctx.stage, transaction);
@@ -911,6 +919,8 @@ module.exports = app => {
                 await this.ctx.service.stageJgcl.updateHistory4CheckAgain(this.ctx.stage, transaction);
                 await this.ctx.service.stageBonus.updateHistory4CheckAgain(this.ctx.stage, transaction);
                 await this.ctx.service.stageOther.updateHistory4CheckAgain(this.ctx.stage, transaction);
+                await this.ctx.service.stageSafeProd.updateHistory4CheckAgain(this.ctx.stage, transaction);
+                await this.ctx.service.stageTempLand.updateHistory4CheckAgain(this.ctx.stage, transaction);
 
                 // 本期结束
                 // 生成截止本期数据 final数据
@@ -1227,6 +1237,8 @@ module.exports = app => {
             await this.ctx.service.stageJgcl.deleteStageTimesData(sid, times, transaction);
             await this.ctx.service.stageOther.deleteStageTimesData(sid, times, transaction);
             await this.ctx.service.stageBonus.deleteStageTimesData(sid, times, transaction);
+            await this.ctx.service.stageSafeProd.deleteStageTimesData(sid, times, transaction);
+            await this.ctx.service.stageTempLand.deleteStageTimesData(sid, times, transaction);
         }
 
         /**