Jelajahi Sumber

台账修订问题

MaiXinRong 5 tahun lalu
induk
melakukan
d979af7607
3 mengubah file dengan 65 tambahan dan 2 penghapusan
  1. 6 2
      app/controller/revise_controller.js
  2. 58 0
      config/config.remoteuat.js
  3. 1 0
      package.json

+ 6 - 2
app/controller/revise_controller.js

@@ -389,12 +389,16 @@ module.exports = app => {
                 const revise = await ctx.service.ledgerRevise.getLastestRevise(ctx.tender.id);
                 if (!revise) throw '台账修订数据有误';
 
-                const billsFile = revise.bills_file ? this.ctx.app.config.filePath + revise.bills_file : undefined;
+                const billsFile = revise.status === audit.revise.status.checked && revise.bills_file
+                    ? this.ctx.app.config.filePath + revise.bills_file
+                    : undefined;
                 const reviseBills = billsFile && fs.existsSync(billsFile)
                     ? JSON.parse(await fs.readFileSync(billsFile, 'utf8'))
                     : await ctx.service.reviseBills.getData(ctx.tender.id);
 
-                const posFile = revise.pos_file ? this.ctx.app.config.filePath + revise.pos_file : undefined;
+                const posFile = revise.status === audit.revise.status.checked && revise.pos_file
+                    ? this.ctx.app.config.filePath + revise.pos_file
+                    : undefined;
                 const revisePos = posFile && fs.existsSync(posFile)
                     ? JSON.parse(await fs.readFileSync(posFile, 'utf8'))
                     : await ctx.service.revisePos.getData(ctx.tender.id);

+ 58 - 0
config/config.remoteuat.js

@@ -0,0 +1,58 @@
+'use strict';
+/**
+ * 开发环境相关配置
+ *
+ * @author CaiAoLin
+ * @date 2017/8/29
+ * @version
+ */
+
+module.exports = appInfo => {
+    const config = {};
+    // 数据库配置
+    config.mysql = {
+        client: {
+            // host
+            host: '47.106.95.114',
+            // 端口号
+            port: '3306',
+            // 用户名
+            user: 'smartcost',
+            // 密码
+            password: 'zongheng_@)!(_jlzf',
+            // 数据库名
+            database: 'calculation',
+            multipleStatements: true,
+        },
+        // 是否加载到 app 上,默认开启
+        app: true,
+        // 是否加载到 agent 上,默认关闭
+        agent: false,
+    };
+    // 表名前缀
+    config.tablePrefix = 'zh_';
+
+    // redis设置
+    config.redis = {
+        client: {
+            host: '47.106.95.114',
+            port: '6379',
+            password: 'zongheng_@)!(_jlzf',
+            db: '0',
+        },
+        agent: true,
+        version: '1.0.0',
+    };
+
+    // session配置
+    config.session = {
+        key: 'ZHC_SESS',
+        maxAge: 7 * 24 * 3600 * 1000, // 7天
+        httpOnly: true,
+        encrypt: true,
+        //renew: true, // session临近过期更新过期时间
+        rolling: true, // 每次都更新session有效期
+    };
+
+    return config;
+};

+ 1 - 0
package.json

@@ -63,6 +63,7 @@
     "dev": "egg-bin dev --port 7002",
     "dev-local": "set EGG_SERVER_ENV=local&&egg-bin dev --port 7002",
     "dev-remoteqa": "set EGG_SERVER_ENV=remoteqa&&egg-bin dev --port 7002",
+    "dev-remoteuat": "set EGG_SERVER_ENV=remoteuat&&egg-bin dev --port 7002",
     "dev-localpro": "set EGG_SERVER_ENV=localpro&&egg-bin dev --port 7002",
     "dev-temp": "set EGG_SERVER_ENV=temp&&egg-bin dev --port 7002",
     "dev-qa": "set EGG_SERVER_ENV=qa&&egg-bin dev --port 7002",