Przeglądaj źródła

Merge branch 'master' of http://192.168.1.41:3000/SmartCost/YangHuCost

chenshilong 5 lat temu
rodzic
commit
5725cc528b

+ 8 - 7
modules/main/facade/project_facade.js

@@ -582,9 +582,9 @@ async function getBillsByProjectID(projectID) {
     let rationFee = _.find(b._doc.fees, {
       "fieldName": "rationCommon"
     });
-    if (commonFee && commonFee.totalFee) prices[projectName] = commonFee.totalFee;
-    if (commonFee && commonFee.unitFee) unitPrices[projectName] = commonFee.unitFee;
-    if (rationFee && rationFee.totalFee) rationCommons[projectName] = rationFee.totalFee;
+    if (commonFee && commonFee.tenderTotalFee) prices[projectName] = commonFee.tenderTotalFee;
+    if (commonFee && commonFee.tenderUnitFee) unitPrices[projectName] = commonFee.tenderUnitFee;
+    if (rationFee && rationFee.tenderTotalFee) rationCommons[projectName] = rationFee.tenderTotalFee;
     baseProgressiveFees[projectName] = b.baseProgressiveFee;
 
     quantityMap[projectName] = b.quantity;
@@ -760,7 +760,7 @@ function mergeGLJ(mp, projects) {
     gljList = [];
   for (let g of mp.gljList) {
     g.quantityMap = {};
-    g.quantityMap[mp.name] = g.quantity;
+    g.quantityMap[mp.name] = g.tenderQuantity;
     gljMap[gljUtil.getIndex(g)] = g;
     gljList.push(g);
 
@@ -769,12 +769,12 @@ function mergeGLJ(mp, projects) {
     let temList = projects[i].gljList;
     for (let t of temList) {
       t.quantityMap = {};
-      t.quantityMap[projects[i].name] = t.quantity;
+      t.quantityMap[projects[i].name] = t.tenderQuantity;
       //这里除了5个属性相同判断为同一个之外,还要判断市场价相同,才认为是同一个工料机
       let connect_key = gljUtil.getIndex(t);
       let g = gljMap[connect_key];
       if (g && g.marketPrice == t.marketPrice) {
-        g.quantityMap[projects[i].name] = t.quantity;
+        g.quantityMap[projects[i].name] = t.tenderQuantity;
       } else {
         gljMap[connect_key] = t;
         gljList.push(t);
@@ -841,9 +841,10 @@ async function getProjectGLJPrice(projectID, unitPriceFileId, property) {
   let [gljList, mixRatioConnectData, mixRatioMap, unitPriceMap] = await gljListModel.getListByProjectId(projectID, unitPriceFileId);
   gljList = JSON.parse(JSON.stringify(gljList));
   for (let glj of gljList) {
+    let tenderCoe = gljUtil.getTenderPriceCoe(glj, property);
     let result = gljUtil.getGLJPrice(glj, {
       gljList: gljList
-    }, calcOptions, labourCoeDatas, decimalObj, false, _, scMathUtil);
+    }, calcOptions, labourCoeDatas, decimalObj, false,tenderCoe,true);
     glj.marketPrice = result.marketPrice;
     glj.basePrice = result.basePrice;
   }

+ 16 - 15
public/gljUtil.js

@@ -10,21 +10,22 @@ let gljNodeUtil = require("./web/gljUtil");
 // eval(data + ' ; gljNodeUtil = gljUtil; ');
 
 module.exports = {
-    calcProjectGLJQuantity :calcProjectGLJQuantity,
-    getGLJPrice:getGLJPrice,
-    calcPriceDiff:calcPriceDiff,
-    getMarketPrice:getMarketPrice,
-    getBasePrice:getBasePrice,
-    getAdjustPrice:getAdjustPrice,
-    getMainType:getMainType,
-    isConcreteType:isConcreteType,
-    isCommercialConcreteType:isCommercialConcreteType,
-    getIndex:getIndex,
-    sortRationGLJ:sortRationGLJ,
-    sortProjectGLJ:sortProjectGLJ,
-    getCCSProjectGLJ:getCCSProjectGLJ,
-    getBaseCCSMixRatio:getBaseCCSMixRatio,
-    setMaterialCalcRationFee:setMaterialCalcRationFee
+  calcProjectGLJQuantity: calcProjectGLJQuantity,
+  getGLJPrice: getGLJPrice,
+  calcPriceDiff: calcPriceDiff,
+  getMarketPrice: getMarketPrice,
+  getBasePrice: getBasePrice,
+  getAdjustPrice: getAdjustPrice,
+  getMainType: getMainType,
+  isConcreteType: isConcreteType,
+  isCommercialConcreteType: isCommercialConcreteType,
+  getIndex: getIndex,
+  sortRationGLJ: sortRationGLJ,
+  sortProjectGLJ: sortProjectGLJ,
+  getCCSProjectGLJ: getCCSProjectGLJ,
+  getBaseCCSMixRatio: getBaseCCSMixRatio,
+  setMaterialCalcRationFee: setMaterialCalcRationFee,
+  getTenderPriceCoe: getTenderPriceCoe
 };
 
 function calcProjectGLJQuantity(projectGLJDatas,rationGLJDatas,rationDatas,billsDatas,q_decimal) {

+ 8 - 0
web/building_saas/standard_interface/config.js

@@ -64,6 +64,14 @@ const INTERFACE_CONFIG = (() => {
         [CONTROL]: '.XCGLKZJ',
       },
     },
+    '安徽@亳州': {
+      scriptName: 'anhui_maanshan.js',
+      fileSuffix: {
+        [BID_INVITATION]: '.BZGLZB',
+        [BID_SUBMISSION]: '.BZGLTB',
+        [CONTROL]: '.BZGLKZJ',
+      },
+    },
     '安徽@池州': {
       scriptName: 'anhui_chizhou.js',
       fileSuffix: {

+ 1 - 1
web/building_saas/standard_interface/export/anhui_maanshan.js

@@ -69,7 +69,7 @@ INTERFACE_EXPORT = (() => {
         { name: 'Jsdw', value: getValueByKey(information, 'constructingUnits') }, // 建设单位
         { name: 'Czzt', value: czzt[exportKind] }, // 操作状态:招标、投标、招标控制,即导出接口时,所选的文件类型
         { name: 'Jsfs', value: taxModeMap[getValueByKey(information, 'taxMode')] || '1', type: TYPE.INT }, // 计税方式,默认1。1=一般计税 2=简易计税
-        { name: 'Version', value: ['淮北', '铜陵'].includes(subArea) ? '1.1' : '1.0' },
+        { name: 'Version', value: ['淮北', '铜陵', '毫州'].includes(subArea) ? '1.1' : '1.0' },
       ];
       Element.call(this, 'JingJiBiao', attrs);
     }

+ 66 - 47
web/building_saas/standard_interface/export/guangdong_zhongshan.js

@@ -69,6 +69,8 @@ INTERFACE_EXPORT = (() => {
     'equipment': 'DESBF',
     'marketDirect': 'ZJF',
     'measure': 'CSF',
+    'measure1': 'CSF1',
+    'measure2': 'CSF2',
     'manage': 'QYGLF',
     'force': 'GF',
     'profit': 'LR',
@@ -774,49 +776,53 @@ INTERFACE_EXPORT = (() => {
         i++
       }
       return bidMaterials;
-      function BidEvaluationMainMaterial(b, index) { 
+      function BidEvaluationMainMaterial(b, index) {
         const attrs = [{
-          name: "Code",
-          value: index,
-        },
-        {
-          name: "Number",
-          value: b.code
-        },
-        {
-          name: "Name",
-          value: b.name
-        },
-        {
-          name: "Specification",
-          value: b.specs
-        },
-        {
-          name: "Unit",
-          value: b.unit
-        },
-        {
-          name: "Price",
-          value: b.tenderPrice
-        },
-        {
-          name: "LimitedPrice",
-          value: b.tenderPrice
-        },
-        {
-          name: "Quantity",
-          value: b.quantity
-        },
-        {
-          name: "Total",
-          value: b.totalPrice
-        },
-        {
-          name: "Remark",
-          value: b.remark
+            name: "Code",
+            value: index,
+          },
+          {
+            name: "Number",
+            value: b.code
+          },
+          {
+            name: "Name",
+            value: b.name
+          },
+          {
+            name: "Specification",
+            value: b.specs
+          },
+          {
+            name: "Unit",
+            value: b.unit
+          },
+          {
+            name: "Price",
+            value: b.tenderPrice
+          },
+          {
+            name: "LimitedPrice",
+            value: b.tenderPrice
+          },
+          {
+            name: "Quantity",
+            value: 0//b.quantity
+          },
+          {
+            name: "Total",
+            value: 0//b.totalPrice
+          },
+          {
+            name: "Remark",
+            value: b.remark
+          }
+        ];
+        if (isBidSubmission) { 
+          attrs[7].value = b.quantity;
+          attrs[8].value = b.totalPrice;
         }
-      ];
-      Element.call(this, "BidEvaluationMainMaterial", attrs);
+        Element.call(this, "BidEvaluationMainMaterial", attrs);
       }
 
     }
@@ -869,13 +875,14 @@ INTERFACE_EXPORT = (() => {
 
       function setItem(bNode, level, list) {
         if (bNode.sourceType == ModuleNames.ration) return;
-        list.push(new bill(bNode, level));
+        let item = new bill(bNode, level);
         if (bNode.children && bNode.children.length > 0) {
           level += 1;
           for (let c of bNode.children) {
-            setItem(c, level, list);
+            setItem(c, level, item.children);
           }
         }
+        list.push(item);
 
         function bill(bNode, level) {
           let data = bNode.data;
@@ -924,7 +931,7 @@ INTERFACE_EXPORT = (() => {
             },
             {
               name: "Price",
-              value: data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderUnitFee : "",
+              value: 0//data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderUnitFee : "",
             },
             {
               name: "Rate",
@@ -932,7 +939,7 @@ INTERFACE_EXPORT = (() => {
             },
             {
               name: "Sum",
-              value: data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderTotalFee : "",
+              value: 0//data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderTotalFee : "",
             },
             {
               name: "ChapterKind",
@@ -991,12 +998,19 @@ INTERFACE_EXPORT = (() => {
               value: "",
             },
           ];
+
+          if (isBidSubmission) { 
+            attrs[5].value = data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderUnitFee : "";
+            attrs[7].value = data.feesIndex && data.feesIndex.common ? data.feesIndex.common.tenderTotalFee : "";
+          }
+
           Element.call(this, "Item", attrs);
           let cc = CostComposition(bNode);
           if (cc) this.children.push(cc);
           this.children.push(CostStructure(data))
 
           function CostComposition(bNode) {
+            if (isControl || isBidInvitation) return null;
             let CostComposition = new emptyElement('CostComposition');
             let Norms = [];
             let Costs = [];
@@ -1197,8 +1211,9 @@ INTERFACE_EXPORT = (() => {
                 value: itemFeeMap[fee.fieldName],
               }, {
                 name: 'Sum',
-                value: fee.tenderTotalFee
+                value: 0 //fee.tenderTotalFee
               }]
+              if (isBidSubmission) attrs[1].value = fee.tenderTotalFee;
               Element.call(this, "CostItem", attrs);
             }
             return CostStructure;
@@ -1301,7 +1316,7 @@ INTERFACE_EXPORT = (() => {
     }
 
     function SummaryOfCost(totalItem, proItem,feature) {
-      const attrs = [{
+      let attrs = [{
           name: "TenderSumLimit",
           value: totalItem.feesIndex && totalItem.feesIndex.common && totalItem.feesIndex.common.tenderTotalFee ? totalItem.feesIndex.common.tenderTotalFee : 0,
         },
@@ -1420,6 +1435,10 @@ INTERFACE_EXPORT = (() => {
           value: baseMap["工程说明"] ? baseMap["工程说明"].value : "",
         },
       ];
+      if (isControl || isBidInvitation) { //招标、招标控制价文件,则以下的8、12~18则不输出
+        attrs.splice(11, 7);
+        attrs.splice(7, 1);
+      }
       Element.call(this, "MakeInfo", attrs);
     }
 

+ 1 - 2
web/building_saas/standard_interface/import/anhui_maanshan.js

@@ -66,7 +66,7 @@ INTERFACE_IMPORT = (() => {
       const feeRateItems = arrayValue(tenderSrc, ['Qfxx', 'JjFlx', 'JjFlxMx']);
       const locationItem = feeRateItems.find(item => getValue(item, ['_Mc']) === '工程所在地');
       if (locationItem) {
-        feature.push(locationItem);
+        feature.push({ key: 'location', value: getValue(locationItem, ['_ShuZhi']) });
       }
       return feature;
     }
@@ -210,7 +210,6 @@ INTERFACE_IMPORT = (() => {
           arrayValue(midSrc, ['Dwgcxx'])
             .forEach(tenderSrc => tenders.push(setupTender(midSrc, tenderSrc)))
         });
-
       return {
         name: getValue(projectSrc, ['_Xmmc']),
         info: setupInformation(projectSrc),

+ 7 - 19
web/building_saas/standard_interface/import/base.js

@@ -113,20 +113,20 @@ const INTERFACE_EXPORT_BASE = (() => {
     return feesA;
   }
 
-  // 将A对象的一部分属性赋值到B对象上
+  // 将A对象的属性赋值到B对象上
   function assignAttr(target, source, attrs) {
     if (!source || !target) {
       return;
     }
     const sourceAttrs = attrs || Object.keys(source);
     for (const attr of sourceAttrs) {
-      const attrName = attr.name;
-      if (attr.soft && source[attrName] === undefined) {
+      // 如果值是undefined,则不进行赋值覆盖处理
+      if (attr === 'children' || source[attr] === undefined) {
         continue;
       }
-      target[attrName] = attrName === 'fees'
-        ? mergeFees(target[attrName], source[attrName]) // 如果是价格,不能简单地覆盖,要合并两个对象的价格
-        : source[attrName];
+      target[attr] = attr === 'fees'
+        ? mergeFees(target[attr], source[attr]) // 如果是价格,不能简单地覆盖,要合并两个对象的价格
+        : source[attr];
     }
   }
 
@@ -228,18 +228,6 @@ const INTERFACE_EXPORT_BASE = (() => {
    * @return {void}
    */
   function mergeBills(source, target, parent) {
-    // 要赋值的字段
-    const attrs = [
-      { name: 'code' },
-      { name: 'name' },
-      { name: 'rowCode' },
-      { name: 'unit' },
-      { name: 'quantity' },
-      { name: 'calcBase' },
-      { name: 'specialProvisional' },
-      { name: 'unitPriceAnalysis', soft: true }, // 不强制赋值:当源数据该字段的值为undefined的时候,不进行赋值
-      { name: 'remark' },
-    ];
     source.forEach(bills => {
       const simpleName = bills.name ? bills.name.replace(/\s/g, '') : '';
       let matched;
@@ -270,7 +258,7 @@ const INTERFACE_EXPORT_BASE = (() => {
         }
       }
       if (matched) {
-        assignAttr(matched, bills, attrs);
+        assignAttr(matched, bills);
         if (bills.children && bills.children.length) {
           mergeBills(bills.children, matched.children, matched);
         }