Browse Source

Merge remote-tracking branch 'origin/master'

蔡德晨 5 years ago
parent
commit
7adc2c0fe9
21 changed files with 3378 additions and 0 deletions
  1. 184 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpAccount.java
  2. 187 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCredit.java
  3. 85 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCreditChild1.java
  4. 54 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCreditChild2.java
  5. 94 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCreditChild3.java
  6. 10 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/ErpCreditChild1Mapper.java
  7. 14 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/ErpCreditChild2Mapper.java
  8. 14 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/ErpCreditChild3Mapper.java
  9. 13 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/ErpCreditMapper.java
  10. 139 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditChild1Mapper.xml
  11. 138 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditChild2Mapper.xml
  12. 149 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditChild3Mapper.xml
  13. 148 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditMapper.xml
  14. 99 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/service/ErpCreditService.java
  15. 462 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ErpInfo.java
  16. 394 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ImportUtil.java
  17. 19 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/Test.java
  18. 235 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/web/ErpCreditController.java
  19. 375 0
      src/main/webapp/webpage/modules/sg/financial/erp/erpCreditForm.jsp
  20. 475 0
      src/main/webapp/webpage/modules/sg/financial/erp/erpCreditList.js
  21. 90 0
      src/main/webapp/webpage/modules/sg/financial/erp/erpCreditList.jsp

+ 184 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpAccount.java

@@ -0,0 +1,184 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import org.dozer.Mapping;
+
+import java.io.Serializable;
+
+public class ErpAccount implements Serializable {
+    private static final long serialVersionUID = 1L;
+//    private String companyCode;//公司代码
+//    private String aProfitCenter;//利润中心
+//    private String accountData;//过账日期
+//    private String voucherCode;//凭证代码
+//    private String archivingVoucher;//归档凭证类型
+//    private String numberOfArchiving;//归档凭证编码
+//    private String titleText;//凭证抬头文本
+//    private String hookWbsCode;//挂接WBS编码
+//    private String WbsCode;//WBS编码
+    private String WbsDetails;//WBS描述
+    private String ProjectDefinitionCode;//项目定义编码
+    private String ProjectDefinitionDetails;//项目定义描述
+//    private String subjectCode;//科目代码
+    private String subjectName;//科目名称
+//    private String borrowingDirection;//借贷方向
+    private String lineItemAmount;//行项目金额
+    private String theNumber;//数量
+//    private String batch;//批次
+//    private String materialCode;//物料编码
+    private String materialDetails;//物料描述
+    private String unit;//单位
+//    private String theInputTax;//进项税额
+//    private String taxPurposes;//转出进行税额
+//    private String taxNumbers;//转出凭证号码
+//    private String taxZcDate;//转出凭证过账日期
+//    private String supplier;//供应商)
+//    private String supplierNumber;//供应商名称
+
+////    @ExcelField(title="公司代码")
+//    public String getCompanyCode() {
+//        return companyCode;
+//    }
+////    @ExcelField(title="利润中心")
+//    public String getaProfitCenter() {
+//        return aProfitCenter;
+//    }
+////    @ExcelField(title="凭证编码")
+//    public String getVoucherCode() {
+//        return voucherCode;
+//    }
+////    @ExcelField(title="归档凭证类型")
+//    public String getArchivingVoucher() {
+//        return archivingVoucher;
+//    }
+////    @ExcelField(title="归档凭证编码")
+//    public String getNumberOfArchiving() {
+//        return numberOfArchiving;
+//    }
+////    @ExcelField(title="凭证抬头文本")
+//    public String getTitleText() {
+//        return titleText;
+//    }
+////    @ExcelField(title="挂接WBS编码")
+//    public String getHookWbsCode() {
+//        return hookWbsCode;
+//    }
+////    @ExcelField(title="WBS编码")
+//    public String getWbsCode() {
+//        return WbsCode;
+//    }
+//    @ExcelField(title="WBS描述")
+    public String getWbsDetails() {
+        return WbsDetails;
+    }
+//    @ExcelField(title="项目定义编码")
+    public String getProjectDefinitionCode() {
+        return ProjectDefinitionCode;
+    }
+//    @ExcelField(title="项目定义描述")
+    public String getProjectDefinitionDetails() {
+        return ProjectDefinitionDetails;
+    }
+//    @ExcelField(title="科目代码")
+//    public String getSubjectCode() {
+//        return subjectCode;
+//    }
+//    @ExcelField(title="科目名称")
+    public String getSubjectName() {
+        return subjectName;
+    }
+//    @ExcelField(title="借贷方向")
+//    public String getBorrowingDirection() {
+//        return borrowingDirection;
+//    }
+//    @ExcelField(title="行项目金额")
+    public String getLineItemAmount() {
+        return lineItemAmount;
+    }
+//    @ExcelField(title="数量")
+    public String getTheNumber() {
+        return theNumber;
+    }
+//    @ExcelField(title="批次")
+//    public String getBatch() {
+//        return batch;
+//    }
+//    @ExcelField(title="物料编码")
+//    public String getMaterialCode() {
+//        return materialCode;
+//    }
+//    @ExcelField(title="物料描述")
+    public String getMaterialDetails() {
+        return materialDetails;
+    }
+//    @ExcelField(title="单位")
+    public String getUnit() {
+        return unit;
+    }
+//    @ExcelField(title="进项税额")
+//    public String getTheInputTax() {
+//        return theInputTax;
+//    }
+////    @ExcelField(title="转出进行税额")
+//    public String getTaxPurposes() {
+//        return taxPurposes;
+//    }
+////    @ExcelField(title="转出凭证号码")
+//    public String getTaxNumbers() {
+//        return taxNumbers;
+//    }
+////    @ExcelField(title="供应商")
+//    public String getSupplier() {
+//        return supplier;
+//    }
+////    @ExcelField(title="供应商名称")
+//    public String getSupplierNumber() {
+//        return supplierNumber;
+//    }
+
+    public void setWbsDetails(String wbsDetails) {
+        WbsDetails = wbsDetails;
+    }
+    public void setProjectDefinitionCode(String projectDefinitionCode) {
+        ProjectDefinitionCode = projectDefinitionCode;
+    }
+    public void setProjectDefinitionDetails(String projectDefinitionDetails) {
+        ProjectDefinitionDetails = projectDefinitionDetails;
+    }
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+    public void setLineItemAmount(String lineItemAmount) {
+        this.lineItemAmount = lineItemAmount;
+    }
+    public void setTheNumber(String theNumber) {
+        this.theNumber = theNumber;
+    }
+
+    public void setMaterialDetails(String materialDetails) {
+        this.materialDetails = materialDetails;
+    }
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+
+    @Override
+    public String toString() {
+        return "ErpAccount{" +
+                "WbsDetails='" + WbsDetails + '\'' +
+                ", ProjectDefinitionCode='" + ProjectDefinitionCode + '\'' +
+                ", ProjectDefinitionDetails='" + ProjectDefinitionDetails + '\'' +
+                ", subjectName='" + subjectName + '\'' +
+                ", lineItemAmount='" + lineItemAmount + '\'' +
+                ", theNumber='" + theNumber + '\'' +
+                ", materialDetails='" + materialDetails + '\'' +
+                ", unit='" + unit + '\'' +
+                '}';
+    }
+}

+ 187 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCredit.java

@@ -0,0 +1,187 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+import com.jeeplus.core.persistence.DataEntity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ErpCredit extends DataEntity<ErpCredit>{
+    private static final long serialVersionUID = 1L;
+
+    private String itemId;//项目定义编码
+    private String itemName;//项目名称
+    private Double actualInvestment;//实际投资
+    private Double transferAssets;//移交生产的资产总值
+    private Double consBuildingFee;//施工:建筑费
+    private Double consInstallFee;//施工:安装费
+    private Double consTotalFee;//施工:总计
+    private Double otherSupervisorFee;//其他:监理费
+    private Double otherDesignFee;//其他设计费
+    private Double otherBeWorkFee;//项目前期工作费
+    private Double otherBuildLoan;//建设期贷款利息
+    private Double otherLineDamages;//线路施工赔偿费
+    private Double otherLegalManage;//法人管理费
+    private Double otherTotalFee;//其他费用合计
+    private List<ErpCreditChild1> erpCreditChild1s = new ArrayList<ErpCreditChild1>();
+    private List<ErpCreditChild2> erpCreditChild2s = new ArrayList<ErpCreditChild2>();
+    private List<ErpCreditChild3> erpCreditChild3s = new ArrayList<ErpCreditChild3>();
+
+    @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 +
+                ", erpCreditChild1s=" + erpCreditChild1s +
+                ", erpCreditChild2s=" + erpCreditChild2s +
+                ", erpCreditChild3s=" + erpCreditChild3s +
+                '}';
+    }
+
+    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 Double getActualInvestment() {
+        return actualInvestment;
+    }
+
+    public void setActualInvestment(Double actualInvestment) {
+        this.actualInvestment = actualInvestment;
+    }
+
+    public Double getTransferAssets() {
+        return transferAssets;
+    }
+
+    public void setTransferAssets(Double transferAssets) {
+        this.transferAssets = transferAssets;
+    }
+
+    public Double getConsBuildingFee() {
+        return consBuildingFee;
+    }
+
+    public void setConsBuildingFee(Double consBuildingFee) {
+        this.consBuildingFee = consBuildingFee;
+    }
+
+    public Double getConsInstallFee() {
+        return consInstallFee;
+    }
+
+    public void setConsInstallFee(Double consInstallFee) {
+        this.consInstallFee = consInstallFee;
+    }
+
+    public Double getConsTotalFee() {
+        return consTotalFee;
+    }
+
+    public void setConsTotalFee(Double consTotalFee) {
+        this.consTotalFee = consTotalFee;
+    }
+
+    public Double getOtherSupervisorFee() {
+        return otherSupervisorFee;
+    }
+
+    public void setOtherSupervisorFee(Double otherSupervisorFee) {
+        this.otherSupervisorFee = otherSupervisorFee;
+    }
+
+    public Double getOtherDesignFee() {
+        return otherDesignFee;
+    }
+
+    public void setOtherDesignFee(Double otherDesignFee) {
+        this.otherDesignFee = otherDesignFee;
+    }
+
+    public Double getOtherBeWorkFee() {
+        return otherBeWorkFee;
+    }
+
+    public void setOtherBeWorkFee(Double otherBeWorkFee) {
+        this.otherBeWorkFee = otherBeWorkFee;
+    }
+
+    public Double getOtherBuildLoan() {
+        return otherBuildLoan;
+    }
+
+    public void setOtherBuildLoan(Double otherBuildLoan) {
+        this.otherBuildLoan = otherBuildLoan;
+    }
+
+    public Double getOtherLineDamages() {
+        return otherLineDamages;
+    }
+
+    public void setOtherLineDamages(Double otherLineDamages) {
+        this.otherLineDamages = otherLineDamages;
+    }
+
+    public Double getOtherLegalManage() {
+        return otherLegalManage;
+    }
+
+    public void setOtherLegalManage(Double otherLegalManage) {
+        this.otherLegalManage = otherLegalManage;
+    }
+
+    public Double getOtherTotalFee() {
+        return otherTotalFee;
+    }
+
+    public void setOtherTotalFee(Double otherTotalFee) {
+        this.otherTotalFee = otherTotalFee;
+    }
+
+    public List<ErpCreditChild1> getErpCreditChild1s() {
+        return erpCreditChild1s;
+    }
+
+    public void setErpCreditChild1s(List<ErpCreditChild1> erpCreditChild1s) {
+        this.erpCreditChild1s = erpCreditChild1s;
+    }
+
+    public List<ErpCreditChild2> getErpCreditChild2s() {
+        return erpCreditChild2s;
+    }
+
+    public void setErpCreditChild2s(List<ErpCreditChild2> erpCreditChild2s) {
+        this.erpCreditChild2s = erpCreditChild2s;
+    }
+
+    public List<ErpCreditChild3> getErpCreditChild3s() {
+        return erpCreditChild3s;
+    }
+
+    public void setErpCreditChild3s(List<ErpCreditChild3> erpCreditChild3s) {
+        this.erpCreditChild3s = erpCreditChild3s;
+    }
+}

