Ver código fonte

erp项目管理 后台

xs 5 anos atrás
pai
commit
b583b5d6e3
18 arquivos alterados com 2438 adições e 0 exclusões
  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

+ 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;
+	}
+
+}