Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

yue 5 gadi atpakaļ
vecāks
revīzija
1de38f7078
41 mainītis faili ar 3629 papildinājumiem un 711 dzēšanām
  1. 18 2
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpAccount.java
  2. 115 19
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCredit.java
  3. 28 3
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCreditChild1.java
  4. 43 1
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCreditChild2.java
  5. 0 79
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCreditChild3.java
  6. 160 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/GeneralSituation.java
  7. 79 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/MaterialEquipment.java
  8. 153 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/Schedule.java
  9. 223 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ScheduleOther.java
  10. 58 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/TheAssetsTotal.java
  11. 124 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/TransferOfPower1.java
  12. 115 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/TransferOfPower2.java
  13. 5 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/ErpCreditChild1Mapper.java
  14. 5 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/ErpCreditChild2Mapper.java
  15. 0 14
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/ErpCreditChild3Mapper.java
  16. 4 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/ErpCreditMapper.java
  17. 22 5
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditChild1Mapper.xml
  18. 24 5
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditChild2Mapper.xml
  19. 0 151
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditChild3Mapper.xml
  20. 50 5
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditMapper.xml
  21. 134 27
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/service/ErpCreditService.java
  22. 316 199
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ErpInfo.java
  23. 173 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportTemplate.java
  24. 462 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtil.java
  25. 582 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtil1.java
  26. 400 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtil2.java
  27. 151 12
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/Test.java
  28. 15 18
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/web/ErpCreditController.java
  29. 28 0
      src/main/java/com/jeeplus/modules/sg/financial/settlement/entity/MaintainData.java
  30. 1 0
      src/main/java/com/jeeplus/modules/sg/financial/settlement/mapper/DataMaintenanceMapper.java
  31. 14 1
      src/main/java/com/jeeplus/modules/sg/financial/settlement/mapper/xml/DataMaintenanceMapper.xml
  32. 3 3
      src/main/java/com/jeeplus/modules/sg/financial/settlement/service/DataMaintenanceService.java
  33. 5 0
      src/main/java/com/jeeplus/modules/sg/financial/settlement/util/ExcelWriter.java
  34. 17 11
      src/main/java/com/jeeplus/modules/sg/financial/settlement/web/DataMaintenanceController.java
  35. 9 2
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/service/MaterialInfoService.java
  36. 10 1
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/service/MaterialVersionService.java
  37. 5 33
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/web/MaterialInfoController.java
  38. 13 2
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/web/MaterialVersionController.java
  39. BIN
      src/main/resources/freemarker/excelmodel/竣工决算模板.xlsx
  40. 0 60
      src/main/webapp/webpage/modules/sg/financial/erp/erpCreditForm.jsp
  41. 65 58
      src/main/webapp/webpage/modules/sg/financial/erp/erpCreditList.js

+ 18 - 2
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpAccount.java