+ 85 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCreditChild1.java

@@ -0,0 +1,85 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+import com.jeeplus.core.persistence.DataEntity;
+
+public class ErpCreditChild1 extends DataEntity<ErpCreditChild1> {//设备费实体类
+    private static final long serialVersionUID = 1L;
+    private String eqmMaterialDetails1;//设备物料描述
+    private String eqmUnit;//设备单位
+    private Double eqmNumbers;//设备台数
+    private String eqmTotalCapacity;//设备总容量
+    private Double eqmBookedFee1;//设备入账金额
+
+    private ErpCredit erpCredit;//父类
+
+    public ErpCreditChild1(ErpCredit erpCredit) {
+        this.erpCredit = erpCredit;
+    }
+    public ErpCreditChild1(){
+        super();
+    }
+
+    @Override
+    public String toString() {
+        return "ErpCreditChild1{" +
+                "eqmMaterialDetails1='" + eqmMaterialDetails1 + '\'' +
+                ", eqmUnit='" + eqmUnit + '\'' +
+                ", eqmNumbers=" + eqmNumbers +
+                ", eqmTotalCapacity='" + eqmTotalCapacity + '\'' +
+                ", eqmBookedFee1=" + eqmBookedFee1 +
+                ", erpCredit=" + erpCredit +
+                '}';
+    }
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public String getEqmMaterialDetails1() {
+        return eqmMaterialDetails1;
+    }
+
+    public void setEqmMaterialDetails1(String eqmMaterialDetails1) {
+        this.eqmMaterialDetails1 = eqmMaterialDetails1;
+    }
+
+    public String getEqmUnit() {
+        return eqmUnit;
+    }
+
+    public void setEqmUnit(String eqmUnit) {
+        this.eqmUnit = eqmUnit;
+    }
+
+    public Double getEqmNumbers() {
+        return eqmNumbers;
+    }
+
+    public void setEqmNumbers(Double eqmNumbers) {
+        this.eqmNumbers = eqmNumbers;
+    }
+
+    public String getEqmTotalCapacity() {
+        return eqmTotalCapacity;
+    }
+
+    public void setEqmTotalCapacity(String eqmTotalCapacity) {
+        this.eqmTotalCapacity = eqmTotalCapacity;
+    }
+
+    public Double getEqmBookedFee1() {
+        return eqmBookedFee1;
+    }
+
+    public void setEqmBookedFee1(Double eqmBookedFee1) {
+        this.eqmBookedFee1 = eqmBookedFee1;
+    }
+
+    public ErpCredit getErpCredit() {
+        return erpCredit;
+    }
+
+    public void setErpCredit(ErpCredit erpCredit) {
+        this.erpCredit = erpCredit;
+    }
+}

+ 54 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCreditChild2.java

@@ -0,0 +1,54 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+import com.jeeplus.core.persistence.DataEntity;
+
+public class ErpCreditChild2 extends DataEntity<ErpCreditChild2> {//材料费实体类
+    private static final long serialVersionUID = 1L;
+    private Double mtlBookedFee2;//材料 入账金额
+    private String eqmMaterialDetails2;//设备物料描述
+    private ErpCredit erpCredit;//父类
+
+    public ErpCreditChild2(ErpCredit erpCredit) {
+        this.erpCredit = erpCredit;
+    }
+    public ErpCreditChild2(){
+        super();
+    }
+
+    @Override
+    public String toString() {
+        return "ErpCreditChild2{" +
+                "mtlBookedFee2=" + mtlBookedFee2 +
+                ", eqmMaterialDetails2='" + eqmMaterialDetails2 + '\'' +
+                ", erpCredit=" + erpCredit +
+                '}';
+    }
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Double getMtlBookedFee2() {
+        return mtlBookedFee2;
+    }
+
+    public void setMtlBookedFee2(Double mtlBookedFee2) {
+        this.mtlBookedFee2 = mtlBookedFee2;
+    }
+
+    public String getEqmMaterialDetails2() {
+        return eqmMaterialDetails2;
+    }
+
+    public void setEqmMaterialDetails2(String eqmMaterialDetails2) {
+        this.eqmMaterialDetails2 = eqmMaterialDetails2;
+    }
+
+    public ErpCredit getErpCredit() {
+        return erpCredit;
+    }
+
+    public void setErpCredit(ErpCredit erpCredit) {
+        this.erpCredit = erpCredit;
+    }
+}

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

@@ -0,0 +1,94 @@
+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();
+    }
+    @Override
+    public String toString() {
+        return "ErpCreditChild3{" +
+                "tenKvModel='" + tenKvModel + '\'' +
+                ", tenKvUnit='" + tenKvUnit + '\'' +
+                ", tenKvLength=" + tenKvLength +
+                ", tenKvLineLength=" + tenKvLineLength +
+                ", tenKvItsLine=" + tenKvItsLine +
+                ", tenKvItesFhvFollow=" + tenKvItesFhvFollow +
+                ", erpCredit=" + erpCredit +
+                '}';
+    }
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    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;
+    }
+}

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

@@ -0,0 +1,10 @@
+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.ErpCreditChild1;
+
+@MyBatisMapper
+public interface ErpCreditChild1Mapper extends BaseMapper<ErpCreditChild1> {
+}

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

