浏览代码

广西接口

Tony Kang 3 年之前
父节点
当前提交
d7a7483ac2

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

@@ -111,6 +111,14 @@ const INTERFACE_CONFIG = (() => {
         [CONTROL]: '.XML',
       },
     },
+    '广西@广西': {
+      scriptName: 'guangxi_common.js',
+      fileSuffix: {
+        [BID_INVITATION]: '.GLZB',
+        [BID_SUBMISSION]: '.GLTB',
+        [CONTROL]: '.GLKZJ',
+      },
+    },
     '山东@山东': {
       scriptName: 'shandong_common.js',
       fileSuffix: {

+ 148 - 37
web/building_saas/standard_interface/export/guangxi_common.js

@@ -108,33 +108,33 @@ INTERFACE_EXPORT = (() => {
       "清单 第100章 总则": true,
       "清单 第200章 路基": true,
       "清单 第300章 路面": true,
-      "清单 第400章 桥梁、涵洞工程": true,
+      "清单 第400章 桥梁、涵洞": true,
       "清单 第500章 隧道": true,
-      "清单 第600章 交通安全设施": true,
+      "清单 第600章 安全设施及预埋管线": true,
       "清单 第700章 绿化及环境保护设施": true,
-      "清单 第800章 机电工程": true,
-      "清单 第900章 附属区房建工程":true
+      // "清单 第800章 机电工程": true,
+      // "清单 第900章 附属区房建工程":true
     }
   
     const ListCodeMap = {
-      "第100章至900章清单":"1",
-      "清单 第100章 总则": "一",
-      "清单 第200章 路基": "二",
-      "清单 第300章 路面": "三",
-      "清单 第400章 桥梁、涵洞工程": "四",
-      "清单 第500章 隧道": "五",
-      "清单 第600章 交通安全设施": "六",
-      "清单 第700章 绿化及环境保护设施": "七",
-      "清单 第800章 机电工程": "八",
-      "清单 第900章 附属区房建工程": "九",
-      "已包含在清单合计中的材料、工程设备、专业工程暂估价合计": "10",
-      "清单合计减去材料、工程设备、专业工程暂估价合计": "11",
-      "计日工合计": "12",
-      "劳务": "12.1",
-      "材料": "12.2",
-      "机械": "12.3",
-      "暂列金额(不含计日工总额)": "13",
-      "投标报价": "14"
+      "第100章至700章清单合计":["1", "A"],
+      "清单 第100章 总则": ["一", "A1"],
+      "清单 第200章 路基": ["二", "A2"],
+      "清单 第300章 路面": ["三", "A3"],
+      "清单 第400章 桥梁、涵洞": ["四", "A4"],
+      "清单 第500章 隧道": ["五", "A5"],
+      "清单 第600章 安全设施及预埋管线": ["六", "A6"],
+      "清单 第700章 绿化及环境保护设施": ["七", "A7"],
+      // "清单 第800章 机电工程": "八",
+      // "清单 第900章 附属区房建工程": "九",
+      "已包含在清单合计中的材料、工程设备、专业工程暂估价合计": ["8", "B"],
+      "清单合计减去材料、工程设备、专业工程暂估价合计": ["9", "C"],
+      "计日工合计": ["10", "D"],
+      "劳务": ["10.1", "D1"],
+      "材料": ["10.2", "D2"],
+      "机械": ["10.3", "D3"],
+      "暂列金额(不含计日工总额)": ["11", "E"],
+      "投标报价": ["12", "Total"]
     } 
   
   
@@ -174,7 +174,7 @@ INTERFACE_EXPORT = (() => {
         let flag = data.flagsIndex.fixed.flag;
         switch (flag) {
           case fixedFlag.ONE_SEVEN_BILLS:
-            pass = data.name == "第100章至900章清单" || data.name == "第100章至900章清单合计";
+            pass = data.name == "第100章至700章清单" || data.name == "第100章至700章清单合计";
             break;
           case fixedFlag.PROVISIONAL_TOTAL:
             pass = data.name == "已包含在清单合计中的材料、工程设备、专业工程暂估价合计";
@@ -185,7 +185,8 @@ INTERFACE_EXPORT = (() => {
           case fixedFlag.DAYWORK_LABOR:
             pass = data.name == "计日工合计";
             break;
-  /*         case fixedFlag.LABOUR_SERVICE:
+          /*
+          case fixedFlag.LABOUR_SERVICE:
             pass = data.name == "劳务";
             break;
           case fixedFlag.MATERIAL:
@@ -193,7 +194,8 @@ INTERFACE_EXPORT = (() => {
             break;
           case fixedFlag.CONSTRUCTION_MACHINE:
             pass = data.name == "机械";
-            break; */
+            break; 
+          //*/
           case fixedFlag.PROVISIONAL:
             pass = data.name == "暂列金额(不含计日工总额)";
             break;
@@ -259,6 +261,9 @@ INTERFACE_EXPORT = (() => {
   
       // 建设项目根节点信息
       function CprjInfo(projectName) {
+        let baseInfo = _.find(projectData.property.basicInformation, {
+          dispName: "基本信息",
+        });
         const attrs = [{
             name: "CprjName",
             value: projectName,
@@ -267,10 +272,26 @@ INTERFACE_EXPORT = (() => {
             name: "CprjType",
             value: cprjType[exportKind],
           },
-        //   {
-        //     name: "Zbbh",
-        //     value: cprjType[exportKind],
-        //   },
+          {
+            name: "Zbbh",
+            value: '', //暂时为空,后期补上
+          },
+          {
+            name: "Zbr",
+            value: _.find(baseInfo.items, { "key": "tendereeName" })
+          },
+          {
+            name: "Zbdljg",
+            value: _.find(baseInfo.items, { "key": "proxy" })
+          },
+          {
+            name: "Shijian",
+            value: _.find(baseInfo.items, { "key": "compileDate" })
+          },
+          {
+            name: "KeyId",
+            value: uuid.v1()
+          }
         ];
         Element.call(this, "CprjInfo", attrs);
       }
@@ -324,6 +345,10 @@ INTERFACE_EXPORT = (() => {
             name: "Key3",
             value: window.btoa(macId),
           },
+          {
+            name: "KeyId",
+            value: uuid.v1()
+          }
         ];
         if (isBidSubmission)
           attrs.splice(6, 0, {
@@ -348,6 +373,10 @@ INTERFACE_EXPORT = (() => {
             name: "ItemStandardNo",
             value: "GYSFX-000000-2018-86",
           },
+          {
+            name: "KeyId",
+            value: uuid.v1()
+          }
         ];
         Element.call(this, "CostBasis", attrs);
   
@@ -387,10 +416,18 @@ INTERFACE_EXPORT = (() => {
             name: "RateLibNo",
             value: feeLibNoMap[feeRateInfo.libID],
           },
+          {
+            name: "KeyId",
+            value: uuid.v1()
+          }
         ];
         Element.call(this, "Rate", attrs);
   
         let RateParams = new emptyElement("RateParams");
+        RateParams.attrs = [{
+          name: "KeyId",
+          value: uuid.v1()
+        }];
         let subRates = projectObj.project.FeeRate.getAllSubRates(feeRateInfo.rates);
         for (let s of subRates) {
           let sname = s.name.replace("(%)", "");
@@ -439,6 +476,10 @@ INTERFACE_EXPORT = (() => {
         }
   
         let RateValues = new emptyElement("RateValues");
+        RateValues.attrs = [{
+          name: "KeyId",
+          value: uuid.v1()
+        }];
   
         function RateValue(CostTypeNo, RateTypeNo, value) {
           const attrs = [{
@@ -453,6 +494,10 @@ INTERFACE_EXPORT = (() => {
               name: "RateValue",
               value: value,
             },
+            {
+              name: "KeyId",
+              value: uuid.v1()
+            }
           ];
           Element.call(this, "RateValue", attrs);
         }
@@ -479,6 +524,10 @@ INTERFACE_EXPORT = (() => {
             name: "Name",
             value: pgljData.constData.usedUnitPriceInfo.name,
           },
+          {
+            name: "KeyId",
+            value: uuid.v1()
+          }
         ];
         Element.call(this, "Pract", attrs);
   
@@ -834,8 +883,20 @@ INTERFACE_EXPORT = (() => {
         }
   
         let Mps = new emptyElement("Mps");
+        Mps.attrs = [{
+          name: "KeyId",
+          value: uuid.v1()
+        }];
         let Materials = new emptyElement("Materials");
+        Materials.attrs = [{
+          name: "KeyId",
+          value: uuid.v1()
+        }];
         let Mechs = new emptyElement("Mechs");
+        Mechs.attrs = [{
+          name: "KeyId",
+          value: uuid.v1()
+        }];
         let gljKeyMap = {};
         let temMechs = [];
         if (isBidSubmission || isControl) { //导出到招标文件中,不输出这一部分。
@@ -885,6 +946,10 @@ INTERFACE_EXPORT = (() => {
             name: "Sums",
             value: totalItem.feesIndex && totalItem.feesIndex.common && totalItem.feesIndex.common.tenderTotalFee ? totalItem.feesIndex.common.tenderTotalFee : 0,
           },
+          {
+            name: "KeyId",
+            value: uuid.v1()
+          }
         ];
         //输出控制价、投标文件时,取调价后的标段总造价。
         //输出招标文件时,取0
@@ -964,6 +1029,10 @@ INTERFACE_EXPORT = (() => {
   
       function getIndexs(tenderProject) {
         let Indexs = new emptyElement('Indexs');
+        Indexs.attrs = [{
+          name: "KeyId",
+          value: uuid.v1()
+        }];
         let feature = tenderProject.property.projectFeature ? tenderProject.property.projectFeature : [];
         for (let f of feature) {
           if (f.code) Indexs.children.push(new IndexItem(f))
@@ -990,17 +1059,23 @@ INTERFACE_EXPORT = (() => {
             {
               name: "Remark",
               value: fea.remark,
+            },
+            {
+              name: "KeyId",
+              value: uuid.v1()
             }
           ]
           Element.call(this, "IndexItem", attrs);
         }
-  
-  
       }
   
   
       function getBillsItems(tenderProject) {
         let items = new emptyElement("Items");
+        items.attrs =[{
+          name: "KeyId",
+          value: uuid.v1()
+        }];
         let rootNodes = tenderProject.mainTree.roots;
         for (let r of rootNodes) {
           
@@ -1082,8 +1157,12 @@ INTERFACE_EXPORT = (() => {
             let fail = billNameChecking(bNode,tenderProject.projectInfo.name,fixedFlag)
             //fail: { hint: '错误提示', type: '提示所属(基本就是单位工程名称)' }
             let ListCode = "";
-            if (ListCodeMap[data.name]) ListCode = ListCodeMap[data.name];
+            if (ListCodeMap[data.name]) ListCode = ListCodeMap[data.name][0];
             if (data.code && data.code != "") ListCode = data.code;
+            let formulaCode = "";
+            if (ListCodeMap[data.name]) formulaCode = ListCodeMap[data.name][1];
+            let perKeyId = '';
+            if (data.ParentID != -1) perKeyId = data.ParentID;
   
             const attrs = [{
                 name: "ListCode",
@@ -1179,10 +1258,18 @@ INTERFACE_EXPORT = (() => {
                 name: "ItemType",
                 value: getItemType(bNode),
               },
-              /* {
-                name: "FomulaCode",
-                value: ""
-              }, */
+              {
+                name: "FormulaCode",
+                value: formulaCode
+              },
+              {
+                name: "KeyId",
+                value: data.ID
+              },
+              {
+                name: "PerKeyId",
+                value: perKeyId
+              }
             ];
             //投标、招标控制价时。取单价。
             //招标时,如果是“安全生产费”或“暂列金额”,取单价,否则取0。
@@ -1201,6 +1288,10 @@ INTERFACE_EXPORT = (() => {
             function CostComposition(bNode) {
               if (isBidInvitation) return null;
               let CostComposition = new emptyElement('CostComposition');
+              CostComposition.attrs =[{
+                name: "KeyId",
+                value: uuid.v1()
+              }];
               let Norms = [];
               let Costs = [];
               if (bNode.children && bNode.children.length > 0 && bNode.children[0].sourceType == ModuleNames.ration) {
@@ -1245,6 +1336,10 @@ INTERFACE_EXPORT = (() => {
                   {
                     name: "Remarks",
                     value: bills.remark
+                  },
+                  {
+                    name: "KeyId",
+                    value: uuid.v1()
                   }
                 ]
                 Element.call(this, "Formula", attrs);
@@ -1397,6 +1492,10 @@ INTERFACE_EXPORT = (() => {
   
             function CostStructure(item) {
               let CostStructure = new emptyElement('CostStructure');
+              CostStructure.attrs = [{
+                name: "KeyId",
+                value: uuid.v1()
+              }];
               for (let f of cpFeeTypes) {
                 if(itemFeeMap[f.type]) CostStructure.children.push(new CostItem(item,f.type))
               }
@@ -1408,7 +1507,11 @@ INTERFACE_EXPORT = (() => {
                 }, {
                   name: 'Sum',
                   value: 0 //fee.tenderTotalFee
-                }]
+                }, {
+                  name: "KeyId",
+                  value: uuid.v1()
+                }
+              ]
                 if ((isBidSubmission || isControl) && item.feesIndex && item.feesIndex[type]) attrs[1].value = item.feesIndex[type].tenderTotalFee;
                 Element.call(this, "CostItem", attrs);
               }
@@ -1529,6 +1632,10 @@ INTERFACE_EXPORT = (() => {
             value: featrueMap["laneLength"] ? featrueMap["laneLength"].value : "",
             mustHasValue: true
           },
+          {
+            name: "KeyId",
+            value: uuid.v1()
+          }
         ];
         Element.call(this, "Params", attrs);
       }
@@ -1680,6 +1787,10 @@ INTERFACE_EXPORT = (() => {
             value: baseMap["projectExplain"] ? baseMap["projectExplain"].value : "",
             mustHasValue:true
           },
+          {
+            name: "KeyId",
+            value: uuid.v1()
+          }
         ];
         if (isBidInvitation) { //招标文件,则以下的8、12~18则不输出
           attrs.splice(11, 7);