Переглянути джерело

Merge branch '1.0.0_online' of http://smartcost.f3322.net:3000/SmartCost/ConstructionCost into 1.0.0_online

chenshilong 7 роки тому
батько
коміт
65128843b3
5 змінених файлів з 12 додано та 9 видалено
  1. 1 1
      Dockerfile
  2. 1 1
      Dockerfile_pp
  3. 1 1
      Dockerfile_qa
  4. 3 1
      config/db/db_manager.js
  5. 6 5
      public/web/gljUtil.js

+ 1 - 1
Dockerfile

@@ -2,7 +2,7 @@ FROM costbase:latest
 
 WORKDIR /home/ConstructionCost
 
-RUN git pull http://192.168.1.12:3000/SmartCost/ConstructionCost master
+RUN git pull http://192.168.1.12:3000/SmartCost/ConstructionCost 1.0.0_online
 
 RUN cnpm install
 

+ 1 - 1
Dockerfile_pp

@@ -2,7 +2,7 @@ FROM costbase:latest
 
 WORKDIR /home/ConstructionCost
 
-RUN git pull http://192.168.1.12:3000/SmartCost/ConstructionCost master
+RUN git pull http://192.168.1.12:3000/SmartCost/ConstructionCost 1.0.0_online
 
 RUN cnpm install
 

+ 1 - 1
Dockerfile_qa

@@ -2,7 +2,7 @@ FROM costbase:latest
 
 WORKDIR /home/ConstructionCost
 
-RUN git pull http://192.168.1.12:3000/SmartCost/ConstructionCost master
+RUN git pull http://192.168.1.12:3000/SmartCost/ConstructionCost 1.0.0_online
 
 RUN cnpm install
 

+ 3 - 1
config/db/db_manager.js

@@ -49,7 +49,9 @@ module.exports = {
     connect:function (env="local") {
         var config = require("../config.js");
         var dbURL = 'mongodb://' + config[env].server + ":" + config[env].port + '/scConstruct';
-        if(config[env].options){
+        if(config[env].dbURL){
+            mg.connect(config[env].dbURL,{connectTimeoutMS: 20000,useMongoClient: true});
+        } else if(config[env].options){
             mg.connect(dbURL,config[env].options);
         }else {
             mg.connect(dbURL,{connectTimeoutMS: 20000,useMongoClient: true});//useMongoClient': true*! //报 DeprecationWarning: `open()` is deprecated in mongoose这个错

+ 6 - 5
public/web/gljUtil.js

@@ -205,8 +205,9 @@ let gljUtil = {
             }
             return scMathUtil.roundForObj(p,price_hasM_decimal);
         }else {
-            let tem_decimal = isRadio==true?process_decimal:price_decimal;
-            return scMathUtil.roundForObj(parseFloat(glj.unit_price.market_price)*priceCoe,tem_decimal);
+            let tem_decimal =price_decimal; //isRadio==true?process_decimal:price_decimal;
+            let tem_price = scMathUtil.roundForObj(glj.unit_price.market_price,price_decimal);
+            return scMathUtil.roundForObj(tem_price*priceCoe,tem_decimal);
         }
     },
     getBasePrice:function (glj,projectGLJDatas,calcOptions,labourCoeDatas,decimalObj,isRadio,_,scMathUtil) {
@@ -232,7 +233,7 @@ let gljUtil = {
             }
             return scMathUtil.roundForObj(p,price_hasM_decimal);
         }else {
-            let tem_decimal = isRadio==true?process_decimal:price_decimal;
+            let tem_decimal =price_decimal; //isRadio==true?process_decimal:price_decimal;
             return scMathUtil.roundForObj(glj.unit_price.base_price,tem_decimal);
         }
     },
@@ -245,7 +246,7 @@ let gljUtil = {
         if (glj.unit_price.type == this.gljType.LABOUR || glj.unit_price.type == this.gljType.MACHINE_LABOUR) {//人工、机上人工,调整价根据定额价*调整系数计算得出。
             let labour = _.find(labourCoeDatas.coes,{'ID':glj.adjCoe});
             let coe = labour && labour.coe ? labour.coe : 1;
-            return scMathUtil.roundTo(parseFloat(coe * scMathUtil.roundForObj(glj.unit_price.base_price,tem_decimal)), -tem_decimal);
+            return scMathUtil.roundTo(parseFloat(coe * scMathUtil.roundForObj(glj.unit_price.base_price,decimal)), -decimal);
         } else if (notEditType.indexOf(glj.unit_price.type)!=-1&&glj.ratio_data.length>0) {//对于混凝土、配合比、砂浆、机械台班,调整价根据组成物计算得出。
             let p =0;
             for(let ratio of glj.ratio_data){
@@ -264,7 +265,7 @@ let gljUtil = {
             }
             return scMathUtil.roundForObj(p,price_hasM_decimal);
         } else {//对于其他普通材料等,无调整系数,调整价=定额价。
-            return  scMathUtil.roundForObj(glj.unit_price.base_price,tem_decimal)
+            return  scMathUtil.roundForObj(glj.unit_price.base_price,decimal)
         }
     },
     calcPriceDiff:function (glj,calcOptions) {