@@ -0,0 +1,14 @@
+/**
+ * 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.ErpCreditChild2;
+
+
+@MyBatisMapper
+public interface ErpCreditChild2Mapper extends BaseMapper<ErpCreditChild2> {
+}

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

@@ -0,0 +1,14 @@
+/**
+ * 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> {
+}

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

@@ -0,0 +1,13 @@
+/**
+ * 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;
+
+
+@MyBatisMapper
+public interface ErpCreditMapper extends BaseMapper<ErpCredit> {
+}

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

@@ -0,0 +1,139 @@
+<?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.ErpCreditChild1Mapper">
+    
+	<sql id="erpChild1Columns">
+		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.eqm_material_details As "eqmMaterialDetails1",
+		a.eqm_unit As "eqmUnit",
+		a.eqm_numbers As "eqmNumbers",
+		a.eqm_total_capacity As "eqmTotalCapacity",
+		a.eqm_booked_fee As "eqmBookedFee1"
+	</sql>
+
+	<select id="get" resultType="ErpCreditChild1" >
+		SELECT 
+			<include refid="erpChild1Columns"/>
+		FROM js_erp_credit_child1 a
+		WHERE a.erp_credit_id = #{erpCredit.id}
+	</select>
+	
+	<select id="findList" resultType="ErpCreditChild1" >
+		SELECT 
+			<include refid="erpChild1Columns"/>
+		FROM js_erp_credit_child1 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="ErpCreditChild1" >
+		SELECT 
+			<include refid="erpChild1Columns"/>
+		FROM js_erp_credit_child1 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_child1(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			erp_credit_id,
+			eqm_material_details,
+			eqm_unit,
+			eqm_numbers,
+			eqm_total_capacity,
+			eqm_booked_fee
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{erpCredit.id},
+			#{eqmMaterialDetails1},
+    		#{eqmUnit},
+    		#{eqmNumbers},
+    		#{eqmTotalCapacity},
+    		#{eqmBookedFee1}
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE js_erp_credit_child1 SET
+
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM test_data_child
+		<choose>
+			<when test="id !=null and id != ''">
+				WHERE id = #{id}
+			</when>
+			<otherwise>
+				WHERE test_data_main_id = #{testDataMain.id}
+			</otherwise>
+		</choose>
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE test_data_child SET 
+			del_flag = #{DEL_FLAG_DELETE}
+		<choose>
+			<when test="id !=null and id != ''">
+				WHERE id = #{id}
+			</when>
+			<otherwise>
+				WHERE test_data_main_id = #{testDataMain.id}
+			</otherwise>
+		</choose>
+	</update>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="TestDataChild11" statementType="STATEMENT">
+		select * FROM js_erp_credit_child1  where ${propertyName} = '${value}'
+	</select>
+	
+</mapper>

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

@@ -0,0 +1,138 @@
+<?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.ErpCreditChild2Mapper">
+    
+	<sql id="erpChild2Columns">
+		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.eqm_material_details As "eqmMaterialDetails2",
+		a.mtl_booked_fee As "mtlBookedFee2"
+	</sql>
+
+	<select id="get" resultType="ErpCreditChild2" >
+		SELECT 
+			<include refid="erpChild2Columns"/>
+		FROM js_erp_credit_child2 a
+		WHERE a.erp_credit_id = #{erpCredit.id}
+	</select>
+	
+	<select id="findList" resultType="ErpCreditChild2" >
+		SELECT 
+			<include refid="erpChild2Columns"/>
+		FROM js_erp_credit_child2 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="ErpCreditChild2" >
+		SELECT 
+			<include refid="erpChild2Columns"/>
+		FROM js_erp_credit_child2 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_child2(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			erp_credit_id,
+			eqm_material_details,
+			mtl_booked_fee
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{erpCredit.id},
+			#{eqmMaterialDetails2},
+			#{mtlBookedFee2}
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE test_data_child2 SET 	
+			startarea = #{startArea.id},
+			endarea = #{endArea.id},
+			starttime = #{startTime},
+			price = #{price},
+			yes_no = #{isHave},
+			test_data_main = #{testDataMain.id},
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM test_data_child2
+		<choose>
+			<when test="id !=null and id != ''">
+				WHERE id = #{id}
+			</when>
+			<otherwise>
+				WHERE test_data_main = #{testDataMain.id}
+			</otherwise>
+		</choose>
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE test_data_child2 SET 
+			del_flag = #{DEL_FLAG_DELETE}
+		<choose>
+			<when test="id !=null and id != ''">
+				WHERE id = #{id}
+			</when>
+			<otherwise>
+				WHERE test_data_main = #{testDataMain.id}
+			</otherwise>
+		</choose>
+	</update>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="ErpCreditChild2" statementType="STATEMENT">
+		select * FROM js_erp_credit_child2  where ${propertyName} = '${value}'
+	</select>
+	
+</mapper>

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

@@ -0,0 +1,149 @@
+<?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 test_data_child3 SET 	
+			startarea = #{startArea.id},
+			endarea = #{endArea.id},
+			price = #{price},
+			yes_no = #{isHave},
+			test_data_main = #{testDataMain.id},
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM test_data_child3
+		<choose>
+			<when test="id !=null and id != ''">
+				WHERE id = #{id}
+			</when>
+			<otherwise>
+				WHERE test_data_main = #{testDataMain.id}
+			</otherwise>
+		</choose>
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE test_data_child3 SET 
+			del_flag = #{DEL_FLAG_DELETE}
+		<choose>
+			<when test="id !=null and id != ''">
+				WHERE id = #{id}
+			</when>
+			<otherwise>
+				WHERE test_data_main = #{testDataMain.id}
+			</otherwise>
+		</choose>
+	</update>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="ErpCreditChild3" statementType="STATEMENT">
+		select * FROM js_erp_credit_child3  where ${propertyName} = '${value}'
+	</select>
+	
+</mapper>

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

@@ -0,0 +1,148 @@
+<?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.ErpCreditMapper">
+
+	<sql id="erpColumns">
+		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.item_id As "itemId",
+		a.item_name As "itemName",
+		a.actual_investment As "actualInvestment",
+		a.transfer_assets As "transferAssets",
+		a.cons_building_fee As "consBuildingFee",
+		a.cons_install_fee As "consInstallFee",
+		a.cons_total_fee As "consTotalFee",
+		a.other_supervisor_fee As "otherSupervisorFee",
+		a.other_design_fee As "otherDesignFee",
+		a.other_bework_fee As "otherBeWorkFee",
+		a.other_build_loan As "otherBuildLoan",
+		a.other_line_damages As "otherLineDamages",
+		a.other_legal_manage As "otherLegalManage",
+		a.other_total_fee As "otherTotalFee"
+	</sql>
+
+	<select id="get" resultType="ErpCredit" >
+		SELECT
+		<include refid="erpColumns"/>
+		FROM js_erp_credit a
+		WHERE a.id = #{id}
+	</select>
+
+	<select id="findList" resultType="ErpCredit" >
+		SELECT
+		<include refid="erpColumns"/>
+		FROM js_erp_credit 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.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+
+	<select id="findAllList" resultType="ErpCredit" >
+		SELECT
+		<include refid="erpColumns"/>
+		FROM js_erp_credit 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.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+
+	<insert id="insert">
+		INSERT INTO js_erp_credit(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			item_id,
+			item_name,
+			actual_investment,
+			transfer_assets,
+			cons_building_fee,
+			cons_install_fee,
+			cons_total_fee,
+			other_supervisor_fee,
+			other_design_fee,
+			other_bework_fee,
+			other_build_loan,
+			other_line_damages,
+			other_legal_manage,
+			other_total_fee
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{itemId},
+			#{itemName},
+			#{actualInvestment},
+			#{transferAssets},
+    		#{consBuildingFee},
+    		#{consInstallFee},
+    		#{consTotalFee},
+    		#{otherSupervisorFee},
+    		#{otherDesignFee},
+    		#{otherBeWorkFee},
+    		#{otherBuildLoan},
+    		#{otherLineDamages},
+    		#{otherLegalManage},
+    		#{otherTotalFee}
+		)
+	</insert>
+
+	<update id="update">
+		UPDATE js_erp_credit SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+		WHERE id = #{id}
+	</update>
+
+
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM js_erp_credit
+		WHERE id = #{id}
+	</update>
+
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE js_erp_credit SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+
+
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="ErpCredit" statementType="STATEMENT">
+		select * FROM js_erp_credit where ${propertyName} = '${value}'
+	</select>
+	
+</mapper>

+ 99 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/service/ErpCreditService.java

@@ -0,0 +1,99 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.sg.financial.erpcredit.service;
+
+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 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.util.List;
+import java.util.Map;
+
+
+@Service
+@Transactional(readOnly = true)
+public class ErpCreditService extends CrudService<ErpCreditMapper,ErpCredit> {
+    @Autowired
+    private ErpCreditChild1Mapper erpCreditChild1Mapper;
+    @Autowired
+    private ErpCreditChild2Mapper erpCreditChild2Mapper;
+    @Autowired
+    private ErpCreditChild3Mapper erpCreditChild3Mapper;
+
+    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)));
+        return erpCredit;
+    }
+
+    public List<ErpCredit> findList(ErpCredit erpCredit) {
+        return super.findList(erpCredit);
+    }
+
+    public Page<ErpCredit> findPage(Page<ErpCredit> page, ErpCredit erpCredit) {
+        return super.findPage(page, erpCredit);
+    }
+
+    @Transactional(readOnly = false)
+    public void save(ErpCredit erpCredit) {
+        System.out.println(erpCredit);
+        super.save(erpCredit);
+        for (ErpCreditChild1 erpCreditChild1 : erpCredit.getErpCreditChild1s()){
+            if (erpCreditChild1.getErpCredit().getItemId().isEmpty()){
+                continue;
+            }
+            if (ErpCreditChild1.DEL_FLAG_NORMAL.equals(erpCredit.getDelFlag())){
+                erpCreditChild1.setErpCredit(erpCredit);
+                erpCreditChild1.preInsert();
+                erpCreditChild1Mapper.insert(erpCreditChild1);
+            }
+        }
+        for (ErpCreditChild2 erpCreditChild2 : erpCredit.getErpCreditChild2s()){
+            if (erpCreditChild2.getErpCredit().getItemId().isEmpty()){
+                continue;
+            }
+            if (ErpCreditChild2.DEL_FLAG_NORMAL.equals(erpCreditChild2.getDelFlag())){
+                erpCreditChild2.setErpCredit(erpCredit);
+                erpCreditChild2.preInsert();
+                erpCreditChild2Mapper.insert(erpCreditChild2);
+            }
+        }
+        for (ErpCreditChild3 erpCreditChild3 : erpCredit.getErpCreditChild3s()){
+            if (erpCreditChild3.getErpCredit().getItemId().isEmpty()){
+                continue;
+            }
+            if (ErpCreditChild3.DEL_FLAG_NORMAL.equals(erpCreditChild3.getDelFlag())){
+                erpCreditChild3.setErpCredit(erpCredit);
+                erpCreditChild3.preInsert();
+                erpCreditChild3Mapper.insert(erpCreditChild3);
+            }
+        }
+    }
+
+    @Transactional(readOnly = false)
+    public void delete(ErpCredit erpCredit) {
+        super.delete(erpCredit);
+        erpCreditChild1Mapper.delete(new ErpCreditChild1(erpCredit));
+        erpCreditChild2Mapper.delete(new ErpCreditChild2(erpCredit));
+        erpCreditChild3Mapper.delete(new ErpCreditChild3(erpCredit));
+    }
+}

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

@@ -0,0 +1,462 @@
+package com.jeeplus.modules.sg.financial.erpcredit.util;
+
+import com.jeeplus.modules.sg.financial.erpcredit.entity.*;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.ss.usermodel.Row;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public  class ErpInfo {
+    public final static String CON_PROJECT = "工程成本";
+
+    public final static String CON_IPE = "安装工程支出";
+
+    public final static String CON_PES= "待摊支出";
+
+    public final static String CON_PLPM = "项目法人管理费";
+
+    public final static String CON_PMF= "项目管理经费";
+
+    public final static String CON_OTR ="其他";
+
+    public final static String CON_METF= "会议费";
+
+    public final static String CON_PSF="工程监理费";
+
+    public final static String CON_EDF="工程设计费";
+
+    public final static String CON_OBL="建设期贷款利息";
+
+    public final static String CON_OLD="线路施工赔偿费";
+
+    public final static String CON_TSF="变压器";
+
+    public final static String CON_RNB="环网柜";
+
+    public final static String CON_BST="箱式变电站";
+
+    public final static String CON_HVS="高压开关柜";
+
+    public final static String CON_OIC="架空绝缘导线";
+
+    public final static String CON_OICAC10="架空绝缘导线,AC10kV";
+    public final static String CON_OICAC20="架空绝缘导线,AC20kV";
+
+    public final static String CON_PRC="电缆电力";
+
+    public final static String CON_PRCAC10="电力电缆,AC10kV";
+    public final static String CON_PRCAC20="电力电缆,AC20kV";
+
+    public final static String  CON_lINE = "-";
+
+    public final static String CON_PlPlQ=CON_PROJECT+CON_lINE+CON_PES+CON_lINE+CON_OTR;//工程成本-待摊支出-其他
+
+    public final static String CON_PLPLPLQ=CON_PlPlQ+CON_lINE+CON_PES+CON_lINE+CON_PLPM+CON_lINE+CON_OTR;//工程成本-待摊支出-项目法人管理费-其他
+
+    public final static String CON_PLM=CON_PMF+CON_lINE+CON_METF;//项目管理经费 - 会议费
+
+    public static Boolean getContains(Object object,Object object1){
+        return true;
+    }
+
+    public static List<ErpAccount> getErpAccount(ImportUtil importUtil)  {
+        int lastRow = importUtil.getLastDataRowNum();
+        List<ErpAccount> list = new ArrayList<ErpAccount>();
+        ErpAccount erpAccount = null;
+        for(int i=1; i<lastRow;i++){
+            erpAccount = new ErpAccount();
+            Row row = importUtil.getRow(i);
+            String erpCode = (String) importUtil.getCellValue(row,10);
+            if(StringUtils.isNotBlank(erpCode)) {
+                erpAccount.setProjectDefinitionCode(erpCode);
+                erpAccount.setProjectDefinitionDetails((String)importUtil.getCellValue(row,11));
+                erpAccount.setSubjectName((String)importUtil.getCellValue(row,13));
+                erpAccount.setLineItemAmount((String)importUtil.getCellValue(row,15));
+                erpAccount.setTheNumber((String)importUtil.getCellValue(row,16));
+                erpAccount.setMaterialDetails((String)importUtil.getCellValue(row,19));
+                erpAccount.setUnit((String)importUtil.getCellValue(row,20));
+                erpAccount.setWbsDetails((String)importUtil.getCellValue(row,9));
+                list.add(erpAccount);
+            }
+        }
+        return list;
+    }
+
+    /**
+     * 传入表的数据集合,获取设备费/材料费/10kV线路信息 集合
+     * 分别获取List<ErpCreditChild1>(设备费)<ErpCreditChild2>(材料费)List<ErpCreditChild3>(10kV线路信息)集合中
+     * 与List<ErpCredit>项目定义编号对应的对象
+     * 添加到List<ErpCredit>集合中的erpCreditChild1s,erpCreditChild2s,erpCreditChild3s.
+     * @param list 表格对象
+     * @return 返回List<ErpCredit>
+     */
+    public static List<ErpCredit> getAllErpCreditList(List<ErpAccount> list){
+        boolean flag; //设备费开关
+        //获取erpCredit对象 list集合
+        List<ErpCredit> erpCredits = getListErpCredit(list);
+        //获取ErpCreditChild1对象 list集合 (设备费)
+        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;
+            //设备费 集合 循环
+            for (ErpCreditChild1 erpCreditChild1:erpCreditChild1s){
+                //判断 erpCredit对象项目定义编号  与  ErpCreditChild1对象项目定义编号
+                if (erpCredit.getItemId().equals(erpCreditChild1.getErpCredit().getItemId())){
+                    //把erpCreditChild1对象 添加到 List<ErpCredit>的List<ErpCreditChild1>中
+                    erpCredit.getErpCreditChild1s().add(erpCreditChild1);
+                    flag =false;
+                }
+            }
+            //材料费 集合 循环
+            for (ErpCreditChild2 erpCreditChild2:erpCreditChild2s){
+                //判断 erpCredit对象项目定义编号  与  ErpCreditChild2对象项目定义编号
+                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){
+                System.out.println("1111111111111111");
+                erpCredit.setConsBuildingFee(erpCredit.getConsTotalFee());
+            }else {
+                erpCredit.setConsInstallFee(erpCredit.getConsTotalFee());
+            }
+        }
+        return erpCredits;
+    }
+
+
+    public static List<ErpCredit> getListErpCredit(List<ErpAccount> list){
+        List<ErpCredit> erpCredits = new ArrayList<ErpCredit>();
+        ErpCredit erpCredit=null;
+        ErpAccount erpAccount=null;
+        boolean flag = true;
+        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;//行项目金额合计
+        for (int i = 0; i < list.size(); i++) {
+            flag = true;
+            erpAccount=list.get(i);//获取erpAccount对象
+            if(erpAccount.getLineItemAmount().isEmpty()){
+                lineItemAmount=0.0;
+            }else {
+                lineItemAmount = Double.parseDouble(erpAccount.getLineItemAmount());
+            }
+            //判断当前集合存在
+            if (null!=erpCredits&&erpCredits.size()>0){
+                for (int j = 0; j < erpCredits.size(); j++) {
+                    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;
+                        break;
+                    }
+                }
+            }
+            //第一次,或者项目定义编码不同 进行如下方法计算
+            if (flag){
+                erpCredit = new ErpCredit();
+                erpCredit.setItemId(erpAccount.getProjectDefinitionCode());//添加项目定义编号
+                erpCredit.setItemName(erpAccount.getProjectDefinitionDetails());//
+                //预先赋值,防止空指针
+                erpCredit.setConsTotalFee(lineItemAmount);
+                erpCredit.setOtherSupervisorFee(lineItemAmount);
+                erpCredit.setOtherDesignFee(lineItemAmount);
+                erpCredit.setOtherBuildLoan(lineItemAmount);
+                erpCredit.setOtherLineDamages(lineItemAmount);
+                erpCredit.setOtherLegalManage(lineItemAmount);
+                //其他费用:合计
+                erpCredit.setOtherTotalFee(lineItemAmount);
+
+                //实际投资
+                if (erpAccount.getSubjectName().contains(ErpInfo.CON_PROJECT)){
+                    erpCredit.setActualInvestment(lineItemAmount);//添加实际金额
+                }
+                //施工费:合计:入账金额 判断物料描述是否为空
+                if (erpAccount.getMaterialDetails().isEmpty()) {
+                    if (erpAccount.getSubjectName().contains(ErpInfo.CON_PROJECT + ErpInfo.CON_lINE + ErpInfo.CON_IPE)) {
+                        //得到施工费
+                        erpCredit.setConsTotalFee(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);
+                    }
+                }
+                erpCredits.add(erpCredit);
+            }
+        }
+        return erpCredits;
+    }
+
+    /**
+     * 获取设备的list集合
+     * @param list 导入的表格 bean对象
+     * @return 设备的list集合
+     */
+    public static List<ErpCreditChild1> getListErpCreditChild1(List<ErpAccount> list){
+        Double eqmNumbers=0.0;//设备台数
+        Double eqmBookedFee=0.0;//设备入账金额
+        String materialDetails="";//筛选kva
+        boolean flag = true;//开关:判断集合是否重复
+        ErpCreditChild1 erpCreditChild1;//设备对象
+        ErpCredit erpCredit;//设备父类
+        ErpAccount erpAccount;//数据集合
+        List<ErpCreditChild1> creditListChild1 = new ArrayList<ErpCreditChild1>();
+        for (int i = 0; i < list.size(); i++) {
+            flag=true;
+            erpAccount=list.get(i);
+            if (erpAccount.getTheNumber().isEmpty()){//设备台数
+                eqmNumbers=0.0;
+            }else {
+                eqmNumbers = Double.parseDouble(erpAccount.getTheNumber());
+            }
+            if (erpAccount.getLineItemAmount().isEmpty()){//入账金额
+                eqmBookedFee=0.0;
+            }else {
+                eqmBookedFee = Double.parseDouble(erpAccount.getLineItemAmount());
+            }
+            if (null!=creditListChild1&&creditListChild1.size()>0){
+                for (int j = 0; j < creditListChild1.size(); j++) {
+                    erpCreditChild1 = creditListChild1.get(j);//获取设备对象
+                    //判断项目定义号是否相同
+                    if (erpCreditChild1.getErpCredit().getItemId().equals(erpAccount.getProjectDefinitionCode())) {
+                        //判断物料描述是否相同
+                        if (erpAccount.getMaterialDetails().equals(erpCreditChild1.getEqmMaterialDetails1())) {
+                            eqmBookedFee += erpCreditChild1.getEqmBookedFee1();//累加 入账金额
+                            erpCreditChild1.setEqmBookedFee1(eqmBookedFee);
+                            eqmNumbers += erpCreditChild1.getEqmNumbers();//累计 数量
+                            erpCreditChild1.setEqmNumbers(eqmNumbers);
+                            flag = false;
+                            break;
+                        }
+                    }
+                }
+            }
+            if (flag){
+                //筛选物料描述包含(变压器、环网柜(无“”有“无”字样)、箱式变电站、高压开关柜),分别显示筛选出的物料描述
+                if (erpAccount.getMaterialDetails().contains(ErpInfo.CON_TSF)||
+                        erpAccount.getMaterialDetails().contains(ErpInfo.CON_RNB)||
+                        erpAccount.getMaterialDetails().contains(ErpInfo.CON_BST)||
+                        erpAccount.getMaterialDetails().contains(ErpInfo.CON_HVS)){
+                    erpCreditChild1 = new ErpCreditChild1();//获取设备对象
+                    erpCredit=new ErpCredit();//获取设备 父类 主类
+                    materialDetails = erpAccount.getMaterialDetails();//获取物料描述
+                    if (materialDetails.contains("kVA")){
+                        String str[] =  materialDetails.split(",");
+                        for (int k = 0; k < str.length; k++) {
+                            if (str[k].contains("kVA")){
+                                materialDetails = str[k].substring(0,str[k].indexOf("kVA"));
+                            }
+                        }
+                        erpCreditChild1.setEqmTotalCapacity(materialDetails);//添加总容量
+                    }
+                    erpCredit.setItemId(erpAccount.getProjectDefinitionCode());//添加项目定义编码
+                    erpCreditChild1.setEqmMaterialDetails1(erpAccount.getMaterialDetails());//添加物料描述
+                    erpCreditChild1.setEqmUnit(erpAccount.getUnit());//添加的单位
+                    erpCreditChild1.setEqmNumbers(eqmNumbers);//添加数量
+                    erpCreditChild1.setEqmBookedFee1(eqmBookedFee);//添加入账金额
+                    erpCreditChild1.setErpCredit(erpCredit);
+                    creditListChild1.add(erpCreditChild1);
+                }
+            }
+        }
+        return creditListChild1;
+    }
+
+    /**
+     * 获取材料的list集合
+     * @param erpAccounts 导入的表格 bean对象
+     * @return 材料 list金额
+     */
+    public static List<ErpCreditChild2> getListErpCreditChild2(List<ErpAccount> erpAccounts){
+        List<ErpCreditChild2> creditListChild2 = new ArrayList<ErpCreditChild2>();
+        boolean flag = true;//判断 材料费
+        double eqmBookedFee2=0.0;//材料入账金额
+        ErpCreditChild2 erpCreditChild2=null;
+        ErpCredit erpCredit = null;
+        ErpAccount erpAccount=null;
+        for (int i = 0; i < erpAccounts.size(); i++) {
+            flag=true;
+            erpAccount = erpAccounts.get(i);
+            if (erpAccount.getLineItemAmount().isEmpty()){
+                eqmBookedFee2 = 0.0;
+            }else {
+                eqmBookedFee2 = Double.parseDouble(erpAccount.getLineItemAmount());
+            }
+            if (null!=creditListChild2&&creditListChild2.size()>0){
+                for (int j = 0; j < creditListChild2.size(); j++) {
+                    erpCreditChild2 = creditListChild2.get(j);
+                    //判断项目定义号是否相同
+                    if (erpCreditChild2.getErpCredit().getItemId().equals(erpAccount.getProjectDefinitionCode())) {
+                        //判断物料描述是否相同
+                        if (erpAccount.getMaterialDetails().equals(erpCreditChild2.getEqmMaterialDetails2())) {
+                            eqmBookedFee2 += erpCreditChild2.getMtlBookedFee2();
+                            erpCreditChild2.setMtlBookedFee2(eqmBookedFee2);
+                            flag=false;
+                            break;
+                        }
+                    }
+                }
+            }
+            if (flag){
+                //排除 物料描述为空的内容
+                if (!erpAccount.getMaterialDetails().isEmpty()) {
+                    //筛选物料描述不包含(变压器、环网柜(无“”有“无”字样)、箱式变电站、高压开关柜)的行项目金额合计
+                    if (!erpAccount.getMaterialDetails().contains(ErpInfo.CON_TSF) &&
+                            !erpAccount.getMaterialDetails().contains(ErpInfo.CON_RNB) &&
+                            !erpAccount.getMaterialDetails().contains(ErpInfo.CON_BST) &&
+                            !erpAccount.getMaterialDetails().contains(ErpInfo.CON_HVS)) {
+                        erpCreditChild2 = new ErpCreditChild2();//获取材料费对象
+                        erpCredit = new ErpCredit();//获取材料 父类 对象
+                        erpCredit.setItemId(erpAccount.getProjectDefinitionCode());//添加项目id
+                        erpCreditChild2.setEqmMaterialDetails2(erpAccount.getMaterialDetails());//添加物料描述
+                        erpCreditChild2.setMtlBookedFee2(eqmBookedFee2);//添加项目材料费
+                        erpCreditChild2.setErpCredit(erpCredit);
+                        creditListChild2.add(erpCreditChild2);
+                    }
+                }
+            }
+        }
+        return creditListChild2;
+    }
+
+    /**
+     * 获取 10kv数据集合
+     * @param erpAccounts
+     * @return
+     */
+    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;
+    }
+}

