Browse Source

审批通过,刷新报表签字时间,并标记,重审时刷新

MaiXinRong 1 year ago
parent
commit
eeb66993c9
3 changed files with 4 additions and 3 deletions
  1. 2 1
      app/service/role_rpt_rel.js
  2. 1 1
      app/service/stage_audit.js
  3. 1 1
      db_script/test_query.js

+ 2 - 1
app/service/role_rpt_rel.js

@@ -198,7 +198,7 @@ module.exports = app => {
                 let bChange = false;
                 const roleContent = JSON.parse(rc.rel_content);
                 for (const role of roleContent) {
-                    if (!role.sign_date) {
+                    if (!role.sign_date || role.sign_flow) {
                         if (role.acc_id === curAudit.aid) {
                             role.sign_date = time;
                         } else if (role.acc_id === stage.userId) {
@@ -207,6 +207,7 @@ module.exports = app => {
                             const audit = this.ctx.helper._.findLast(stage.auditors, x => { return x.aid === role.acc_id; });
                             role.sign_date = audit ? audit.end_time || time : new Date(period[period.length - 1]);
                         }
+                        role.sign_flow = 1;
                         bChange = true;
                     }
                 }

+ 1 - 1
app/service/stage_audit.js

@@ -555,7 +555,7 @@ module.exports = app => {
                         };
                         await this.ctx.helper.sendWechat(users, smsTypeConst.const.JL, smsTypeConst.judge.result.toString(), wxConst.template.stage, wechatData);
                         // 期审批完成,检查角色签名数据
-                        // await this.ctx.service.roleRptRel.checkSignDate(transaction, this.ctx.stage, selfAudit, time);
+                        await this.ctx.service.roleRptRel.checkSignDate(transaction, this.ctx.stage, selfAudit, time);
                         // 审批通过 - 检查三方特殊推送
                         await this.ctx.service.specMsg.addStageMsg(transaction, pid, this.ctx.stage, pushOperate.stage.checked);
                     }

+ 1 - 1
db_script/test_query.js

@@ -13,7 +13,7 @@ const saveJSON = async function(obj, file) {
 const loadReportArchiveData = async function() {
     //const tid = 4417, sOrder = 2;
     // const tid = 3698, sOrder = 7;
-    const tid = 5161, sOrder = 9;
+    const tid = 5161, sOrder = 11;
     const stage = await querySql('SELECT * FROM zh_stage where tid = ? and `order` = ?', [tid, sOrder]);
     const rptArchive = await querySql('SELECT * FROM zh_rpt_archive where stage_id = ?', [stage[0].id]);
     for (const ra of rptArchive) {