Browse Source

设备改成材料

zhangweicheng 5 years ago
parent
commit
66a9921ffe

+ 12 - 0
modules/main/facade/ration_facade.js

@@ -15,6 +15,7 @@ module.exports = {
   deleteSubListByQuery:deleteSubListByQuery,
   updateCoeAdjust:updateCoeAdjust,
   getUnitPriceData:getUnitPriceData,
+  transGljType:transGljType
 };
 
 
@@ -570,6 +571,15 @@ function getExtendData(property,compilation) {
 }
 
 
+//查看是否需要将“设备”的处理成“普通材料”
+function transGljType(compilation,newGlJ){
+    if(compilation.overWriteUrl && compilation.overWriteUrl!=""){
+        let overWrite = require("../../.."+compilation.overWriteUrl);
+        if(overWrite.ifTransEqToMateria && overWrite.ifTransEqToMateria()){
+            if(newGlJ.type == 5) newGlJ.type = 201;
+        }
+     }
+}
 
 
 async function addRationGLJ(std,newRation,compilation,isMaterial,connect_key) {
@@ -625,6 +635,8 @@ async function addRationGLJ(std,newRation,compilation,isMaterial,connect_key) {
             let std_glj = getStdGlj(sub,stdGLJMap,cptGLJMap,{},ext);
             if(std_glj){
                 ration_glj_facade.setPropertyFromStd(newGLJ,std_glj);
+                //有些编办要把设备类型转成普通材料  -- todo
+                transGljType(compilation,newGLJ);
                 let tindex = getIndex(newGLJ);
                 if(std_glj.component && std_glj.component.length > 0) mixRatioMap[tindex] = std_glj.component
                 let tdata = ration_glj_facade.getGLJSearchInfo(newGLJ);

+ 2 - 0
modules/ration_glj/facade/ration_glj_facade.js

@@ -50,6 +50,7 @@ let glj_calculate_facade = require('./glj_calculate_facade');
 let glj_type_util = require('../../../public/cache/std_glj_type_util');
 let quantity_detail_facade = require('../../main/facade/quantity_detail_facade');
 let ration_installation_facade = require('../../main/facade/ration_installation_facade');
+let ration_facade = require('../../main/facade/ration_facade');
 let logger = require("../../../logs/log_helper").logger;
 const stdgljutil = require("../../../public/cache/std_glj_type_util");
 const EngineeringLibModel = require("../../users/models/engineering_lib_model");
@@ -791,6 +792,7 @@ async function insertAddTypeGLJ(rgList, compilation, needInsert = true) {
   let projectGLJList = [];
   let [unitFileId, ext] = await prepareExtData(rgList[0].projectID, compilation);
   for (let g of rgList) {
+    ration_facade.transGljType(compilation,g);
     let projectGljModel = new GLJListModel();
     let result = await projectGljModel.addList(getGLJSearchInfo(g), unitFileId, ext);
     let typeString = result.type + '';

+ 1 - 0
server.js

@@ -20,6 +20,7 @@ dbm.connect(process.env.NODE_ENV);
 fileUtils.getGlobbedFiles('./modules/all_models/*.js').forEach(function(modelPath) {
     require(path.resolve(modelPath));
 })
+
 //config.setupCache();
 let cfgCacheUtil = require("./config/cacheCfg");
 cfgCacheUtil.setupDftCache();

+ 7 - 1
web/over_write/js/anhui_2019.js

@@ -381,9 +381,15 @@ if (typeof $ !== 'undefined') { // 后端也有引用这个文件,后端引用
     });
 }
 
+//是否需要将“设备”的处理成“普通材料”
+function ifTransEqToMateria(){
+    return true;
+  }
+
 if (typeof module !== 'undefined') {
     module.exports = {
         progression,
-        deficiency
+        deficiency,
+        ifTransEqToMateria
     };
 }

+ 6 - 0
web/over_write/js/hunan_2014.js

@@ -345,11 +345,17 @@ if (typeof projectObj !== 'undefined') {
   }
 }
 
+//是否需要将“设备”的处理成“普通材料”
+function ifTransEqToMateria(){
+  return true;
+}
+
 if (typeof module !== 'undefined') {
   module.exports = {
       progression,
       deficiency,
       beyond,
+      ifTransEqToMateria,
       getDefalutAssistProductionFeeRate: function () {
         return 5
       }

+ 6 - 0
web/over_write/js/shandong_2016.js

@@ -383,11 +383,17 @@ if (typeof projectObj !== 'undefined') {
   }
 }
 
+//是否需要将“设备”的处理成“普通材料”
+function ifTransEqToMateria(){
+  return true;
+}
+
 
 if (typeof module !== "undefined" && !module.nodeType) {
   module.exports = {
     progression,
     deficiency,
+    ifTransEqToMateria,
     sortRationGLJ: o_sortRationGLJ,
     getDefalutAssistProductionFeeRate: function () {
       return 5;

+ 6 - 0
web/over_write/js/zhejiang_2005.js

@@ -327,9 +327,15 @@ function getCodeSortMath() {
     }
 }
 
+//是否需要将“设备”的处理成“普通材料”
+function ifTransEqToMateria(){
+    return true;
+  }
+
 if (typeof module !== 'undefined') {
     module.exports = {
         progression,
+        ifTransEqToMateria,
         deficiency
     };
 }