+ 394 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ImportUtil.java

@@ -0,0 +1,394 @@
+/**
+ * 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.Reflections;
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.modules.sys.entity.Area;
+import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.utils.DictUtils;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.hssf.usermodel.HSSFDateUtil;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.text.NumberFormat;
+import java.text.SimpleDateFormat;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 导入Excel文件(支持“XLS”和“XLSX”格式)
+ * @author jeeplus
+ * @version 2016-03-10
+ */
+public class ImportUtil {
+
+	private static Logger log = LoggerFactory.getLogger(ImportUtil.class);
+
+	/**
+	 * 工作薄对象
+	 */
+	private Workbook wb;
+
+	/**
+	 * 工作表对象
+	 */
+	private Sheet sheet;
+
+	/**
+	 * 标题行号
+	 */
+	private int headerNum;
+
+	/**
+	 * 构造函数
+	 * @param path 导入文件,读取第一个工作表
+	 * @param headerNum 标题行号,数据行号=标题行号+1
+	 * @throws InvalidFormatException
+	 * @throws IOException
+	 */
+	public ImportUtil(String fileName, int headerNum)
+			throws InvalidFormatException, IOException {
+		this(new File(fileName), headerNum);
+	}
+
+	/**
+	 * 构造函数
+	 * @param path 导入文件对象,读取第一个工作表
+	 * @param headerNum 标题行号,数据行号=标题行号+1
+	 * @throws InvalidFormatException
+	 * @throws IOException
+	 */
+	public ImportUtil(File file, int headerNum)
+			throws InvalidFormatException, IOException {
+		this(file, headerNum, 0);
+	}
+
+	/**
+	 * 构造函数
+	 * @param path 导入文件
+	 * @param headerNum 标题行号,数据行号=标题行号+1
+	 * @param sheetIndex 工作表编号
+	 * @throws InvalidFormatException
+	 * @throws IOException
+	 */
+	public ImportUtil(String fileName, int headerNum, int sheetIndex)
+			throws InvalidFormatException, IOException {
+		this(new File(fileName), headerNum, sheetIndex);
+	}
+
+	/**
+	 * 构造函数
+	 * @param path 导入文件对象
+	 * @param headerNum 标题行号,数据行号=标题行号+1
+	 * @param sheetIndex 工作表编号
+	 * @throws InvalidFormatException
+	 * @throws IOException
+	 */
+	public ImportUtil(File file, int headerNum, int sheetIndex)
+			throws InvalidFormatException, IOException {
+		this(file.getName(), new FileInputStream(file), headerNum, sheetIndex);
+	}
+
+	/**
+	 * 构造函数
+	 * @param file 导入文件对象
+	 * @param headerNum 标题行号,数据行号=标题行号+1
+	 * @param sheetIndex 工作表编号
+	 * @throws InvalidFormatException
+	 * @throws IOException
+	 */
+	public ImportUtil(MultipartFile multipartFile, int headerNum, int sheetIndex)
+			throws InvalidFormatException, IOException {
+		this(multipartFile.getOriginalFilename(), multipartFile.getInputStream(), headerNum, sheetIndex);
+	}
+
+	/**
+	 * 构造函数
+	 * @param path 导入文件对象
+	 * @param headerNum 标题行号,数据行号=标题行号+1
+	 * @param sheetIndex 工作表编号
+	 * @throws InvalidFormatException
+	 * @throws IOException
+	 */
+	public ImportUtil(String fileName, InputStream is, int headerNum, int sheetIndex)
+			throws InvalidFormatException, IOException {
+		if (StringUtils.isBlank(fileName)){
+			throw new RuntimeException("导入文档为空!");
+		}else if(fileName.toLowerCase().endsWith("xls")){    
+			this.wb = new HSSFWorkbook(is);    
+        }else if(fileName.toLowerCase().endsWith("xlsx")){  
+        	this.wb = new XSSFWorkbook(is);
+        }else{  
+        	throw new RuntimeException("文档格式不正确!");
+        }  
+		if (this.wb.getNumberOfSheets()<sheetIndex){
+			throw new RuntimeException("文档中没有工作表!");
+		}
+		this.sheet = this.wb.getSheetAt(sheetIndex);
+		this.headerNum = headerNum;
+		log.debug("Initialize success.");
+	}
+	
+	/**
+	 * 获取行对象
+	 * @param rownum
+	 * @return
+	 */
+	public Row getRow(int rownum){
+		return this.sheet.getRow(rownum);
+	}
+
+	/**
+	 * 获取数据行号
+	 * @return
+	 */
+	public int getDataRowNum(){
+		return headerNum+1;
+	}
+	
+	/**
+	 * 获取最后一个数据行号
+	 * @return
+	 */
+	public int getLastDataRowNum(){
+		return this.sheet.getLastRowNum()+headerNum;
+	}
+	
+	/**
+	 * 获取最后一个列号
+	 * @return
+	 */
+	public int getLastCellNum(){
+		return this.getRow(headerNum).getLastCellNum();
+	}
+	
+	/**
+	 * 获取单元格值
+	 * @param row 获取的行
+	 * @param column 获取单元格列号
+	 * @return 单元格值
+	 */
+	public Object getCellValue(Row row, int column) {
+		Object val = "";
+		try {
+			Cell cell = row.getCell(column);
+			if (cell != null) {
+				if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
+					// val = cell.getNumericCellValue();
+					// 当excel 中的数据为数值或日期是需要特殊处理
+					if (HSSFDateUtil.isCellDateFormatted(cell)) {
+						double d = cell.getNumericCellValue();
+						Date date = HSSFDateUtil.getJavaDate(d);
+						SimpleDateFormat dformat = new SimpleDateFormat(
+								"yyyy-MM-dd");
+						val = dformat.format(date);
+					} else {
+						NumberFormat nf = NumberFormat.getInstance();
+						nf.setGroupingUsed(false);// true时的格式:1,234,567,890
+						val = nf.format(cell.getNumericCellValue());// 数值类型的数据为double,所以需要转换一下
+					}
+				} else if (cell.getCellType() == Cell.CELL_TYPE_STRING) {
+					val = cell.getStringCellValue();
+				} else if (cell.getCellType() == Cell.CELL_TYPE_FORMULA) {
+					val = cell.getCellFormula();
+				} else if (cell.getCellType() == Cell.CELL_TYPE_BOOLEAN) {
+					val = cell.getBooleanCellValue();
+				} else if (cell.getCellType() == Cell.CELL_TYPE_ERROR) {
+					val = cell.getErrorCellValue();
+				}
+			}
+		} catch (Exception e) {
+			return val;
+		}
+		return val;
+	}
+	
+	/**
+	 * 获取导入数据列表
+	 * @param cls 导入对象类型
+	 * @param groups 导入分组
+	 */
+	public <E> List<E> getDataList(Class<E> cls, int... groups) throws InstantiationException, IllegalAccessException{
+		List<Object[]> annotationList = Lists.newArrayList();
+		// 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()==2)){
+				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()==2)){
+				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()));
+			};
+		});
+		//log.debug("Import column count:"+annotationList.size());
+		// Get excel data
+		List<E> dataList = Lists.newArrayList();
+		for (int i = this.getDataRowNum(); i < this.getLastDataRowNum(); i++) {
+			E e = (E)cls.newInstance();
+			int column = 0;
+			Row row = this.getRow(i);
+			StringBuilder sb = new StringBuilder();
+			for (Object[] os : annotationList){
+				Object val = this.getCellValue(row, column++);
+				if (val != null){
+					ExcelField ef = (ExcelField)os[0];
+					// If is dict type, get dict value
+					if (StringUtils.isNotBlank(ef.dictType())){
+						val = DictUtils.getDictValue(val.toString(), ef.dictType(), "");
+						//log.debug("Dictionary type value: ["+i+","+colunm+"] " + val);
+					}
+					// Get param type and type cast
+					Class<?> valType = Class.class;
+					if (os[1] instanceof Field){
+						valType = ((Field)os[1]).getType();
+					}else if (os[1] instanceof Method){
+						Method method = ((Method)os[1]);
+						if ("get".equals(method.getName().substring(0, 3))){
+							valType = method.getReturnType();
+						}else if("set".equals(method.getName().substring(0, 3))){
+							valType = ((Method)os[1]).getParameterTypes()[0];
+						}
+					}
+					//log.debug("Import value type: ["+i+","+column+"] " + valType);
+					try {
+						//如果导入的java对象,需要在这里自己进行变换。
+						if (valType == String.class){
+							String s = String.valueOf(val.toString());
+							if(StringUtils.endsWith(s, ".0")){
+								val = StringUtils.substringBefore(s, ".0");
+							}else{
+								val = String.valueOf(val.toString());
+							}
+						}else if (valType == Integer.class){
+							val = Double.valueOf(val.toString()).intValue();
+						}else if (valType == Long.class){
+							val = Double.valueOf(val.toString()).longValue();
+						}else if (valType == Double.class){
+							val = Double.valueOf(val.toString());
+						}else if (valType == Float.class){
+							val = Float.valueOf(val.toString());
+						}else if (valType == Date.class){
+							SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
+							val=sdf.parse(val.toString()); 
+						}else if (valType == User.class){
+							val = UserUtils.getByUserName(val.toString());
+						}else if (valType == Office.class){
+							val = UserUtils.getByOfficeName(val.toString());
+						}else if (valType == Area.class){
+							val = UserUtils.getByAreaName(val.toString());
+						}else{
+							if (ef.fieldType() != Class.class){
+								val = ef.fieldType().getMethod("getValue", String.class).invoke(null, val.toString());
+							}else{
+								val = Class.forName(this.getClass().getName().replaceAll(this.getClass().getSimpleName(), 
+										"fieldtype."+valType.getSimpleName()+"Type")).getMethod("getValue", String.class).invoke(null, val.toString());
+							}
+						}
+					} catch (Exception ex) {
+						log.info("Get cell value ["+i+","+column+"] error: " + ex.toString());
+						val = null;
+					}
+					// set entity value
+					if (os[1] instanceof Field){
+						Reflections.invokeSetter(e, ((Field)os[1]).getName(), val);
+					}else if (os[1] instanceof Method){
+						String mthodName = ((Method)os[1]).getName();
+						if ("get".equals(mthodName.substring(0, 3))){
+							mthodName = "set"+StringUtils.substringAfter(mthodName, "get");
+						}
+						Reflections.invokeMethod(e, mthodName, new Class[] {valType}, new Object[] {val});
+					}
+				}
+				sb.append(val+", ");
+			}
+			dataList.add(e);
+			log.debug("Read success: ["+i+"] "+sb.toString());
+		}
+		return dataList;
+	}
+
+//	/**
+//	 * 导入测试
+//	 */
+//	public static void main(String[] args) throws Throwable {
+//		
+//		ImportExcel ei = new ImportExcel("target/export.xlsx", 1);
+//		
+//		for (int i = ei.getDataRowNum(); i < ei.getLastDataRowNum(); i++) {
+//			Row row = ei.getRow(i);
+//			for (int j = 0; j < ei.getLastCellNum(); j++) {
+//				Object val = ei.getCellValue(row, j);
+//				System.out.print(val+", ");
+//			}
+//			System.out.print("\n");
+//		}
+//		
+//	}
+}