@@ -16,6 +16,7 @@ public class ErpAccount implements Serializable {
 //    private String titleText;//凭证抬头文本
 //    private String hookWbsCode;//挂接WBS编码
 //    private String WbsCode;//WBS编码
+
     private String WbsDetails;//WBS描述
     private String ProjectDefinitionCode;//项目定义编码
     private String ProjectDefinitionDetails;//项目定义描述
@@ -28,12 +29,12 @@ public class ErpAccount implements Serializable {
 //    private String materialCode;//物料编码
     private String materialDetails;//物料描述
     private String unit;//单位
-//    private String theInputTax;//进项税额
+    private String theInputTax;//进项税额
 //    private String taxPurposes;//转出进行税额
 //    private String taxNumbers;//转出凭证号码
 //    private String taxZcDate;//转出凭证过账日期
 //    private String supplier;//供应商)
-//    private String supplierNumber;//供应商名称
+    private String supplierName;//供应商名称
 
 ////    @ExcelField(title="公司代码")
 //    public String getCompanyCode() {
@@ -167,4 +168,19 @@ public class ErpAccount implements Serializable {
         return serialVersionUID;
     }
 
+    public String getTheInputTax() {
+        return theInputTax;
+    }
+
+    public void setTheInputTax(String theInputTax) {
+        this.theInputTax = theInputTax;
+    }
+
+    public String getSupplierName() {
+        return supplierName;
+    }
+
+    public void setSupplierName(String supplierName) {
+        this.supplierName = supplierName;
+    }
 }

+ 115 - 19
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCredit.java

@@ -23,11 +23,21 @@ public class ErpCredit extends DataEntity<ErpCredit>{
     private Double otherLineDamages;//线路施工赔偿费
     private Double otherLegalManage;//法人管理费
     private Double otherTotalFee;//其他费用合计
+    private Double theInputTax;//进项税额
+    private String tenKvModel;//架空导线型号
+    private String tenKvUnit;//10kv线路信息单位
+    private Double tenKvLength;//10kv线路信息长度
+    private Double tenKvLineLength;//10kv线路长度
+    private Double tenKvItsLine;//10kv线路
+    private Double tenKvItesFhvFollow;//400v以下
+    private String supplierName;//供应商名称
     private List<ErpCreditChild1> erpCreditChild1s = new ArrayList<ErpCreditChild1>();
     private List<ErpCreditChild2> erpCreditChild2s = new ArrayList<ErpCreditChild2>();
-    private List<ErpCreditChild3> erpCreditChild3s = new ArrayList<ErpCreditChild3>();
 
-    @ExcelField(title="项目定义编码", align=2, sort=1)
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+    @ExcelField(title="项目定义编号", align=2, sort=1)
     public String getItemId() {
         return itemId;
     }
@@ -51,7 +61,7 @@ public class ErpCredit extends DataEntity<ErpCredit>{
     public void setActualInvestment(Double actualInvestment) {
         this.actualInvestment = actualInvestment;
     }
-    @ExcelField(title="移交生产的资产总值", align=2, sort=4)
+
     public Double getTransferAssets() {
         return transferAssets;
     }
@@ -59,7 +69,7 @@ public class ErpCredit extends DataEntity<ErpCredit>{
     public void setTransferAssets(Double transferAssets) {
         this.transferAssets = transferAssets;
     }
-    @ExcelField(title="建筑费", align=2, sort=5)
+
     public Double getConsBuildingFee() {
         return consBuildingFee;
     }
@@ -67,7 +77,7 @@ public class ErpCredit extends DataEntity<ErpCredit>{
     public void setConsBuildingFee(Double consBuildingFee) {
         this.consBuildingFee = consBuildingFee;
     }
-    @ExcelField(title="安装费", align=2, sort=6)
+
     public Double getConsInstallFee() {
         return consInstallFee;
     }
@@ -75,7 +85,7 @@ public class ErpCredit extends DataEntity<ErpCredit>{
     public void setConsInstallFee(Double consInstallFee) {
         this.consInstallFee = consInstallFee;
     }
-    @ExcelField(title="施工:合计", align=2, sort=7)
+
     public Double getConsTotalFee() {
         return consTotalFee;
     }
@@ -83,7 +93,7 @@ public class ErpCredit extends DataEntity<ErpCredit>{
     public void setConsTotalFee(Double consTotalFee) {
         this.consTotalFee = consTotalFee;
     }
-    @ExcelField(title="监理费", align=2, sort=8)
+
     public Double getOtherSupervisorFee() {
         return otherSupervisorFee;
     }
@@ -91,7 +101,7 @@ public class ErpCredit extends DataEntity<ErpCredit>{
     public void setOtherSupervisorFee(Double otherSupervisorFee) {
         this.otherSupervisorFee = otherSupervisorFee;
     }
-    @ExcelField(title="设计费", align=2, sort=9)
+
     public Double getOtherDesignFee() {
         return otherDesignFee;
     }
@@ -99,7 +109,7 @@ public class ErpCredit extends DataEntity<ErpCredit>{
     public void setOtherDesignFee(Double otherDesignFee) {
         this.otherDesignFee = otherDesignFee;
     }
-    @ExcelField(title="项目前期工作费", align=2, sort=10)
+
     public Double getOtherBeWorkFee() {
         return otherBeWorkFee;
     }
@@ -107,7 +117,7 @@ public class ErpCredit extends DataEntity<ErpCredit>{
     public void setOtherBeWorkFee(Double otherBeWorkFee) {
         this.otherBeWorkFee = otherBeWorkFee;
     }
-    @ExcelField(title="建设期贷款利息", align=2, sort=11)
+
     public Double getOtherBuildLoan() {
         return otherBuildLoan;
     }
@@ -115,7 +125,7 @@ public class ErpCredit extends DataEntity<ErpCredit>{
     public void setOtherBuildLoan(Double otherBuildLoan) {
         this.otherBuildLoan = otherBuildLoan;
     }
-    @ExcelField(title="线路施工赔偿费", align=2, sort=12)
+
     public Double getOtherLineDamages() {
         return otherLineDamages;
     }
@@ -123,7 +133,7 @@ public class ErpCredit extends DataEntity<ErpCredit>{
     public void setOtherLineDamages(Double otherLineDamages) {
         this.otherLineDamages = otherLineDamages;
     }
-    @ExcelField(title="法人管理费", align=2, sort=13)
+
     public Double getOtherLegalManage() {
         return otherLegalManage;
     }
@@ -131,7 +141,7 @@ public class ErpCredit extends DataEntity<ErpCredit>{
     public void setOtherLegalManage(Double otherLegalManage) {
         this.otherLegalManage = otherLegalManage;
     }
-    @ExcelField(title="其他费用:合计", align=2, sort=14)
+
     public Double getOtherTotalFee() {
         return otherTotalFee;
     }
@@ -140,6 +150,70 @@ public class ErpCredit extends DataEntity<ErpCredit>{
         this.otherTotalFee = otherTotalFee;
     }
 
+    public Double getTheInputTax() {
+        return theInputTax;
+    }
+
+    public void setTheInputTax(Double theInputTax) {
+        this.theInputTax = theInputTax;
+    }
+
+    public String getTenKvModel() {
+        return tenKvModel;
+    }
+
+    public void setTenKvModel(String tenKvModel) {
+        this.tenKvModel = tenKvModel;
+    }
+
+    public String getTenKvUnit() {
+        return tenKvUnit;
+    }
+
+    public void setTenKvUnit(String tenKvUnit) {
+        this.tenKvUnit = tenKvUnit;
+    }
+
+    public Double getTenKvLength() {
+        return tenKvLength;
+    }
+
+    public void setTenKvLength(Double tenKvLength) {
+        this.tenKvLength = tenKvLength;
+    }
+
+    public Double getTenKvLineLength() {
+        return tenKvLineLength;
+    }
+
+    public void setTenKvLineLength(Double tenKvLineLength) {
+        this.tenKvLineLength = tenKvLineLength;
+    }
+
+    public Double getTenKvItsLine() {
+        return tenKvItsLine;
+    }
+
+    public void setTenKvItsLine(Double tenKvItsLine) {
+        this.tenKvItsLine = tenKvItsLine;
+    }
+
+    public Double getTenKvItesFhvFollow() {
+        return tenKvItesFhvFollow;
+    }
+
+    public void setTenKvItesFhvFollow(Double tenKvItesFhvFollow) {
+        this.tenKvItesFhvFollow = tenKvItesFhvFollow;
+    }
+
+    public String getSupplierName() {
+        return supplierName;
+    }
+
+    public void setSupplierName(String supplierName) {
+        this.supplierName = supplierName;
+    }
+
     public List<ErpCreditChild1> getErpCreditChild1s() {
         return erpCreditChild1s;
     }
@@ -156,11 +230,33 @@ public class ErpCredit extends DataEntity<ErpCredit>{
         this.erpCreditChild2s = erpCreditChild2s;
     }
 
-    public List<ErpCreditChild3> getErpCreditChild3s() {
-        return erpCreditChild3s;
-    }
-
-    public void setErpCreditChild3s(List<ErpCreditChild3> erpCreditChild3s) {
-        this.erpCreditChild3s = erpCreditChild3s;
+    @Override
+    public String toString() {
+        return "ErpCredit{" +
+                "itemId='" + itemId + '\'' +
+                ", itemName='" + itemName + '\'' +
+                ", actualInvestment=" + actualInvestment +
+                ", transferAssets=" + transferAssets +
+                ", consBuildingFee=" + consBuildingFee +
+                ", consInstallFee=" + consInstallFee +
+                ", consTotalFee=" + consTotalFee +
+                ", otherSupervisorFee=" + otherSupervisorFee +
+                ", otherDesignFee=" + otherDesignFee +
+                ", otherBeWorkFee=" + otherBeWorkFee +
+                ", otherBuildLoan=" + otherBuildLoan +
+                ", otherLineDamages=" + otherLineDamages +
+                ", otherLegalManage=" + otherLegalManage +
+                ", otherTotalFee=" + otherTotalFee +
+                ", theInputTax=" + theInputTax +
+                ", tenKvModel='" + tenKvModel + '\'' +
+                ", tenKvUnit='" + tenKvUnit + '\'' +
+                ", tenKvLength=" + tenKvLength +
+                ", tenKvLineLength=" + tenKvLineLength +
+                ", tenKvItsLine=" + tenKvItsLine +
+                ", tenKvItesFhvFollow=" + tenKvItesFhvFollow +
+                ", supplierName='" + supplierName + '\'' +
+                ", erpCreditChild1s=" + erpCreditChild1s +
+                ", erpCreditChild2s=" + erpCreditChild2s +
+                '}';
     }
 }

+ 28 - 3
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCreditChild1.java

@@ -10,14 +10,18 @@ public class ErpCreditChild1 extends DataEntity<ErpCreditChild1> {//设备费实
     private Double eqmNumbers;//设备台数
     private String eqmTotalCapacity;//设备总容量
     private Double eqmBookedFee1;//设备入账金额
-
+    private String eqmSupplierName;//供应商
     private ErpCredit erpCredit;//父类
 
+    public ErpCreditChild1(){
+
+    }
     public ErpCreditChild1(ErpCredit erpCredit) {
         this.erpCredit = erpCredit;
     }
-    public ErpCreditChild1(){
-        super();
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
     }
 
     public String getEqmMaterialDetails1() {
@@ -60,6 +64,14 @@ public class ErpCreditChild1 extends DataEntity<ErpCreditChild1> {//设备费实
         this.eqmBookedFee1 = eqmBookedFee1;
     }
 
+    public String getEqmSupplierName() {
+        return eqmSupplierName;
+    }
+
+    public void setEqmSupplierName(String eqmSupplierName) {
+        this.eqmSupplierName = eqmSupplierName;
+    }
+
     public ErpCredit getErpCredit() {
         return erpCredit;
     }
@@ -67,4 +79,17 @@ public class ErpCreditChild1 extends DataEntity<ErpCreditChild1> {//设备费实
     public void setErpCredit(ErpCredit erpCredit) {
         this.erpCredit = erpCredit;
     }
+
+    @Override
+    public String toString() {
+        return "ErpCreditChild1{" +
+                "eqmMaterialDetails1='" + eqmMaterialDetails1 + '\'' +
+                ", eqmUnit='" + eqmUnit + '\'' +
+                ", eqmNumbers=" + eqmNumbers +
+                ", eqmTotalCapacity='" + eqmTotalCapacity + '\'' +
+                ", eqmBookedFee1=" + eqmBookedFee1 +
+                ", eqmSupplierName='" + eqmSupplierName + '\'' +
+                ", erpCredit=" + erpCredit +
+                '}';
+    }
 }

+ 43 - 1
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCreditChild2.java

@@ -6,13 +6,19 @@ public class ErpCreditChild2 extends DataEntity<ErpCreditChild2> {//材料费实
     private static final long serialVersionUID = 1L;
     private Double mtlBookedFee2;//材料 入账金额
     private String eqmMaterialDetails2;//设备物料描述
+    private String mtlUnit;//设备单位
+    private Double mtlNumbers;//设备台数
+    private String mtlSupplierName;//供应商
     private ErpCredit erpCredit;//父类
 
     public ErpCreditChild2(ErpCredit erpCredit) {
         this.erpCredit = erpCredit;
     }
     public ErpCreditChild2(){
-        super();
+
+    }
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
     }
 
     public Double getMtlBookedFee2() {
@@ -31,6 +37,30 @@ public class ErpCreditChild2 extends DataEntity<ErpCreditChild2> {//材料费实
         this.eqmMaterialDetails2 = eqmMaterialDetails2;
     }
 
+    public String getMtlUnit() {
+        return mtlUnit;
+    }
+
+    public void setMtlUnit(String mtlUnit) {
+        this.mtlUnit = mtlUnit;
+    }
+
+    public Double getMtlNumbers() {
+        return mtlNumbers;
+    }
+
+    public void setMtlNumbers(Double mtlNumbers) {
+        this.mtlNumbers = mtlNumbers;
+    }
+
+    public String getMtlSupplierName() {
+        return mtlSupplierName;
+    }
+
+    public void setMtlSupplierName(String mtlSupplierName) {
+        this.mtlSupplierName = mtlSupplierName;
+    }
+
     public ErpCredit getErpCredit() {
         return erpCredit;
     }
@@ -38,4 +68,16 @@ public class ErpCreditChild2 extends DataEntity<ErpCreditChild2> {//材料费实
     public void setErpCredit(ErpCredit erpCredit) {
         this.erpCredit = erpCredit;
     }
+
+    @Override
+    public String toString() {
+        return "ErpCreditChild2{" +
+                "mtlBookedFee2=" + mtlBookedFee2 +
+                ", eqmMaterialDetails2='" + eqmMaterialDetails2 + '\'' +
+                ", mtlUnit='" + mtlUnit + '\'' +
+                ", mtlNumbers=" + mtlNumbers +
+                ", mtlSupplierName='" + mtlSupplierName + '\'' +
+                ", erpCredit=" + erpCredit +
+                '}';
+    }
 }

+ 0 - 79
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCreditChild3.java

@@ -1,79 +0,0 @@
-package com.jeeplus.modules.sg.financial.erpcredit.entity;
-
-import com.jeeplus.core.persistence.DataEntity;
-
-public class ErpCreditChild3 extends DataEntity<ErpCreditChild3> {//10kv线路设备费
-    private static final long serialVersionUID = 1L;
-
-    private String tenKvModel;//架空导线型号
-    private String tenKvUnit;//10kv线路信息单位
-    private Double tenKvLength;//10kv线路信息长度
-    private Double tenKvLineLength;//10kv线路长度
-    private Double tenKvItsLine;//10kv线路
-    private Double tenKvItesFhvFollow;//400v以下
-    private ErpCredit erpCredit;//父类
-
-    public ErpCreditChild3(ErpCredit erpCredit) {
-        this.erpCredit = erpCredit;
-    }
-    public ErpCreditChild3(){
-        super();
-    }
-
-
-    public String getTenKvModel() {
-        return tenKvModel;
-    }
-
-    public void setTenKvModel(String tenKvModel) {
-        this.tenKvModel = tenKvModel;
-    }
-
-    public String getTenKvUnit() {
-        return tenKvUnit;
-    }
-
-    public void setTenKvUnit(String tenKvUnit) {
-        this.tenKvUnit = tenKvUnit;
-    }
-
-    public Double getTenKvLength() {
-        return tenKvLength;
-    }
-
-    public void setTenKvLength(Double tenKvLength) {
-        this.tenKvLength = tenKvLength;
-    }
-
-    public Double getTenKvLineLength() {
-        return tenKvLineLength;
-    }
-
-    public void setTenKvLineLength(Double tenKvLineLength) {
-        this.tenKvLineLength = tenKvLineLength;
-    }
-
-    public Double getTenKvItsLine() {
-        return tenKvItsLine;
-    }
-
-    public void setTenKvItsLine(Double tenKvItsLine) {
-        this.tenKvItsLine = tenKvItsLine;
-    }
-
-    public Double getTenKvItesFhvFollow() {
-        return tenKvItesFhvFollow;
-    }
-
-    public void setTenKvItesFhvFollow(Double tenKvItesFhvFollow) {
-        this.tenKvItesFhvFollow = tenKvItesFhvFollow;
-    }
-
-    public ErpCredit getErpCredit() {
-        return erpCredit;
-    }
-
-    public void setErpCredit(ErpCredit erpCredit) {
-        this.erpCredit = erpCredit;
-    }
-}

+ 160 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/GeneralSituation.java

@@ -0,0 +1,160 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+/**
+ * 概况表
+ */
+public class GeneralSituation {
+    private String projectName;//工程名称
+    private String consAddress;//建设地址
+    private String consNature;//建设性质
+    private String lineArea;//线路起止地点
+    private String lineLength;//线路长度
+    private String tenKvLength;//其中:10kv线路
+    private String fourKvLength;//400v及以下
+    private String circuitNumber;//电压及回路数
+    private String designUnit;//设计单位
+    private String buildUnit;//施工单位
+    private String organDataNumber;//预算批准机关、日期、文号
+    private String commencementDate;//开工日期
+    private String completionDate;//竣工日期
+    private String investmentBudget;//预算投资
+    private String actualInvestment;//实际投资
+    private String transferAssets;//移交生产总值
+    private String hasItsOwn;//企业自由
+
+    public String getTransferAssets() {
+        return transferAssets;
+    }
+
+    public void setTransferAssets(String transferAssets) {
+        this.transferAssets = transferAssets;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public String getConsAddress() {
+        return consAddress;
+    }
+
+    public void setConsAddress(String consAddress) {
+        this.consAddress = consAddress;
+    }
+
+    public String getConsNature() {
+        return consNature;
+    }
+
+    public void setConsNature(String consNature) {
+        this.consNature = consNature;
+    }
+
+    public String getLineArea() {
+        return lineArea;
+    }
+
+    public void setLineArea(String lineArea) {
+        this.lineArea = lineArea;
+    }
+
+    public String getLineLength() {
+        return lineLength;
+    }
+
+    public void setLineLength(String lineLength) {
+        this.lineLength = lineLength;
+    }
+
+    public String getTenKvLength() {
+        return tenKvLength;
+    }
+
+    public void setTenKvLength(String tenKvLength) {
+        this.tenKvLength = tenKvLength;
+    }
+
+    public String getFourKvLength() {
+        return fourKvLength;
+    }
+
+    public void setFourKvLength(String fourKvLength) {
+        this.fourKvLength = fourKvLength;
+    }
+
+    public String getCircuitNumber() {
+        return circuitNumber;
+    }
+
+    public void setCircuitNumber(String circuitNumber) {
+        this.circuitNumber = circuitNumber;
+    }
+
+    public String getDesignUnit() {
+        return designUnit;
+    }
+
+    public void setDesignUnit(String designUnit) {
+        this.designUnit = designUnit;
+    }
+
+    public String getBuildUnit() {
+        return buildUnit;
+    }
+
+    public void setBuildUnit(String buildUnit) {
+        this.buildUnit = buildUnit;
+    }
+
+    public String getOrganDataNumber() {
+        return organDataNumber;
+    }
+
+    public void setOrganDataNumber(String organDataNumber) {
+        this.organDataNumber = organDataNumber;
+    }
+
+    public String getCommencementDate() {
+        return commencementDate;
+    }
+
+    public void setCommencementDate(String commencementDate) {
+        this.commencementDate = commencementDate;
+    }
+
+    public String getCompletionDate() {
+        return completionDate;
+    }
+
+    public void setCompletionDate(String completionDate) {
+        this.completionDate = completionDate;
+    }
+
+    public String getInvestmentBudget() {
+        return investmentBudget;
+    }
+
+    public void setInvestmentBudget(String investmentBudget) {
+        this.investmentBudget = investmentBudget;
+    }
+
+    public String getActualInvestment() {
+        return actualInvestment;
+    }
+
+    public void setActualInvestment(String actualInvestment) {
+        this.actualInvestment = actualInvestment;
+    }
+
+    public String getHasItsOwn() {
+        return hasItsOwn;
+    }
+
+    public void setHasItsOwn(String hasItsOwn) {
+        this.hasItsOwn = hasItsOwn;
+    }
+}

+ 79 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/MaterialEquipment.java

@@ -0,0 +1,79 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+/**
+ * 设备材料清册
+ */
+public class MaterialEquipment {
+    private String id;//序号
+    private String meName;//设备材料名称
+    private String meSpecifications;//规格型号
+    private String meSupplierName;//供应单位制造
+    private String meUnit;//计量单位
+    private String meNumber;//数量
+    private String meUnitPrice;//单价
+    private String meAllPrice;//合计
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getMeName() {
+        return meName;
+    }
+
+    public void setMeName(String meName) {
+        this.meName = meName;
+    }
+
+    public String getMeSpecifications() {
+        return meSpecifications;
+    }
+
+    public void setMeSpecifications(String meSpecifications) {
+        this.meSpecifications = meSpecifications;
+    }
+
+    public String getMeSupplierName() {
+        return meSupplierName;
+    }
+
+    public void setMeSupplierName(String meSupplierName) {
+        this.meSupplierName = meSupplierName;
+    }
+
+    public String getMeUnit() {
+        return meUnit;
+    }
+
+    public void setMeUnit(String meUnit) {
+        this.meUnit = meUnit;
+    }
+
+    public String getMeNumber() {
+        return meNumber;
+    }
+
+    public void setMeNumber(String meNumber) {
+        this.meNumber = meNumber;
+    }
+
+    public String getMeUnitPrice() {
+        return meUnitPrice;
+    }
+
+    public void setMeUnitPrice(String meUnitPrice) {
+        this.meUnitPrice = meUnitPrice;
+    }
+
+    public String getMeAllPrice() {
+        return meAllPrice;
+    }
+
+    public void setMeAllPrice(String meAllPrice) {
+        this.meAllPrice = meAllPrice;
+    }
+}

+ 153 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/Schedule.java

@@ -0,0 +1,153 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+/**
+ * 一览表
+ */
+public class Schedule {
+    private String itemId;//项目定义编码
+    private String itemName;//工程名称
+    private String budgetBuildProject;//预算建筑工程
+    private String budgetInstallProject;//预算安装工程
+    private String budgetEquipmentValue;//预算设备价值
+    private String budgetOtherFee;//预算其他费用
+    private String budgetTotalFee;//预算合计金额
+    private String actualBuildProject;//实际金额建筑工程
+    private String actualIntallProject;//实际安装工程
+    private String actualEquipmentValue;//实际设备价值
+    private String actualOtherFee;//实际其他费用
+    private String actualTotalFee;//实际合计
+    private String addSubtractionLines;//增加额
+    private String addSubtractionRate;//增加率
+
+    @Override
+    public String toString() {
+        return "Schedule{" +
+                "itemId='" + itemId + '\'' +
+                ", itemName='" + itemName + '\'' +
+                ", budgetBuildProject='" + budgetBuildProject + '\'' +
+                ", budgetInstallProject='" + budgetInstallProject + '\'' +
+                ", budgetEquipmentValue='" + budgetEquipmentValue + '\'' +
+                ", budgetOtherFee='" + budgetOtherFee + '\'' +
+                ", budgetTotalFee='" + budgetTotalFee + '\'' +
+                ", actualBuildProject='" + actualBuildProject + '\'' +
+                ", actualIntallProject='" + actualIntallProject + '\'' +
+                ", actualEquipmentValue='" + actualEquipmentValue + '\'' +
+                ", actualOtherFee='" + actualOtherFee + '\'' +
+                ", actualTotalFee='" + actualTotalFee + '\'' +
+                ", addSubtractionLines='" + addSubtractionLines + '\'' +
+                ", addSubtractionRate='" + addSubtractionRate + '\'' +
+                '}';
+    }
+
+    public String getItemId() {
+        return itemId;
+    }
+
+    public void setItemId(String itemId) {
+        this.itemId = itemId;
+    }
+
+    public String getItemName() {
+        return itemName;
+    }
+
+    public void setItemName(String itemName) {
+        this.itemName = itemName;
+    }
+
+    public String getBudgetBuildProject() {
+        return budgetBuildProject;
+    }
+
+    public void setBudgetBuildProject(String budgetBuildProject) {
+        this.budgetBuildProject = budgetBuildProject;
+    }
+
+    public String getBudgetInstallProject() {
+        return budgetInstallProject;
+    }
+
+    public void setBudgetInstallProject(String budgetInstallProject) {
+        this.budgetInstallProject = budgetInstallProject;
+    }
+
+    public String getBudgetEquipmentValue() {
+        return budgetEquipmentValue;
+    }
+
+    public void setBudgetEquipmentValue(String budgetEquipmentValue) {
+        this.budgetEquipmentValue = budgetEquipmentValue;
+    }
+
+    public String getBudgetOtherFee() {
+        return budgetOtherFee;
+    }
+
+    public void setBudgetOtherFee(String budgetOtherFee) {
+        this.budgetOtherFee = budgetOtherFee;
+    }
+
+    public String getBudgetTotalFee() {
+        return budgetTotalFee;
+    }
+
+    public void setBudgetTotalFee(String budgetTotalFee) {
+        this.budgetTotalFee = budgetTotalFee;
+    }
+
+    public String getActualBuildProject() {
+        return actualBuildProject;
+    }
+
+    public void setActualBuildProject(String actualBuildProject) {
+        this.actualBuildProject = actualBuildProject;
+    }
+
+    public String getActualIntallProject() {
+        return actualIntallProject;
+    }
+
+    public void setActualIntallProject(String actualIntallProject) {
+        this.actualIntallProject = actualIntallProject;
+    }
+
+    public String getActualEquipmentValue() {
+        return actualEquipmentValue;
+    }
+
+    public void setActualEquipmentValue(String actualEquipmentValue) {
+        this.actualEquipmentValue = actualEquipmentValue;
+    }
+
+    public String getActualOtherFee() {
+        return actualOtherFee;
+    }
+
+    public void setActualOtherFee(String actualOtherFee) {
+        this.actualOtherFee = actualOtherFee;
+    }
+
+    public String getActualTotalFee() {
+        return actualTotalFee;
+    }
+
+    public void setActualTotalFee(String actualTotalFee) {
+        this.actualTotalFee = actualTotalFee;
+    }
+
+    public String getAddSubtractionLines() {
+        return addSubtractionLines;
+    }
+
+    public void setAddSubtractionLines(String addSubtractionLines) {
+        this.addSubtractionLines = addSubtractionLines;
+    }
+
+    public String getAddSubtractionRate() {
+        return addSubtractionRate;
+    }
+
+    public void setAddSubtractionRate(String addSubtractionRate) {
+        this.addSubtractionRate = addSubtractionRate;
+    }
+}

+ 223 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ScheduleOther.java

@@ -0,0 +1,223 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+/**
+ * 其他费用明细表
+ */
+public class ScheduleOther {
+    private String requisitionSite;//建设场地征用及清理费
+    private String compensationAcquisition;//土地征用补偿费
+    private String cleaningFees;//余物清理费
+    private String storageFee;//集中配送物资保管费
+    private String compensateFee;//土地征用补偿费(赔青费)
+    private String managementFee;//项目建设管理费
+    private String preWorkingFee;//项目前期工作费
+    private String itemManageFee;//项目管理经费
+    private String theTenderFee;//招标费
+    private String supervisionFee;//工程监理费
+    private String  technicalFee;//项目建设技术服务费
+    private String surveyFee;//工程勘察费
+    private String designFee;//工程设计费
+    private String drawingBudgetFee;//施工图预算编制费
+    private String evaluationFee;//项目后评价费
+    private String economicFee;//技术经济标准变值管理费
+    private String inspectionFee;//工程建设监督检测费
+    private String preparationFee;//生产准备费
+    private String basicFee;//基本预备费
+    private String reserveFee;//资本化利息
+    private String totalFee;//合计
+
+    @Override
+    public String toString() {
+        return "ScheduleOther{" +
+                "requisitionSite='" + requisitionSite + '\'' +
+                ", compensationAcquisition='" + compensationAcquisition + '\'' +
+                ", cleaningFees='" + cleaningFees + '\'' +
+                ", storageFee='" + storageFee + '\'' +
+                ", compensateFee='" + compensateFee + '\'' +
+                ", managementFee='" + managementFee + '\'' +
+                ", preWorkingFee='" + preWorkingFee + '\'' +
+                ", itemManageFee='" + itemManageFee + '\'' +
+                ", theTenderFee='" + theTenderFee + '\'' +
+                ", supervisionFee='" + supervisionFee + '\'' +
+                ", technicalFee='" + technicalFee + '\'' +
+                ", surveyFee='" + surveyFee + '\'' +
+                ", designFee='" + designFee + '\'' +
+                ", drawingBudgetFee='" + drawingBudgetFee + '\'' +
+                ", evaluationFee='" + evaluationFee + '\'' +
+                ", economicFee='" + economicFee + '\'' +
+                ", inspectionFee='" + inspectionFee + '\'' +
+                ", preparationFee='" + preparationFee + '\'' +
+                ", basicFee='" + basicFee + '\'' +
+                ", reserveFee='" + reserveFee + '\'' +
+                ", totalFee='" + totalFee + '\'' +
+                '}';
+    }
+
+    public String getRequisitionSite() {
+        return requisitionSite;
+    }
+
+    public void setRequisitionSite(String requisitionSite) {
+        this.requisitionSite = requisitionSite;
+    }
+
+    public String getCompensationAcquisition() {
+        return compensationAcquisition;
+    }
+
+    public void setCompensationAcquisition(String compensationAcquisition) {
+        this.compensationAcquisition = compensationAcquisition;
+    }
+
+    public String getCleaningFees() {
+        return cleaningFees;
+    }
+
+    public void setCleaningFees(String cleaningFees) {
+        this.cleaningFees = cleaningFees;
+    }
+
+    public String getStorageFee() {
+        return storageFee;
+    }
+
+    public void setStorageFee(String storageFee) {
+        this.storageFee = storageFee;
+    }
+
+    public String getCompensateFee() {
+        return compensateFee;
+    }
+
+    public void setCompensateFee(String compensateFee) {
+        this.compensateFee = compensateFee;
+    }
+
+    public String getManagementFee() {
+        return managementFee;
+    }
+
+    public void setManagementFee(String managementFee) {
+        this.managementFee = managementFee;
+    }
+
+    public String getPreWorkingFee() {
+        return preWorkingFee;
+    }
+
+    public void setPreWorkingFee(String preWorkingFee) {
+        this.preWorkingFee = preWorkingFee;
+    }
+
+    public String getItemManageFee() {
+        return itemManageFee;
+    }
+
+    public void setItemManageFee(String itemManageFee) {
+        this.itemManageFee = itemManageFee;
+    }
+
+    public String getTheTenderFee() {
+        return theTenderFee;
+    }
+
+    public void setTheTenderFee(String theTenderFee) {
+        this.theTenderFee = theTenderFee;
+    }
+
+    public String getSupervisionFee() {
+        return supervisionFee;
+    }
+
+    public void setSupervisionFee(String supervisionFee) {
+        this.supervisionFee = supervisionFee;
+    }
+
+    public String getTechnicalFee() {
+        return technicalFee;
+    }
+
+    public void setTechnicalFee(String technicalFee) {
+        this.technicalFee = technicalFee;
+    }
+
+    public String getSurveyFee() {
+        return surveyFee;
+    }
+
+    public void setSurveyFee(String surveyFee) {
+        this.surveyFee = surveyFee;
+    }
+
+    public String getDesignFee() {
+        return designFee;
+    }
+
+    public void setDesignFee(String designFee) {
+        this.designFee = designFee;
+    }
+
+    public String getDrawingBudgetFee() {
+        return drawingBudgetFee;
+    }
+
+    public void setDrawingBudgetFee(String drawingBudgetFee) {
+        this.drawingBudgetFee = drawingBudgetFee;
+    }
+
+    public String getEvaluationFee() {
+        return evaluationFee;
+    }
+
+    public void setEvaluationFee(String evaluationFee) {
+        this.evaluationFee = evaluationFee;
+    }
+
+    public String getEconomicFee() {
+        return economicFee;
+    }
+
+    public void setEconomicFee(String economicFee) {
+        this.economicFee = economicFee;
+    }
+
+    public String getInspectionFee() {
+        return inspectionFee;
+    }
+
+    public void setInspectionFee(String inspectionFee) {
+        this.inspectionFee = inspectionFee;
+    }
+
+    public String getPreparationFee() {
+        return preparationFee;
+    }
+
+    public void setPreparationFee(String preparationFee) {
+        this.preparationFee = preparationFee;
+    }
+
+    public String getBasicFee() {
+        return basicFee;
+    }
+
+    public void setBasicFee(String basicFee) {
+        this.basicFee = basicFee;
+    }
+
+    public String getReserveFee() {
+        return reserveFee;
+    }
+
+    public void setReserveFee(String reserveFee) {
+        this.reserveFee = reserveFee;
+    }
+
+    public String getTotalFee() {
+        return totalFee;
+    }
+
+    public void setTotalFee(String totalFee) {
+        this.totalFee = totalFee;
+    }
+}

+ 58 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/TheAssetsTotal.java

@@ -0,0 +1,58 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+public class TheAssetsTotal {
+    private String propertyName;//财产名称
+    private String buildProject;//建筑工程
+    private String intallProject;//安装工程费
+    private String equipmentValue;//设备价值
+    private String costSharing;//分摊费用
+    private String deliveryCostValue;//交付使用资产价值
+
+    public String getPropertyName() {
+        return propertyName;
+    }
+
+    public void setPropertyName(String propertyName) {
+        this.propertyName = propertyName;
+    }
+
+    public String getBuildProject() {
+        return buildProject;
+    }
+
+    public void setBuildProject(String buildProject) {
+        this.buildProject = buildProject;
+    }
+
+    public String getIntallProject() {
+        return intallProject;
+    }
+
+    public void setIntallProject(String intallProject) {
+        this.intallProject = intallProject;
+    }
+
+    public String getEquipmentValue() {
+        return equipmentValue;
+    }
+
+    public void setEquipmentValue(String equipmentValue) {
+        this.equipmentValue = equipmentValue;
+    }
+
+    public String getCostSharing() {
+        return costSharing;
+    }
+
+    public void setCostSharing(String costSharing) {
+        this.costSharing = costSharing;
+    }
+
+    public String getDeliveryCostValue() {
+        return deliveryCostValue;
+    }
+
+    public void setDeliveryCostValue(String deliveryCostValue) {
+        this.deliveryCostValue = deliveryCostValue;
+    }
+}

+ 124 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/TransferOfPower1.java

@@ -0,0 +1,124 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+/**
+ * 移交资产-配电网资产-一览表
+ */
+public class TransferOfPower1 {
+    private String powerId;//配电网项目编号
+    private String powerName;//配电网资产名称
+    private String powerNumberBars;//线路条数
+    private String powerAssetClass;//资产类别
+    private String powerArea;//线路起止地点或配电所在地
+    private String powerDepartment;//保管部门
+    private String powerTenKvLineLength;//10kv线路长度
+    private String powerTenKvCableType;//10kv电缆架空导线型号
+    private String powerBuildFee;//建筑费用
+    private String powerInstallFee;//安装费用
+    private String powerStandInFee;//摊入费用
+    private String powerDeliveredAssets;//交付使用资产价值
+    private String poweRequipmentFee;//其中:附属设备价值
+
+    public String getPowerNumberBars() {
+        return powerNumberBars;
+    }
+
+    public void setPowerNumberBars(String powerNumberBars) {
+        this.powerNumberBars = powerNumberBars;
+    }
+
+    public String getPowerAssetClass() {
+        return powerAssetClass;
+    }
+
+    public void setPowerAssetClass(String powerAssetClass) {
+        this.powerAssetClass = powerAssetClass;
+    }
+
+    public String getPowerId() {
+        return powerId;
+    }
+
+    public void setPowerId(String powerId) {
+        this.powerId = powerId;
+    }
+
+    public String getPowerName() {
+        return powerName;
+    }
+
+    public void setPowerName(String powerName) {
+        this.powerName = powerName;
+    }
+
+    public String getPowerArea() {
+        return powerArea;
+    }
+
+    public void setPowerArea(String powerArea) {
+        this.powerArea = powerArea;
+    }
+
+    public String getPowerDepartment() {
+        return powerDepartment;
+    }
+
+    public void setPowerDepartment(String powerDepartment) {
+        this.powerDepartment = powerDepartment;
+    }
+
+    public String getPowerTenKvLineLength() {
+        return powerTenKvLineLength;
+    }
+
+    public void setPowerTenKvLineLength(String powerTenKvLineLength) {
+        this.powerTenKvLineLength = powerTenKvLineLength;
+    }
+
+    public String getPowerTenKvCableType() {
+        return powerTenKvCableType;
+    }
+
+    public void setPowerTenKvCableType(String powerTenKvCableType) {
+        this.powerTenKvCableType = powerTenKvCableType;
+    }
+
+    public String getPowerBuildFee() {
+        return powerBuildFee;
+    }
+
+    public void setPowerBuildFee(String powerBuildFee) {
+        this.powerBuildFee = powerBuildFee;
+    }
+
+    public String getPowerInstallFee() {
+        return powerInstallFee;
+    }
+
+    public void setPowerInstallFee(String powerInstallFee) {
+        this.powerInstallFee = powerInstallFee;
+    }
+
+    public String getPowerStandInFee() {
+        return powerStandInFee;
+    }
+
+    public void setPowerStandInFee(String powerStandInFee) {
+        this.powerStandInFee = powerStandInFee;
+    }
+
+    public String getPowerDeliveredAssets() {
+        return powerDeliveredAssets;
+    }
+
+    public void setPowerDeliveredAssets(String powerDeliveredAssets) {
+        this.powerDeliveredAssets = powerDeliveredAssets;
+    }
+
+    public String getPoweRequipmentFee() {
+        return poweRequipmentFee;
+    }
+
+    public void setPoweRequipmentFee(String poweRequipmentFee) {
+        this.poweRequipmentFee = poweRequipmentFee;
+    }
+}

+ 115 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/TransferOfPower2.java

@@ -0,0 +1,115 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+/**
+ * 移交资产-配电网资产-一览表2(设备)
+ */
+public class TransferOfPower2 {
+    private String powerId;//配电网项目编号
+    private String powerName;//配电网资产名称
+    private String powerAssetClass;//资产类别
+    private String powerArea;//线路起止地点或配变所在滴
+    private String powerDepartment;//保管部门
+    private String powerNumber;//配变数量
+    private String powerUnit;//计量单位
+    private String powerCapacity;//配变容量
+    private String powerValue;//设备价值
+    private String powerStandInFee;//摊入费用
+    private String powerDeliveredAssets;//交付使用资产价值
+    private String poweRequipmentFee;//其中:附属设备价值
+
+    public String getPowerAssetClass() {
+        return powerAssetClass;
+    }
+
+    public void setPowerAssetClass(String powerAssetClass) {
+        this.powerAssetClass = powerAssetClass;
+    }
+
+    public String getPowerId() {
+        return powerId;
+    }
+
+    public void setPowerId(String powerId) {
+        this.powerId = powerId;
+    }
+
+    public String getPowerName() {
+        return powerName;
+    }
+
+    public void setPowerName(String powerName) {
+        this.powerName = powerName;
+    }
+
+    public String getPowerArea() {
+        return powerArea;
+    }
+
+    public void setPowerArea(String powerArea) {
+        this.powerArea = powerArea;
+    }
+
+    public String getPowerDepartment() {
+        return powerDepartment;
+    }
+
+    public void setPowerDepartment(String powerDepartment) {
+        this.powerDepartment = powerDepartment;
+    }
+
+    public String getPowerNumber() {
+        return powerNumber;
+    }
+
+    public void setPowerNumber(String powerNumber) {
+        this.powerNumber = powerNumber;
+    }
+
+    public String getPowerUnit() {
+        return powerUnit;
+    }
+
+    public void setPowerUnit(String powerUnit) {
+        this.powerUnit = powerUnit;
+    }
+
+    public String getPowerCapacity() {
+        return powerCapacity;
+    }
+
+    public void setPowerCapacity(String powerCapacity) {
+        this.powerCapacity = powerCapacity;
+    }
+
+    public String getPowerValue() {
+        return powerValue;
+    }
+
+    public void setPowerValue(String powerValue) {
+        this.powerValue = powerValue;
+    }
+
+    public String getPowerStandInFee() {
+        return powerStandInFee;
+    }
+
+    public void setPowerStandInFee(String powerStandInFee) {
+        this.powerStandInFee = powerStandInFee;
+    }
+
+    public String getPowerDeliveredAssets() {
+        return powerDeliveredAssets;
+    }
+
+    public void setPowerDeliveredAssets(String powerDeliveredAssets) {
+        this.powerDeliveredAssets = powerDeliveredAssets;
+    }
+
+    public String getPoweRequipmentFee() {
+        return poweRequipmentFee;
+    }
+
+    public void setPoweRequipmentFee(String poweRequipmentFee) {
+        this.poweRequipmentFee = poweRequipmentFee;
+    }
+}

+ 5 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/ErpCreditChild1Mapper.java

@@ -3,8 +3,13 @@ package com.jeeplus.modules.sg.financial.erpcredit.mapper;
 import com.jeeplus.core.persistence.BaseEntity;
 import com.jeeplus.core.persistence.BaseMapper;
 import com.jeeplus.core.persistence.annotation.MyBatisMapper;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCredit;
 import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCreditChild1;
 
+import java.util.List;
+
 @MyBatisMapper
 public interface ErpCreditChild1Mapper extends BaseMapper<ErpCreditChild1> {
+
+    public List<ErpCreditChild1> findErpCreditChild1List(String[] ids);
 }

+ 5 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/ErpCreditChild2Mapper.java

@@ -6,9 +6,14 @@ package com.jeeplus.modules.sg.financial.erpcredit.mapper;
 import com.jeeplus.core.persistence.BaseMapper;
 import com.jeeplus.core.persistence.annotation.MyBatisMapper;
 import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCredit;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCreditChild1;
 import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCreditChild2;
 
+import java.util.List;
+
 
 @MyBatisMapper
 public interface ErpCreditChild2Mapper extends BaseMapper<ErpCreditChild2> {
+
+    public List<ErpCreditChild2> findErpCreditChild2List(String[] ids);
 }

+ 0 - 14
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/ErpCreditChild3Mapper.java

@@ -1,14 +0,0 @@
-/**
- * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
- */
-package com.jeeplus.modules.sg.financial.erpcredit.mapper;
-
-import com.jeeplus.core.persistence.BaseMapper;
-import com.jeeplus.core.persistence.annotation.MyBatisMapper;
-import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCredit;
-import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCreditChild3;
-
-
-@MyBatisMapper
-public interface ErpCreditChild3Mapper extends BaseMapper<ErpCreditChild3> {
-}

+ 4 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/ErpCreditMapper.java

@@ -7,7 +7,11 @@ import com.jeeplus.core.persistence.BaseMapper;
 import com.jeeplus.core.persistence.annotation.MyBatisMapper;
 import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCredit;
 
+import java.util.List;
+
 
 @MyBatisMapper
 public interface ErpCreditMapper extends BaseMapper<ErpCredit> {
+    //查询
+    public List<ErpCredit> findErpCreditList(String[] ids);
 }

+ 22 - 5
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditChild1Mapper.xml

@@ -15,7 +15,8 @@
 		a.eqm_unit As "eqmUnit",
 		a.eqm_numbers As "eqmNumbers",
 		a.eqm_total_capacity As "eqmTotalCapacity",
-		a.eqm_booked_fee As "eqmBookedFee1"
+		a.eqm_booked_fee As "eqmBookedFee1",
+		a.eqm_supplier_name As "eqmSupplierName"
 	</sql>
 
 	<select id="get" resultType="ErpCreditChild1" >
@@ -78,7 +79,8 @@
 			eqm_unit,
 			eqm_numbers,
 			eqm_total_capacity,
-			eqm_booked_fee
+			eqm_booked_fee,
+			eqm_supplier_name
 		) VALUES (
 			#{id},
 			#{createBy.id},
@@ -92,7 +94,8 @@
     		#{eqmUnit},
     		#{eqmNumbers},
     		#{eqmTotalCapacity},
-    		#{eqmBookedFee1}
+    		#{eqmBookedFee1},
+    		#{eqmSupplierName}
 		)
 	</insert>
 	
@@ -106,7 +109,8 @@
 			eqm_unit = #{eqmUnit},
 			eqm_numbers = #{eqmNumbers},
 			eqm_total_capacity = #{eqmTotalCapacity},
-			eqm_booked_fee = #{eqmBookedFee1}
+			eqm_booked_fee = #{eqmBookedFee1},
+			eqm_supplier_name = #{eqmSupplierName}
 		WHERE id = #{id}
 	</update>
 	
@@ -143,5 +147,18 @@
 	<select id="findUniqueByProperty" resultType="TestDataChild11" statementType="STATEMENT">
 		select * FROM js_erp_credit_child1  where ${propertyName} = '${value}'
 	</select>
-	
+	<!--查找多个条件-->
+	<select id="findErpCreditChild1List" parameterType="java.util.List" resultType="erpCreditChild1">
+		select
+		<include refid="erpChild1Columns"/>
+		FROM js_erp_credit_child1 a
+		WHERE a.del_flag = '0'
+		and a.erp_credit_id in
+		<if test="array !=null and array.length > 0">
+			<foreach collection="array" index="index" item="item" open="("
+					 separator="," close=")">
+				#{item}
+			</foreach>
+		</if>
+	</select>
 </mapper>

+ 24 - 5
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditChild2Mapper.xml

@@ -12,7 +12,10 @@
 		a.del_flag AS "delFlag",
 		a.erp_credit_id As "erpCredit.id",
 		a.eqm_material_details As "eqmMaterialDetails2",
-		a.mtl_booked_fee As "mtlBookedFee2"
+		a.mtl_booked_fee As "mtlBookedFee2",
+		a.mtl_unit As "mtlUnit",
+		a.mtl_numbers As "mtlNumbers",
+		a.mtl_supplier_name As "mtlSupplierName"
 	</sql>
 
 	<select id="get" resultType="ErpCreditChild2" >
@@ -72,7 +75,8 @@
 			del_flag,
 			erp_credit_id,
 			eqm_material_details,
-			mtl_booked_fee
+			mtl_booked_fee,
+			mtl_supplier_name
 		) VALUES (
 			#{id},
 			#{createBy.id},
@@ -83,7 +87,8 @@
 			#{delFlag},
 			#{erpCredit.id},
 			#{eqmMaterialDetails2},
-			#{mtlBookedFee2}
+			#{mtlBookedFee2},
+			#{mtlSupplierName}
 		)
 	</insert>
 	
@@ -94,7 +99,8 @@
 			remarks = #{remarks},
 			del_flag = #{delFlag},
 			eqm_material_details = #{eqmMaterialDetails2},
-			mtl_booked_fee = #{mtlBookedFee2}
+			mtl_booked_fee = #{mtlBookedFee2},
+			mtl_supplier_name=#{mtlSupplierName}
 		WHERE id = #{id}
 	</update>
 	
@@ -131,5 +137,18 @@
 	<select id="findUniqueByProperty" resultType="ErpCreditChild2" statementType="STATEMENT">
 		select * FROM js_erp_credit_child2  where ${propertyName} = '${value}'
 	</select>
-	
+	<!--查找多个条件-->
+	<select id="findErpCreditChild2List" parameterType="java.util.List" resultType="erpCreditChild2">
+		select
+		<include refid="erpChild2Columns"/>
+		FROM js_erp_credit_child2 a
+		WHERE a.del_flag = '0'
+		and a.erp_credit_id in
+		<if test="array !=null and array.length > 0">
+			<foreach collection="array" index="index" item="item" open="("
+					 separator="," close=")">
+				#{item}
+			</foreach>
+		</if>
+	</select>
 </mapper>

+ 0 - 151
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditChild3Mapper.xml

@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.jeeplus.modules.sg.financial.erpcredit.mapper.ErpCreditChild3Mapper">
-	<sql id="erpChild3Columns">
-		a.id AS "id",
-		a.create_by AS "createBy.id",
-		a.create_date AS "createDate",
-		a.update_by AS "updateBy.id",
-		a.update_date AS "updateDate",
-		a.remarks AS "remarks",
-		a.del_flag AS "delFlag",
-		a.erp_credit_id As "erpCredit.id",
-		a.tenkv_model As "tenKvModel",
-		a.tenkv_unit As "tenKvUnit",
-		a.tenkv_length As "tenKvLength",
-		a.tenkv_line_length As "tenKvLineLength",
-		a.tenkv_its_line As "tenKvItsLine",
-		a.tenkv_ites_fhv_follow As "tenKvItesFhvFollow"
-	</sql>
-
-    
-	<select id="get" resultType="ErpCreditChild3" >
-		SELECT 
-			<include refid="erpChild3Columns"/>
-		FROM js_erp_credit_child3 a
-		WHERE a.erp_credit_id = #{erpCredit.id}
-	</select>
-	
-	<select id="findList" resultType="ErpCreditChild3" >
-		SELECT 
-			<include refid="erpChild3Columns"/>
-		FROM js_erp_credit_child3 a
-		<where>
-			a.del_flag = #{DEL_FLAG_NORMAL}
-			${dataScope}
-			<if test="erpCredit != null and erpCredit.itemId != null and erpCredit.itemId != ''">
-				AND a.erp_credit_id = #{erpCredit.id}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.create_date ASC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="ErpCreditChild3" >
-		SELECT 
-			<include refid="erpChild3Columns"/>
-		FROM js_erp_credit_child3 a
-		<where>
-			a.del_flag = #{DEL_FLAG_NORMAL}
-			${dataScope}
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.create_date ASC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert">
-		INSERT INTO js_erp_credit_child3(
-			id,
-			create_by,
-			create_date,
-			update_by,
-			update_date,
-			remarks,
-			del_flag,
-			erp_credit_id,
-			tenkv_model,
-			tenkv_unit,
-			tenkv_length,
-			tenkv_line_length,
-			tenkv_its_line,
-			tenkv_ites_fhv_follow
-		) VALUES (
-			#{id},
-			#{createBy.id},
-			#{createDate},
-			#{updateBy.id},
-			#{updateDate},
-			#{remarks},
-			#{delFlag},
-			#{erpCredit.id},
-			#{tenKvModel},
-    		#{tenKvUnit},
-    		#{tenKvLength},
-    		#{tenKvLineLength},
-    		#{tenKvItsLine},
-    		#{tenKvItesFhvFollow}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE js_erp_credit_child3 SET
-			update_by = #{updateBy.id},
-			update_date = #{updateDate},
-			remarks = #{remarks},
-			del_flag = #{delFlag},
-			tenkv_model = #{tenKvModel},
-			tenkv_unit = #{tenKvUnit},
-			tenkv_length = #{tenKvLength},
-			tenkv_line_length = #{tenKvLineLength},
-			tenkv_its_line = #{tenKvItsLine},
-			tenkv_ites_fhv_follow = #{tenKvItesFhvFollow}
-		WHERE id = #{id}
-	</update>
-	
-	
-	<!--物理删除-->
-	<update id="delete">
-		DELETE FROM js_erp_credit_child3
-		<choose>
-			<when test="id !=null and id != ''">
-				WHERE id = #{id}
-			</when>
-			<otherwise>
-				WHERE erp_credit_id = #{erpCredit.id}
-			</otherwise>
-		</choose>
-	</update>
-	
-	<!--逻辑删除-->
-	<update id="deleteByLogic">
-		UPDATE js_erp_credit_child3 SET
-			del_flag = #{DEL_FLAG_DELETE}
-		<choose>
-			<when test="id !=null and id != ''">
-				WHERE id = #{id}
-			</when>
-			<otherwise>
-				WHERE erp_credit_id = #{erpCredit.id}
-			</otherwise>
-		</choose>
-	</update>
-	
-	
-	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
-	<select id="findUniqueByProperty" resultType="ErpCreditChild3" statementType="STATEMENT">
-		select * FROM js_erp_credit_child3  where ${propertyName} = '${value}'
-	</select>
-	
-</mapper>

+ 50 - 5
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditMapper.xml

@@ -23,7 +23,15 @@
 		a.other_build_loan As "otherBuildLoan",
 		a.other_line_damages As "otherLineDamages",
 		a.other_legal_manage As "otherLegalManage",
-		a.other_total_fee As "otherTotalFee"
+		a.other_total_fee As "otherTotalFee",
+		a.tenkv_model As "tenKvModel",
+		a.tenkv_unit As "tenKvUnit",
+		a.tenkv_length As "tenKvLength",
+		a.tenkv_line_length As "tenKvLineLength",
+		a.tenkv_its_line As "tenKvItsLine",
+		a.tenkv_ites_fhv_follow As "tenKvItesFhvFollow",
+		a.the_input_tax As "theInputTax",
+		a.ten_supplier_name As "supplierName"
 	</sql>
 
 	<select id="get" resultType="ErpCredit" >
@@ -94,7 +102,15 @@
 			other_build_loan,
 			other_line_damages,
 			other_legal_manage,
-			other_total_fee
+			other_total_fee,
+			tenkv_model,
+			tenkv_unit,
+			tenkv_length,
+			tenkv_line_length,
+			tenkv_its_line,
+			tenkv_ites_fhv_follow,
+			the_input_tax,
+			ten_supplier_name
 		) VALUES (
 			#{id},
 			#{createBy.id},
@@ -116,7 +132,15 @@
     		#{otherBuildLoan},
     		#{otherLineDamages},
     		#{otherLegalManage},
-    		#{otherTotalFee}
+    		#{otherTotalFee},
+    		#{tenKvModel},
+    		#{tenKvUnit},
+    		#{tenKvLength},
+    		#{tenKvLineLength},
+    		#{tenKvItsLine},
+    		#{tenKvItesFhvFollow},
+    		#{theInputTax},
+    		#{supplierName}
 		)
 	</insert>
 
@@ -139,7 +163,15 @@
 			other_build_loan = #{otherBuildLoan},
 			other_line_damages = #{otherLineDamages},
 			other_legal_manage =#{otherLegalManage},
-			other_total_fee = #{otherTotalFee}
+			other_total_fee = #{otherTotalFee},
+			tenkv_model = #{tenKvModel},
+			tenkv_unit = #{tenKvUnit},
+			tenkv_length = #{tenKvLength},
+			tenkv_line_length = #{tenKvLineLength},
+			tenkv_its_line = #{tenKvItsLine},
+			tenkv_ites_fhv_follow = #{tenKvItesFhvFollow},
+			the_input_tax = #{theInputTax},
+			ten_supplier_name=#{supplierName}
 		WHERE id = #{id}
 	</update>
 
@@ -162,5 +194,18 @@
 	<select id="findUniqueByProperty" resultType="ErpCredit" statementType="STATEMENT">
 		select * FROM js_erp_credit where ${propertyName} = '${value}'
 	</select>
-	
+
+	<select id="findErpCreditList" parameterType="java.util.List" resultType="erpCredit">
+		select
+		<include refid="erpColumns"/>
+		FROM js_erp_credit a
+		WHERE a.del_flag = '0'
+		and a.id in
+		<if test="array !=null and array.length > 0">
+			<foreach collection="array" index="index" item="item" open="("
+					 separator="," close=")">
+				#{item}
+			</foreach>
+		</if>
+	</select>
 </mapper>

+ 134 - 27
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/service/ErpCreditService.java

@@ -3,28 +3,28 @@
  */
 package com.jeeplus.modules.sg.financial.erpcredit.service;
 
+import com.jeeplus.common.json.AjaxJson;
 import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.core.persistence.Page;
 import com.jeeplus.core.service.CrudService;
 import com.jeeplus.modules.sg.financial.erpcredit.entity.*;
 import com.jeeplus.modules.sg.financial.erpcredit.mapper.ErpCreditChild1Mapper;
 import com.jeeplus.modules.sg.financial.erpcredit.mapper.ErpCreditChild2Mapper;
-import com.jeeplus.modules.sg.financial.erpcredit.mapper.ErpCreditChild3Mapper;
 import com.jeeplus.modules.sg.financial.erpcredit.mapper.ErpCreditMapper;
-import com.jeeplus.modules.sg.financial.erpcredit.util.ErpInfo;
-import com.jeeplus.modules.test.onetomany.dialog.entity.TestDataChild11;
-import com.jeeplus.modules.test.onetomany.dialog.entity.TestDataChild12;
-import com.jeeplus.modules.test.onetomany.dialog.entity.TestDataChild13;
-import com.jeeplus.modules.test.onetomany.dialog.entity.TestDataMain1;
+import com.jeeplus.modules.sg.financial.erpcredit.util.ExportTemplate;
+import com.jeeplus.modules.sg.financial.erpcredit.util.ExportUtil2;
+import com.jeeplus.modules.sg.financial.settlement.entity.MaintainData;
+import com.jeeplus.modules.sg.financial.settlement.mapper.DataMaintenanceMapper;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.servlet.http.HttpServletResponse;
-import java.util.ArrayList;
-import java.util.HashMap;
+import java.io.*;
+import java.net.URLEncoder;
 import java.util.List;
-import java.util.Map;
 
 
 @Service
@@ -35,13 +35,39 @@ public class ErpCreditService extends CrudService<ErpCreditMapper,ErpCredit> {
     @Autowired
     private ErpCreditChild2Mapper erpCreditChild2Mapper;
     @Autowired
-    private ErpCreditChild3Mapper erpCreditChild3Mapper;
+    private ErpCreditMapper erpCreditMapper;
+    @Autowired
+    private DataMaintenanceMapper dataMaintenanceMapper;
 
+    public List<ErpCredit> getListErpCredit(String[] ids){
+        List<ErpCredit> erpCreditList = erpCreditMapper.findErpCreditList(ids);
+        List<ErpCreditChild1> erpCreditChild1List = erpCreditChild1Mapper.findErpCreditChild1List(ids);
+        List<ErpCreditChild2> erpCreditChild2List = erpCreditChild2Mapper.findErpCreditChild2List(ids);
+        if (null!=erpCreditList&&erpCreditList.size()>0){
+            for (ErpCredit erpCredit:erpCreditList){
+                if (null!=erpCreditChild1List&&erpCreditChild1List.size()>0){
+                    for (ErpCreditChild1 erpCreditChild1:erpCreditChild1List){
+                        if (erpCredit.getId().equals(erpCreditChild1.getErpCredit().getId())){
+                            erpCredit.getErpCreditChild1s().add(erpCreditChild1);
+                        }
+                    }
+                }
+                if (null!=erpCreditChild2List&&erpCreditChild2List.size()>0){
+                    for (ErpCreditChild2 erpCreditChild2:erpCreditChild2List){
+                        if (erpCredit.getId().equals(erpCreditChild2.getErpCredit().getId())){
+                            erpCredit.getErpCreditChild2s().add(erpCreditChild2);
+                        }
+                    }
+                }
+            }
+        }
+        return erpCreditList;
+    }
     public ErpCredit get(String id) {
         ErpCredit erpCredit = super.get(id);
         erpCredit.setErpCreditChild1s(erpCreditChild1Mapper.findList(new ErpCreditChild1(erpCredit)));
         erpCredit.setErpCreditChild2s(erpCreditChild2Mapper.findList(new ErpCreditChild2(erpCredit)));
-        erpCredit.setErpCreditChild3s(erpCreditChild3Mapper.findList(new ErpCreditChild3(erpCredit)));
+//        erpCredit.setErpCreditChild3s(erpCreditChild3Mapper.findList(new ErpCreditChild3(erpCredit)));
         return erpCredit;
     }
 
@@ -55,7 +81,6 @@ public class ErpCreditService extends CrudService<ErpCreditMapper,ErpCredit> {
 
     @Transactional(readOnly = false)
     public void save(ErpCredit erpCredit) {
-        System.out.println(erpCredit);
         super.save(erpCredit);
         for (ErpCreditChild1 erpCreditChild1 : erpCredit.getErpCreditChild1s()){
             if (ErpCreditChild1.DEL_FLAG_NORMAL.equals(erpCredit.getDelFlag())){
@@ -85,20 +110,20 @@ public class ErpCreditService extends CrudService<ErpCreditMapper,ErpCredit> {
                 erpCreditChild2Mapper.delete(erpCreditChild2);
             }
         }
-        for (ErpCreditChild3 erpCreditChild3 : erpCredit.getErpCreditChild3s()){
-            if (ErpCreditChild3.DEL_FLAG_NORMAL.equals(erpCreditChild3.getDelFlag())){
-                if (StringUtils.isBlank(erpCreditChild3.getId())){
-                    erpCreditChild3.setErpCredit(erpCredit);
-                    erpCreditChild3.preInsert();
-                    erpCreditChild3Mapper.insert(erpCreditChild3);
-                }else {
-                    erpCreditChild3.preUpdate();
-                    erpCreditChild3Mapper.update(erpCreditChild3);
-                }
-            }else {
-                erpCreditChild3Mapper.delete(erpCreditChild3);
-            }
-        }
+//        for (ErpCreditChild3 erpCreditChild3 : erpCredit.getErpCreditChild3s()){
+//            if (ErpCreditChild3.DEL_FLAG_NORMAL.equals(erpCreditChild3.getDelFlag())){
+//                if (StringUtils.isBlank(erpCreditChild3.getId())){
+//                    erpCreditChild3.setErpCredit(erpCredit);
+//                    erpCreditChild3.preInsert();
+//                    erpCreditChild3Mapper.insert(erpCreditChild3);
+//                }else {
+//                    erpCreditChild3.preUpdate();
+//                    erpCreditChild3Mapper.update(erpCreditChild3);
+//                }
+//            }else {
+//                erpCreditChild3Mapper.delete(erpCreditChild3);
+//            }
+//        }
     }
 
     @Transactional(readOnly = false)
@@ -106,6 +131,88 @@ public class ErpCreditService extends CrudService<ErpCreditMapper,ErpCredit> {
         super.delete(erpCredit);
         erpCreditChild1Mapper.delete(new ErpCreditChild1(erpCredit));
         erpCreditChild2Mapper.delete(new ErpCreditChild2(erpCredit));
-        erpCreditChild3Mapper.delete(new ErpCreditChild3(erpCredit));
+//        erpCreditChild3Mapper.delete(new ErpCreditChild3(erpCredit));
+    }
+
+    //维护表
+    public List<MaintainData> getFindListMain(String[] ids){
+        return dataMaintenanceMapper.getFindListMain(ids);
+    }
+
+    //导出
+    public void getExport(String[] ids, HttpServletResponse response){
+        List<ErpCredit> erpCreditList = getListErpCredit(ids);
+        List<MaintainData> maintainDatas = getFindListMain(ids);
+        ExportTemplate exportTemplate = new ExportTemplate();
+        File newFile = exportTemplate.createNewFile();
+        // 新文件写入数据,并下载
+        InputStream inputStream = null;
+        XSSFWorkbook workbook = null;
+        XSSFSheet sheet1 = null;
+        XSSFSheet sheet2 = null;
+        XSSFSheet sheet3 = null;
+        XSSFSheet sheet5 = null;
+        XSSFSheet sheet4 = null;
+        XSSFSheet sheet6=null;
+        XSSFSheet sheet7=null;
+        XSSFSheet sheet10=null;
+        XSSFSheet sheet11=null;
+        try {
+            inputStream = new FileInputStream(newFile);// 将excel文件转为输入流
+            workbook = new XSSFWorkbook(inputStream);// 创建个workbook,
+            sheet1 =workbook.getSheetAt(1);
+            sheet2 = workbook.getSheetAt(2);
+            sheet3 = workbook.getSheetAt(3);
+            sheet4 = workbook.getSheetAt(4);
+            sheet5=workbook.getSheetAt(5);
+            sheet6=workbook.getSheetAt(6);
+            sheet7=workbook.getSheetAt(7);
+            sheet10=workbook.getSheetAt(10);
+            sheet11=workbook.getSheetAt(11);
+        } catch (Exception e1) {
+            e1.printStackTrace();
+        }
+        try {
+            // 写数据
+            FileOutputStream fos = new FileOutputStream(newFile);
+            ExportUtil2.getSheet1(sheet1,erpCreditList,maintainDatas);
+            ExportUtil2.getSheet2(sheet2,erpCreditList,maintainDatas);
+            ExportUtil2.getSheet3(sheet3,erpCreditList,maintainDatas);
+            ExportUtil2.getSheet5(sheet5,erpCreditList);
+            ExportUtil2.getSheet6(sheet6,erpCreditList);
+            ExportUtil2.getSheet7(sheet7,erpCreditList);
+            ExportUtil2.getSheet10(sheet10,erpCreditList);
+            ExportUtil2.getSheet11(sheet11,erpCreditList);
+            ExportUtil2.getSheet4(sheet4,erpCreditList);
+            workbook.write(fos);
+            fos.flush();
+            fos.close();
+            InputStream fis = new BufferedInputStream(new FileInputStream(
+                    newFile));
+            byte[] buffer = new byte[fis.available()];
+            fis.read(buffer);
+            fis.close();
+            response.reset();
+            response.setContentType("text/html;charset=UTF-8");
+            OutputStream toClient = new BufferedOutputStream(response.getOutputStream());
+            response.setContentType("application/x-msdownload");
+            String newName = URLEncoder.encode("竣工结算表" + System.currentTimeMillis() + ".xlsx","UTF-8");
+            response.addHeader("Content-Disposition","attachment;filename=\"" + newName + "\"");
+            response.addHeader("Content-Length", "" + newFile.length());
+            toClient.write(buffer);
+            toClient.flush();
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (null != inputStream) {
+                    inputStream.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        // 删除创建的新文件
+        // this.deleteFile(newFile);
     }
 }

+ 316 - 199
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ErpInfo.java

@@ -48,6 +48,12 @@ public  class ErpInfo {
     public final static String CON_PRCAC10="电力电缆,AC10kV";
     public final static String CON_PRCAC20="电力电缆,AC20kV";
 
+    public final static String CON_OICAC1="架空绝缘导线,AC1kV";
+    public final static String CON_PRCAC1="电力电缆,AC1kV";
+
+    public final static String CON_OICAC="架空绝缘导线";
+    public final static String CON_PRCAC="电力电缆";
+
     public final static String  CON_lINE = "-";
 
     public final static String CON_PlPlQ=CON_PROJECT+CON_lINE+CON_PES+CON_lINE+CON_OTR;//工程成本-待摊支出-其他
@@ -82,6 +88,8 @@ public  class ErpInfo {
                 erpAccount.setMaterialDetails((String)importUtil.getCellValue(row,19));
                 erpAccount.setUnit((String)importUtil.getCellValue(row,20));
                 erpAccount.setWbsDetails((String)importUtil.getCellValue(row,9));
+                erpAccount.setTheInputTax((String)importUtil.getCellValue(row,21));
+                erpAccount.setSupplierName((String)importUtil.getCellValue(row,26));
                 list.add(erpAccount);
             }
         }
@@ -90,13 +98,14 @@ public  class ErpInfo {
 
     /**
      * 传入表的数据集合,获取设备费/材料费/10kV线路信息 集合
-     * 分别获取List<ErpCreditChild1>(设备费)<ErpCreditChild2>(材料费)List<ErpCreditChild3>(10kV线路信息)集合中
+     * 分别获取List<ErpCreditChild1>(设备费)<ErpCreditChild2>(材料费)
      * 与List<ErpCredit>项目定义编号对应的对象
      * 添加到List<ErpCredit>集合中的erpCreditChild1s,erpCreditChild2s,erpCreditChild3s.
      * @param list 表格对象
      * @return 返回List<ErpCredit>
      */
     public static List<ErpCredit> getAllErpCreditList(List<ErpAccount> list){
+        double tenKvLineLength=0.0;
         boolean flag; //设备费开关:施工费中 建筑费 安装判断 true-建筑费 false-安装费
         //获取erpCredit对象 list集合
         List<ErpCredit> erpCredits = getListErpCredit(list);
@@ -104,18 +113,26 @@ public  class ErpInfo {
         List<ErpCreditChild1> erpCreditChild1s = getListErpCreditChild1(list);
         //获取ErpCreditChild2对象 list集合  (材料费)
         List<ErpCreditChild2> erpCreditChild2s = getListErpCreditChild2(list);
-        //获取ErpCreditChild3对象 list集合   (10kV线路信息)
-        List<ErpCreditChild3> erpCreditChild3s = getListErpCreditChild3(list);
         //循环erpCredit对象 list集合
         for (ErpCredit erpCredit:erpCredits){
-            flag = true;//赋初始值
+            tenKvLineLength=0.0;
+            flag = false;//赋初始值
+            //赋值线路长度
+            if (null!=erpCredit.getTenKvItesFhvFollow()&&null!=erpCredit.getTenKvItsLine()){
+                tenKvLineLength=erpCredit.getTenKvItesFhvFollow()+erpCredit.getTenKvItsLine();
+                erpCredit.setTenKvLineLength(tenKvLineLength);
+            }
+            //判断线路信息是否为空
+            if (null!=erpCredit.getTenKvModel()&&erpCredit.getTenKvModel().length()!=0){
+                flag=true;
+            }
             //设备费 集合 循环
             for (ErpCreditChild1 erpCreditChild1:erpCreditChild1s){
                 //判断 erpCredit对象项目定义编号  与  ErpCreditChild1对象项目定义编号
                 if (erpCredit.getItemId().equals(erpCreditChild1.getErpCredit().getItemId())){
                     //把erpCreditChild1对象 添加到 List<ErpCredit>的List<ErpCreditChild1>中
                     erpCredit.getErpCreditChild1s().add(erpCreditChild1);
-                    flag =false;
+                    flag =true;
                 }
             }
             //材料费 集合 循环
@@ -124,23 +141,14 @@ public  class ErpInfo {
                 if (erpCreditChild2.getErpCredit().getItemId().equals(erpCredit.getItemId())){
                     //把erpCreditChild1对象 添加到 List<ErpCredit>的List<ErpCreditChild2>中
                     erpCredit.getErpCreditChild2s().add(erpCreditChild2);
-                    flag =false;
-                }
-            }
-            //10kV线路 集合 循环
-            for (ErpCreditChild3 erpCreditChild3:erpCreditChild3s){
-                //判断 erpCredit对象项目定义编号  与  ErpCreditChild2对象项目定义编号
-                if (erpCreditChild3.getErpCredit().getItemId().equals(erpCredit.getItemId())){
-                    //把erpCreditChild1对象 添加到 List<ErpCredit>的List<ErpCreditChild1>中
-                    erpCredit.getErpCreditChild3s().add(erpCreditChild3);
                 }
             }
             if (flag){//如果为true
-                //施工费合计 赋值为 建筑费(无 设备费入账金额 以及 材料费入账金额)
-                erpCredit.setConsBuildingFee(erpCredit.getConsTotalFee());
-            }else {
                 //施工费合计 赋值为安装费(有 设备费入账金额 或者 材料费入账金额)
                 erpCredit.setConsInstallFee(erpCredit.getConsTotalFee());
+            }else {
+                //施工费合计 赋值为 建筑费(无 设备费入账金额 以及 材料费入账金额)
+                erpCredit.setConsBuildingFee(erpCredit.getConsTotalFee());
             }
         }
         return erpCredits;
@@ -155,27 +163,11 @@ public  class ErpInfo {
         List<ErpCredit> erpCredits = new ArrayList<ErpCredit>();//定义集合
         ErpCredit erpCredit=null;//要获取集合对象
         ErpAccount erpAccount=null;//导入表格对象
-        boolean flag = true;//判断 项目定义编号是否相同 true-不相同 false-相同
-        double actualInvestment = 0.0;//实际投资
-        double consTotalFee=0.0;//施工费:合计
-        double otherSupervisorFee=0.0;//其他费用:监理费:入账金额
-        double otherDesignFee = 0.0;//其他费用:设计费:入账金额
-        double otherBuildLoan=0.0;//其他费用:建设期贷款利息
-        double otherLineDamages=0.0;//线路施工赔偿费
-        double otherLegalManage=0.0;//法人管理费
-        double otherTotalFee=0.0;//其他费用合计
-        double lineItemAmount;//行项目金额合计
+        boolean flag;//判断 项目定义编号是否相同 true-不相同 false-相同
         //循环导入表格对象
         for (int i = 0; i < list.size(); i++) {
             flag = true;//默认值为true (默认项目定义编号不相同)
             erpAccount=list.get(i);//获取erpAccount对象
-            //判断 导入表格 对象 的行项目金额是否为空
-            if(erpAccount.getLineItemAmount().isEmpty()){
-                lineItemAmount=0.0;//如果为空  默认值为0.0;
-            }else {
-                //否则 获取行羡慕金额
-                lineItemAmount = Double.parseDouble(erpAccount.getLineItemAmount());
-            }
             //判断当前 集合有数据
             if (null!=erpCredits&&erpCredits.size()>0){
                 //循环 当前得到的ErpCredits对象
@@ -183,55 +175,10 @@ public  class ErpInfo {
                     erpCredit = erpCredits.get(j);//获取 erpCredit对象
                     //判断项目定义号相同
                     if (erpAccount.getProjectDefinitionCode().equals(erpCredit.getItemId())){
-                        //筛选(科目名称)中包含(工程成本-)的所有内容,统计行项目金额合计
-                        if (erpAccount.getSubjectName().contains(ErpInfo.CON_PROJECT)){
-                            //当前实际投资+获取到的行项目金额
-                            actualInvestment=erpCredit.getActualInvestment()+lineItemAmount;
-                            //替换 实际投资金额
-                            erpCredit.setActualInvestment(actualInvestment);
-                        }
-                        //施工费:合计:入账金额 判断物料描述是否为空
-                        if (erpAccount.getMaterialDetails().isEmpty()) {
-                            //筛选物料描述为空的(科目名称)中包含(工程成本-安装工程支出)的所有内容,统计行项目金额合计
-                            if (erpAccount.getSubjectName().contains(ErpInfo.CON_PROJECT + ErpInfo.CON_lINE + ErpInfo.CON_IPE)) {
-                                //当前施工费:合计+获取到的行项目金额
-                                consTotalFee = erpCredit.getConsTotalFee()+ lineItemAmount;
-                                //替换 施工费:合计金额
-                                erpCredit.setConsTotalFee(consTotalFee);
-                            }
-                            //筛选物料描述为空的先筛选(科目名称)中包含(工程成本-待摊支出-其他/工程成本-待摊支出-项目法人管理费-其他/项目管理经费 - 会议费)
-                            if (erpAccount.getSubjectName().contains(ErpInfo.CON_PlPlQ)||
-                                    erpAccount.getSubjectName().contains(ErpInfo.CON_PLPLPLQ)||
-                                    erpAccount.getSubjectName().contains(ErpInfo.CON_PLM)){
-                                //筛选(WBS描述)为工程监理费的行项目金额合计
-                                if (erpAccount.getWbsDetails().equals(ErpInfo.CON_PSF)){
-                                    otherSupervisorFee = erpCredit.getOtherSupervisorFee()+lineItemAmount;//监理费
-                                    erpCredit.setOtherSupervisorFee(otherSupervisorFee);
-                                }
-                                //判断WBS描述为工程设计费
-                                if (erpAccount.getWbsDetails().equals(ErpInfo.CON_EDF)){
-                                    otherDesignFee = erpCredit.getOtherDesignFee() + lineItemAmount;//设计费
-                                    erpCredit.setOtherDesignFee(otherDesignFee);
-                                }
-                                //判断WBS描述为建设期贷款利息
-                                if (erpAccount.getWbsDetails().equals(ErpInfo.CON_OBL)){
-                                    otherBuildLoan =erpCredit.getOtherBuildLoan()+lineItemAmount;//建设期贷款利息
-                                    erpCredit.setOtherBuildLoan(otherBuildLoan);
-                                }
-                                //判断WBS描述为线路施工赔偿费
-                                if (erpAccount.getWbsDetails().equals(ErpInfo.CON_OLD)){
-                                    otherLineDamages = erpCredit.getOtherLineDamages()+lineItemAmount;//建设期贷款利息
-                                    erpCredit.setOtherLineDamages(otherLineDamages);
-                                }
-                                //其他费用:法人管理费
-                                otherLegalManage=erpCredit.getOtherLegalManage()+lineItemAmount;
-                                erpCredit.setOtherLegalManage(otherLegalManage);
-                                //其他费用:合计
-                                otherTotalFee = erpCredit.getOtherTotalFee()+ lineItemAmount;
-                                erpCredit.setOtherTotalFee(otherTotalFee);
-                            }
-                        }
                         flag = false;
+                        erpCredit = getActualAndConstruction(erpCredit,erpAccount,flag);
+                        erpCredit=getOtherFee(erpCredit,erpAccount,flag);
+                        erpCredit=getTenKvLineInformation(erpCredit,erpAccount,flag);
                         break;
                     }
                 }
@@ -241,60 +188,284 @@ public  class ErpInfo {
                 erpCredit = new ErpCredit();//获取ErpCredit对象
                 erpCredit.setItemId(erpAccount.getProjectDefinitionCode());//添加项目定义编号
                 erpCredit.setItemName(erpAccount.getProjectDefinitionDetails());//项目名称
-                erpCredit.setConsTotalFee(lineItemAmount);//添加施工费合计
-                erpCredit.setOtherSupervisorFee(lineItemAmount);//添加其他:监理费
-                erpCredit.setOtherDesignFee(lineItemAmount);//添加 其他设计费
-//                erpCredit.setOtherBeWorkFee(lineItemAmount); // 添加 项目前期工作费 (暂不确定)
-                erpCredit.setOtherBuildLoan(lineItemAmount);//添加 建设期贷款利息
-                erpCredit.setOtherLineDamages(lineItemAmount);//添加 线路施工赔偿费
-                erpCredit.setOtherLegalManage(lineItemAmount);//添加 法人管理费
-                //其他费用:合计
-                erpCredit.setOtherTotalFee(lineItemAmount);
-
-                //筛选(科目名称)中包含(工程成本-)的所有内容,统计行项目金额合计
-                if (erpAccount.getSubjectName().contains(ErpInfo.CON_PROJECT)){
-                    //添加行项目金额 到 ErpCredit对象中的实际投资金额
-                    erpCredit.setActualInvestment(lineItemAmount);
+                erpCredit = getActualAndConstruction(erpCredit,erpAccount,flag);
+                erpCredit = getOtherFee(erpCredit,erpAccount,flag);
+                erpCredit = getTenKvLineInformation(erpCredit,erpAccount,flag);
+                erpCredits.add(erpCredit);
+            }
+        }
+        return erpCredits;
+    }
+
+    /**
+     * 400
+     * @param erpCredit
+     * @param erpAccount
+     * @param flag
+     * @return
+     */
+    public static ErpCredit getFourHundredInformation(ErpCredit erpCredit,ErpAccount erpAccount,boolean flag){
+        double fourHundredKvLength=0.0;//10kv线路信息长度
+        //400
+        if (!erpAccount.getTheNumber().isEmpty()){
+            fourHundredKvLength = Double.parseDouble(erpAccount.getTheNumber());
+        }
+        if (flag){
+            //架空绝缘导线AC1V 电力电缆AC1V
+            if (erpAccount.getMaterialDetails().contains(ErpInfo.CON_OICAC1)||
+                    erpAccount.getMaterialDetails().contains(ErpInfo.CON_PRCAC1)){
+                erpCredit.setTenKvItesFhvFollow(fourHundredKvLength);
+            }
+            return erpCredit;
+        }
+        //得到400
+        if (erpAccount.getMaterialDetails().contains(ErpInfo.CON_OICAC1)||
+                erpAccount.getMaterialDetails().contains(ErpInfo.CON_PRCAC1)){
+            if (null!=erpCredit.getTenKvItesFhvFollow()){//如果值不存在则赋值为0.0
+                fourHundredKvLength = erpCredit.getTenKvItesFhvFollow()+fourHundredKvLength;
+            }
+            erpCredit.setTenKvItesFhvFollow(fourHundredKvLength);
+        }
+        return erpCredit;
+    }
+    /**
+     * 10kv线路信息
+     * @param erpCredit
+     * @param erpAccount
+     * @param flag
+     * @return
+     */
+    public static ErpCredit getTenKvLineInformation(ErpCredit erpCredit,ErpAccount erpAccount,boolean flag){
+        String materialDetails = erpAccount.getMaterialDetails();//物料描述
+        double tenKvLength=0.0;//长度
+        double tenKvItsLine=0.0;//10kv线路
+        String[] split;
+        String[] split1;
+        if (!erpAccount.getTheNumber().isEmpty()){
+            tenKvLength = Double.parseDouble(erpAccount.getTheNumber());
+            tenKvItsLine= Double.parseDouble(erpAccount.getTheNumber());
+        }
+        if (flag){
+            if (materialDetails.contains(ErpInfo.CON_OICAC10)||
+                    materialDetails.contains(ErpInfo.CON_OICAC20)||
+                    materialDetails.contains(ErpInfo.CON_PRCAC10)||
+                    materialDetails.contains(ErpInfo.CON_PRCAC20)){
+                erpCredit.setTenKvModel(materialDetails);//架空导线型号
+                erpCredit.setTenKvUnit(erpAccount.getUnit());//单位
+                erpCredit.setTenKvLength(tenKvLength);//长度
+                erpCredit.setTenKvItsLine(tenKvItsLine);//10kv线路
+                erpCredit.setSupplierName(erpAccount.getSupplierName());
+            }
+            return erpCredit;
+        }
+        //得到10
+        if (materialDetails.contains(ErpInfo.CON_OICAC10)||
+                materialDetails.contains(ErpInfo.CON_OICAC20)||
+                materialDetails.contains(ErpInfo.CON_PRCAC10)||
+                materialDetails.contains(ErpInfo.CON_PRCAC20)){
+            //判断型号 显示
+//            if (null!=erpCredit.getTenKvModel()&& erpCredit.getTenKvModel().length() != 0){
+//                split = materialDetails.split(",");
+//                split1 = erpCredit.getTenKvModel().split(",");
+//                if (materialDetails.contains(ErpInfo.CON_OICAC)){
+//                    if (Double.parseDouble(split[split.length-1]) >= Double.parseDouble(split1[split1.length-1])){
+//                        erpCredit.setTenKvModel(materialDetails);
+//                        erpCredit.setTenKvUnit(erpAccount.getUnit());//单位
+//                        erpCredit.setSupplierName(erpAccount.getSupplierName());//公司
+//                    }else {
+//                        if (!erpCredit.getTenKvModel().contains(ErpInfo.CON_OICAC)){
+//                            erpCredit.setTenKvModel(materialDetails);
+//                            erpCredit.setTenKvUnit(erpAccount.getUnit());//单位
+//                            erpCredit.setSupplierName(erpAccount.getSupplierName());//公司
+//                        }
+//                    }
+//                }else {
+//                    if (!erpCredit.getTenKvModel().contains(ErpInfo.CON_OICAC)){
+//                        if (Double.parseDouble(split[split.length-1]) >= Double.parseDouble(split1[split1.length-1])){
+//                            erpCredit.setTenKvModel(materialDetails);
+//                            erpCredit.setTenKvUnit(erpAccount.getUnit());//单位
+//                            erpCredit.setSupplierName(erpAccount.getSupplierName());//公司
+//                        }
+//                    }
+//                }
+//            }else {
+//                erpCredit.setTenKvModel(materialDetails);
+//                erpCredit.setTenKvUnit(erpAccount.getUnit());//单位
+//                erpCredit.setSupplierName(erpAccount.getSupplierName());//公司
+//            }
+            erpCredit.setTenKvModel(materialDetails);
+            erpCredit.setTenKvUnit(erpAccount.getUnit());//单位
+            erpCredit.setSupplierName(erpAccount.getSupplierName());//公司
+            if (null!=erpCredit.getTenKvLength()){
+                tenKvLength=erpCredit.getTenKvLength()+tenKvLength;
+            }
+            if (null!=erpCredit.getTenKvItsLine()){
+                tenKvItsLine=erpCredit.getTenKvItsLine()+tenKvItsLine;
+            }
+            //添加长度
+            erpCredit.setTenKvLength(tenKvLength);
+            //添加10kv线路
+            erpCredit.setTenKvItsLine(tenKvItsLine);
+        }
+        return erpCredit;
+    }
+    /**
+     * 获取实际金额,进项税额,施工费合计
+     * @param erpCredit
+     * @param erpAccount
+     * @param flag
+     * @return
+     */
+    public static ErpCredit getActualAndConstruction(ErpCredit erpCredit,ErpAccount erpAccount,boolean flag){
+        double actualInvestment = 0.0;//实际投资
+        double consTotalFee=0.0;//施工费:合计
+        double theInputNumer=0.0;//进项税额
+        //判断 导入表格 对象 的行项目金额是否为空
+        if(!erpAccount.getLineItemAmount().isEmpty()){
+            actualInvestment = Double.parseDouble(erpAccount.getLineItemAmount());
+            consTotalFee = Double.parseDouble(erpAccount.getLineItemAmount());
+        }
+        //判断进项税额是否为空值
+        if (!erpAccount.getTheInputTax().isEmpty()){
+            theInputNumer=Double.parseDouble(erpAccount.getTheInputTax());
+        }
+        if (flag){
+            erpCredit.setTheInputTax(theInputNumer);//添加进项税额
+            //筛选(科目名称)中包含(工程成本-)的所有内容,统计行项目金额合计
+            if (erpAccount.getSubjectName().contains(ErpInfo.CON_PROJECT)){
+                //添加行项目金额 到 ErpCredit对象中的实际投资金额
+                erpCredit.setActualInvestment(actualInvestment);
+            }
+            //施工费:合计:入账金额 判断物料描述是否为空
+            if (erpAccount.getMaterialDetails().isEmpty()) {
+                //筛选物料描述为空的(科目名称)中包含(工程成本-安装工程支出)的所有内容,统计行项目金额合计
+                if (erpAccount.getSubjectName().contains(ErpInfo.CON_PROJECT + ErpInfo.CON_lINE + ErpInfo.CON_IPE)) {
+                    //得到施工费
+                    erpCredit.setConsTotalFee(consTotalFee);
+                }
+            }
+            return erpCredit;
+        }
+        //添加进项税额
+        if (null!=erpCredit.getTheInputTax()){
+            theInputNumer=erpCredit.getTheInputTax()+theInputNumer;
+        }
+        erpCredit.setTheInputTax(theInputNumer);
+        //筛选(科目名称)中包含(工程成本-)的所有内容,统计行项目金额合计
+        if (erpAccount.getSubjectName().contains(ErpInfo.CON_PROJECT)){
+            //当前实际投资+获取到的行项目金额
+            if (null!=erpCredit.getActualInvestment()){
+                actualInvestment=erpCredit.getActualInvestment()+actualInvestment;
+            }
+            //替换 实际投资金额
+            erpCredit.setActualInvestment(actualInvestment);
+        }
+        //施工费:合计:入账金额 判断物料描述是否为空
+        if (erpAccount.getMaterialDetails().isEmpty()) {
+            //筛选物料描述为空的(科目名称)中包含(工程成本-安装工程支出)的所有内容,统计行项目金额合计
+            if (erpAccount.getSubjectName().contains(ErpInfo.CON_PROJECT + ErpInfo.CON_lINE + ErpInfo.CON_IPE)) {
+                //当前施工费:合计+获取到的行项目金额
+                if (null!=erpCredit.getConsTotalFee()){
+                    consTotalFee = erpCredit.getConsTotalFee()+ consTotalFee;
                 }
-                //施工费:合计:入账金额 判断物料描述是否为空
-                if (erpAccount.getMaterialDetails().isEmpty()) {
-                    //筛选物料描述为空的(科目名称)中包含(工程成本-安装工程支出)的所有内容,统计行项目金额合计
-                    if (erpAccount.getSubjectName().contains(ErpInfo.CON_PROJECT + ErpInfo.CON_lINE + ErpInfo.CON_IPE)) {
-                        //得到施工费
-                        erpCredit.setConsTotalFee(lineItemAmount);
+                //替换 施工费:合计金额
+                erpCredit.setConsTotalFee(consTotalFee);
+            }
+        }
+        return erpCredit;
+    }
+    /**
+     * 其他费用
+     * @param erpCredit
+     * @param erpAccount
+     * @param flag
+     * @return
+     */
+    public static ErpCredit getOtherFee(ErpCredit erpCredit,ErpAccount erpAccount,boolean flag){
+        double otherSupervisorFee=0.0;//其他费用:监理费:入账金额
+        double otherDesignFee = 0.0;//其他费用:设计费:入账金额
+        double otherBuildLoan=0.0;//其他费用:建设期贷款利息
+        double otherLineDamages=0.0;//线路施工赔偿费
+        double otherLegalManage=0.0;//法人管理费
+        double otherTotalFee=0.0;//其他费用合计
+        double lineItemAmount=0.0;//行项目金额合计
+        //判断 导入表格 对象 的行项目金额是否为空
+        if(!erpAccount.getLineItemAmount().isEmpty()){
+            lineItemAmount = Double.parseDouble(erpAccount.getLineItemAmount());
+        }
+        if (flag){
+            erpCredit.setOtherSupervisorFee(0.0);//添加其他:监理费
+            erpCredit.setOtherDesignFee(0.0);//添加 其他设计费
+            erpCredit.setOtherBuildLoan(0.0);//添加 建设期贷款利息
+            erpCredit.setOtherLineDamages(0.0);//添加 线路施工赔偿费
+            erpCredit.setOtherLegalManage(0.0);//添加 法人管理费
+            //其他费用:合计
+            erpCredit.setOtherTotalFee(0.0);
+            //判断物料描述是否为空
+            if (erpAccount.getMaterialDetails().isEmpty()) {
+                //筛选物料描述为空的先筛选(科目名称)中包含(工程成本-待摊支出-其他/工程成本-待摊支出-项目法人管理费-其他/项目管理经费 - 会议费)
+                if (erpAccount.getSubjectName().contains(ErpInfo.CON_PlPlQ)||
+                        erpAccount.getSubjectName().contains(ErpInfo.CON_PLPLPLQ)||
+                        erpAccount.getSubjectName().contains(ErpInfo.CON_PLM)){
+                    //判断WBS描述为工程监理费
+                    if (erpAccount.getWbsDetails().equals(ErpInfo.CON_PSF)){
+                        erpCredit.setOtherSupervisorFee(lineItemAmount);
                     }
-                    //筛选物料描述为空的先筛选(科目名称)中包含(工程成本-待摊支出-其他/工程成本-待摊支出-项目法人管理费-其他/项目管理经费 - 会议费)
-                    if (erpAccount.getSubjectName().contains(ErpInfo.CON_PlPlQ)||
-                            erpAccount.getSubjectName().contains(ErpInfo.CON_PLPLPLQ)||
-                            erpAccount.getSubjectName().contains(ErpInfo.CON_PLM)){
-                        //判断WBS描述为工程监理费
-                        if (erpAccount.getWbsDetails().equals(ErpInfo.CON_PSF)){
-                            erpCredit.setOtherSupervisorFee(lineItemAmount);
-                        }
-                        //判断WBS描述为工程设计费
-                        if (erpAccount.getWbsDetails().equals(ErpInfo.CON_EDF)){
-                            erpCredit.setOtherDesignFee(lineItemAmount);
-                        }
-                        //判断WBS描述为建设期贷款利息
-                        if (erpAccount.getWbsDetails().equals(ErpInfo.CON_OBL)){
-                            erpCredit.setOtherBuildLoan(lineItemAmount);
-                        }
-                        //判断WBS描述为线路施工赔偿费
-                        if (erpAccount.getWbsDetails().equals(ErpInfo.CON_OLD)){
-                            erpCredit.setOtherLineDamages(lineItemAmount);
-                        }
-                        //其他费用:法人管理费
-                        erpCredit.setOtherLegalManage(lineItemAmount);
-                        //其他费用:合计
-                        erpCredit.setOtherTotalFee(lineItemAmount);
+                    //判断WBS描述为工程设计费
+                    if (erpAccount.getWbsDetails().equals(ErpInfo.CON_EDF)){
+                        erpCredit.setOtherDesignFee(lineItemAmount);
+                    }
+                    //判断WBS描述为建设期贷款利息
+                    if (erpAccount.getWbsDetails().equals(ErpInfo.CON_OBL)){
+                        erpCredit.setOtherBuildLoan(lineItemAmount);
                     }
+                    //判断WBS描述为线路施工赔偿费
+                    if (erpAccount.getWbsDetails().equals(ErpInfo.CON_OLD)){
+                        erpCredit.setOtherLineDamages(lineItemAmount);
+                    }
+                    //其他费用:法人管理费
+                    erpCredit.setOtherLegalManage(lineItemAmount);
+                    //其他费用:合计
+                    erpCredit.setOtherTotalFee(lineItemAmount);
+                }
+            }
+        }else {
+            if (erpAccount.getMaterialDetails().isEmpty()) {
+                //筛选物料描述为空的先筛选(科目名称)中包含(工程成本-待摊支出-其他/工程成本-待摊支出-项目法人管理费-其他/项目管理经费 - 会议费)
+                if (erpAccount.getSubjectName().contains(ErpInfo.CON_PlPlQ)||
+                        erpAccount.getSubjectName().contains(ErpInfo.CON_PLPLPLQ)||
+                        erpAccount.getSubjectName().contains(ErpInfo.CON_PLM)){
+                    //筛选(WBS描述)为工程监理费的行项目金额合计
+                    if (erpAccount.getWbsDetails().equals(ErpInfo.CON_PSF)){
+                        otherSupervisorFee = erpCredit.getOtherSupervisorFee()+lineItemAmount;//监理费
+                        erpCredit.setOtherSupervisorFee(otherSupervisorFee);
+                    }
+                    //判断WBS描述为工程设计费
+                    if (erpAccount.getWbsDetails().equals(ErpInfo.CON_EDF)){
+                        otherDesignFee = erpCredit.getOtherDesignFee() + lineItemAmount;//设计费
+                        erpCredit.setOtherDesignFee(otherDesignFee);
+                    }
+                    //判断WBS描述为建设期贷款利息
+                    if (erpAccount.getWbsDetails().equals(ErpInfo.CON_OBL)){
+                        otherBuildLoan =erpCredit.getOtherBuildLoan()+lineItemAmount;//建设期贷款利息
+                        erpCredit.setOtherBuildLoan(otherBuildLoan);
+                    }
+                    //判断WBS描述为线路施工赔偿费
+                    if (erpAccount.getWbsDetails().equals(ErpInfo.CON_OLD)){
+                        otherLineDamages = erpCredit.getOtherLineDamages()+lineItemAmount;//建设期贷款利息
+                        erpCredit.setOtherLineDamages(otherLineDamages);
+                    }
+                    //其他费用:法人管理费
+                    otherLegalManage=erpCredit.getOtherLegalManage()+lineItemAmount;
+                    erpCredit.setOtherLegalManage(otherLegalManage);
+                    //其他费用:合计
+                    otherTotalFee = erpCredit.getOtherTotalFee()+ lineItemAmount;
+                    erpCredit.setOtherTotalFee(otherTotalFee);
                 }
-                erpCredits.add(erpCredit);
             }
         }
-        return erpCredits;
+        return erpCredit;
     }
-
     /**
      * 获取设备的list集合
      * @param list 导入的表格 bean对象
@@ -313,15 +484,11 @@ public  class ErpInfo {
             flag=true;
             erpAccount=list.get(i);
             //判断设备台数是否为空
-            if (erpAccount.getTheNumber().isEmpty()){//设备台数
-                eqmNumbers=0.0; //为空时 赋初始值0.0
-            }else {
+            if (!erpAccount.getTheNumber().isEmpty()){//设备台数
                 eqmNumbers = Double.parseDouble(erpAccount.getTheNumber()); //否则 获取设备台数 信息
             }
             //判断如行项目金额是否为空
-            if (erpAccount.getLineItemAmount().isEmpty()){
-                eqmBookedFee=0.0;//入账金额赋初始值
-            }else {
+            if (!erpAccount.getLineItemAmount().isEmpty()){
                 eqmBookedFee = Double.parseDouble(erpAccount.getLineItemAmount());//行项目金额赋值费入账金额
             }
             //判断当前 设备费 集合是否存在
@@ -332,9 +499,9 @@ public  class ErpInfo {
                     if (erpCreditChild1.getErpCredit().getItemId().equals(erpAccount.getProjectDefinitionCode())) {
                         //判断物料描述是否相同
                         if (erpAccount.getMaterialDetails().equals(erpCreditChild1.getEqmMaterialDetails1())) {
-                            eqmBookedFee += erpCreditChild1.getEqmBookedFee1();//累加 入账金额
+                            eqmBookedFee = erpCreditChild1.getEqmBookedFee1()+eqmBookedFee;//累加 入账金额
                             erpCreditChild1.setEqmBookedFee1(eqmBookedFee);//替换
-                            eqmNumbers += erpCreditChild1.getEqmNumbers();//累计 数量
+                            eqmNumbers = erpCreditChild1.getEqmNumbers()+eqmNumbers;//累计 数量
                             erpCreditChild1.setEqmNumbers(eqmNumbers);//替换
                             flag = false;// 项目定义编号相同且物料描述相同(当前ErpAccount对象在ErpCreditChild1对象中存在且相同 跳过下面方法)
                             break;
@@ -367,6 +534,7 @@ public  class ErpInfo {
                     erpCreditChild1.setEqmUnit(erpAccount.getUnit());//添加的单位
                     erpCreditChild1.setEqmNumbers(eqmNumbers);//添加数量
                     erpCreditChild1.setEqmBookedFee1(eqmBookedFee);//添加入账金额
+                    erpCreditChild1.setEqmSupplierName(erpAccount.getSupplierName());//添加供应商
                     erpCreditChild1.setErpCredit(erpCredit);
                     creditListChild1.add(erpCreditChild1);
                 }
@@ -384,6 +552,7 @@ public  class ErpInfo {
         List<ErpCreditChild2> creditListChild2 = new ArrayList<ErpCreditChild2>();
         boolean flag = true;//判断 材料费 true-物料描述不同或者项目定义编号不同 false-仙姑定义编号物料描述相同
         double eqmBookedFee2=0.0;//材料入账金额
+        double eqmNumber2=0.0;//设备台数
         ErpCreditChild2 erpCreditChild2=null;
         ErpCredit erpCredit = null;
         ErpAccount erpAccount=null;
@@ -391,12 +560,13 @@ public  class ErpInfo {
             flag=true;//默认初始值 项目定义编号不同
             erpAccount = erpAccounts.get(i);
             //判断行项目金额是否为空
-            if (erpAccount.getLineItemAmount().isEmpty()){
-                eqmBookedFee2 = 0.0;//材料入账金额初始值为0.0
-            }else {
+            if (!erpAccount.getLineItemAmount().isEmpty()){
                 //赋值材料入账金额为行项目金额
                 eqmBookedFee2 = Double.parseDouble(erpAccount.getLineItemAmount());
             }
+            if (!erpAccount.getTheNumber().isEmpty()){//判断设备材料
+                eqmNumber2=Double.parseDouble(erpAccount.getTheNumber());
+            }
             //判断creditListChild2对象集合 是否存在
             if (null!=creditListChild2&&creditListChild2.size()>0){
                 for (int j = 0; j < creditListChild2.size(); j++) {
@@ -405,8 +575,10 @@ public  class ErpInfo {
                     if (erpCreditChild2.getErpCredit().getItemId().equals(erpAccount.getProjectDefinitionCode())) {
                         //判断物料描述是否相同
                         if (erpAccount.getMaterialDetails().equals(erpCreditChild2.getEqmMaterialDetails2())) {
-                            eqmBookedFee2 += erpCreditChild2.getMtlBookedFee2();
+                            eqmBookedFee2 += erpCreditChild2.getMtlBookedFee2();//入账金额累加
                             erpCreditChild2.setMtlBookedFee2(eqmBookedFee2);
+                            eqmNumber2 = erpCreditChild2.getMtlNumbers()+eqmNumber2;//台数累加
+                            erpCreditChild2.setMtlNumbers(eqmNumber2);//添加设备台数
                             flag=false;
                             break;
                         }
@@ -426,6 +598,9 @@ public  class ErpInfo {
                         erpCredit.setItemId(erpAccount.getProjectDefinitionCode());//添加项目id
                         erpCreditChild2.setEqmMaterialDetails2(erpAccount.getMaterialDetails());//添加物料描述
                         erpCreditChild2.setMtlBookedFee2(eqmBookedFee2);//添加项目材料费
+                        erpCreditChild2.setMtlNumbers(eqmNumber2);//添加设备台数
+                        erpCreditChild2.setMtlUnit(erpAccount.getUnit());//添加设备单位
+                        erpCreditChild2.setMtlSupplierName(erpAccount.getSupplierName());//添加供应商
                         erpCreditChild2.setErpCredit(erpCredit);
                         creditListChild2.add(erpCreditChild2);
                     }
@@ -434,62 +609,4 @@ public  class ErpInfo {
         }
         return creditListChild2;
     }
-
-    /**
-     * 获取 10kv数据集合
-     * @param erpAccounts
-     * @return List<ErpCreditChild3> 10KV线路信息
-     */
-    public static List<ErpCreditChild3> getListErpCreditChild3(List<ErpAccount> erpAccounts){
-        List<ErpCreditChild3> creditChild3s = new ArrayList<ErpCreditChild3>();
-        boolean flag = true;//判断 10KV线路信息
-        ErpCredit erpCredit;
-        ErpAccount erpAccount;
-        Double tenKvLength;//10kv线路信息长度
-        ErpCreditChild3 erpCreditChild3;
-        for (int i = 0; i < erpAccounts.size(); i++) {
-            flag=true;
-            erpAccount = erpAccounts.get(i);
-            if (erpAccount.getTheNumber().isEmpty()){
-                tenKvLength=0.0;
-            }else {
-                tenKvLength = Double.parseDouble(erpAccount.getTheNumber());
-            }
-            //相同判断
-            if (null!=creditChild3s&&creditChild3s.size()>0){
-                for (int j = 0; j < creditChild3s.size(); j++) {
-                    erpCreditChild3 = creditChild3s.get(j);
-                    if (erpCreditChild3.getErpCredit().getItemId().equals(erpAccount.getProjectDefinitionCode())) {
-                        //判断物料描述是否相同
-                        if (erpAccount.getMaterialDetails().equals(erpCreditChild3.getTenKvModel())) {
-                            tenKvLength +=erpCreditChild3.getTenKvLength();
-                            erpCreditChild3.setTenKvLength(tenKvLength);
-                            erpCreditChild3.setTenKvLineLength(tenKvLength);
-                            erpCreditChild3.setTenKvItsLine(tenKvLength);
-                            flag=false;
-                            break;
-                        }
-                    }
-                }
-            }
-            if (flag){//赋值初始值
-                if (erpAccount.getMaterialDetails().contains(ErpInfo.CON_OICAC10)||
-                        erpAccount.getMaterialDetails().contains(ErpInfo.CON_OICAC20)||
-                        erpAccount.getMaterialDetails().contains(ErpInfo.CON_PRCAC10)||
-                        erpAccount.getMaterialDetails().contains(ErpInfo.CON_PRCAC20)){
-                    erpCreditChild3 = new ErpCreditChild3();
-                    erpCredit = new ErpCredit();
-                    erpCredit.setItemId(erpAccount.getProjectDefinitionCode());
-                    erpCreditChild3.setTenKvModel(erpAccount.getMaterialDetails());
-                    erpCreditChild3.setTenKvUnit(erpAccount.getUnit());
-                    erpCreditChild3.setTenKvLength(tenKvLength);
-                    erpCreditChild3.setTenKvLineLength(tenKvLength);
-                    erpCreditChild3.setTenKvItsLine(tenKvLength);
-                    erpCreditChild3.setErpCredit(erpCredit);
-                    creditChild3s.add(erpCreditChild3);
-                }
-            }
-        }
-        return creditChild3s;
-    }
 }

+ 173 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportTemplate.java

@@ -0,0 +1,173 @@
+package com.jeeplus.modules.sg.financial.erpcredit.util;
+
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCredit;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ScheduleOther;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+import org.apache.poi.xssf.usermodel.XSSFRow;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 根据模板导出excel表格
+ */
+public class ExportTemplate {
+//    public void exportExcel(List<ErpCredit> erpCredits) {
+//        File newFile = createNewFile();
+//        // 新文件写入数据,并下载
+//        InputStream inputStream = null;
+//        XSSFWorkbook workbook = null;
+//        XSSFSheet sheet1 = null;//概况表
+//        XSSFSheet sheet2=null;//一览表
+//        XSSFSheet sheet3=null;//其他费用明细表
+//        XSSFSheet sheet4=null;//移交生产的资产总表
+//        XSSFSheet sheet5=null;//移交资产—配电网资产一览表(线路)
+//        XSSFSheet sheet6=null;//移交资产—配电网资产一览表(设备)
+//        XSSFSheet sheet7=null;//设备材料清册
+//        XSSFSheet sheet8=null;//竣工工程财务决算表
+//        XSSFSheet sheet9=null;//移交资产—配电网资产一览表(线路)1
+//        XSSFSheet sheet10=null;//移交资产—配电网资产一览表(设备)2
+//        try {
+//            inputStream = new FileInputStream(newFile);// 将excel文件转为输入流
+//            workbook = new XSSFWorkbook(inputStream);// 创建个workbook,
+//            //获取概况表
+//            sheet1 =workbook.getSheetAt(1);
+//            //获取一览表
+//            sheet2 = workbook.getSheetAt(2);
+//            // 获取其他费用明细表
+//            sheet3 = workbook.getSheetAt(3);
+//            //获取移交生产的总表
+//            sheet4=workbook.getSheetAt(4);
+//            //获取移交资产—配电网资产一览表(线路)
+//            sheet5=workbook.getSheetAt(5);
+//            //获取移交资产—配电网资产一览表(设备)
+//            sheet6=workbook.getSheetAt(6);
+//            //获取设备材料清册
+//            sheet7=workbook.getSheetAt(7);
+//            //获取竣工工程财务决算表
+//            sheet8=workbook.getSheetAt(8);
+//            //获取移交资产—配电网资产一览表(线路)1
+//            sheet9=workbook.getSheetAt(10);
+//            //获取移交资产—配电网资产一览表(设备)2
+//            sheet10 = workbook.getSheetAt(11);
+//        } catch (Exception e1) {
+//            e1.printStackTrace();
+//        }
+//
+//        if (sheet3!= null) {
+//            try {
+//                // 写数据
+//                FileOutputStream fos = new FileOutputStream(newFile);
+//                XSSFRow row = sheet3.getRow(6);
+//                XSSFCell cell = row.getCell(3);
+//                ScheduleOther scheduleOther = ExportUtil1.getScheduleOfOtherExpenses(erpCredits);
+//                for (int i = 0; i < 20; i++) {
+//                    row =sheet3.getRow((int)i+6);
+//                    cell=row.getCell(3);
+//                    cell.setCellValue(i);
+//                }
+//                workbook.write(fos);
+//                fos.flush();
+//                fos.close();
+//            } catch (Exception e) {
+//                e.printStackTrace();
+//            } finally {
+//                try {
+//                    if (null != inputStream) {
+//                        inputStream.close();
+//                    }
+//                } catch (Exception e) {
+//                    e.printStackTrace();
+//                }
+//            }
+//        }
+//        // 删除创建的新文件
+//        // this.deleteFile(newFile);
+//    }
+
+    /**
+     * 复制文件
+     * @param file
+     *            源文件
+     * @param fileNew
+     *            复制到的新文件
+     */
+    public static void fileChannelCopy(File file, File fileNew) {
+        try {
+            InputStream in = null;
+            OutputStream out = null;
+            try {
+                in = new BufferedInputStream(new FileInputStream(file), 1024);
+                out = new BufferedOutputStream(new FileOutputStream(fileNew), 1024);
+                byte[] buffer = new byte[1024];
+                int len;
+                while ((len = in.read(buffer)) != -1) {
+                    out.write(buffer, 0, len);
+                }
+            } finally {
+                if (null != in) {
+                    in.close();
+                }
+                if (null != out) {
+                    out.close();
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public String getSispPath() {
+        String sispPath = this.getClass().getResource("/").getPath()+ "freemarker/";
+        return sispPath;
+    }
+    /**
+     * 读取excel模板,并复制到新文件中供写入和下载
+     * @return
+     */
+    public File createNewFile() {
+        // 读取模板,并赋值到新文件
+        // 文件模板路径
+        String path = (getSispPath() + "excelmodel/竣工决算模板.xlsx");
+        File file = new File(path);
+        // 保存文件的路径
+        String realPath = (getSispPath() + "newexcelmodel");
+        // 新的文件名
+        String newFileName = "竣工决算" + System.currentTimeMillis() + ".xlsx";
+        // 判断路径是否存在
+        File filePath = new File(realPath);
+        if (!filePath.exists()) {
+            filePath.mkdirs();
+        }
+        // 写入到新的excel
+        File newFile = new File(realPath, newFileName);
+        try {
+            newFile.createNewFile();
+            // 复制模板到新文件
+            fileChannelCopy(file, newFile);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return newFile;
+    }
+    /**
+     * 下载成功后删除
+     *
+     * @param files
+     */
+    private void deleteFile(File... files) {
+        for (File file : files) {
+            if (file.exists()) {
+                file.delete();
+            }
+        }
+    }
+
+}

+ 462 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtil.java

@@ -0,0 +1,462 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.financial.erpcredit.util;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.utils.Encodes;
+import com.jeeplus.common.utils.Reflections;
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.modules.sys.utils.DictUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
+import org.apache.poi.xssf.usermodel.XSSFRichTextString;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.*;
+
+/**
+ * 导出Excel文件(导出“XLSX”格式,支持大数据量导出   @see org.apache.poi.ss.SpreadsheetVersion)
+ * @author jeeplus
+ * @version 2016-04-21
+ */
+public class ExportUtil {
+
+	private static Logger log = LoggerFactory.getLogger(ExportUtil.class);
+
+	/**
+	 * 工作薄对象
+	 */
+	private SXSSFWorkbook wb;
+
+	/**
+	 * 工作表对象
+	 */
+	private Sheet sheet;
+
+	/**
+	 * 样式列表
+	 */
+	private Map<String, CellStyle> styles;
+
+	/**
+	 * 当前行号
+	 */
+	private int rownum;
+
+	/**
+	 * 注解列表(Object[]{ ExcelField, Field/Method })
+	 */
+	List<Object[]> annotationList = Lists.newArrayList();
+
+	/**
+	 * 构造函数
+	 * @param title 表格标题,传“空值”,表示无标题
+	 * @param cls 实体对象,通过annotation.ExportField获取标题
+	 */
+	public ExportUtil(String title, Class<?> cls){
+		this(title, cls, 1);
+	}
+
+	/**
+	 * 构造函数
+	 * @param title 表格标题,传“空值”,表示无标题
+	 * @param cls 实体对象,通过annotation.ExportField获取标题
+	 * @param type 导出类型(1:导出数据;2:导出模板)
+	 * @param groups 导入分组
+	 */
+	public ExportUtil(String title, Class<?> cls, int type, int... groups){
+		// Get annotation field
+		Field[] fs = cls.getDeclaredFields();
+		for (Field f : fs){
+			ExcelField ef = f.getAnnotation(ExcelField.class);
+			if (ef != null && (ef.type()==0 || ef.type()==type)){
+				if (groups!=null && groups.length>0){
+					boolean inGroup = false;
+					for (int g : groups){
+						if (inGroup){
+							break;
+						}
+						for (int efg : ef.groups()){
+							if (g == efg){
+								inGroup = true;
+								annotationList.add(new Object[]{ef, f});
+								break;
+							}
+						}
+					}
+				}else{
+					annotationList.add(new Object[]{ef, f});
+				}
+			}
+		}
+		// Get annotation method
+		Method[] ms = cls.getDeclaredMethods();
+		for (Method m : ms){
+			ExcelField ef = m.getAnnotation(ExcelField.class);
+			if (ef != null && (ef.type()==0 || ef.type()==type)){
+				if (groups!=null && groups.length>0){
+					boolean inGroup = false;
+					for (int g : groups){
+						if (inGroup){
+							break;
+						}
+						for (int efg : ef.groups()){
+							if (g == efg){
+								inGroup = true;
+								annotationList.add(new Object[]{ef, m});
+								break;
+							}
+						}
+					}
+				}else{
+					annotationList.add(new Object[]{ef, m});
+				}
+			}
+		}
+		// Field sorting
+		Collections.sort(annotationList, new Comparator<Object[]>() {
+			public int compare(Object[] o1, Object[] o2) {
+				return new Integer(((ExcelField)o1[0]).sort()).compareTo(
+						new Integer(((ExcelField)o2[0]).sort()));
+			};
+		});
+		// Initialize
+		List<String> headerList = Lists.newArrayList();
+		for (Object[] os : annotationList){
+			String t = ((ExcelField)os[0]).title();
+			// 如果是导出,则去掉注释
+			if (type==1){
+				String[] ss = StringUtils.split(t, "**", 2);
+				if (ss.length==2){
+					t = ss[0];
+				}
+			}
+			headerList.add(t);
+		}
+		initialize(title, headerList);
+	}
+
+	/**
+	 * 构造函数
+	 * @param title 表格标题,传“空值”,表示无标题
+	 * @param headers 表头数组
+	 */
+	public ExportUtil(String title, String[] headers) {
+		initialize(title, Lists.newArrayList(headers));
+	}
+
+	/**
+	 * 构造函数
+	 * @param title 表格标题,传“空值”,表示无标题
+	 * @param headerList 表头列表
+	 */
+	public ExportUtil(String title, List<String> headerList) {
+		initialize(title, headerList);
+	}
+	
+	/**
+	 * 初始化函数
+	 * @param title 表格标题,传“空值”,表示无标题
+	 * @param headerList 表头列表
+	 */
+	private void initialize(String title, List<String> headerList) {
+		this.wb = new SXSSFWorkbook(500);
+		this.sheet = wb.createSheet("Export");
+		this.styles = createStyles(wb);
+		// Create title
+		if (StringUtils.isNotBlank(title)){
+			Row titleRow = sheet.createRow(rownum++);
+			titleRow.setHeightInPoints(30);
+			Cell titleCell = titleRow.createCell(0);
+			titleCell.setCellStyle(styles.get("title"));
+			titleCell.setCellValue(title);
+			sheet.addMergedRegion(new CellRangeAddress(titleRow.getRowNum(),
+					titleRow.getRowNum(), titleRow.getRowNum(), headerList.size()-1));
+		}
+		// Create header
+		if (headerList == null){
+			throw new RuntimeException("headerList not null!");
+		}
+		Row headerRow = sheet.createRow(rownum++);
+		headerRow.setHeightInPoints(16);
+		for (int i = 0; i < headerList.size(); i++) {
+			Cell cell = headerRow.createCell(i);
+			cell.setCellStyle(styles.get("header"));
+			String[] ss = StringUtils.split(headerList.get(i), "**", 2);
+			if (ss.length==2){
+				cell.setCellValue(ss[0]);
+				Comment comment = this.sheet.createDrawingPatriarch().createCellComment(
+						new XSSFClientAnchor(0, 0, 0, 0, (short) 3, 3, (short) 5, 6));
+				comment.setString(new XSSFRichTextString(ss[1]));
+				cell.setCellComment(comment);
+			}else{
+				cell.setCellValue(headerList.get(i));
+			}
+			sheet.autoSizeColumn(i);
+		}
+		for (int i = 0; i < headerList.size(); i++) {  
+			int colWidth = sheet.getColumnWidth(i)*2;
+	        sheet.setColumnWidth(i, colWidth < 3000 ? 3000 : colWidth);  
+		}
+		log.debug("Initialize success.");
+	}
+	
+	/**
+	 * 创建表格样式
+	 * @param wb 工作薄对象
+	 * @return 样式列表
+	 */
+	private Map<String, CellStyle> createStyles(Workbook wb) {
+		Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
+		
+		CellStyle style = wb.createCellStyle();
+		style.setAlignment(CellStyle.ALIGN_CENTER);
+		style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
+		Font titleFont = wb.createFont();
+		titleFont.setFontName("Arial");
+		titleFont.setFontHeightInPoints((short) 16);
+		titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+		style.setFont(titleFont);
+		styles.put("title", style);
+
+		style = wb.createCellStyle();
+		style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
+		style.setBorderRight(CellStyle.BORDER_THIN);
+		style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
+		style.setBorderLeft(CellStyle.BORDER_THIN);
+		style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
+		style.setBorderTop(CellStyle.BORDER_THIN);
+		style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
+		style.setBorderBottom(CellStyle.BORDER_THIN);
+		style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
+		Font dataFont = wb.createFont();
+		dataFont.setFontName("Arial");
+		dataFont.setFontHeightInPoints((short) 10);
+		style.setFont(dataFont);
+		styles.put("data", style);
+		
+		style = wb.createCellStyle();
+		style.cloneStyleFrom(styles.get("data"));
+		style.setAlignment(CellStyle.ALIGN_LEFT);
+		styles.put("data1", style);
+
+		style = wb.createCellStyle();
+		style.cloneStyleFrom(styles.get("data"));
+		style.setAlignment(CellStyle.ALIGN_CENTER);
+		styles.put("data2", style);
+
+		style = wb.createCellStyle();
+		style.cloneStyleFrom(styles.get("data"));
+		style.setAlignment(CellStyle.ALIGN_RIGHT);
+		styles.put("data3", style);
+		
+		style = wb.createCellStyle();
+		style.cloneStyleFrom(styles.get("data"));
+//		style.setWrapText(true);
+		style.setAlignment(CellStyle.ALIGN_CENTER);
+		style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());
+		style.setFillPattern(CellStyle.SOLID_FOREGROUND);
+		Font headerFont = wb.createFont();
+		headerFont.setFontName("Arial");
+		headerFont.setFontHeightInPoints((short) 10);
+		headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+		headerFont.setColor(IndexedColors.WHITE.getIndex());
+		style.setFont(headerFont);
+		styles.put("header", style);
+		
+		return styles;
+	}
+
+	/**
+	 * 添加一行
+	 * @return 行对象
+	 */
+	public Row addRow(){
+		return sheet.createRow(rownum++);
+	}
+	
+
+	/**
+	 * 添加一个单元格
+	 * @param row 添加的行
+	 * @param column 添加列号
+	 * @param val 添加值
+	 * @return 单元格对象
+	 */
+	public Cell addCell(Row row, int column, Object val){
+		return this.addCell(row, column, val, 0, Class.class);
+	}
+	
+	/**
+	 * 添加一个单元格
+	 * @param row 添加的行
+	 * @param column 添加列号
+	 * @param val 添加值
+	 * @param align 对齐方式(1:靠左;2:居中;3:靠右)
+	 * @return 单元格对象
+	 */
+	public Cell addCell(Row row, int column, Object val, int align, Class<?> fieldType){
+		Cell cell = row.createCell(column);
+		CellStyle style = styles.get("data"+(align>=1&&align<=3?align:""));
+		try {
+			if (val == null){
+				cell.setCellValue("");
+			} else if (val instanceof String) {
+				cell.setCellValue((String) val);
+			} else if (val instanceof Integer) {
+				cell.setCellValue((Integer) val);
+			} else if (val instanceof Long) {
+				cell.setCellValue((Long) val);
+			} else if (val instanceof Double) {
+				cell.setCellValue((Double) val);
+			} else if (val instanceof Float) {
+				cell.setCellValue((Float) val);
+			} else if (val instanceof Date) {
+				DataFormat format = wb.createDataFormat();
+	            style.setDataFormat(format.getFormat("yyyy-MM-dd"));
+				cell.setCellValue((Date) val);
+			} else {
+				if (fieldType != Class.class){
+					cell.setCellValue((String)fieldType.getMethod("setValue", Object.class).invoke(null, val));
+				}else{
+					cell.setCellValue((String)Class.forName(this.getClass().getName().replaceAll(this.getClass().getSimpleName(), 
+						"fieldtype."+val.getClass().getSimpleName()+"Type")).getMethod("setValue", Object.class).invoke(null, val));
+				}
+			}
+		} catch (Exception ex) {
+			log.info("Set cell value ["+row.getRowNum()+","+column+"] error: " + ex.toString());
+			cell.setCellValue(val.toString());
+		}
+		cell.setCellStyle(style);
+		return cell;
+	}
+
+	/**
+	 * 添加数据(通过annotation.ExportField添加数据)
+	 * @return list 数据列表
+	 */
+	public <E> ExportUtil setDataList(List<E> list){
+		for (E e : list){
+			int colunm = 0;
+			Row row = this.addRow();
+			StringBuilder sb = new StringBuilder();
+			for (Object[] os : annotationList){
+				ExcelField ef = (ExcelField)os[0];
+				Object val = null;
+				// Get entity value
+				try{
+					if (StringUtils.isNotBlank(ef.value())){
+						val = Reflections.invokeGetter(e, ef.value());
+					}else{
+						if (os[1] instanceof Field){
+							val = Reflections.invokeGetter(e, ((Field)os[1]).getName());
+						}else if (os[1] instanceof Method){
+							val = Reflections.invokeMethod(e, ((Method)os[1]).getName(), new Class[] {}, new Object[] {});
+						}
+					}
+					// If is dict, get dict label
+					if (StringUtils.isNotBlank(ef.dictType())){
+						val = DictUtils.getDictLabel(val==null?"":val.toString(), ef.dictType(), "");
+					}
+				}catch(Exception ex) {
+					// Failure to ignore
+					log.info(ex.toString());
+					val = "";
+				}
+				this.addCell(row, colunm++, val, ef.align(), ef.fieldType());
+				sb.append(val + ", ");
+			}
+			log.debug("Write success: ["+row.getRowNum()+"] "+sb.toString());
+		}
+		return this;
+	}
+	
+	/**
+	 * 输出数据流
+	 * @param os 输出数据流
+	 */
+	public ExportUtil write(OutputStream os) throws IOException{
+		wb.write(os);
+		return this;
+	}
+	
+	/**
+	 * 输出到客户端
+	 * @param fileName 输出文件名
+	 */
+	public ExportUtil write(HttpServletResponse response, String fileName) throws IOException{
+		response.reset();
+        response.setContentType("application/octet-stream; charset=utf-8");
+        response.setHeader("Content-Disposition", "attachment; filename="+Encodes.urlEncode(fileName));
+		write(response.getOutputStream());
+		return this;
+	}
+	
+	/**
+	 * 输出到文件
+	 * @param name 输出文件名
+	 */
+	public ExportUtil writeFile(String name) throws FileNotFoundException, IOException{
+		FileOutputStream os = new FileOutputStream(name);
+		this.write(os);
+		return this;
+	}
+	
+	/**
+	 * 清理临时文件
+	 */
+	public ExportUtil dispose(){
+		wb.dispose();
+		return this;
+	}
+	
+//	/**
+//	 * 导出测试
+//	 */
+//	public static void main(String[] args) throws Throwable {
+//		
+//		List<String> headerList = Lists.newArrayList();
+//		for (int i = 1; i <= 10; i++) {
+//			headerList.add("表头"+i);
+//		}
+//		
+//		List<String> dataRowList = Lists.newArrayList();
+//		for (int i = 1; i <= headerList.size(); i++) {
+//			dataRowList.add("数据"+i);
+//		}
+//		
+//		List<List<String>> dataList = Lists.newArrayList();
+//		for (int i = 1; i <=1000000; i++) {
+//			dataList.add(dataRowList);
+//		}
+//
+//		ExportExcel ee = new ExportExcel("表格标题", headerList);
+//		
+//		for (int i = 0; i < dataList.size(); i++) {
+//			Row row = ee.addRow();
+//			for (int j = 0; j < dataList.get(i).size(); j++) {
+//				ee.addCell(row, j, dataList.get(i).get(j));
+//			}
+//		}
+//		
+//		ee.writeFile("target/export.xlsx");
+//
+//		ee.dispose();
+//		
+//		log.debug("Export success.");
+//		
+//	}
+
+}

+ 582 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtil1.java

@@ -0,0 +1,582 @@
+package com.jeeplus.modules.sg.financial.erpcredit.util;
+
+import com.jeeplus.modules.sg.financial.erpcredit.entity.*;
+import com.jeeplus.modules.sg.financial.settlement.entity.MaintainData;
+
+import javax.xml.crypto.Data;
+import java.text.DecimalFormat;
+import java.util.*;
+
+public class ExportUtil1 {
+    public static String POWER_DEPARTMENT="配电检修工区";
+    public static String POWER_BDZ="变电站";
+    public static String POWER_BOXBDZ="箱式变电站";
+    public static String POWER_HGW="环网柜";
+    public static String POWER_KGG="高压开关柜";
+    public static String POWER_ZYXL="中压线路";
+    public static String POWER_BDZCOUNT="160200001";
+    public static String POWER_BOXCOUNT="160200002";
+    public static String POWER_HGWCOUNT="160200003";
+    public static String POWER_KGGCOUNT="160200010";
+
+    public static List<Schedule> getScheduleList(List<ErpCredit> erpCreditList,List<MaintainData> maintainDataList){
+        List<Schedule> schedules = new ArrayList<Schedule>();
+        Schedule schedule = null;
+        if (null!=erpCreditList&&erpCreditList.size()>0){
+            for (ErpCredit erpCredit:erpCreditList){
+                schedule = new Schedule();
+                schedule = getActualRelative(schedule,erpCredit,maintainDataList);//得到一览表实际金额
+                schedules.add(schedule);
+            }
+        }
+        return schedules;
+    }
+    //一览表 实际较预算增减
+    public static Schedule getActualRelative(Schedule schedule,ErpCredit erpCredit,List<MaintainData> maintainDataList){
+        DecimalFormat decimalFormat   = new DecimalFormat("#0.00");
+        schedule = getScheduleBudget(schedule,erpCredit,maintainDataList);
+        schedule = getScheduleActual(schedule,erpCredit);
+        double addSubtractionLines = 0.0;
+        double addSubtractionRate1=0.0;
+        String addSubtractionRate2="";
+        if (null==schedule.getActualTotalFee()) {
+            schedule.setActualTotalFee("0");
+        }
+        if (null==schedule.getBudgetTotalFee()){
+            schedule.setBudgetTotalFee("0");
+        }
+        addSubtractionLines=Double.parseDouble(schedule.getActualTotalFee())-Double.parseDouble(schedule.getBudgetTotalFee());
+        schedule.setAddSubtractionLines(String.valueOf(addSubtractionLines));
+        if (null==schedule.getBudgetTotalFee()) {
+            schedule.setAddSubtractionLines("1");
+        }
+        addSubtractionRate1 = addSubtractionLines/Double.parseDouble(schedule.getBudgetTotalFee());
+        addSubtractionRate2 = decimalFormat.format(addSubtractionRate1);
+        schedule.setAddSubtractionRate(addSubtractionRate2);
+        return schedule;
+    }
+    //获取:一览表 预算价值
+    public static Schedule getScheduleBudget(Schedule schedule,ErpCredit erpCredit,List<MaintainData> maintainDataList){
+        if (null!=maintainDataList&&maintainDataList.size()>0){
+            for (MaintainData maintainData:maintainDataList){
+                //判断id是否一样
+                if (maintainData.getProjectId().equals(erpCredit.getItemId())){
+                    schedule.setBudgetBuildProject(String.valueOf(maintainData.getBuildingFee()));//建筑费
+                    schedule.setBudgetInstallProject(String.valueOf(maintainData.getInstallFee()+maintainData.getMaterialFee()));
+                    schedule.setBudgetEquipmentValue(String.valueOf(maintainData.getEquipmentFee()));//设备购置费
+                    schedule.setBudgetTotalFee(String.valueOf(maintainData.getEquipmentFee()+maintainData.getInstallFee()+maintainData.getMaterialFee()+maintainData.getEquipmentFee()));
+                }
+            }
+        }
+        return schedule;
+    }
+    //获取:一览表 实际价值
+    public static Schedule getScheduleActual(Schedule schedule,ErpCredit erpCredit){
+        boolean flag = false;
+        List<ErpCreditChild2> erpCreditChild2s = null;//得到材料费金额
+        List<ErpCreditChild1> erpCreditChild1s = null;//得到设备费金额
+        double netAmount=0.0;//入账金额:设备费,材料费
+        double actualTotalFee=0.0;//合计金额
+        //循环erpCredit集合
+        schedule.setItemId(erpCredit.getItemId());//得到项目定义编号
+        schedule.setItemName(erpCredit.getItemName());//得到项目名称
+        if (null!=erpCredit.getConsBuildingFee()){//如果建筑费不为空
+            //得到建筑费
+            schedule.setActualBuildProject(String.valueOf(erpCredit.getConsBuildingFee()));
+            actualTotalFee+=erpCredit.getConsBuildingFee();
+        }
+        erpCreditChild2s = erpCredit.getErpCreditChild2s();//得到材料费
+        //判断材料费
+        if (erpCreditChild2s!=null&&erpCreditChild2s.size()>0){
+            for (ErpCreditChild2 erpCreditChild2:erpCreditChild2s){
+                if (null!=erpCreditChild2.getMtlBookedFee2()){
+                    netAmount+=erpCreditChild2.getMtlBookedFee2();//得到材料费入账金额
+                    flag = true;
+                }
+            }
+            if (flag){
+                schedule.setActualIntallProject(String.valueOf(netAmount));
+                actualTotalFee+=netAmount;
+            }
+            flag = false;
+            netAmount = 0.0;
+        }
+        erpCreditChild1s = erpCredit.getErpCreditChild1s();//得到设备费
+        //判断设备费
+        if (null!=erpCreditChild1s&&erpCreditChild1s.size()>0){
+            for (ErpCreditChild1 erpCreditChild1:erpCreditChild1s){
+                if (null!=erpCreditChild1.getEqmBookedFee1()){
+                    netAmount+=erpCreditChild1.getEqmBookedFee1();//得到
+                    flag=true;
+                }
+            }
+            if (flag){
+                schedule.setActualEquipmentValue(String.valueOf(netAmount));
+                actualTotalFee+=netAmount;
+            }
+            flag=false;
+            netAmount=0.0;
+        }
+        //得到其他费用合计
+        if (null!=erpCredit.getOtherTotalFee()){
+            schedule.setActualOtherFee(String.valueOf(erpCredit.getOtherTotalFee()));
+            actualTotalFee+=erpCredit.getOtherTotalFee();
+        }
+        //添加合计金额
+        schedule.setActualTotalFee(String.valueOf(actualTotalFee));
+        return schedule;
+    }
+
+    /**
+     * 其他费用明细表
+     * @param erpCreditList
+     * @return
+     */
+    public static ScheduleOther getScheduleOfOtherExpenses(List<ErpCredit> erpCreditList,List<MaintainData> maintainDataList){
+        ScheduleOther scheduleOther = new ScheduleOther();
+        Double requisitionSite=0.0;//建设场地征用及清理费
+        Double  compensationAcquisition=0.0;//土地征用补偿费
+        Double  cleaningFees=0.0;//余物清理费
+        Double  storageFee=0.0;//集中配送物资保管费
+        Double compensateFee=0.0;//土地征用补偿费(赔青费)
+        Double  managementFee=0.0;//项目建设管理费
+        Double  preWorkingFee=0.0;//项目前期工作费
+        Double  itemManageFee=0.0;//项目管理经费
+        Double  theTenderFee=0.0;//招标费
+        Double  supervisionFee=0.0;//工程监理费
+        Double   technicalFee=0.0;//项目建设技术服务费
+        Double  surveyFee=0.0;//工程勘察费
+        Double  designFee=0.0;//工程设计费
+        Double drawingBudgetFee=0.0;//施工图预算编制费
+        Double  evaluationFee=0.0;//项目后评价费
+        Double  economicFee=0.0;//技术经济标准变值管理费
+        Double  inspectionFee=0.0;//工程建设监督检测费
+        Double  preparationFee=0.0;//生产准备费
+        Double  basicFee=0.0;//基本预备费
+        Double  reserveFee=0.0;//资本化利息
+        Double  totalFee=0.0;//合计
+        if (null!=maintainDataList&&maintainDataList.size()>0){
+            for (MaintainData maintainData:maintainDataList){
+                cleaningFees+=maintainData.getDamages();//清理费
+                preWorkingFee+=maintainData.getPreliminaryWorkFee();//项目前期工作费
+            }
+            scheduleOther.setCleaningFees(String.valueOf(cleaningFees));
+            scheduleOther.setPreWorkingFee(String.valueOf(preparationFee));
+        }
+        if (null!=erpCreditList&&erpCreditList.size()>0){
+            for (ErpCredit erpCredit:erpCreditList){
+                //如果线路施工赔偿费不等于空,土地征用补偿费累加
+                if (null!=erpCredit.getOtherLineDamages()){
+                    compensateFee+=erpCredit.getOtherLineDamages();
+                }
+                //如果法人管理费不为空,则赋值项目管理经费
+                if (null!=erpCredit.getOtherLegalManage()){
+                    itemManageFee=+erpCredit.getOtherLegalManage();
+                }
+                //如果监理费不为空,则赋值为工程监理费
+                if (null!=erpCredit.getOtherSupervisorFee()){
+                    supervisionFee+=erpCredit.getOtherSupervisorFee();
+                }
+                //如果设计费不为空,则赋值为工程设计费
+                if (null!=erpCredit.getOtherDesignFee()){
+                    designFee+=erpCredit.getOtherDesignFee();
+                }
+                //如果=ERP账生成数据中建设期贷款利息不为空,则累计赋值到资本化利息
+                if (null!= erpCredit.getOtherBuildLoan()){
+                    reserveFee+=erpCredit.getOtherBuildLoan();
+                }
+            }
+        }
+        //项目建设技术服务费(暂无)
+        technicalFee=surveyFee+economicFee;
+        //项目建设管理费
+        managementFee=itemManageFee+supervisionFee;
+        //建设场地征用费
+        requisitionSite=compensationAcquisition+compensateFee;
+        //合计
+        totalFee=requisitionSite+managementFee+technicalFee+inspectionFee+preparationFee+basicFee+reserveFee;
+        scheduleOther.setCompensateFee(String.valueOf(compensateFee));//土地征用补偿费
+        scheduleOther.setItemManageFee(String.valueOf(itemManageFee));//项目管理经费
+        scheduleOther.setSupervisionFee(String.valueOf(supervisionFee));//工程监理费
+        scheduleOther.setDesignFee(String.valueOf(designFee));//工程设计费
+        scheduleOther.setReserveFee(String.valueOf(reserveFee));//资本化利息
+        scheduleOther.setTechnicalFee(String.valueOf(technicalFee));//项目设计技术服务费
+        scheduleOther.setManagementFee(String.valueOf(managementFee));//项目建设管理费
+        scheduleOther.setRequisitionSite(String.valueOf(requisitionSite));//建设场地征用费
+        scheduleOther.setTotalFee(String.valueOf(totalFee));//合计
+        return scheduleOther;
+    }
+
+    /**
+     * 设备材料清册
+     * @param erpCredits
+     * @return
+     */
+    public static List<MaterialEquipment> getMaterialEquipment(List<ErpCredit> erpCredits){
+        DecimalFormat decimalFormat   = new DecimalFormat("#0.00");
+        DecimalFormat decimalFormat1 = new DecimalFormat("#0");
+        Double count = 0.0;
+        List<MaterialEquipment> materialEquipments = new ArrayList<MaterialEquipment>();
+        MaterialEquipment materialEquipment = null;
+        List<ErpCreditChild1> erpCreditChild1s = null;
+        List<ErpCreditChild2> erpCreditChild2s = null;
+        for (ErpCredit erpCredit:erpCredits){
+            erpCreditChild1s=erpCredit.getErpCreditChild1s();
+            erpCreditChild2s=erpCredit.getErpCreditChild2s();
+            //设备详情
+            if (null!=erpCreditChild1s&&erpCreditChild1s.size()>0){
+                for (ErpCreditChild1 erpCreditChild1:erpCreditChild1s){
+                    count=0.0;
+                    materialEquipment=new MaterialEquipment();
+                    materialEquipment.setId(erpCredit.getItemId());
+                    //物料描述赋值给名称
+                    materialEquipment.setMeName(erpCreditChild1.getEqmMaterialDetails1());
+                    //如果供应商不为空,赋值供应商
+                    if (null!=erpCreditChild1.getEqmSupplierName()){
+                        materialEquipment.setMeSupplierName(erpCreditChild1.getEqmSupplierName());
+                    }
+                    //得到单位
+                    if (null!=erpCreditChild1.getEqmUnit()){
+                        materialEquipment.setMeUnit(erpCreditChild1.getEqmUnit());
+                    }
+                    //得到数量
+                    if (null!=erpCreditChild1.getEqmNumbers()){
+                        materialEquipment.setMeNumber(decimalFormat1.format(erpCreditChild1.getEqmNumbers()));
+                    }
+                    //得到合计金额
+                    if (null!=erpCreditChild1.getEqmBookedFee1()){
+                        materialEquipment.setMeAllPrice(String.valueOf(erpCreditChild1.getEqmBookedFee1()));
+                        if (null!=materialEquipment.getMeNumber()){
+                            count=erpCreditChild1.getEqmBookedFee1()/Double.parseDouble(materialEquipment.getMeNumber());
+                            materialEquipment.setMeUnitPrice(decimalFormat.format(count));
+                        }else {
+                            materialEquipment.setMeUnitPrice(decimalFormat.format(erpCreditChild1.getEqmBookedFee1()));
+                        }
+                    }else {
+                        materialEquipment.setMeAllPrice("0");
+                    }
+                    materialEquipments.add(materialEquipment);
+                }
+            }
+            //材料详情
+            if (null!=erpCreditChild2s&&erpCreditChild2s.size()>0){
+                for (ErpCreditChild2 erpCreditChild2:erpCreditChild2s){
+                    count=0.0;
+                    //得到材料费项目定义好
+                    materialEquipment.setId(erpCredit.getItemId());
+                    //得到材料费名称
+                    materialEquipment.setMeName(erpCreditChild2.getEqmMaterialDetails2());
+                    //得到供应商
+                    if (null!=erpCreditChild2.getMtlSupplierName()){
+                        materialEquipment.setMeSupplierName(erpCreditChild2.getMtlSupplierName());
+                    }
+                    //得到单位
+                    if (null!=erpCreditChild2.getMtlUnit()){
+                        materialEquipment.setMeUnit(erpCreditChild2.getMtlUnit());
+                    }
+                    //得到数量
+                    if (null!=erpCreditChild2.getMtlNumbers()){
+                        materialEquipment.setMeNumber(decimalFormat1.format(erpCreditChild2.getMtlNumbers()));
+                    }
+                    //得到合计金额
+                    if (null!=erpCreditChild2.getMtlBookedFee2()){
+                        materialEquipment.setMeAllPrice(String.valueOf(erpCreditChild2.getMtlBookedFee2()));
+                        if (null!=materialEquipment.getMeNumber()){
+                            count=erpCreditChild2.getMtlBookedFee2()/Double.parseDouble(materialEquipment.getMeNumber());
+                            materialEquipment.setMeUnitPrice(decimalFormat.format(count));
+                        }else {
+                            materialEquipment.setMeUnitPrice(decimalFormat.format(erpCreditChild2.getMtlBookedFee2()));
+                        }
+                    }else {
+                        materialEquipment.setMeUnit("0");
+                    }
+                    materialEquipments.add(materialEquipment);
+                }
+            }
+        }
+        return materialEquipments;
+    }
+
+    /**
+     * 移交资产—配电网资产一览表(线路)
+     * @return
+     */
+    public static List<TransferOfPower1> getTransFerPower1(List<ErpCredit> erpCredits){
+        DecimalFormat decimalFormat   = new DecimalFormat("#0.00");
+        List<TransferOfPower1> transferOfPower1s = new ArrayList<TransferOfPower1>();
+        TransferOfPower1 transferOfPower1 = null;
+        List<ErpCreditChild1> erpCreditChild1s = null;
+        Double eqmNumbers = 0.0;//获取总数量
+        Double eqmValue = 0.0;//相同项目定义号合计
+        Double standInFee=0.0;//摊入费用
+        Double powerDeliveredAssets=0.0;//交付知产使用价值
+        for (ErpCredit erpCredit:erpCredits){
+            erpCreditChild1s = erpCredit.getErpCreditChild1s();//获取集合
+            if (null!=erpCreditChild1s&&erpCreditChild1s.size()>=0){
+                eqmNumbers = 0.0;
+                for (ErpCreditChild1 erpCreditChild11:erpCreditChild1s){
+                    if (null!=erpCreditChild11.getEqmNumbers()){//当前项目定义号所有的台数合计
+                        eqmNumbers+=erpCreditChild11.getEqmNumbers();
+                    }
+                }
+                if (null!=erpCredit.getConsInstallFee()){//得到分摊后安装费
+                    eqmNumbers=erpCredit.getConsTotalFee()/eqmNumbers;
+                }
+                for (ErpCreditChild1 erpCreditChild1:erpCreditChild1s){
+                    if (null!=erpCredit.getTenKvModel()){//若10KV电缆、架空导线型号为空:得到设备价值
+                        eqmValue = erpCreditChild1.getEqmBookedFee1()+eqmNumbers+eqmValue;//设备H6的和
+                    }
+                }
+            }
+            //添加固定数据:线路
+            transferOfPower1  = new TransferOfPower1();
+            transferOfPower1.setPowerId(erpCredit.getItemId());//添加项目定义号
+            transferOfPower1.setPowerName(erpCredit.getItemName());//添加项目名称
+            transferOfPower1.setPowerDepartment(ExportUtil1.POWER_DEPARTMENT);//添加保管
+            if (null!=erpCredit.getTenKvItsLine()) {//其中 10kv线路 10kv线路长度
+                transferOfPower1.setPowerTenKvLineLength(String.valueOf(erpCredit.getTenKvItsLine()));
+            }
+            if (null!=erpCredit.getTenKvModel()){//10kv电缆架空导线型号
+                transferOfPower1.setPowerTenKvCableType(erpCredit.getTenKvModel());
+                transferOfPower1.setPowerNumberBars("1");
+                transferOfPower1.setPowerAssetClass(POWER_ZYXL);
+            }
+            if (null!=erpCredit.getConsBuildingFee()){//建筑费
+                transferOfPower1.setPowerBuildFee(String.valueOf(erpCredit.getConsBuildingFee()));
+                powerDeliveredAssets+=erpCredit.getConsBuildingFee();
+            }
+            if (null!=erpCredit.getConsInstallFee()){//安装费
+                transferOfPower1.setPowerInstallFee(String.valueOf(erpCredit.getConsInstallFee()));
+                powerDeliveredAssets+=erpCredit.getConsInstallFee();
+            }else {
+                transferOfPower1.setPowerInstallFee("0");
+            }
+            if (transferOfPower1.getPowerInstallFee().equals("0")){//摊入费用
+                transferOfPower1.setPowerInstallFee("0");
+            }else {
+                standInFee = Double.valueOf(transferOfPower1.getPowerInstallFee())/(Double.valueOf(transferOfPower1.getPowerInstallFee())+eqmNumbers);
+                transferOfPower1.setPowerStandInFee(decimalFormat.format(standInFee));
+                powerDeliveredAssets+=standInFee;
+            }
+            //添加交付使用资产价值
+            transferOfPower1.setPowerDeliveredAssets(decimalFormat.format(powerDeliveredAssets));
+            transferOfPower1s.add(transferOfPower1);//添加到集合中
+        }
+        return transferOfPower1s;
+    }
+
+    /**
+     * 移交资产—配电网资产一览表(设备)
+     * @param erpCredits
+     * @return
+     */
+    public static List<TransferOfPower2> getTransferOfPower2(List<ErpCredit> erpCredits){
+        DecimalFormat decimalFormat   = new DecimalFormat("#0.00");
+        DecimalFormat decimalFormat1   = new DecimalFormat("#0");
+        List<TransferOfPower2> transferOfPower2s =  new ArrayList<TransferOfPower2>();
+        List<ErpCreditChild1> erpCreditChild1s = null;
+        TransferOfPower2 transferOfPower2 = null;
+        Double powerValue = 0.0;
+        Double eqmNumbers = 0.0;//获取总数量
+        Double powerInstallFee = 0.0;//安装费用(线路)
+        Double powerStandInFee = 0.0;//摊入费用
+        Double powerDeliveredAssets=0.0;//交付使用资产价值
+        for (ErpCredit erpCredit:erpCredits){
+            erpCreditChild1s = erpCredit.getErpCreditChild1s();//得到集合
+            //得到安装费用
+            if (null!=erpCredit.getConsInstallFee()){//安装费
+                powerInstallFee = erpCredit.getConsInstallFee();
+            }
+            if (null!=erpCreditChild1s && erpCreditChild1s.size()>=0){
+                eqmNumbers = 0.0;
+                for (ErpCreditChild1 erpCreditChild11:erpCreditChild1s){
+                    if (null!=erpCreditChild11.getEqmNumbers()){//当前项目定义号所有的台数合计
+                        eqmNumbers+=erpCreditChild11.getEqmNumbers();
+                    }
+                }
+                if (null!=erpCredit.getConsInstallFee()){//得到分摊后安装费
+                    eqmNumbers=eqmNumbers/erpCredit.getConsTotalFee();
+                }
+                for (ErpCreditChild1 erpCreditChild1:erpCreditChild1s){
+                    powerDeliveredAssets=0.0;
+                    transferOfPower2 = new TransferOfPower2();
+                    transferOfPower2.setPowerId(erpCredit.getItemId());
+                    transferOfPower2.setPowerName(erpCredit.getItemName());//添加名称
+                    transferOfPower2.setPowerDepartment(ExportUtil1.POWER_DEPARTMENT);//添加保管
+                    if (null!=erpCreditChild1.getEqmNumbers()){//得到配变数量
+                        transferOfPower2.setPowerNumber(decimalFormat1.format(erpCreditChild1.getEqmNumbers()));
+                    }
+                    if (null!=erpCreditChild1.getEqmUnit()){//计量单位
+                        transferOfPower2.setPowerUnit(erpCreditChild1.getEqmUnit());
+                    }
+                    //配电容量
+                    transferOfPower2.setPowerCapacity(erpCreditChild1.getEqmMaterialDetails1());
+                    //设备价值
+                    if (null!=erpCreditChild1.getEqmBookedFee1()){
+                        powerValue=erpCreditChild1.getEqmBookedFee1()+eqmNumbers;
+                        transferOfPower2.setPowerValue(decimalFormat.format(powerValue));
+                        powerDeliveredAssets +=powerValue;
+                    }else {
+                        powerValue=erpCreditChild1.getEqmBookedFee1();
+                        transferOfPower2.setPowerValue(decimalFormat.format(powerValue));
+                        powerDeliveredAssets+=powerValue;
+                    }
+                    //计算摊入费用
+                    if (erpCredit.getConsBuildingFee()!=null&&erpCredit.getConsBuildingFee()!=0){
+                        powerStandInFee=Double.parseDouble(transferOfPower2.getPowerValue())/(Double.parseDouble(transferOfPower2.getPowerValue())+powerInstallFee)*erpCredit.getConsBuildingFee();
+                        transferOfPower2.setPowerStandInFee(decimalFormat.format(powerStandInFee));
+                        powerDeliveredAssets+=powerStandInFee;
+                    }else {
+                        transferOfPower2.setPowerStandInFee("0");
+                    }
+                    //添加资产类别
+                    if (erpCreditChild1.getEqmMaterialDetails1().contains(POWER_BDZ)){
+                        transferOfPower2.setPowerAssetClass(POWER_BDZCOUNT);
+                    }
+                    if (erpCreditChild1.getEqmMaterialDetails1().contains(POWER_BOXBDZ)){
+                        transferOfPower2.setPowerAssetClass(POWER_BOXCOUNT);
+                    }
+                    if (erpCreditChild1.getEqmMaterialDetails1().contains(POWER_HGW)){
+                        transferOfPower2.setPowerAssetClass(POWER_HGWCOUNT);
+                    }
+                    if (erpCreditChild1.getEqmMaterialDetails1().contains(POWER_KGG)){
+                        transferOfPower2.setPowerAssetClass(POWER_KGGCOUNT);
+                    }
+                    transferOfPower2.setPowerDeliveredAssets(decimalFormat.format(powerDeliveredAssets));//交付使用资产价值
+                    transferOfPower2s.add(transferOfPower2);
+                }
+            }
+        }
+        return transferOfPower2s;
+    }
+    //概况表
+    public static GeneralSituation getFeneraSituation(List<ErpCredit> erpCredits, List<MaintainData> maintainDataList){
+        GeneralSituation generalSituation = new GeneralSituation();
+        Double lineLength=0.0;//线路长度
+        Double tenKvLength=0.0;//其中:10kv线路
+        Double fourKvLength=0.0;//400v及以下
+        List<String> organDataList = new ArrayList<String>();//预算批准机关、日期、文号
+        List<Date> commencementDateList =new ArrayList<Date>();//开工日期
+        List<Date> completionDateList = new ArrayList<Date>();//竣工日期
+        String organData = "";//文号
+        Double investmentBudget=0.0;//预算投资
+        Double actualInvestment=0.0;//实际投资
+        if (null!=erpCredits&&erpCredits.size()>0){
+            for (ErpCredit erpCredit:erpCredits){
+                //如果线路长度不为空
+                if (null!=erpCredit.getTenKvLineLength()){
+                    lineLength+=erpCredit.getTenKvLineLength();//得到线路长度(线路)
+                }
+                //其中:10kv线路
+                if (null!=erpCredit.getTenKvItsLine()){
+                    tenKvLength+=erpCredit.getTenKvItsLine();
+                }
+                //400kv
+                if (null!=erpCredit.getTenKvItesFhvFollow()){
+                    fourKvLength+=erpCredit.getTenKvItesFhvFollow();
+                }
+                //实际投资
+                if (null!=erpCredit.getActualInvestment()){
+                    actualInvestment+=erpCredit.getActualInvestment();
+                }
+            }
+            generalSituation.setLineLength(String.valueOf(lineLength));
+            generalSituation.setTenKvLength(String.valueOf(tenKvLength));
+            generalSituation.setFourKvLength(String.valueOf(fourKvLength));
+            generalSituation.setActualInvestment(String.valueOf(actualInvestment));
+            generalSituation.setTransferAssets(String.valueOf(actualInvestment));
+            generalSituation.setHasItsOwn(String.valueOf(actualInvestment));
+        }
+        if (null!=maintainDataList&&maintainDataList.size()>0){
+            for (MaintainData maintainData:maintainDataList){
+                if (null!=maintainData.getApprovalNumber()){//如果审批文号不为空
+                    organDataList.add(maintainData.getApprovalNumber());
+                }
+                if (maintainData.getStartDate().toString()!=null&&maintainData.getStartDate().toString().length()>0){
+                    commencementDateList.add(maintainData.getStartDate());
+                }
+                if (null!=maintainData.getEndDate()&&maintainData.getEndDate().toString().length()>0){
+                    completionDateList.add(maintainData.getEndDate());
+                }
+                investmentBudget+=maintainData.getTotalFee();
+            }
+            if (null!=organDataList&&organDataList.size()>0){
+                //去重
+                for (int i = 0; i < organDataList.size(); i++) {
+                    for (int j = 0; j < organDataList.size(); j++) {
+                        if(i!=j&&organDataList.get(i)==organDataList.get(j)) {
+                            organDataList.remove(organDataList.get(j));
+                        }
+                    }
+                }
+                for(String str:organDataList){
+                    organData+=str+",";
+                }
+                generalSituation.setOrganDataNumber(organData);
+            }
+            if (null!=commencementDateList&&commencementDateList.size()>0){
+                generalSituation.setCommencementDate(Collections.min(commencementDateList).toString());
+            }
+            if (null!=completionDateList&&completionDateList.size()>0){
+                generalSituation.setCompletionDate(Collections.max(completionDateList).toString());
+            }
+            generalSituation.setInvestmentBudget(String.valueOf(investmentBudget));
+        }
+        return generalSituation;
+    }
+    //资产总表
+    public static List<TheAssetsTotal> getTheAssetsTotal(List<ErpCredit> erpCredits){
+        DecimalFormat decimalFormat   = new DecimalFormat("#0.00");
+        List<TheAssetsTotal> theAssetsTotals = new ArrayList<TheAssetsTotal>();
+        TheAssetsTotal theAssetsTotal1 = new TheAssetsTotal();
+        TheAssetsTotal theAssetsTotal2 = new TheAssetsTotal();
+        TheAssetsTotal theAssetsTotal3 = new TheAssetsTotal();
+        Double buildProject=0.0;//建筑工程
+        Double intallProject=0.0;//安装工程费
+        Double equipmentValue=0.0;//设备价值
+        Double costSharing=0.0;//分摊费用
+        Double deliveryCostValue=0.0;//交付使用资产价值
+        Double equipmentValue1=0.0;//设备价值
+        Double costSharing1=0.0;//分摊费用
+        Double deliveryCostValue1=0.0;//交付使用资产价值
+        List<TransferOfPower1> transferOfPower1s = getTransFerPower1(erpCredits);
+        List<TransferOfPower2> transferOfPower2s = getTransferOfPower2(erpCredits);
+        for (TransferOfPower1 transferOfPower1:transferOfPower1s){
+            if (null!=transferOfPower1.getPowerBuildFee()){//建筑
+                buildProject+=Double.parseDouble(transferOfPower1.getPowerBuildFee());
+            }
+            if (null!=transferOfPower1.getPowerInstallFee()){
+                intallProject+=Double.parseDouble(transferOfPower1.getPowerInstallFee());
+            }
+            if (null!=transferOfPower1.getPowerStandInFee()){//分摊费用
+                costSharing+=Double.parseDouble(transferOfPower1.getPowerStandInFee());
+            }
+            deliveryCostValue=buildProject+intallProject+costSharing;
+        }
+        theAssetsTotal1.setBuildProject(decimalFormat.format(buildProject));
+        theAssetsTotal1.setIntallProject(decimalFormat.format(intallProject));
+        theAssetsTotal1.setCostSharing(decimalFormat.format(costSharing));
+        theAssetsTotal1.setDeliveryCostValue(decimalFormat.format(deliveryCostValue));
+        for (TransferOfPower2 transferOfPower2:transferOfPower2s){
+            if (null!=transferOfPower2.getPowerValue()){//设备价值
+                equipmentValue1+=Double.parseDouble(transferOfPower2.getPowerValue());
+            }
+            if (null!=transferOfPower2.getPowerStandInFee()){
+                costSharing1+=Double.parseDouble(transferOfPower2.getPowerStandInFee());
+            }
+            deliveryCostValue1=equipmentValue1+costSharing1;
+            theAssetsTotal2.setEquipmentValue(decimalFormat.format(equipmentValue1));
+            theAssetsTotal2.setCostSharing(decimalFormat.format(costSharing1));
+            theAssetsTotal2.setDeliveryCostValue(decimalFormat.format(deliveryCostValue1));
+        }
+        theAssetsTotal3.setBuildProject(decimalFormat.format(buildProject));
+        theAssetsTotal3.setIntallProject(decimalFormat.format(intallProject));
+        theAssetsTotal3.setEquipmentValue(decimalFormat.format(equipmentValue1));
+        theAssetsTotal3.setCostSharing(decimalFormat.format(costSharing+costSharing1));
+        theAssetsTotal3.setDeliveryCostValue(decimalFormat.format(deliveryCostValue+deliveryCostValue1));
+        theAssetsTotals.add(theAssetsTotal3);
+        theAssetsTotals.add(theAssetsTotal1);
+        theAssetsTotals.add(theAssetsTotal2);
+        return theAssetsTotals;
+    }
+}

+ 400 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtil2.java

@@ -0,0 +1,400 @@
+package com.jeeplus.modules.sg.financial.erpcredit.util;
+
+import com.jeeplus.modules.sg.financial.erpcredit.entity.*;
+import com.jeeplus.modules.sg.financial.settlement.entity.MaintainData;
+import org.apache.poi.hssf.util.HSSFColor;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+import org.apache.poi.xssf.usermodel.XSSFRow;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class ExportUtil2 {
+
+    //一览表
+    public static void getSheet2(Sheet sheet,List<ErpCredit> erpCredits,List<MaintainData> maintainDataList){
+        if (sheet!=null){
+            Schedule schedule = null;
+            XSSFRow row = (XSSFRow) sheet.getRow(0);
+            XSSFCell cell = row.getCell(3);
+            List<Schedule> scheduleList = ExportUtil1.getScheduleList(erpCredits, maintainDataList);
+            for (int i = 1; i <=scheduleList.size(); i++) {
+                schedule = scheduleList.get(i);
+                row=(XSSFRow)sheet.getRow(i+5);
+                cell=row.getCell(0);
+                cell.setCellValue(i);
+                cell=row.getCell(1);
+                cell.setCellValue(schedule.getItemId());
+                cell=row.getCell(2);
+                cell.setCellValue(schedule.getItemName());
+                cell=row.getCell(3);
+                cell.setCellValue(schedule.getBudgetBuildProject());
+                cell=row.getCell(4);
+                cell.setCellValue(schedule.getBudgetInstallProject());
+                cell=row.getCell(5);
+                cell.setCellValue(schedule.getBudgetEquipmentValue());
+                cell=row.getCell(6);
+                cell.setCellValue(schedule.getBudgetOtherFee());
+                cell=row.getCell(7);
+                cell.setCellValue(schedule.getBudgetTotalFee());
+                cell=row.getCell(8);
+                cell.setCellValue(schedule.getActualBuildProject());
+                cell=row.getCell(9);
+                cell.setCellValue(schedule.getActualIntallProject());
+                cell=row.getCell(10);
+                cell.setCellValue(schedule.getActualEquipmentValue());
+                cell=row.getCell(11);
+                cell.setCellValue(schedule.getActualOtherFee());
+                cell=row.getCell(12);
+                cell.setCellValue(schedule.getActualTotalFee());
+                cell=row.getCell(13);
+                cell.setCellValue(schedule.getAddSubtractionLines());
+                cell=row.getCell(14);
+                cell.setCellValue(schedule.getAddSubtractionRate());
+            }
+        }
+
+    }
+    //读取得到其他费用表
+   public static void getSheet3(Sheet sheet,List<ErpCredit> erpCredits,List<MaintainData> maintainDataList){
+       if (null!=sheet){
+           XSSFRow row = (XSSFRow) sheet.getRow(0);
+           XSSFCell cell = row.getCell(3);
+           ScheduleOther scheduleOther = ExportUtil1.getScheduleOfOtherExpenses(erpCredits,maintainDataList);
+           List list = new ArrayList();
+           list.add(scheduleOther.getRequisitionSite());
+           list.add(scheduleOther.getCompensationAcquisition());
+           list.add(scheduleOther.getCleaningFees());
+           list.add(scheduleOther.getStorageFee());
+           list.add(scheduleOther.getCompensateFee());
+           list.add(scheduleOther.getManagementFee());
+           list.add(scheduleOther.getPreparationFee());
+           list.add(scheduleOther.getItemManageFee());
+           list.add(scheduleOther.getTheTenderFee());
+           list.add(scheduleOther.getSupervisionFee());
+           list.add(scheduleOther.getTechnicalFee());
+           list.add(scheduleOther.getSurveyFee());
+           list.add(scheduleOther.getDesignFee());
+           list.add(scheduleOther.getDrawingBudgetFee());
+           list.add(scheduleOther.getEvaluationFee());
+           list.add(scheduleOther.getEconomicFee());
+           list.add(scheduleOther.getInspectionFee());
+           list.add(scheduleOther.getPreparationFee());
+           list.add(scheduleOther.getBasicFee());
+           list.add(scheduleOther.getReserveFee());
+           list.add(scheduleOther.getTotalFee());
+           for (int i = 0; i < list.size(); i++) {
+               row = (XSSFRow) sheet.getRow((int)i+6);
+               cell=row.getCell(3);
+               cell.setCellValue((String)list.get(i));
+           }
+       }
+   }
+   //移交资产—配电网资产一览表(线路)
+   public static void getSheet5(Sheet sheet,List<ErpCredit> erpCredits){
+       if (null!=sheet){
+           XSSFRow row = (XSSFRow) sheet.getRow(0);
+           XSSFCell cell = row.getCell(0);
+           TransferOfPower1 transferOfPower1 = null;
+           List<TransferOfPower1> transferOfPower1s = ExportUtil1.getTransFerPower1(erpCredits);
+           for (int i = 0; i < transferOfPower1s.size(); i++) {
+               transferOfPower1=transferOfPower1s.get(i);
+               row = (XSSFRow) sheet.getRow((int)i+5);
+               cell=row.getCell(0);
+               cell.setCellValue(transferOfPower1.getPowerId());
+               cell=row.getCell(1);
+               cell.setCellValue(transferOfPower1.getPowerName());
+               cell=row.getCell(2);
+               cell.setCellValue(transferOfPower1.getPowerArea());
+               cell=row.getCell(3);
+               cell.setCellValue(transferOfPower1.getPowerDepartment());
+               cell=row.getCell(4);
+               cell.setCellValue(transferOfPower1.getPowerTenKvLineLength());
+               cell=row.getCell(5);
+               cell.setCellValue(transferOfPower1.getPowerTenKvCableType());
+               cell=row.getCell(6);
+               cell.setCellValue(transferOfPower1.getPowerBuildFee());
+               cell=row.getCell(7);
+               cell.setCellValue(transferOfPower1.getPowerInstallFee());
+               cell=row.getCell(8);
+               cell.setCellValue(transferOfPower1.getPowerStandInFee());
+               cell=row.getCell(9);
+               cell.setCellValue(transferOfPower1.getPowerDeliveredAssets());
+               cell=row.getCell(10);
+               cell.setCellValue(transferOfPower1.getPoweRequipmentFee());
+           }
+       }
+   }
+   //移交资产—配电网资产一览表(设备)
+   public static void getSheet6(Sheet sheet,List<ErpCredit> erpCredits){
+      if (sheet!=null){
+          XSSFRow row = (XSSFRow) sheet.getRow(0);
+          XSSFCell cell = row.getCell(0);
+          TransferOfPower2 transferOfPower2 = null;
+          List<TransferOfPower2> transferOfPower2s = ExportUtil1.getTransferOfPower2(erpCredits);
+          for (int i = 0; i < transferOfPower2s.size(); i++) {
+              transferOfPower2=transferOfPower2s.get(i);
+              row = (XSSFRow) sheet.getRow((int)i+5);
+              cell=row.getCell(0);
+              cell.setCellValue(transferOfPower2.getPowerId());//项目定义编号
+              cell=row.getCell(1);
+              cell.setCellValue(transferOfPower2.getPowerName());//配电网资产名称
+              cell=row.getCell(2);
+              cell.setCellValue(transferOfPower2.getPowerArea());////线路起止地点或配变所在滴
+              cell=row.getCell(3);
+              cell.setCellValue(transferOfPower2.getPowerDepartment());//保管部门
+              cell=row.getCell(4);
+              cell.setCellValue(transferOfPower2.getPowerNumber());//配变数量
+              cell=row.getCell(5);
+              cell.setCellValue(transferOfPower2.getPowerUnit());//计量单位
+              cell=row.getCell(6);
+              cell.setCellValue(transferOfPower2.getPowerCapacity());//配变容量
+              cell=row.getCell(7);
+              cell.setCellValue(transferOfPower2.getPowerValue());//设备价值
+              cell=row.getCell(8);
+              cell.setCellValue(transferOfPower2.getPowerStandInFee());//摊入费用
+              cell=row.getCell(9);
+              cell.setCellValue(transferOfPower2.getPowerDeliveredAssets());//交付使用资产价值
+              cell=row.getCell(10);
+              cell.setCellValue(transferOfPower2.getPoweRequipmentFee());//其中:附属设备价值
+          }
+      }
+   }
+   //设备材料清册
+    public static void getSheet7(Sheet sheet,List<ErpCredit> erpCredits){
+        XSSFRow row = (XSSFRow) sheet.getRow(0);
+        XSSFCell cell = row.getCell(0);
+        MaterialEquipment materialEquipment = null;
+        if (null!=sheet){
+            List<MaterialEquipment> materialEquipments = ExportUtil1.getMaterialEquipment(erpCredits);
+            for (int i = 0; i < materialEquipments.size(); i++) {
+                materialEquipment = materialEquipments.get(i);
+                row = (XSSFRow) sheet.getRow((int)i+5);
+                cell=row.getCell(0);
+                cell.setCellValue(materialEquipment.getId());//项目定义编号
+                cell=row.getCell(1);
+                cell.setCellValue(materialEquipment.getMeName());
+                cell=row.getCell(2);
+                cell.setCellValue(materialEquipment.getMeSpecifications());
+                cell=row.getCell(3);
+                cell.setCellValue(materialEquipment.getMeSupplierName());//供应单位制造
+                cell=row.getCell(4);
+                cell.setCellValue(materialEquipment.getMeUnit());////计量单位
+                cell=row.getCell(5);
+                cell.setCellValue(materialEquipment.getMeNumber());////数量
+                cell=row.getCell(6);
+                cell.setCellValue(materialEquipment.getMeUnitPrice());////单价
+                cell=row.getCell(7);
+                cell.setCellValue(materialEquipment.getMeAllPrice());////合计
+            }
+        }
+    }
+
+    //移交资产—配电网资产一览表(线路)1
+    public static void getSheet10(Sheet sheet,List<ErpCredit> erpCredits){
+        if (null!=sheet){
+            XSSFRow row = (XSSFRow) sheet.getRow(0);
+            XSSFCell cell = row.getCell(0);
+            TransferOfPower1 transferOfPower1 = null;
+            List<TransferOfPower1> transferOfPower1s = ExportUtil1.getTransFerPower1(erpCredits);
+            for (int i = 0; i < transferOfPower1s.size(); i++) {
+                transferOfPower1=transferOfPower1s.get(i);
+                row = (XSSFRow) sheet.getRow((int)i+5);
+                cell=row.getCell(0);
+                cell.setCellValue(transferOfPower1.getPowerId());
+                cell=row.getCell(1);
+                cell.setCellValue(transferOfPower1.getPowerName());
+                cell=row.getCell(2);
+                cell.setCellValue(transferOfPower1.getPowerNumberBars());
+                cell=row.getCell(3);
+                cell.setCellValue(transferOfPower1.getPowerAssetClass());
+                cell=row.getCell(4);
+                cell.setCellValue(transferOfPower1.getPowerArea());
+                cell=row.getCell(5);
+                cell.setCellValue(transferOfPower1.getPowerDepartment());
+                cell=row.getCell(6);
+                cell.setCellValue(transferOfPower1.getPowerTenKvLineLength());
+                cell=row.getCell(7);
+                cell.setCellValue(transferOfPower1.getPowerTenKvCableType());
+                cell=row.getCell(8);
+                cell.setCellValue(transferOfPower1.getPowerBuildFee());
+                cell=row.getCell(9);
+                cell.setCellValue(transferOfPower1.getPowerInstallFee());
+                cell=row.getCell(10);
+                cell.setCellValue(transferOfPower1.getPowerStandInFee());
+                cell=row.getCell(11);
+                cell.setCellValue(transferOfPower1.getPowerDeliveredAssets());
+                cell=row.getCell(12);
+                cell.setCellValue(transferOfPower1.getPoweRequipmentFee());
+            }
+        }
+    }
+    //移交资产—配电网资产一览表(设备)2
+    public static void getSheet11(Sheet sheet,List<ErpCredit> erpCredits){
+        if (sheet!=null){
+            XSSFRow row = (XSSFRow) sheet.getRow(0);
+            XSSFCell cell = row.getCell(0);
+            TransferOfPower2 transferOfPower2 = null;
+            List<TransferOfPower2> transferOfPower2s = ExportUtil1.getTransferOfPower2(erpCredits);
+            for (TransferOfPower2 transferOfPower21:transferOfPower2s){
+                System.out.println(transferOfPower21);
+            }
+            for (int i = 0; i < transferOfPower2s.size(); i++) {
+                transferOfPower2=transferOfPower2s.get(i);
+                row = (XSSFRow) sheet.getRow((int)i+5);
+                cell=row.getCell(0);
+                cell.setCellValue(transferOfPower2.getPowerId());//项目定义编号
+                cell=row.getCell(1);
+                cell.setCellValue(transferOfPower2.getPowerName());//配电网资产名称
+                cell=row.getCell(2);
+                cell.setCellValue(transferOfPower2.getPowerAssetClass());
+                cell=row.getCell(3);
+                cell.setCellValue(transferOfPower2.getPowerArea());////线路起止地点或配变所在滴
+                cell=row.getCell(4);
+                cell.setCellValue(transferOfPower2.getPowerDepartment());//保管部门
+                cell=row.getCell(5);
+                cell.setCellValue(transferOfPower2.getPowerNumber());//配变数量
+                cell=row.getCell(6);
+                cell.setCellValue(transferOfPower2.getPowerUnit());//计量单位
+                cell=row.getCell(7);
+                cell.setCellValue(transferOfPower2.getPowerCapacity());//配变容量
+                cell=row.getCell(8);
+                cell.setCellValue(transferOfPower2.getPowerValue());//设备价值
+                cell=row.getCell(9);
+                cell.setCellValue(transferOfPower2.getPowerStandInFee());//摊入费用
+                cell=row.getCell(10);
+                cell.setCellValue(transferOfPower2.getPowerDeliveredAssets());//交付使用资产价值
+                cell=row.getCell(11);
+                cell.setCellValue(transferOfPower2.getPoweRequipmentFee());//其中:附属设备价值
+            }
+        }
+    }
+
+    //概述表
+    public static void getSheet1(Sheet sheet, List<ErpCredit> erpCredits, List<MaintainData> maintainDataList){
+       if (sheet!=null){
+           GeneralSituation generalSituation = ExportUtil1.getFeneraSituation(erpCredits,maintainDataList);
+           XSSFRow row = (XSSFRow) sheet.getRow(6);
+           XSSFCell cell = row.getCell(6);
+           cell.setCellValue(generalSituation.getOrganDataNumber());//日期,批文号
+
+           row = (XSSFRow)sheet.getRow(9);
+           cell = row.getCell(2);
+           cell.setCellValue(generalSituation.getLineLength());
+           cell = row.getCell(7);
+           cell.setCellValue(generalSituation.getCommencementDate());
+
+           row = (XSSFRow)sheet.getRow(10);
+           cell = row.getCell(2);
+           cell.setCellValue(generalSituation.getTenKvLength());
+           cell = row.getCell(7);
+           cell.setCellValue(generalSituation.getCompletionDate());
+
+           row = (XSSFRow)sheet.getRow(11);
+           cell=row.getCell(2);
+           cell.setCellValue(generalSituation.getFourKvLength());
+
+           row = (XSSFRow)sheet.getRow(12);
+           cell=row.getCell(7);
+           cell.setCellValue(generalSituation.getInvestmentBudget());
+
+           row = (XSSFRow)sheet.getRow(13);
+           cell=row.getCell(7);
+           cell.setCellValue(generalSituation.getActualInvestment());//实际投资
+
+           row = (XSSFRow)sheet.getRow(14);
+           cell=row.getCell(7);
+           cell.setCellValue(generalSituation.getTransferAssets());
+
+           row = (XSSFRow)sheet.getRow(16);
+           cell=row.getCell(7);
+           cell.setCellValue(generalSituation.getHasItsOwn());
+       }
+    }
+    //资产总表
+    public static void getSheet4(Sheet sheet,List<ErpCredit> erpCredits){
+       if (sheet!=null){
+           XSSFRow row = (XSSFRow) sheet.getRow(0);
+           XSSFCell cell = row.getCell(0);
+           TheAssetsTotal theAssetsTotal = null;
+           List<TheAssetsTotal> theAssetsTotals = ExportUtil1.getTheAssetsTotal(erpCredits);
+           for (int i = 0; i < theAssetsTotals.size(); i++) {
+               theAssetsTotal = theAssetsTotals.get(i);
+               row = (XSSFRow) sheet.getRow((int)i+6);
+               cell = row.getCell(2);
+               cell.setCellValue(theAssetsTotal.getBuildProject());
+               cell=row.getCell(3);
+               cell.setCellValue(theAssetsTotal.getIntallProject());
+               cell=row.getCell(4);
+               cell.setCellValue(theAssetsTotal.getEquipmentValue());
+               cell=row.getCell(5);
+               cell.setCellValue(theAssetsTotal.getCostSharing());
+               cell=row.getCell(6);
+               cell.setCellValue(theAssetsTotal.getDeliveryCostValue());
+           }
+       }
+    }
+    private static Map<String, CellStyle> createStyles(Workbook wb) {
+        Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
+
+        CellStyle style = wb.createCellStyle();
+        style.setAlignment(CellStyle.ALIGN_CENTER);
+        style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
+        Font titleFont = wb.createFont();
+        titleFont.setFontName("Arial");
+        titleFont.setFontHeightInPoints((short) 16);
+        titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+        style.setFont(titleFont);
+        styles.put("title", style);
+
+        style = wb.createCellStyle();
+        style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
+        style.setBorderRight(CellStyle.BORDER_THIN);
+        style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
+        style.setBorderLeft(CellStyle.BORDER_THIN);
+        style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
+        style.setBorderTop(CellStyle.BORDER_THIN);
+        style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
+        style.setBorderBottom(CellStyle.BORDER_THIN);
+        style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
+        Font dataFont = wb.createFont();
+        dataFont.setFontName("Arial");
+        dataFont.setFontHeightInPoints((short) 10);
+        style.setFont(dataFont);
+        styles.put("data", style);
+
+        style = wb.createCellStyle();
+        style.cloneStyleFrom(styles.get("data"));
+        style.setAlignment(CellStyle.ALIGN_LEFT);
+        styles.put("data1", style);
+
+        style = wb.createCellStyle();
+        style.cloneStyleFrom(styles.get("data"));
+        style.setAlignment(CellStyle.ALIGN_CENTER);
+        styles.put("data2", style);
+
+        style = wb.createCellStyle();
+        style.cloneStyleFrom(styles.get("data"));
+        style.setAlignment(CellStyle.ALIGN_RIGHT);
+        styles.put("data3", style);
+
+        style = wb.createCellStyle();
+        style.cloneStyleFrom(styles.get("data"));
+//		style.setWrapText(true);
+        style.setAlignment(CellStyle.ALIGN_CENTER);
+        style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());
+        style.setFillPattern(CellStyle.SOLID_FOREGROUND);
+        Font headerFont = wb.createFont();
+        headerFont.setFontName("Arial");
+        headerFont.setFontHeightInPoints((short) 10);
+        headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
+        headerFont.setColor(IndexedColors.BLACK.getIndex());
+        style.setFont(headerFont);
+        style.setFillForegroundColor(HSSFColor.WHITE.index);
+        styles.put("header", style);
+
+        return styles;
+    }
+}

+ 151 - 12
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/Test.java

@@ -1,20 +1,159 @@
 package com.jeeplus.modules.sg.financial.erpcredit.util;
 
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCredit;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ScheduleOther;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+import org.apache.poi.xssf.usermodel.XSSFRow;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.URLEncoder;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 public class Test {
-        @org.junit.Test
-        public void getTest(){
-            String content = "10kV箱式变电站,400kva,美式,硅钢片,普通,无环网柜,600kVA";
-            String str[] =  content.split(",");
-            for (int i = 0; i < str.length; i++) {
+    public void getTest() {
+        String content = "10kV箱式变电站,400kva,美式,硅钢片,普通,无环网柜,600kVA";
+        String str[] = content.split(",");
+        for (int i = 0; i < str.length; i++) {
 //                System.out.println(str[i]);
-                    if (str[i].toLowerCase().contains("kva")){
-                    System.out.println(str[i].substring(0,str[i].toLowerCase().indexOf("kva")));
-                    break;
-                }
+            if (str[i].toLowerCase().contains("kva")) {
+                System.out.println(str[i].substring(0, str[i].toLowerCase().indexOf("kva")));
+                break;
             }
         }
+    }
+
+    public void getTest1() {
+        String str = "架空绝缘导线,AC10kV,JKLYJ,150";
+        String[] split = str.split(",");
+        System.out.println(split[split.length - 1]);
+    }
+
+    @org.junit.Test
+    public void getExcel(){
+            // 读取模板,并赋值到新文件
+            // 文件模板路径
+        ExportTemplate exportTemplate = new ExportTemplate();
+        String path = (exportTemplate.getSispPath() + "excelmodel/");
+        File file = new File(path);
+        // 保存文件的路径
+        String realPath = (exportTemplate.getSispPath() + "newexcelmodel");
+        // 新的文件名
+        String newFileName = "竣工决算" + System.currentTimeMillis() + ".xlsx";
+        System.out.println(newFileName);
+        // 判断路径是否存在
+        File createNewFile = new File(realPath);
+        if (!createNewFile.exists()) {
+            createNewFile.mkdirs();
+            System.out.println("创建了");
+        }
+        // 写入到新的excel
+        File newFile = new File(realPath, newFileName);
+        try {
+            newFile.createNewFile();
+            System.out.println();
+            // 复制模板到新文件
+            exportTemplate.fileChannelCopy(file, newFile);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
 
-}
+    }
+    @org.junit.Test
+    public void getPath(){
+        String sispPath = this.getClass().getResource("/").getPath()+ "freemarker/excelmodel/daochu.xlsx";
+        System.out.println(sispPath);
+    }
+    @org.junit.Test
+    public void exportExcel() {
+        ExportTemplate exportTemplate = new ExportTemplate();
+        File newFile = exportTemplate.createNewFile();
+        // 新文件写入数据,并下载
+        InputStream inputStream = null;
+        XSSFWorkbook workbook = null;
+        XSSFSheet sheet = null;
+        try {
+            inputStream = new FileInputStream(newFile);// 将excel文件转为输入流
+            workbook = new XSSFWorkbook(inputStream);// 创建个workbook,
+            // 获取第一个sheet
+            sheet = workbook.getSheetAt(3);
+        } catch (Exception e1) {
+            e1.printStackTrace();
+        }
+
+        if (sheet != null) {
+            try {
+                // 写数据
+                FileOutputStream fos = new FileOutputStream(newFile);
+                XSSFRow row = sheet.getRow(0);
+                XSSFCell cell = row.getCell(3);
+                for (int i = 0; i < 10; i++) {
+                    row =sheet.getRow((int)i+6);
+                    cell=row.getCell(3);
+                    cell.setCellValue(i);
+                }
+                workbook.write(fos);
+                fos.flush();
+                fos.close();
+                // 定义一个list集合假数据
+//                List<Map<String, Object>> lst = new ArrayList();
+//                Map<String, Object> map1 = new HashMap<String, Object>();
+//                for (int i = 0; i < 42; i++) {
+//                    map1.put("id" + i, i);
+//                    lst.add(map1);
+//                }
+//                for (int m = 0; m < lst.size(); m++) {
+//                    Map<String, Object> map = lst.get(m);
+//                    row = sheet.createRow((int) m + 3);
+//                    for (int i = 0; i < 42; i++) {
+//                        String value = map.get("id" + m) + "";
+//                        if (value.equals("null")) {
+//                            value = "0";
+//                        }
+//                        cell = row.createCell(i);
+//                        cell.setCellValue(value);
+//                    }
+//                }
+//                // 下载
+//                InputStream fis = new BufferedInputStream(new FileInputStream(
+//                        newFile));
+////                HttpServletResponse response = ServletActionContext.getResponse();
+//                HttpServletResponse response = null;
+//                byte[] buffer = new byte[fis.available()];
+//                fis.read(buffer);
+//                fis.close();
+//                response.reset();
+//                response.setContentType("text/html;charset=UTF-8");
+//                OutputStream toClient = new BufferedOutputStream(
+//                        response.getOutputStream());
+//                response.setContentType("application/x-msdownload");
+//                String newName = URLEncoder.encode(
+//                        "违法案件报表" + System.currentTimeMillis() + ".xlsx",
+//                        "UTF-8");
+//                response.addHeader("Content-Disposition",
+//                        "attachment;filename=\"" + newName + "\"");
+//                response.addHeader("Content-Length", "" + newFile.length());
+//                toClient.write(buffer);
+//                toClient.flush();
+            } catch (Exception e) {
+                e.printStackTrace();
+            } finally {
+                try {
+                    if (null != inputStream) {
+                        inputStream.close();
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        // 删除创建的新文件
+        // this.deleteFile(newFile);
+    }
+}

+ 15 - 18
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/web/ErpCreditController.java

@@ -3,26 +3,25 @@
  */
 package com.jeeplus.modules.sg.financial.erpcredit.web;
 
-import com.google.common.collect.Lists;
 import com.jeeplus.common.json.AjaxJson;
 import com.jeeplus.common.utils.DateUtils;
 import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.common.utils.excel.ExportExcel;
-import com.jeeplus.common.utils.excel.ImportExcel;
 import com.jeeplus.core.persistence.Page;
 import com.jeeplus.core.web.BaseController;
 import com.jeeplus.modules.sg.financial.erpcredit.entity.*;
 import com.jeeplus.modules.sg.financial.erpcredit.service.ErpCreditService;
 import com.jeeplus.modules.sg.financial.erpcredit.util.ErpInfo;
+import com.jeeplus.modules.sg.financial.erpcredit.util.ExportTemplate;
+import com.jeeplus.modules.sg.financial.erpcredit.util.ExportUtil2;
 import com.jeeplus.modules.sg.financial.erpcredit.util.ImportUtil;
 import com.jeeplus.modules.sg.financial.settlement.entity.MaintainData;
 import com.jeeplus.modules.sg.financial.settlement.service.DataMaintenanceService;
-import com.jeeplus.modules.test.one.dialog.entity.Leave1;
-import com.jeeplus.modules.test.onetomany.dialog.entity.TestDataMain1;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.shiro.authz.annotation.Logical;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+import org.apache.poi.xssf.usermodel.XSSFRow;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
@@ -35,11 +34,9 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.ConstraintViolationException;
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
+import java.io.*;
+import java.net.URLEncoder;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -53,6 +50,7 @@ public class ErpCreditController extends BaseController {
 	@Autowired
 	private ErpCreditService erpCreditService;
 
+
 	@ModelAttribute
 	public ErpCredit get(@RequestParam(required=false) String id) {
 		ErpCredit entity = null;
@@ -155,18 +153,16 @@ public class ErpCreditController extends BaseController {
 	@ResponseBody
 //	@RequiresPermissions("sg:financial:erpCredit:export")
 	@RequestMapping(value = "export")
-	public AjaxJson exportFile(ErpCredit erpCredit, HttpServletRequest request, HttpServletResponse response) {
+	public AjaxJson exportFile(String ids, HttpServletRequest request, HttpServletResponse response){
 		AjaxJson j = new AjaxJson();
+		String idArray[] =ids.split(",");
 		try {
-			String fileName = "表单"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
-			Page<ErpCredit> page = erpCreditService.findPage(new Page<ErpCredit>(request, response, -1), erpCredit);
-			new ExportExcel("表单", ErpCredit.class).setDataList(page.getList()).write(response, fileName).dispose();
+			erpCreditService.getExport(idArray,response);
 			j.setSuccess(true);
 			j.setMsg("导出成功!");
-			return j;
-		} catch (Exception e) {
+		}catch (Exception e){
 			j.setSuccess(false);
-			j.setMsg("导出请单记录失败!失败信息:"+e.getMessage());
+			j.setMsg("导出失败!失败信息:"+e.getMessage());
 		}
 		return j;
 	}
@@ -191,6 +187,7 @@ public class ErpCreditController extends BaseController {
 			List<ErpAccount> erpAccounts = ErpInfo.getErpAccount(importUtil);//获取表格数据
 			List<ErpCredit> erpCredits = ErpInfo.getAllErpCreditList(erpAccounts);//获取单条数据
 			for (ErpCredit erpCredit : erpCredits){
+				System.out.println(erpCredit);
 				try{
 					erpCreditService.save(erpCredit);
 					successNum++;

+ 28 - 0
src/main/java/com/jeeplus/modules/sg/financial/settlement/entity/MaintainData.java

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import com.jeeplus.common.utils.excel.annotation.ExcelField;
 import com.jeeplus.core.persistence.DataEntity;
 
+import java.util.Arrays;
 import java.util.Date;
 
 public class MaintainData extends DataEntity<MaintainData> {
@@ -216,4 +217,31 @@ public class MaintainData extends DataEntity<MaintainData> {
     public void setTotalFee(Double totalFee) {
         this.totalFee = totalFee;
     }
+
+    @Override
+    public String toString() {
+        return "MaintainData{" +
+                "projectId='" + projectId + '\'' +
+                ", designUnits='" + designUnits + '\'' +
+                ", constructionUnits='" + constructionUnits + '\'' +
+                ", address='" + address + '\'' +
+                ", property='" + property + '\'' +
+                ", investment='" + investment + '\'' +
+                ", startDate=" + startDate +
+                ", endDate=" + endDate +
+                ", approvalNumber='" + approvalNumber + '\'' +
+                ", buildingFee=" + buildingFee +
+                ", installFee=" + installFee +
+                ", equipmentFee=" + equipmentFee +
+                ", materialFee=" + materialFee +
+                ", designFee=" + designFee +
+                ", supervisionFee=" + supervisionFee +
+                ", preliminaryWorkFee=" + preliminaryWorkFee +
+                ", damages=" + damages +
+                ", managementFee=" + managementFee +
+                ", totalFee=" + totalFee +
+                ", state='" + state + '\'' +
+                ", projectIds=" + Arrays.toString(projectIds) +
+                '}';
+    }
 }

+ 1 - 0
src/main/java/com/jeeplus/modules/sg/financial/settlement/mapper/DataMaintenanceMapper.java

@@ -15,4 +15,5 @@ import java.util.List;
 public interface DataMaintenanceMapper extends BaseMapper<MaintainData> {
 	int insertList(@Param("list") List<MaintainData> list);
 	void deleteData(String projectId);
+	List<MaintainData> getFindListMain(String[] ids);
 }

+ 14 - 1
src/main/java/com/jeeplus/modules/sg/financial/settlement/mapper/xml/DataMaintenanceMapper.xml

@@ -247,5 +247,18 @@
 	<select id="findUniqueByProperty" resultType="TestNote" statementType="STATEMENT">
 		select * FROM js_maintain_data  where ${propertyName} = '${value}'
 	</select>
-	
+
+	<select id="getFindListMain" parameterType="java.util.List" resultType="maintainData">
+		select
+		<include refid="infoColumns"/>
+		FROM js_maintain_data a
+		WHERE a.del_flag = '0'
+		and a.project_id in
+		<if test="array !=null and array.length > 0">
+			<foreach collection="array" index="index" item="item" open="("
+					 separator="," close=")">
+				#{item}
+			</foreach>
+		</if>
+	</select>
 </mapper>

+ 3 - 3
src/main/java/com/jeeplus/modules/sg/financial/settlement/service/DataMaintenanceService.java

@@ -57,9 +57,9 @@ public class DataMaintenanceService extends CrudService<DataMaintenanceMapper, M
 	}
 
 	@Transactional(readOnly = false)
-	public void deleteData(String projectId){
-		dataMaintenanceMapper.deleteData(projectId);
-	}
+    public void deleteData(String projectId){
+        dataMaintenanceMapper.deleteData(projectId);
+    }
 
 
 	public void export(MaintainData maintainData , HttpServletResponse response){

+ 5 - 0
src/main/java/com/jeeplus/modules/sg/financial/settlement/util/ExcelWriter.java

@@ -257,6 +257,11 @@ public class ExcelWriter {
         return style;
     }
 
+    /**
+     * 设置导出表格样式
+     * @param wb
+     * @return
+     */
     private static Map<String, CellStyle> createStyles(Workbook wb) {
         Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
 

+ 17 - 11
src/main/java/com/jeeplus/modules/sg/financial/settlement/web/DataMaintenanceController.java

@@ -66,7 +66,8 @@ public class DataMaintenanceController extends BaseController {
 		model.addAttribute("maintainData", maintainData);
 		return "modules/sg/financial/settlement/dataMaintenanceList";
 	}
-	
+
+
 		/**
 	 * 列表数据
 	 */
@@ -99,8 +100,8 @@ public class DataMaintenanceController extends BaseController {
 	@ResponseBody
 	@RequiresPermissions("sg:settlement:import")
 	@RequestMapping(value = "importsel")
-	public Map<String, Object> importSelect(@RequestParam("file")MultipartFile file, MaintainData maintainData, HttpServletResponse response, HttpServletRequest request, HttpSession session) throws IOException, InvalidFormatException {
-//		try {
+	public Map<String, Object> importSelect(@RequestParam("file")MultipartFile file, MaintainData maintainData, HttpServletResponse response, HttpServletRequest request, HttpSession session){
+		try {
 			ImportExcel importExcel = new ImportExcel(file, 1, 0);
 			int lastRow = importExcel.getLastDataRowNum();
 			StringBuilder stringBuilder = new StringBuilder();
@@ -113,16 +114,16 @@ public class DataMaintenanceController extends BaseController {
 			}
 			String st = stringBuilder.toString();
 			String sts = st.substring(0,st.length()-1);
+			//把id作为key,把查询条件存入session
 			String id = UserUtils.getUser().getId();
 			session.setAttribute(id,st);
 			String[] strs = st.split(" ");
 			maintainData.setProjectIds(strs);
 			Page<MaintainData> page = dataMaintenanceService.findPage(new Page<MaintainData>(request, response), maintainData);
 			return getBootstrapData(page);
-//			return "redirect:/a/sg/settlement/data";
-//		}catch (Exception e){
-//			return  null;
-//		}
+		}catch (Exception e){
+			return  null;
+		}
 	}
 	/**
 	 * 查看,增加,编辑表单页面
@@ -170,7 +171,6 @@ public class DataMaintenanceController extends BaseController {
 		j.setMsg("删除成功");
 		return j;
 	}
-	
 	/**
 	 * 批量删除
 	 */
@@ -186,7 +186,6 @@ public class DataMaintenanceController extends BaseController {
 		j.setMsg("删除成功");
 		return j;
 	}
-	
 	/**
 	 * 导出excel文件
 	 */
@@ -253,7 +252,9 @@ public class DataMaintenanceController extends BaseController {
 		return j;
     }
 
-
+	/**
+	 *excel文件数据读取
+	 */
 	private List<MaintainData> getData(ImportExcel importExcel) throws ParseException {
 		int lastRow = importExcel.getLastDataRowNum();
 		List<MaintainData> list = new ArrayList<>();
@@ -288,6 +289,9 @@ public class DataMaintenanceController extends BaseController {
 		return list;
 	}
 
+	/**
+	 *获取excel double类型的值
+	 */
 	private double getDouble(ImportExcel importExcel,Row row,int col){
 		double d = 0.00;
         Object o = importExcel.getCellValue(row,col);
@@ -297,7 +301,9 @@ public class DataMaintenanceController extends BaseController {
       return d;
 	}
 
-
+	/**
+	 *获取excel date类型的值
+	 */
 	private Date getDate(ImportExcel importExcel,Row row,int col) throws ParseException {
 		Date d = null;
 		Object o = importExcel.getCellValue(row,col);

+ 9 - 2
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/service/MaterialInfoService.java

@@ -73,12 +73,17 @@ public class MaterialInfoService extends CrudService<MaterialInfoMapper, Materia
 		super.delete(materialInfo);
 	}
 
+	/**
+	 *根据项目名称删除物料信息
+	 */
 	@Transactional(readOnly = false)
 	public void deleteByPro(String projectName) {
 		materialInfoMapper.deleteByPro(projectName);
 	}
 
-
+	/**
+	 *物料信息合并保存
+	 */
     @Transactional(readOnly = false)
 	public void export(MultipartFile file,String batch,String itemBatch) throws IOException, InvalidFormatException {
 		ImportExcel mo = new ImportExcel(file,1,"模块表");
@@ -106,7 +111,9 @@ public class MaterialInfoService extends CrudService<MaterialInfoMapper, Materia
         materialProjectService.save(materialProject);
 	}
 
-
+	/**
+	 *根据项目名称获取物料信息
+	 */
 	public List<MaterialInfo> findByBatch(List<MaterialProject> list){
 		List<MaterialInfo> list1 = materialInfoMapper.findByList(list);
 		 List<MaterialInfo> list2 = getNewData(list1); //合并数据

+ 10 - 1
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/service/MaterialVersionService.java

@@ -51,6 +51,9 @@ public class MaterialVersionService extends CrudService<MaterialVersionMapper, M
 		super.save(materialVersion);
 	}
 
+	/**
+	 *物料保存
+	 */
 	@Transactional(readOnly = false)
 	public void saveList(List<MaterialStandard> list,String batch) {
 		MaterialVersion materialVersion = new MaterialVersion();
@@ -63,13 +66,19 @@ public class MaterialVersionService extends CrudService<MaterialVersionMapper, M
         save(materialVersion);
 		materialVersionMapper.insertList(list);
 	}
-	
+
+	/**
+	 *删除物料信息
+	 */
 	@Transactional(readOnly = false)
 	public void delete(MaterialVersion materialVersion) {
 		super.delete(materialVersion);
 		deleteByPro(materialVersion.getBatch());
 	}
 
+	/**
+	 * 更加批次号删除物料信息
+	 */
 	@Transactional(readOnly = false)
 	public void deleteByPro(String batch) {
 		materialVersionMapper.deleteByBatch(batch);

+ 5 - 33
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/web/MaterialInfoController.java

@@ -116,40 +116,17 @@ public class MaterialInfoController extends BaseController {
 		j.setMsg("删除成功");
 		return j;
 	}
-	
-	/**
-	 * 导出excel文件
-	 */
-	@ResponseBody
-	@RequiresPermissions("managementcenter:materialinfo:export")
-    @RequestMapping(value = "export")
-    public AjaxJson exportFile(MaterialInfo materialInfo, HttpServletRequest request, HttpServletResponse response) {
-		AjaxJson j = new AjaxJson();
-		try {
-//            String fileName = DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
-//            Page<MaintainData> page = dataMaintenanceService.findPage(new Page<MaintainData>(request, response, -1), maintainData);
-//    		new ExportExcel(null, MaintainData.class).setDataList(page.getList()).write(response, fileName).dispose();
-//			dataMaintenanceService.export(maintainData,response);
-    		j.setSuccess(true);
-    		j.setMsg("导出成功!");
-    		return j;
-		} catch (Exception e) {
-			j.setSuccess(false);
-			j.setMsg("导出失败!失败信息:"+e.getMessage());
-		}
-			return j;
-    }
+
 
 	/**
 	 * 导入Excel数据
-
 	 */
 	@ResponseBody
 	@RequiresPermissions("managementcenter:materialinfo:import")
     @RequestMapping(value = "import")
    	public AjaxJson importFile(@RequestParam("file")MultipartFile file, HttpServletResponse response, HttpServletRequest request) {
-		String batch = request.getParameter("batch");
-		String itemBatch = request.getParameter("itemBatch");
+		String batch = request.getParameter("batch");   //物料批次
+		String itemBatch = request.getParameter("itemBatch");  //项目批次
 		AjaxJson j = new AjaxJson();
 		try {
 			materialInfoService.export(file,batch,itemBatch);
@@ -169,8 +146,8 @@ public class MaterialInfoController extends BaseController {
     @RequiresPermissions("managementcenter:materialinfo:import")
     @RequestMapping(value = "imports")
     public AjaxJson importFile(@RequestParam("file")MultipartFile[] file, HttpServletResponse response, HttpServletRequest request) {
-        String batch = request.getParameter("batch");
-        String itemBatch = request.getParameter("itemBatch");
+        String batch = request.getParameter("batch");   //物料批次
+        String itemBatch = request.getParameter("itemBatch");   //项目批次
         AjaxJson j = new AjaxJson();
         try {
             for(int i=0;i<file.length;i++) {
@@ -213,11 +190,6 @@ public class MaterialInfoController extends BaseController {
 
 	/**
 	 * 项目验证
-	 * @param file
-	 * @param batch
-	 * @return
-	 * @throws IOException
-	 * @throws InvalidFormatException
 	 */
 
 	@ResponseBody

+ 13 - 2
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/web/MaterialVersionController.java

@@ -108,15 +108,23 @@ public class MaterialVersionController extends BaseController {
 		return j;
 	}
 
+	/**
+	 * 导入页面跳转
+	 * @param model
+	 * @return
+	 */
 	@RequestMapping(value = "importExcel")
 	public String importExcel(Model model) {
 		return "modules/sg/managementcenter/materialversion/importexcel";
 	}
 
+	/**
+	 *导入
+	 */
 	@ResponseBody
 	@RequiresPermissions("managementcenter:materialversion:import")
 	@RequestMapping(value = "import")
-	public AjaxJson importFile(@RequestParam("file") MultipartFile file, HttpServletResponse response, HttpServletRequest request) throws IOException, InvalidFormatException, IllegalAccessException, InstantiationException {
+	public AjaxJson importFile(@RequestParam("file") MultipartFile file, HttpServletResponse response, HttpServletRequest request){
 		String batch = request.getParameter("batch");
 		AjaxJson j = new AjaxJson();
 		try {
@@ -134,9 +142,12 @@ public class MaterialVersionController extends BaseController {
 		return j;
 	}
 
+	/**
+	 * 导入验证,如果批次号存在,则返回,不存在,则直接读入
+	 */
 	@ResponseBody
 	@RequestMapping(value = "importValidation")
-	public AjaxJson importValidation(@RequestParam("file")MultipartFile file,String batch) throws IOException, InvalidFormatException, IllegalAccessException, InstantiationException {
+	public AjaxJson importValidation(@RequestParam("file")MultipartFile file,String batch) {
 		AjaxJson j = new AjaxJson();
 		try {
 			MaterialVersion materialVersion = new MaterialVersion();

BIN
src/main/resources/freemarker/excelmodel/竣工决算模板.xlsx


+ 0 - 60
src/main/webapp/webpage/modules/sg/financial/erp/erpCreditForm.jsp

@@ -155,8 +155,6 @@
                 </li>
 				<li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">材料费</a>
                 </li>
-				<li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false">10KV线路信息</a>
-                </li>
             </ul>
             <div class="tab-content">
 				<div id="tab-1" class="tab-pane fade in  active">
@@ -260,64 +258,6 @@
 				});
 			</script>
 			</div>
-				<div id="tab-3" class="tab-pane fade">
-			<a class="btn btn-white btn-sm" onclick="addRow('#testDataChild13List', testDataChild13RowIdx, testDataChild13Tpl);testDataChild13RowIdx = testDataChild13RowIdx + 1;" title="新增"><i class="fa fa-plus"></i> 新增</a>
-			<table class="table table-striped table-bordered table-condensed">
-				<thead>
-					<tr>
-						<th class="hide"></th>
-						<th><font color="red">*</font>10KV电缆、架空导线型号</th>
-						<th>单位</th>
-						<th>长度</th>
-						<th>10KV线路长度(KM)</th>
-						<th>其中:10KV线路</th>
-						<th>其中:400V及以下</th>
-						<th width="10">&nbsp;</th>
-					</tr>
-				</thead>
-				<tbody id="testDataChild13List">
-				</tbody>
-			</table>
-			<script type="text/template" id="testDataChild13Tpl">
-				<tr id="testDataChild13List{{idx}}">
-					<td class="hide">
-						<input id="testDataChild13List{{idx}}_id" name="erpCreditChild3s[{{idx}}].id" type="hidden" value="{{row.id}}"/>
-						<input id="testDataChild13List{{idx}}_delFlag" name="erpCreditChild3s[{{idx}}].delFlag" type="hidden" value="0"/>
-					</td>
-					<td  class="max-width-250">
-						<input  name="erpCreditChild3s[{{idx}}].tenKvModel" class="form-control required" type="text" value="{{row.tenKvModel}}"/>
-					</td>
-					<td  class="max-width-250">
-						<input  name="erpCreditChild3s[{{idx}}].tenKvUnit" class="form-control" type="text" value="{{row.tenKvUnit}}"/>
-					</td>
-					<td  class="max-width-250">
-						<input  name="erpCreditChild3s[{{idx}}].tenKvLength" class="form-control" type="text" value="{{row.tenKvLength}}"/>
-					</td>
-					<td  class="max-width-250">
-						<input  name="erpCreditChild3s[{{idx}}].tenKvLineLength" class="form-control" type="text" value="{{row.tenKvLineLength}}"/>
-					</td>
-					<td  class="max-width-250">
-						<input  name="erpCreditChild3s[{{idx}}].tenKvItsLine" class="form-control" type="text" value="{{row.tenKvItsLine}}"/>
-					</td>
-					<td  class="max-width-250">
-						<input  name="erpCreditChild3s[{{idx}}].tenKvItesFhvFollow" class="form-control" type="text" value="{{row.tenKvItesFhvFollow}}"/>
-					</td>
-					<td class="text-center" width="10">
-						{{#delBtn}}<span class="close" onclick="delRow(this, '#testDataChild13List{{idx}}')" title="删除">&times;</span>{{/delBtn}}
-					</td>
-				</tr>
-			</script>
-			<script type="text/javascript">
-				var testDataChild13RowIdx = 0, testDataChild13Tpl = $("#testDataChild13Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
-				$(document).ready(function() {
-					var data = ${fns:toJson(erpCredit.erpCreditChild3s)};
-					for (var i=0; i<data.length; i++){
-						addRow('#testDataChild13List', testDataChild13RowIdx, testDataChild13Tpl, data[i]);
-						testDataChild13RowIdx = testDataChild13RowIdx + 1;
-					}
-				});
-			</script>
-			</div>
 		</div>
 		</div>
 		</form:form>

+ 65 - 58
src/main/webapp/webpage/modules/sg/financial/erp/erpCreditList.js

@@ -204,6 +204,62 @@ $(document).ready(function() {
                        sortName: 'otherTotalFee'
 
                    }
+                   ,{
+                       field: 'tenKvModel',
+                       title: '10KV电缆、架空导线型号',
+                       sortable: true,
+                       sortName: 'tenKvModel'
+
+                   }
+                   ,{
+                       field: 'tenKvUnit',
+                       title: '单位',
+                       sortable: true,
+                       sortName: 'tenKvUnit'
+
+                   }
+                   ,{
+                       field: 'tenKvLength',
+                       title: '长度',
+                       sortable: true,
+                       sortName: 'tenKvLength'
+
+                   }
+                   ,{
+                       field: 'tenKvLineLength',
+                       title: '10KV线路长度(KM)',
+                       sortable: true,
+                       sortName: 'tenKvLineLength'
+
+                   }
+                   ,{
+                       field: 'tenKvItsLine',
+                       title: '其中:10KV线路',
+                       sortable: true,
+                       sortName: 'tenKvItsLine'
+
+                   }
+                   ,{
+                       field: 'tenKvItesFhvFollow',
+                       title: '其中:400V及以下',
+                       sortable: true,
+                       sortName: 'tenKvItesFhvFollow'
+
+                   }
+                   ,{
+                       field: 'theInputTax',
+                       title: '进项税额',
+                       sortable: true,
+                       sortName: 'theInputTax'
+
+                   }
+                   ,{
+                       field: 'supplierName',
+                       title: '供应商名称',
+                       sortable: true,
+                       sortName: 'supplierName'
+
+                   }
 		     ]
 		
 		});
@@ -252,7 +308,7 @@ $(document).ready(function() {
 			}); 
 		});
 	  $("#export").click(function(){//导出Excel文件
-			jp.downloadFile('${ctx}/sg/financial/erpCredit/export');
+			jp.downloadFile('${ctx}/sg/financial/erpCredit/export?ids='+ getIdSelections());
 	  });
 	  $("#search").click("click", function() {// 绑定查询按扭
 		  $('#erpTable').bootstrapTable('refresh');
@@ -350,17 +406,6 @@ $(document).ready(function() {
 				testDataMain1Child2RowIdx = testDataMain1Child2RowIdx + 1;
 			}
 		}
-    	var testDataMain1Child3RowIdx = 0, testDataMain1Child3Tpl = $("#testDataMain1Child3Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
-		var data3 =  erpCredit.erpCreditChild3s;
-    	if(data3!=null){
-			for (var i=0; i<data3.length; i++){
-				// data3[i].dict = {};
-				// data3[i].dict.isHave = jp.getDictLabel(${fns:toJson(fns:getDictList('yes_no'))}, data3[i].isHave, "-");
-				addRow('#testDataMain1Child-'+row.id+'-3-List', testDataMain1Child3RowIdx, testDataMain1Child3Tpl, data3[i]);
-				testDataMain1Child3RowIdx = testDataMain1Child3RowIdx + 1;
-			}
-		}
-      	  			
       })
      
         return html;
@@ -378,18 +423,17 @@ $(document).ready(function() {
 		<ul class="nav nav-tabs">
 				<li class="active"><a data-toggle="tab" href="#tab-{{idx}}-1" aria-expanded="true">设备费</a></li>
 				<li><a data-toggle="tab" href="#tab-{{idx}}-2" aria-expanded="true">材料费</a></li>
-				<li><a data-toggle="tab" href="#tab-{{idx}}-3" aria-expanded="true">10KV线路信息</a></li>
 		</ul>
 		<div class="tab-content">
 				 <div id="tab-{{idx}}-1" class="tab-pane fade in active">
 						<table class="ani table">
 						<thead>
 							<tr>
-								<th width="20%">物料描述</th>
-								<th width="5%">单位</th>
-								<th width="5%">台数</th>
-								<th width="10%">总容量(千伏安)</th>
-								<th width="60%">入账金额(不含税价)</th>
+								<th width="14%">物料描述</th>
+								<th width="4%">单位</th>
+								<th width="4%">台数</th>
+								<th width="6%">总容量(千伏安)</th>
+								<th width="72%">入账金额(不含税价)</th>
 							</tr>
 						</thead>
 						<tbody id="testDataMain1Child-{{idx}}-1-List">
@@ -400,30 +444,14 @@ $(document).ready(function() {
 					<table class="ani table">
 						<thead>
 							<tr>
-                                <th width="30%">物料描述</th>
-								<th width="70%">入账金额(不含税价)</th>
+                                <th width="15%">物料描述</th>
+                                <th width="85%">入账金额(不含税价)</th>
 							</tr>
 						</thead>
 						<tbody id="testDataMain1Child-{{idx}}-2-List">
 						</tbody>
 					</table>
 				</div>
-				<div id="tab-{{idx}}-3" class="tab-pane fade">
-					<table class="ani table">
-						<thead>
-							<tr>
-								<th width="20%">10KV电缆、架空导线型号</th>
-								<th  width="5%">单位</th>
-								<th  width="5%">长度</th>
-								<th  width="10%">10KV线路长度(KM)</th>
-								<th  width="10%">其中:10KV线路</th>
-                                <th  width="50%">其中:400V及以下</th>
-							</tr>
-						</thead>
-						<tbody id="testDataMain1Child-{{idx}}-3-List">
-						</tbody>
-					</table>
-				</div>
 		</div>//-->
 	</script>
 	<script type="text/template" id="testDataMain1Child1Tpl">//<!--
@@ -455,25 +483,4 @@ $(document).ready(function() {
 					</td>
 				</tr>//-->
 	</script>
-	<script type="text/template" id="testDataMain1Child3Tpl">//<!--
-				<tr>
-					<td>
-						{{row.tenKvModel}}
-					</td>
-					<td>
-						{{row.tenKvUnit}}
-					</td>
-					<td>
-						{{row.tenKvLength}}
-					</td>
-					<td>
-						{{row.tenKvLineLength}}
-					</td>
-                    <td>
-                        {{row.tenKvItsLine}}
-                    </td>
-                    <td>
-                        {{row.tenKvItesFhvFollow}}
-                    </td>
-				</tr>//-->
-	</script>
+