+ 19 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/Test.java

@@ -0,0 +1,19 @@
+package com.jeeplus.modules.sg.financial.erpcredit.util;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class Test {
+        @org.junit.Test
+        public void getTest(){
+            String content = "10kV箱式变电站,400kVA,美式,硅钢片,普通,无环网柜,400kVA";
+            String str[] =  content.split(",");
+            for (int i = 0; i < str.length; i++) {
+//                System.out.println(str[i]);
+                if (str[i].contains("kVA")){
+                    System.out.println(str[i].substring(0,str[i].indexOf("kVA")));
+                }
+            }
+        }
+
+}

+ 235 - 0
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/web/ErpCreditController.java

@@ -0,0 +1,235 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+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.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.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+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.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 数据维护
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/sg/financial/erpCredit")
+public class ErpCreditController extends BaseController {
+
+	@Autowired
+	private ErpCreditService erpCreditService;
+
+	@ModelAttribute
+	public ErpCredit get(@RequestParam(required=false) String id) {
+		ErpCredit entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = erpCreditService.get(id);
+		}
+		if (entity == null){
+			entity = new ErpCredit();
+		}
+		return entity;
+	}
+	/**
+	 * 表单列表页面
+	 */
+//	@RequiresPermissions("sg:financial:erpCredit:list")
+	@RequestMapping(value = {"list", ""})
+	public String list(ErpCredit erpCredit, Model model) {
+//		model.addAttribute("leave1", erpCredit);
+		model.addAttribute("erpCredit", erpCredit);
+		return "modules/sg/financial/erp/erpCreditList";
+	}
+
+	/**
+	 * 表单列表数据
+	 */
+	@ResponseBody
+//	@RequiresPermissions("sg:financial:erpCredit:list")
+	@RequestMapping(value = "data")
+	public Map<String, Object> data(ErpCredit erpCredit, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<ErpCredit> page = erpCreditService.findPage(new Page<ErpCredit>(request, response), erpCredit);
+		return getBootstrapData(page);
+	}
+
+	/**
+	 * 查看,增加,编辑表单表单页面
+	 */
+//	@RequiresPermissions(value={"sg:financial:erpCredit:view","sg:financial:erpCredit:add","sg:financial:erpCredit:edit"},logical=Logical.OR)
+	@RequestMapping(value = "form")
+	public String form(ErpCredit erpCredit, Model model) {
+		model.addAttribute("erpCredit", erpCredit);
+		return "modules/sg/financial/erp/erpCreditForm";
+	}
+
+	/**
+	 * 保存表单
+	 */
+	@ResponseBody
+//	@RequiresPermissions(value={"sg:financial:erpCredit:add","sg:financial:erpcredit:edit"},logical=Logical.OR)
+	@RequestMapping(value = "save")
+	public AjaxJson save(ErpCredit erpCredit, Model model) throws Exception{
+		AjaxJson j = new AjaxJson();
+		/**
+		 * 后台hibernate-validation插件校验
+		 */
+		String errMsg = beanValidator(erpCredit);
+		if (StringUtils.isNotBlank(errMsg)){
+			j.setSuccess(false);
+			j.setMsg(errMsg);
+			return j;
+		}
+		//新增或编辑表单保存
+		erpCreditService.save(erpCredit);//保存
+		j.setSuccess(true);
+		j.setMsg("保存表单成功");
+		return j;
+	}
+
+	/**
+	 * 删除表单
+	 */
+	@ResponseBody
+//	@RequiresPermissions("sg:financial:erpCredit:del")
+	@RequestMapping(value = "delete")
+	public AjaxJson delete(ErpCredit erpCredit) {
+		AjaxJson j = new AjaxJson();
+		erpCreditService.delete(erpCredit);
+		j.setMsg("删除表单成功");
+		return j;
+	}
+
+	/**
+	 * 批量请假表单
+	 */
+	@ResponseBody
+//	@RequiresPermissions("sg:financial:erpCredit:del")
+	@RequestMapping(value = "deleteAll")
+	public AjaxJson deleteAll(String ids) {
+		AjaxJson j = new AjaxJson();
+		String idArray[] =ids.split(",");
+		for(String id : idArray){
+			erpCreditService.delete(erpCreditService.get(id));
+		}
+		j.setMsg("删除表单成功");
+		return j;
+	}
+
+	/**
+	 * 导出excel文件
+	 */
+	@ResponseBody
+//	@RequiresPermissions("sg:financial:erpCredit:export")
+	@RequestMapping(value = "export")
+	public AjaxJson exportFile(ErpCredit erpCredit, HttpServletRequest request, HttpServletResponse response) {
+		AjaxJson j = new AjaxJson();
+		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();
+			j.setSuccess(true);
+			j.setMsg("导出成功!");
+			return j;
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导出请单记录失败!失败信息:"+e.getMessage());
+		}
+		return j;
+	}
+	@ResponseBody
+	@RequestMapping(value = "detail")
+	public ErpCredit detail(String id) {
+		System.out.println(id);
+		return erpCreditService.get(id);
+	}
+	/**
+	 * 导入Excel数据
+
+	 */
+	@ResponseBody
+//	@RequiresPermissions("sg:financial:erpCredit:import")
+	@RequestMapping(value = "import")
+	public AjaxJson importFile(@RequestParam("file")MultipartFile file, HttpServletResponse response, HttpServletRequest request){
+		AjaxJson j = new AjaxJson();
+		try {
+			int successNum = 0;
+			int failureNum = 0;
+			StringBuilder failureMsg = new StringBuilder();
+			ImportUtil importUtil = new ImportUtil(file, 0, 0);
+			List<ErpAccount> erpAccounts = ErpInfo.getErpAccount(importUtil);//获取表格数据
+			List<ErpCredit> erpCredits = ErpInfo.getAllErpCreditList(erpAccounts);//获取单条数据
+			for (ErpCredit erpCredit : erpCredits){
+				try{
+					erpCreditService.save(erpCredit);
+					successNum++;
+				}catch(ConstraintViolationException ex){
+					failureNum++;
+				}catch (Exception ex) {
+					failureNum++;
+				}
+			}
+			if (failureNum>0){
+				failureMsg.insert(0, ",失败 "+failureNum+" 条ERP账户记录。");
+			}
+			j.setMsg( "已成功导入 "+successNum+" 条ERP账户记录"+failureMsg);
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导入ERP失败!失败信息:"+e.getMessage());
+		}
+		return j;
+	}
+	/**
+	 * 下载导入请假表单数据模板
+	 */
+	@ResponseBody
+//	@RequiresPermissions("sg:financial:erpCredit:import")
+	@RequestMapping(value = "import/template")
+	public AjaxJson importFileTemplate(HttpServletResponse response) {
+		AjaxJson j = new AjaxJson();
+		try {
+			String fileName = "请假表单数据导入模板.xlsx";
+			List<ErpCredit> list = Lists.newArrayList();
+			new ExportExcel("请假表单数据", ErpCredit.class, 1).setDataList(list).write(response, fileName).dispose();
+			return null;
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg( "导入模板下载失败!失败信息:"+e.getMessage());
+		}
+		return j;
+	}
+
+}

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

@@ -0,0 +1,375 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>Erp项目管理</title>
+	<meta name="decorator" content="ani"/>
+	<script type="text/javascript">
+
+		$(document).ready(function() {
+	        $('#inDate').datetimepicker({
+				 format: "YYYY-MM-DD HH:mm:ss"
+		    });
+		});
+
+		function save() {
+            var isValidate = jp.validateForm('#inputForm');//校验表单
+            if(!isValidate){
+                return false;
+			}else{
+                jp.loading();
+                jp.post("${ctx}/test/onetomany/dialog/testDataMain1/save",$('#inputForm').serialize(),function(data){
+                    if(data.success){
+                        jp.getParent().refresh();
+                        var dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
+                        parent.layer.close(dialogIndex);
+                        jp.success(data.msg)
+
+                    }else{
+                        jp.error(data.msg);
+                    }
+                })
+			}
+
+        }
+		function addRow(list, idx, tpl, row){
+			$(list).append(Mustache.render(tpl, {
+				idx: idx, delBtn: true, row: row
+			}));
+			$(list+idx).find("select").each(function(){
+				$(this).val($(this).attr("data-value"));
+			});
+			$(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+				var ss = $(this).attr("data-value").split(',');
+				for (var i=0; i<ss.length; i++){
+					if($(this).val() == ss[i]){
+						$(this).attr("checked","checked");
+					}
+				}
+			});
+			$(list+idx).find(".form_datetime").each(function(){
+				 $(this).datetimepicker({
+					 format: "YYYY-MM-DD HH:mm:ss"
+			    });
+			});
+		}
+		function delRow(obj, prefix){
+			var id = $(prefix+"_id");
+			var delFlag = $(prefix+"_delFlag");
+			if (id.val() == ""){
+				$(obj).parent().parent().remove();
+			}else if(delFlag.val() == "0"){
+				delFlag.val("1");
+				$(obj).html("&divide;").attr("title", "撤销删除");
+				$(obj).parent().parent().addClass("error");
+			}else if(delFlag.val() == "1"){
+				delFlag.val("0");
+				$(obj).html("&times;").attr("title", "删除");
+				$(obj).parent().parent().removeClass("error");
+			}
+		}
+	</script>
+</head>
+<body class="bg-white">
+		<form:form id="inputForm" modelAttribute="testDataMain1" action="${ctx}/test/onetomany/dialog/testDataMain1/save" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+		<table class="table table-bordered">
+		   <tbody>
+				<tr>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>归属用户:</label></td>
+					<td class="width-35">
+						<sys:userselect id="tuser" name="tuser.id" value="${testDataMain1.tuser.id}" labelName="tuser.name" labelValue="${testDataMain1.tuser.name}"
+							    cssClass="form-control required"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>归属部门:</label></td>
+					<td class="width-35">
+						<sys:treeselect id="office" name="office.id" value="${testDataMain1.office.id}" labelName="office.name" labelValue="${testDataMain1.office.name}"
+							title="部门" url="/sys/office/treeData?type=2" cssClass="form-control required" allowClear="true" notAllowSelectParent="true"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>归属区域:</label></td>
+					<td class="width-35">
+						<sys:treeselect id="area" name="area.id" value="${testDataMain1.area.id}" labelName="area.name" labelValue="${testDataMain1.area.name}"
+							title="区域" url="/sys/area/treeData" cssClass="form-control required" allowClear="true" notAllowSelectParent="true"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>名称:</label></td>
+					<td class="width-35">
+						<form:input path="name" htmlEscape="false"    class="form-control required"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>性别:</label></td>
+					<td class="width-35">
+						<form:radiobuttons path="sex" items="${fns:getDictList('sex')}" itemLabel="label" itemValue="value" htmlEscape="false" class="i-checks required"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>加入日期:</label></td>
+					<td class="width-35">
+							<div class='input-group form_datetime' id='inDate'>
+			                    <input type='text'  name="inDate" class="form-control required"  value="<fmt:formatDate value="${testDataMain1.inDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+			                    <span class="input-group-addon">
+			                        <span class="glyphicon glyphicon-calendar"></span>
+			                    </span>
+			                </div>						            
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="pull-right">备注信息:</label></td>
+					<td class="width-35">
+						<form:textarea path="remarks" htmlEscape="false" rows="4"    class="form-control "/>
+					</td>
+					<td class="width-15 active"></td>
+		   			<td class="width-35" ></td>
+		  		</tr>
+		 	</tbody>
+		</table>
+		<div class="tabs-container">
+            <ul class="nav nav-tabs">
+				<li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">火车票:</a>
+                </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">汽车票:</a>
+                </li>
+            </ul>
+            <div class="tab-content">
+				<div id="tab-1" class="tab-pane fade in  active">
+			<a class="btn btn-white btn-sm" onclick="addRow('#testDataChild11List', testDataChild11RowIdx, testDataChild11Tpl);testDataChild11RowIdx = testDataChild11RowIdx + 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>出发地</th>
+						<th><font color="red">*</font>目的地</th>
+						<th><font color="red">*</font>出发时间</th>
+						<th><font color="red">*</font>代理价格</th>
+						<th>是否有票</th>
+						<th>备注信息</th>
+						<th width="10">&nbsp;</th>
+					</tr>
+				</thead>
+				<tbody id="testDataChild11List">
+				</tbody>
+			</table>
+			<script type="text/template" id="testDataChild11Tpl">//<!--
+				<tr id="testDataChild11List{{idx}}">
+					<td class="hide">
+						<input id="testDataChild11List{{idx}}_id" name="testDataChild11List[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+						<input id="testDataChild11List{{idx}}_delFlag" name="testDataChild11List[{{idx}}].delFlag" type="hidden" value="0"/>
+					</td>
+					
+					<td  class="max-width-250">
+						<sys:treeselect id="testDataChild11List{{idx}}_startArea" name="testDataChild11List[{{idx}}].startArea.id" value="{{row.startArea.id}}" labelName="testDataChild11List{{idx}}.startArea.name" labelValue="{{row.startArea.name}}"
+							title="区域" url="/sys/area/treeData" cssClass="form-control  required" allowClear="true" notAllowSelectParent="true"/>
+					</td>
+					
+					
+					<td  class="max-width-250">
+						<sys:treeselect id="testDataChild11List{{idx}}_endArea" name="testDataChild11List[{{idx}}].endArea.id" value="{{row.endArea.id}}" labelName="testDataChild11List{{idx}}.endArea.name" labelValue="{{row.endArea.name}}"
+							title="区域" url="/sys/area/treeData" cssClass="form-control  required" allowClear="true" notAllowSelectParent="true"/>
+					</td>
+					
+					
+					<td>
+						<div class='input-group form_datetime' id="testDataChild11List{{idx}}_starttime">
+		                    <input type='text'  name="testDataChild11List[{{idx}}].starttime" class="form-control required"  value="{{row.starttime}}"/>
+		                    <span class="input-group-addon">
+		                        <span class="glyphicon glyphicon-calendar"></span>
+		                    </span>
+		                </div>						            
+					</td>
+					
+					
+					<td>
+						<input id="testDataChild11List{{idx}}_price" name="testDataChild11List[{{idx}}].price" type="text" value="{{row.price}}"    class="form-control required isFloatGteZero"/>
+					</td>
+					
+					
+					<td>
+						<select id="testDataChild11List{{idx}}_isHave" name="testDataChild11List[{{idx}}].isHave" data-value="{{row.isHave}}" class="form-control m-b  ">
+							<option value=""></option>
+							<c:forEach items="${fns:getDictList('yes_no')}" var="dict">
+								<option value="${dict.value}">${dict.label}</option>
+							</c:forEach>
+						</select>
+					</td>
+					
+					
+					<td>
+						<textarea id="testDataChild11List{{idx}}_remarks" name="testDataChild11List[{{idx}}].remarks" rows="4"    class="form-control ">{{row.remarks}}</textarea>
+					</td>
+					
+					<td class="text-center" width="10">
+						{{#delBtn}}<span class="close" onclick="delRow(this, '#testDataChild11List{{idx}}')" title="删除">&times;</span>{{/delBtn}}
+					</td>
+				</tr>//-->
+			</script>
+			<script type="text/javascript">
+				var testDataChild11RowIdx = 0, testDataChild11Tpl = $("#testDataChild11Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+				$(document).ready(function() {
+					var data = ${fns:toJson(testDataMain1.testDataChild11List)};
+					for (var i=0; i<data.length; i++){
+						addRow('#testDataChild11List', testDataChild11RowIdx, testDataChild11Tpl, data[i]);
+						testDataChild11RowIdx = testDataChild11RowIdx + 1;
+					}
+				});
+			</script>
+			</div>
+				<div id="tab-2" class="tab-pane fade">
+			<a class="btn btn-white btn-sm" onclick="addRow('#testDataChild12List', testDataChild12RowIdx, testDataChild12Tpl);testDataChild12RowIdx = testDataChild12RowIdx + 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>出发地</th>
+						<th><font color="red">*</font>目的地</th>
+						<th><font color="red">*</font>出发时间</th>
+						<th><font color="red">*</font>代理价格</th>
+						<th><font color="red">*</font>是否有票</th>
+						<th><font color="red">*</font>备注信息</th>
+						<th width="10">&nbsp;</th>
+					</tr>
+				</thead>
+				<tbody id="testDataChild12List">
+				</tbody>
+			</table>
+			<script type="text/template" id="testDataChild12Tpl">//<!--
+				<tr id="testDataChild12List{{idx}}">
+					<td class="hide">
+						<input id="testDataChild12List{{idx}}_id" name="testDataChild12List[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+						<input id="testDataChild12List{{idx}}_delFlag" name="testDataChild12List[{{idx}}].delFlag" type="hidden" value="0"/>
+					</td>
+					
+					<td  class="max-width-250">
+						<sys:treeselect id="testDataChild12List{{idx}}_startArea" name="testDataChild12List[{{idx}}].startArea.id" value="{{row.startArea.id}}" labelName="testDataChild12List{{idx}}.startArea.name" labelValue="{{row.startArea.name}}"
+							title="区域" url="/sys/area/treeData" cssClass="form-control  required" allowClear="true" notAllowSelectParent="true"/>
+					</td>
+					
+					
+					<td  class="max-width-250">
+						<sys:treeselect id="testDataChild12List{{idx}}_endArea" name="testDataChild12List[{{idx}}].endArea.id" value="{{row.endArea.id}}" labelName="testDataChild12List{{idx}}.endArea.name" labelValue="{{row.endArea.name}}"
+							title="区域" url="/sys/area/treeData" cssClass="form-control  required" allowClear="true" notAllowSelectParent="true"/>
+					</td>
+					
+					
+					<td>
+						<div class='input-group form_datetime' id="testDataChild12List{{idx}}_startTime">
+		                    <input type='text'  name="testDataChild12List[{{idx}}].startTime" class="form-control required"  value="{{row.startTime}}"/>
+		                    <span class="input-group-addon">
+		                        <span class="glyphicon glyphicon-calendar"></span>
+		                    </span>
+		                </div>						            
+					</td>
+					
+					
+					<td>
+						<input id="testDataChild12List{{idx}}_price" name="testDataChild12List[{{idx}}].price" type="text" value="{{row.price}}"    class="form-control required isFloatGteZero"/>
+					</td>
+					
+					
+					<td>
+						<select id="testDataChild12List{{idx}}_isHave" name="testDataChild12List[{{idx}}].isHave" data-value="{{row.isHave}}" class="form-control m-b  required">
+							<option value=""></option>
+							<c:forEach items="${fns:getDictList('yes_no')}" var="dict">
+								<option value="${dict.value}">${dict.label}</option>
+							</c:forEach>
+						</select>
+					</td>
+					
+					
+					<td>
+						<textarea id="testDataChild12List{{idx}}_remarks" name="testDataChild12List[{{idx}}].remarks" rows="4"    class="form-control required">{{row.remarks}}</textarea>
+					</td>
+					
+					<td class="text-center" width="10">
+						{{#delBtn}}<span class="close" onclick="delRow(this, '#testDataChild12List{{idx}}')" title="删除">&times;</span>{{/delBtn}}
+					</td>
+				</tr>//-->
+			</script>
+			<script type="text/javascript">
+				var testDataChild12RowIdx = 0, testDataChild12Tpl = $("#testDataChild12Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+				$(document).ready(function() {
+					var data = ${fns:toJson(testDataMain1.testDataChild12List)};
+					for (var i=0; i<data.length; i++){
+						addRow('#testDataChild12List', testDataChild12RowIdx, testDataChild12Tpl, data[i]);
+						testDataChild12RowIdx = testDataChild12RowIdx + 1;
+					}
+				});
+			</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>出发地</th>
+						<th><font color="red">*</font>目的地</th>
+						<th>代理价格</th>
+						<th>是否有票</th>
+						<th>备注信息</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="testDataChild13List[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+						<input id="testDataChild13List{{idx}}_delFlag" name="testDataChild13List[{{idx}}].delFlag" type="hidden" value="0"/>
+					</td>
+					
+					<td  class="max-width-250">
+						<sys:treeselect id="testDataChild13List{{idx}}_startArea" name="testDataChild13List[{{idx}}].startArea.id" value="{{row.startArea.id}}" labelName="testDataChild13List{{idx}}.startArea.name" labelValue="{{row.startArea.name}}"
+							title="区域" url="/sys/area/treeData" cssClass="form-control  required" allowClear="true" notAllowSelectParent="true"/>
+					</td>
+					
+					
+					<td  class="max-width-250">
+						<sys:treeselect id="testDataChild13List{{idx}}_endArea" name="testDataChild13List[{{idx}}].endArea.id" value="{{row.endArea.id}}" labelName="testDataChild13List{{idx}}.endArea.name" labelValue="{{row.endArea.name}}"
+							title="区域" url="/sys/area/treeData" cssClass="form-control  required" allowClear="true" notAllowSelectParent="true"/>
+					</td>
+					
+					
+					<td>
+						<input id="testDataChild13List{{idx}}_price" name="testDataChild13List[{{idx}}].price" type="text" value="{{row.price}}"    class="form-control "/>
+					</td>
+					
+					
+					<td>
+						<select id="testDataChild13List{{idx}}_isHave" name="testDataChild13List[{{idx}}].isHave" data-value="{{row.isHave}}" class="form-control m-b  ">
+							<option value=""></option>
+							<c:forEach items="${fns:getDictList('yes_no')}" var="dict">
+								<option value="${dict.value}">${dict.label}</option>
+							</c:forEach>
+						</select>
+					</td>
+					
+					
+					<td>
+						<textarea id="testDataChild13List{{idx}}_remarks" name="testDataChild13List[{{idx}}].remarks" rows="4"    class="form-control ">{{row.remarks}}</textarea>
+					</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(testDataMain1.testDataChild13List)};
+					for (var i=0; i<data.length; i++){
+						addRow('#testDataChild13List', testDataChild13RowIdx, testDataChild13Tpl, data[i]);
+						testDataChild13RowIdx = testDataChild13RowIdx + 1;
+					}
+				});
+			</script>
+			</div>
+		</div>
+		</div>
+		</form:form>
+</body>
+</html>

+ 475 - 0
src/main/webapp/webpage/modules/sg/financial/erp/erpCreditList.js

@@ -0,0 +1,475 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<script>
+$(document).ready(function() {
+	$('#erpTable').bootstrapTable({
+		 
+		  //请求方法
+               method: 'post',
+               //类型json
+               dataType: "json",
+               contentType: "application/x-www-form-urlencoded",
+               //显示检索按钮
+	       		showSearch: true,
+               //显示刷新按钮
+               showRefresh: true,
+               //显示切换手机试图按钮
+               showToggle: true,
+               //显示 内容列下拉框
+    	       showColumns: true,
+    	       //显示到处按钮
+    	       showExport: true,
+    	       //显示切换分页按钮
+    	       showPaginationSwitch: true,
+    	       //显示详情按钮
+    	       detailView: true,
+    	       	//显示详细内容函数
+	           detailFormatter: "detailFormatter",
+    	       //最低显示2行
+    	       minimumCountColumns: 2,
+               //是否显示行间隔色
+               striped: true,
+               //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)     
+               cache: false,    
+               //是否显示分页(*)  
+               pagination: true,   
+                //排序方式 
+               sortOrder: "asc",  
+               //初始化加载第一页,默认第一页
+               pageNumber:1,   
+               //每页的记录行数(*)   
+               pageSize: 10,  
+               //可供选择的每页的行数(*)    
+               pageList: [10, 25, 50, 100],
+               //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据  
+               url: "${ctx}/sg/financial/erpCredit/data",
+               //默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
+               //queryParamsType:'',   
+               ////查询参数,每次调用是会带上这个参数,可自定义                         
+               queryParams : function(params) {
+               	var searchParam = $("#searchForm").serializeJSON();
+               	searchParam.pageNo = params.limit === undefined? "1" :params.offset/params.limit+1;
+               	searchParam.pageSize = params.limit === undefined? -1 : params.limit;
+               	searchParam.orderBy = params.sort === undefined? "" : params.sort+ " "+  params.order;
+                   return searchParam;
+               },
+               //分页方式:client客户端分页,server服务端分页(*)
+               sidePagination: "server",
+               contextMenuTrigger:"right",//pc端 按右键弹出菜单
+               contextMenuTriggerMobile:"press",//手机端 弹出菜单,click:单击, press:长按。
+               contextMenu: '#context-menu',
+               onContextMenuItem: function(row, $el){
+                   if($el.data("item") == "edit"){
+                   		edit(row.id);
+                   }else if($el.data("item") == "view"){
+                       view(row.id);
+                   } else if($el.data("item") == "delete"){
+                        jp.confirm('确认要删除记录吗?', function(){
+                       	jp.loading();
+                       	jp.get("${ctx}/sg/financial/erpCredit/delete?id="+row.id, function(data){
+                   	  		if(data.success){
+                   	  			$('#erpTable').bootstrapTable('refresh');
+                   	  			jp.success(data.msg);
+                   	  		}else{
+                   	  			jp.error(data.msg);
+                   	  		}
+                   	  	})
+                   	   
+                   	});
+                      
+                   } 
+               },
+              
+               onClickRow: function(row, $el){
+               },
+               	onShowSearch: function () {
+			$("#search-collapse").slideToggle();
+		},
+               columns: [{
+		        checkbox: true
+		       
+		    }
+			,{
+		        field: 'itemId',
+		        title: '项目定义编码',
+		        sortable: true,
+		        sortName: 'itemId'
+		        ,formatter:function(value, row , index){
+
+			   if(value == null || value ==""){
+				   value = "-";
+			   }
+			   <c:choose>
+				   <c:when test="${fns:hasPermission('sg:financial:erpCredit:edit')}">
+				      return "<a href='javascript:edit(\""+row.id+"\")'>"+value+"</a>";
+			      </c:when>
+				  <c:when test="${fns:hasPermission('sg:financial:erpCredit:view')}">
+				      return "<a href='javascript:view(\""+row.id+"\")'>"+value+"</a>";
+			      </c:when>
+				  <c:otherwise>
+				      return value;
+			      </c:otherwise>
+			   </c:choose>
+
+		        }
+		       
+		    }
+			,{
+		        field: 'itemName',
+		        title: '项目名称',
+		        sortable: true,
+		        sortName: 'itemName'
+		       
+		    }
+			,{
+		        field: 'actualInvestment',
+		        title: '实际投资',
+		        sortable: true,
+		        sortName: 'actualInvestment'
+		       
+		    }
+			,{
+		        field: 'transferAssets',
+		        title: '移交生产的资产总值',
+		        sortable: true,
+		        sortName: 'transferAssets'
+		       
+		    }
+                   ,{
+                       field: 'consBuildingFee',
+                       title: '建筑费',
+                       sortable: true,
+                       sortName: 'consBuildingFee'
+
+                   }
+                   ,{
+                       field: 'consInstallFee',
+                       title: '安装费',
+                       sortable: true,
+                       sortName: 'consInstallFee'
+
+                   }
+                   ,{
+                       field: 'consTotalFee',
+                       title: '总计',
+                       sortable: true,
+                       sortName: 'consTotalFee'
+
+                   }
+                   ,{
+                       field: 'otherSupervisorFee',
+                       title: '监理费',
+                       sortable: true,
+                       sortName: 'otherSupervisorFee'
+
+                   }
+                   ,{
+                       field: 'otherDesignFee',
+                       title: '设计费',
+                       sortable: true,
+                       sortName: 'otherDesignFee'
+
+                   }
+                   ,{
+                       field: 'otherBeWorkFee',
+                       title: '项目前期工作费',
+                       sortable: true,
+                       sortName: 'otherBeWorkFee'
+
+                   }
+                   ,{
+                       field: 'otherBuildLoan',
+                       title: '建设期贷款利息',
+                       sortable: true,
+                       sortName: 'otherBuildLoan'
+
+                   }
+                   ,{
+                       field: 'otherLineDamages',
+                       title: '线路施工赔偿费',
+                       sortable: true,
+                       sortName: 'otherLineDamages'
+
+                   }
+                   ,{
+                       field: 'otherLegalManage',
+                       title: '法人管理费',
+                       sortable: true,
+                       sortName: 'otherLegalManage'
+
+                   }
+                   ,{
+                       field: 'otherTotalFee',
+                       title: '合计',
+                       sortable: true,
+                       sortName: 'otherTotalFee'
+
+                   }
+		     ]
+		
+		});
+		
+		  
+	  if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
+
+		 
+		  $('#erpTable').bootstrapTable("toggleView");
+		}
+	  
+	  $('#erpTable').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
+                'check-all.bs.table uncheck-all.bs.table', function () {
+            $('#remove').prop('disabled', ! $('#erpTable').bootstrapTable('getSelections').length);
+            $('#view,#edit').prop('disabled', $('#erpTable').bootstrapTable('getSelections').length!=1);
+        });
+		  
+		$("#btnImport").click(function(){
+			jp.open({
+			    type: 2,
+                area: [500, 200],
+                auto: true,
+			    title:"导入数据",
+			    content: "${ctx}/tag/importExcel" ,
+			    btn: ['下载模板','确定', '关闭'],
+				btn1: function(index, layero){
+					  jp.downloadFile('${ctx}/sg/financial/erpCredit/import/template');
+				  },
+			    btn2: function(index, layero){
+						var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+						iframeWin.contentWindow.importExcel('${ctx}/sg/financial/erpCredit/import', function (data) {
+							if(data.success){
+								jp.success(data.msg);
+								refresh();
+							}else{
+								jp.error(data.msg);
+							}
+                            jp.close(index);
+                        });//调用保存事件
+                    return false;
+				  },
+				 
+				  btn3: function(index){ 
+					  jp.close(index);
+	    	       }
+			}); 
+		});
+	  $("#export").click(function(){//导出Excel文件
+			jp.downloadFile('${ctx}/sg/financial/erpCredit/export');
+	  });
+	  $("#search").click("click", function() {// 绑定查询按扭
+		  $('#erpTable').bootstrapTable('refresh');
+		});
+	 
+	 $("#reset").click("click", function() {// 绑定查询按扭
+		  $("#searchForm  input").val("");
+		  $("#searchForm  select").val("");
+		   $("#searchForm  .select-item").html("");
+		  $('#erpTable').bootstrapTable('refresh');
+		});
+		
+				$('#beginInDate').datetimepicker({
+					 format: "YYYY-MM-DD HH:mm:ss"
+				});
+				$('#endInDate').datetimepicker({
+					 format: "YYYY-MM-DD HH:mm:ss"
+				});
+		
+	});
+		
+  function getIdSelections() {
+        return $.map($("#erpTable").bootstrapTable('getSelections'), function (row) {
+            return row.id
+        });
+    }
+  
+  function deleteAll(){
+
+		jp.confirm('确认要删除该记录吗?', function(){
+			jp.loading();  	
+			jp.get("${ctx}/sg/financial/erpCredit/deleteAll?ids=" + getIdSelections(), function(data){
+         	  		if(data.success){
+         	  			$('#erpTable').bootstrapTable('refresh');
+         	  			jp.success(data.msg);
+         	  		}else{
+         	  			jp.error(data.msg);
+         	  		}
+         	  	})
+          	   
+		})
+  }
+  
+    //刷新列表
+  function refresh() {
+      $('#erpTable').bootstrapTable('refresh');
+  }
+  function add(){
+	  jp.openSaveDialog('新增记录', "${ctx}/sg/financial/erpCredit/form",'800px', '500px');
+  }
+  
+   function edit(id){//没有权限时,不显示确定按钮
+       if(id == undefined){
+	      id = getIdSelections();
+	}
+	jp.openSaveDialog('编辑记录', "${ctx}/sg/financial/erpCredit/form?id=" + id, '800px', '500px');
+  }
+
+  
+ function view(id){//没有权限时,不显示确定按钮
+      if(id == undefined){
+             id = getIdSelections();
+      }
+        jp.openViewDialog('查看表单', "${ctx}/sg/financial/erpCredit/form?id=" + id, '800px', '500px');
+ }
+  
+  
+  
+  
+		   
+  function detailFormatter(index, row) {
+	  var htmltpl =  $("#testDataMain1ChildrenTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+	  var html = Mustache.render(htmltpl, {
+			idx:row.id
+		});
+	  $.get("${ctx}/sg/financial/erpCredit/detail?id="+row.id, function(erpCredit){
+    	var testDataMain1Child1RowIdx = 0, testDataMain1Child1Tpl = $("#testDataMain1Child1Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+		var data1 =  erpCredit.erpCreditChild1s;
+		for (var i=0; i<data1.length; i++){
+			data1[i].dict = {};
+			data1[i].dict.isHave = jp.getDictLabel(${fns:toJson(fns:getDictList('yes_no'))}, data1[i].isHave, "-");
+			addRow('#testDataMain1Child-'+row.id+'-1-List', testDataMain1Child1RowIdx, testDataMain1Child1Tpl, data1[i]);
+			testDataMain1Child1RowIdx = testDataMain1Child1RowIdx + 1;
+		}
+				
+    	var testDataMain1Child2RowIdx = 0, testDataMain1Child2Tpl = $("#testDataMain1Child2Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+		var data2 =  erpCredit.erpCreditChild2s;
+		for (var i=0; i<data2.length; i++){
+			data2[i].dict = {};
+			data2[i].dict.isHave = jp.getDictLabel(${fns:toJson(fns:getDictList('yes_no'))}, data2[i].isHave, "-");
+			addRow('#testDataMain1Child-'+row.id+'-2-List', testDataMain1Child2RowIdx, testDataMain1Child2Tpl, data2[i]);
+			testDataMain1Child2RowIdx = testDataMain1Child2RowIdx + 1;
+		}
+				
+    	var testDataMain1Child3RowIdx = 0, testDataMain1Child3Tpl = $("#testDataMain1Child3Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+		var data3 =  erpCredit.erpCreditChild3s;
+		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;
+    }
+  
+	function addRow(list, idx, tpl, row){
+		$(list).append(Mustache.render(tpl, {
+			idx: idx, delBtn: true, row: row
+		}));
+	}
+			
+</script>
+<script type="text/template" id="testDataMain1ChildrenTpl">//<!--
+	<div class="tabs-container">
+		<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>
+							</tr>
+						</thead>
+						<tbody id="testDataMain1Child-{{idx}}-1-List">
+						</tbody>
+					</table>
+				</div>
+				<div id="tab-{{idx}}-2" class="tab-pane fade">
+					<table class="ani table">
+						<thead>
+							<tr>
+                                <th width="30%">物料描述</th>
+								<th width="70%">入账金额(不含税价)</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">
+				<tr>
+					<td>
+						{{row.eqmMaterialDetails1}}
+					</td>
+					<td>
+						{{row.eqmUnit}}
+					</td>
+					<td>
+						{{row.eqmNumbers}}
+					</td>
+					<td>
+						{{row.eqmTotalCapacity}}
+					</td>
+					<td>
+						{{row.eqmBookedFee1}}
+					</td>
+				</tr>
+	</script>
+	<script type="text/template" id="testDataMain1Child2Tpl">
+				<tr>
+					<td>
+						{{row.eqmMaterialDetails2}}
+					</td>
+					<td>
+						{{row.mtlBookedFee2}}
+					</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>

+ 90 - 0
src/main/webapp/webpage/modules/sg/financial/erp/erpCreditList.jsp

@@ -0,0 +1,90 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>Erp项目管理</title>
+	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
+	<meta name="decorator" content="ani"/>
+	<%@ include file="/webpage/include/bootstraptable.jsp"%>
+	<%@include file="/webpage/include/treeview.jsp" %>
+	<%@include file="erpCreditList.js" %>
+</head>
+<body>
+	<div class="wrapper wrapper-content">
+	<div class="panel panel-primary">
+	<div class="panel-heading">
+		<h3 class="panel-title">Erp管理列表</h3>
+	</div>
+	<div class="panel-body">
+
+		<!-- 搜索 -->
+		<div id="search-collapse" class="collapse">
+			<div class="accordion-inner">
+				<form:form id="searchForm" modelAttribute="erpCredit" class="form form-horizontal well clearfix">
+					<div class="col-xs-12 col-sm-6 col-md-4">
+						<label class="label-item single-overflow pull-left" title="项目定义编码:">项目定义编码:</label>
+						<form:input path="itemId" htmlEscape="false" maxlength="64"  class="form-control"/>
+					</div>
+					<div class="col-xs-12 col-sm-6 col-md-4">
+						<div style="margin-top:26px">
+							<a  id="search" class="btn btn-primary btn-rounded  btn-bordered btn-sm"><i class="fa fa-search"></i> 查询</a>
+							<a  id="reset" class="btn btn-primary btn-rounded  btn-bordered btn-sm" ><i class="fa fa-refresh"></i> 重置</a>
+						</div>
+					</div>
+				</form:form>
+			</div>
+		</div>
+	
+	<!-- 工具栏 -->
+	<div id="toolbar">
+			<%--<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:add">--%>
+				<button id="add" class="btn btn-primary" onclick="add()">
+					<i class="glyphicon glyphicon-plus"></i> 新建
+				</button>
+			<%--</shiro:hasPermission>--%>
+			<%--<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:edit">--%>
+			    <button id="edit" class="btn btn-success" disabled onclick="edit()">
+	            	<i class="glyphicon glyphicon-edit"></i> 修改
+	        	</button>
+			<%--</shiro:hasPermission>--%>
+			<%--<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:del">--%>
+				<button id="remove" class="btn btn-danger" disabled onclick="deleteAll()">
+	            	<i class="glyphicon glyphicon-remove"></i> 删除
+	        	</button>
+			<%--</shiro:hasPermission>--%>
+			<%--<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:import">--%>
+				<button id="btnImport" class="btn btn-info"><i class="fa fa-folder-open-o"></i> 导入</button>
+			<%--</shiro:hasPermission>--%>
+			<%--<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:export">--%>
+	        		<button id="export" class="btn btn-warning">
+					<i class="fa fa-file-excel-o"></i> 导出
+				</button>
+			 <%--</shiro:hasPermission>--%>
+			<%--<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:view">--%>
+				<button id="view" class="btn btn-default" onclick="view()">
+					<i class="fa fa-search-plus"></i> 查看
+				</button>
+			<%--</shiro:hasPermission>--%>
+		    </div>
+		
+	<!-- 表格 -->
+	<table id="erpTable"   data-toolbar="#toolbar"></table>
+
+    <!-- context menu -->
+    <ul id="context-menu" class="dropdown-menu">
+    	<%--<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:view">--%>
+        <li data-item="view"><a>查看</a></li>
+        <%--</shiro:hasPermission>--%>
+    	<%--<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:edit">--%>
+        <li data-item="edit"><a>编辑</a></li>
+        <%--</shiro:hasPermission>--%>
+        <%--<shiro:hasPermission name="test:onetomany:dialog:testDataMain1:del">--%>
+        <li data-item="delete"><a>删除</a></li>
+        <%--</shiro:hasPermission>--%>
+        <li data-item="action1"><a>取消</a></li>
+    </ul>  
+	</div>
+	</div>
+	</div>
+</body>
+</html>