Explorar el Código

Merge remote-tracking branch 'origin/master'

yue hace 5 años
padre
commit
f2ac2bec9b
Se han modificado 37 ficheros con 3931 adiciones y 63 borrados
  1. 170 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpAccount.java
  2. 166 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCredit.java
  3. 70 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCreditChild1.java
  4. 41 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCreditChild2.java
  5. 79 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. 147 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditChild1Mapper.xml
  11. 135 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditChild2Mapper.xml
  12. 151 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditChild3Mapper.xml
  13. 166 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/mapper/xml/ErpCreditMapper.xml
  14. 111 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/service/ErpCreditService.java
  15. 494 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. 213 0
      src/main/java/com/jeeplus/modules/sg/financial/erpcredit/web/ErpCreditController.java
  19. 3 3
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/entity/MaterialInfo.java
  20. 23 6
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/service/MaterialInfoService.java
  21. 105 4
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/web/MaterialInfoController.java
  22. 0 1
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/entity/MaterialProject.java
  23. 1 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/mapper/MaterialProjectMapper.java
  24. 12 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/mapper/xml/MaterialProjectMapper.xml
  25. 4 0
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/service/MaterialProjectService.java
  26. 34 7
      src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/web/MaterialProjectController.java
  27. 1 1
      src/main/resources/j2cache/j2cache.properties
  28. 325 0
      src/main/webapp/webpage/modules/sg/financial/erp/erpCreditForm.jsp
  29. 479 0
      src/main/webapp/webpage/modules/sg/financial/erp/erpCreditList.js
  30. 90 0
      src/main/webapp/webpage/modules/sg/financial/erp/erpCreditList.jsp
  31. 95 14
      src/main/webapp/webpage/modules/sg/managementcenter/materialinfo/importexcel.jsp
  32. 268 0
      src/main/webapp/webpage/modules/sg/managementcenter/materialinfo/importmore.jsp
  33. 62 15
      src/main/webapp/webpage/modules/sg/managementcenter/materialinfo/materialInfoList.js
  34. 3 3
      src/main/webapp/webpage/modules/sg/managementcenter/materialinfo/materialInfoList.jsp
  35. 2 2
      src/main/webapp/webpage/modules/sg/managementcenter/materialproject/materialProjectForm.jsp
  36. 5 0
      src/main/webapp/webpage/modules/sg/managementcenter/materialproject/materialProjectList.js
  37. 12 7
      src/main/webapp/webpage/modules/sg/managementcenter/materialproject/materialProjectList.jsp

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

@@ -0,0 +1,170 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+
+
+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;
+    }
+
+}

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

@@ -0,0 +1,166 @@
+package com.jeeplus.modules.sg.financial.erpcredit.entity;
+
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+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>();
+
+    @ExcelField(title="项目定义编码", align=2, sort=1)
+    public String getItemId() {
+        return itemId;
+    }
+
+    public void setItemId(String itemId) {
+        this.itemId = itemId;
+    }
+    @ExcelField(title="项目名称", align=2, sort=2)
+    public String getItemName() {
+        return itemName;
+    }
+
+    public void setItemName(String itemName) {
+        this.itemName = itemName;
+    }
+    @ExcelField(title="实际投资", align=2, sort=3)
+    public Double getActualInvestment() {
+        return actualInvestment;
+    }
+
+    public void setActualInvestment(Double actualInvestment) {
+        this.actualInvestment = actualInvestment;
+    }
+    @ExcelField(title="移交生产的资产总值", align=2, sort=4)
+    public Double getTransferAssets() {
+        return transferAssets;
+    }
+
+    public void setTransferAssets(Double transferAssets) {
+        this.transferAssets = transferAssets;
+    }
+    @ExcelField(title="建筑费", align=2, sort=5)
+    public Double getConsBuildingFee() {
+        return consBuildingFee;
+    }
+
+    public void setConsBuildingFee(Double consBuildingFee) {
+        this.consBuildingFee = consBuildingFee;
+    }
+    @ExcelField(title="安装费", align=2, sort=6)
+    public Double getConsInstallFee() {
+        return consInstallFee;
+    }
+
+    public void setConsInstallFee(Double consInstallFee) {
+        this.consInstallFee = consInstallFee;
+    }
+    @ExcelField(title="施工:合计", align=2, sort=7)
+    public Double getConsTotalFee() {
+        return consTotalFee;
+    }
+
+    public void setConsTotalFee(Double consTotalFee) {
+        this.consTotalFee = consTotalFee;
+    }
+    @ExcelField(title="监理费", align=2, sort=8)
+    public Double getOtherSupervisorFee() {
+        return otherSupervisorFee;
+    }
+
+    public void setOtherSupervisorFee(Double otherSupervisorFee) {
+        this.otherSupervisorFee = otherSupervisorFee;
+    }
+    @ExcelField(title="设计费", align=2, sort=9)
+    public Double getOtherDesignFee() {
+        return otherDesignFee;
+    }
+
+    public void setOtherDesignFee(Double otherDesignFee) {
+        this.otherDesignFee = otherDesignFee;
+    }
+    @ExcelField(title="项目前期工作费", align=2, sort=10)
+    public Double getOtherBeWorkFee() {
+        return otherBeWorkFee;
+    }
+
+    public void setOtherBeWorkFee(Double otherBeWorkFee) {
+        this.otherBeWorkFee = otherBeWorkFee;
+    }
+    @ExcelField(title="建设期贷款利息", align=2, sort=11)
+    public Double getOtherBuildLoan() {
+        return otherBuildLoan;
+    }
+
+    public void setOtherBuildLoan(Double otherBuildLoan) {
+        this.otherBuildLoan = otherBuildLoan;
+    }
+    @ExcelField(title="线路施工赔偿费", align=2, sort=12)
+    public Double getOtherLineDamages() {
+        return otherLineDamages;
+    }
+
+    public void setOtherLineDamages(Double otherLineDamages) {
+        this.otherLineDamages = otherLineDamages;
+    }
+    @ExcelField(title="法人管理费", align=2, sort=13)
+    public Double getOtherLegalManage() {
+        return otherLegalManage;
+    }
+
+    public void setOtherLegalManage(Double otherLegalManage) {
+        this.otherLegalManage = otherLegalManage;
+    }
+    @ExcelField(title="其他费用:合计", align=2, sort=14)
+    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;
+    }
+}

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

@@ -0,0 +1,70 @@
+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();
+    }
+
+    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;
+    }
+}

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

@@ -0,0 +1,41 @@
+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();
+    }
+
+    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;
+    }
+}

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

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

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

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

@@ -0,0 +1,147 @@
+<?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
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+			del_flag = #{delFlag},
+			eqm_material_details = #{eqmMaterialDetails1},
+			eqm_unit = #{eqmUnit},
+			eqm_numbers = #{eqmNumbers},
+			eqm_total_capacity = #{eqmTotalCapacity},
+			eqm_booked_fee = #{eqmBookedFee1}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM js_erp_credit_child1
+		<choose>
+			<when test="id !=null and id != ''">
+				WHERE id = #{id}
+			</when>
+			<otherwise>
+				WHERE erp_credit_id = #{erpCredit.id}
+			</otherwise>
+		</choose>
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE js_erp_credit_child1 SET
+			del_flag = #{DEL_FLAG_DELETE}
+		<choose>
+			<when test="id !=null and id != ''">
+				WHERE id = #{id}
+			</when>
+			<otherwise>
+				WHERE erp_credit_id = #{erpCredit.id}
+			</otherwise>
+		</choose>
+	</update>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="TestDataChild11" statementType="STATEMENT">
+		select * FROM js_erp_credit_child1  where ${propertyName} = '${value}'
+	</select>
+	
+</mapper>

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

@@ -0,0 +1,135 @@
+<?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 js_erp_credit_child2 SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+			del_flag = #{delFlag},
+			eqm_material_details = #{eqmMaterialDetails2},
+			mtl_booked_fee = #{mtlBookedFee2}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM js_erp_credit_child2
+		<choose>
+			<when test="id !=null and id != ''">
+				WHERE id = #{id}
+			</when>
+			<otherwise>
+				WHERE erp_credit_id = #{erpCredit.id}
+			</otherwise>
+		</choose>
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE js_erp_credit_child2 SET
+			del_flag = #{DEL_FLAG_DELETE}
+		<choose>
+			<when test="id !=null and id != ''">
+				WHERE id = #{id}
+			</when>
+			<otherwise>
+				WHERE erp_credit_id = #{erpCredit.id}
+			</otherwise>
+		</choose>
+	</update>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="ErpCreditChild2" statementType="STATEMENT">
+		select * FROM js_erp_credit_child2  where ${propertyName} = '${value}'
+	</select>
+	
+</mapper>

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

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

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

@@ -0,0 +1,166 @@
+<?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}
+			<if test="itemId != null and itemId != ''">
+				AND a.item_id = #{itemId}
+			</if>
+		</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},
+			del_flag = #{delFlag},
+			item_id = #{itemId},
+			item_name = #{itemName},
+			actual_investment = #{actualInvestment},
+			transfer_assets = #{transferAssets},
+			cons_building_fee = #{consBuildingFee},
+			cons_install_fee = #{consInstallFee},
+			cons_total_fee = #{consInstallFee},
+			other_supervisor_fee = #{otherSupervisorFee},
+			other_design_fee = #{otherDesignFee},
+			other_bework_fee = #{otherBeWorkFee},
+			other_build_loan = #{otherBuildLoan},
+			other_line_damages = #{otherLineDamages},
+			other_legal_manage =#{otherLegalManage},
+			other_total_fee = #{otherTotalFee}
+		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>

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

@@ -0,0 +1,111 @@
+/**
+ * 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.DEL_FLAG_NORMAL.equals(erpCredit.getDelFlag())){
+                if (StringUtils.isBlank(erpCreditChild1.getId())) {
+                    erpCreditChild1.setErpCredit(erpCredit);
+                    erpCreditChild1.preInsert();
+                    erpCreditChild1Mapper.insert(erpCreditChild1);
+                }else {
+                    erpCreditChild1.preUpdate();
+                    erpCreditChild1Mapper.update(erpCreditChild1);
+                }
+            }else {
+                erpCreditChild1Mapper.delete(erpCreditChild1);
+            }
+        }
+        for (ErpCreditChild2 erpCreditChild2 : erpCredit.getErpCreditChild2s()){
+            if (ErpCreditChild2.DEL_FLAG_NORMAL.equals(erpCreditChild2.getDelFlag())){
+                if (StringUtils.isBlank(erpCreditChild2.getId())){
+                    erpCreditChild2.setErpCredit(erpCredit);
+                    erpCreditChild2.preInsert();
+                    erpCreditChild2Mapper.insert(erpCreditChild2);
+                }else {
+                    erpCreditChild2.preUpdate();
+                    erpCreditChild2Mapper.update(erpCreditChild2);
+                }
+            }else {
+                erpCreditChild2Mapper.delete(erpCreditChild2);
+            }
+        }
+        for (ErpCreditChild3 erpCreditChild3 : erpCredit.getErpCreditChild3s()){
+            if (ErpCreditChild3.DEL_FLAG_NORMAL.equals(erpCreditChild3.getDelFlag())){
+                if (StringUtils.isBlank(erpCreditChild3.getId())){
+                    erpCreditChild3.setErpCredit(erpCredit);
+                    erpCreditChild3.preInsert();
+                    erpCreditChild3Mapper.insert(erpCreditChild3);
+                }else {
+                    erpCreditChild3.preUpdate();
+                    erpCreditChild3Mapper.update(erpCreditChild3);
+                }
+            }else {
+                erpCreditChild3Mapper.delete(erpCreditChild3);
+            }
+        }
+    }
+
+    @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));
+    }
+}

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

@@ -0,0 +1,494 @@
+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;
+    }
+
+    /**
+     * 获取表格数据
+     * @param importUtil
+     * @return List<ErpAccount> 导入表格数据
+     */
+    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; //设备费开关:施工费中 建筑费 安装判断 true-建筑费 false-安装费
+        //获取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){//如果为true
+                //施工费合计 赋值为 建筑费(无 设备费入账金额 以及 材料费入账金额)
+                erpCredit.setConsBuildingFee(erpCredit.getConsTotalFee());
+            }else {
+                //施工费合计 赋值为安装费(有 设备费入账金额 或者 材料费入账金额)
+                erpCredit.setConsInstallFee(erpCredit.getConsTotalFee());
+            }
+        }
+        return erpCredits;
+    }
+
+    /**
+     * 获取单独 唯一 的 数据集合(项目定义编号——其他费用合计)
+     * @param list 读取表格获得的列表
+     * @return List<ErpCredit> 主类 集合(单独唯一的数据集合)
+     */
+    public static List<ErpCredit> getListErpCredit(List<ErpAccount> list){
+        List<ErpCredit> erpCredits = new ArrayList<ErpCredit>();//定义集合
+        ErpCredit erpCredit=null;//要获取集合对象
+        ErpAccount erpAccount=null;//导入表格对象
+        boolean flag = true;//判断 项目定义编号是否相同 true-不相同 false-相同
+        double actualInvestment = 0.0;//实际投资
+        double consTotalFee=0.0;//施工费:合计
+        double otherSupervisorFee=0.0;//其他费用:监理费:入账金额
+        double otherDesignFee = 0.0;//其他费用:设计费:入账金额
+        double otherBuildLoan=0.0;//其他费用:建设期贷款利息
+        double otherLineDamages=0.0;//线路施工赔偿费
+        double otherLegalManage=0.0;//法人管理费
+        double otherTotalFee=0.0;//其他费用合计
+        double lineItemAmount;//行项目金额合计
+        //循环导入表格对象
+        for (int i = 0; i < list.size(); i++) {
+            flag = true;//默认值为true (默认项目定义编号不相同)
+            erpAccount=list.get(i);//获取erpAccount对象
+            //判断 导入表格 对象 的行项目金额是否为空
+            if(erpAccount.getLineItemAmount().isEmpty()){
+                lineItemAmount=0.0;//如果为空  默认值为0.0;
+            }else {
+                //否则 获取行羡慕金额
+                lineItemAmount = Double.parseDouble(erpAccount.getLineItemAmount());
+            }
+            //判断当前 集合有数据
+            if (null!=erpCredits&&erpCredits.size()>0){
+                //循环 当前得到的ErpCredits对象
+                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对象
+                erpCredit.setItemId(erpAccount.getProjectDefinitionCode());//添加项目定义编号
+                erpCredit.setItemName(erpAccount.getProjectDefinitionDetails());//项目名称
+                erpCredit.setConsTotalFee(lineItemAmount);//添加施工费合计
+                erpCredit.setOtherSupervisorFee(lineItemAmount);//添加其他:监理费
+                erpCredit.setOtherDesignFee(lineItemAmount);//添加 其他设计费
+//                erpCredit.setOtherBeWorkFee(lineItemAmount); // 添加 项目前期工作费 (暂不确定)
+                erpCredit.setOtherBuildLoan(lineItemAmount);//添加 建设期贷款利息
+                erpCredit.setOtherLineDamages(lineItemAmount);//添加 线路施工赔偿费
+                erpCredit.setOtherLegalManage(lineItemAmount);//添加 法人管理费
+                //其他费用:合计
+                erpCredit.setOtherTotalFee(lineItemAmount);
+
+                //筛选(科目名称)中包含(工程成本-)的所有内容,统计行项目金额合计
+                if (erpAccount.getSubjectName().contains(ErpInfo.CON_PROJECT)){
+                    //添加行项目金额 到 ErpCredit对象中的实际投资金额
+                    erpCredit.setActualInvestment(lineItemAmount);
+                }
+                //施工费:合计:入账金额 判断物料描述是否为空
+                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;//开关:判断集合是否重复 true-物料描述不同 false-项目定义编号相同且物料描述相同
+        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; //为空时 赋初始值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;// 项目定义编号相同且物料描述相同(当前ErpAccount对象在ErpCreditChild1对象中存在且相同 跳过下面方法)
+                            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();//获取物料描述
+                    //截取总容量kVA前数字
+                    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;//判断 材料费 true-物料描述不同或者项目定义编号不同 false-仙姑定义编号物料描述相同
+        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;//材料入账金额初始值为0.0
+            }else {
+                //赋值材料入账金额为行项目金额
+                eqmBookedFee2 = Double.parseDouble(erpAccount.getLineItemAmount());
+            }
+            //判断creditListChild2对象集合 是否存在
+            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 List<ErpCreditChild3> 10KV线路信息
+     */
+    public static List<ErpCreditChild3> getListErpCreditChild3(List<ErpAccount> erpAccounts){
+        List<ErpCreditChild3> creditChild3s = new ArrayList<ErpCreditChild3>();
+        boolean flag = true;//判断 10KV线路信息
+        ErpCredit erpCredit;
+        ErpAccount erpAccount;
+        Double tenKvLength;//10kv线路信息长度
+        ErpCreditChild3 erpCreditChild3;
+        for (int i = 0; i < erpAccounts.size(); i++) {
+            flag=true;
+            erpAccount = erpAccounts.get(i);
+            if (erpAccount.getTheNumber().isEmpty()){
+                tenKvLength=0.0;
+            }else {
+                tenKvLength = Double.parseDouble(erpAccount.getTheNumber());
+            }
+            //相同判断
+            if (null!=creditChild3s&&creditChild3s.size()>0){
+                for (int j = 0; j < creditChild3s.size(); j++) {
+                    erpCreditChild3 = creditChild3s.get(j);
+                    if (erpCreditChild3.getErpCredit().getItemId().equals(erpAccount.getProjectDefinitionCode())) {
+                        //判断物料描述是否相同
+                        if (erpAccount.getMaterialDetails().equals(erpCreditChild3.getTenKvModel())) {
+                            tenKvLength +=erpCreditChild3.getTenKvLength();
+                            erpCreditChild3.setTenKvLength(tenKvLength);
+                            erpCreditChild3.setTenKvLineLength(tenKvLength);
+                            erpCreditChild3.setTenKvItsLine(tenKvLength);
+                            flag=false;
+                            break;
+                        }
+                    }
+                }
+            }
+            if (flag){//赋值初始值
+                if (erpAccount.getMaterialDetails().contains(ErpInfo.CON_OICAC10)||
+                        erpAccount.getMaterialDetails().contains(ErpInfo.CON_OICAC20)||
+                        erpAccount.getMaterialDetails().contains(ErpInfo.CON_PRCAC10)||
+                        erpAccount.getMaterialDetails().contains(ErpInfo.CON_PRCAC20)){
+                    erpCreditChild3 = new ErpCreditChild3();
+                    erpCredit = new ErpCredit();
+                    erpCredit.setItemId(erpAccount.getProjectDefinitionCode());
+                    erpCreditChild3.setTenKvModel(erpAccount.getMaterialDetails());
+                    erpCreditChild3.setTenKvUnit(erpAccount.getUnit());
+                    erpCreditChild3.setTenKvLength(tenKvLength);
+                    erpCreditChild3.setTenKvLineLength(tenKvLength);
+                    erpCreditChild3.setTenKvItsLine(tenKvLength);
+                    erpCreditChild3.setErpCredit(erpCredit);
+                    creditChild3s.add(erpCreditChild3);
+                }
+            }
+        }
+        return creditChild3s;
+    }
+}

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

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

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

+ 3 - 3
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/entity/MaterialInfo.java

@@ -14,7 +14,7 @@ public class MaterialInfo extends DataEntity<MaterialInfo> {
     private Double weightTon;      //总重/吨
     private String supplyType;   //甲乙供
     private String note;      //备注
-    private String state;     //状态,与标准比对,1:相同 2,不相同
+    private String state;     //状态,与标准比对,1:相同 0:不相同
 
 
     public String getState() {
@@ -25,7 +25,7 @@ public class MaterialInfo extends DataEntity<MaterialInfo> {
         this.state = state;
     }
 
-    @ExcelField(title="储备项目名称", align=2, sort=1)
+//    @ExcelField(title="储备项目名称", align=2, sort=1)
     public String getProjectName() {
         return projectName;
     }
@@ -70,7 +70,7 @@ public class MaterialInfo extends DataEntity<MaterialInfo> {
         this.unit = unit;
     }
 
-    @ExcelField(title="总", align=2, sort=6)
+    @ExcelField(title="总", align=2, sort=6)
     public Double getTotalCount() {
         return totalCount;
     }

+ 23 - 6
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/service/MaterialInfoService.java

@@ -25,6 +25,8 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.List;
 
 
@@ -78,20 +80,29 @@ public class MaterialInfoService extends CrudService<MaterialInfoMapper, Materia
 
 
     @Transactional(readOnly = false)
-	public void export(MultipartFile file,String batch) throws IOException, InvalidFormatException {
+	public void export(MultipartFile file,String batch,String itemBatch) throws IOException, InvalidFormatException {
 		ImportExcel mo = new ImportExcel(file,1,"模块表");
 		ImportExcel importExcel = new ImportExcel(file,1,"领料清单");
 		Row row = mo.getRow(0);
-		String projectName = (String) mo.getCellValue(row, 1);
+		String projectNam1 = (String) mo.getCellValue(row, 1);
+		String projectName = projectNam1.trim();
+		MaterialProject materialProject1 = new MaterialProject();
+		materialProject1.setReserveProjectName(projectName);
+		List<MaterialProject> materialProjects = materialProjectService.findList(materialProject1);
+		if(materialProjects != null && materialProjects.size() > 0){
+			materialProjectService.delete(materialProjects.get(0));
+			materialInfoMapper.deleteByPro(projectName);
+		}
 		List<MaterialInfo> materialInfos = getData(importExcel,projectName);   //sheet页数据
-		List<MaterialInfo> list = replaceDate(materialInfos);          //对比替换数据
-		List<MaterialInfo> list1 = getNewData(list);      //合并后数据
+//		List<MaterialInfo> list = replaceDate(materialInfos);          //对比替换数据
+		List<MaterialInfo> list = getNewData(materialInfos);      //合并后数据
 		List<MaterialInfo> standardList = materialInfoMapper.findSat(batch);     //标准库数据
-		List<MaterialInfo> newList = compareData(list1,standardList);    //比对之后的数据
+		List<MaterialInfo> newList = compareData(list,standardList);    //比对之后的数据
 		saveList(newList);
 		MaterialProject materialProject = new MaterialProject();
 		materialProject.setReserveProjectName(projectName);
 		materialProject.setSuppliesBatch(batch);
+		materialProject.setProjectBatch(itemBatch);
         materialProjectService.save(materialProject);
 	}
 
@@ -99,6 +110,12 @@ public class MaterialInfoService extends CrudService<MaterialInfoMapper, Materia
 	public List<MaterialInfo> findByBatch(List<MaterialProject> list){
 		List<MaterialInfo> list1 = materialInfoMapper.findByList(list);
 		 List<MaterialInfo> list2 = getNewData(list1); //合并数据
+		Collections.sort(list2, new Comparator<MaterialInfo>() {
+			@Override
+			public int compare(MaterialInfo o1, MaterialInfo o2) {
+				return o1.getMaterialCode().compareTo(o2.getMaterialCode());
+			}
+		});
 		 return list2;
 	}
 
@@ -115,7 +132,7 @@ public class MaterialInfoService extends CrudService<MaterialInfoMapper, Materia
 		int lastRow = importExcel.getLastDataRowNum();
 		List<MaterialInfo> list = new ArrayList<>();
 		MaterialInfo maintainData = null;
-		for(int i=1; i<lastRow;i++){
+		for(int i=2; i<lastRow;i++){
 			maintainData = new MaterialInfo();
 			Row row = importExcel.getRow(i);
 			String materialCode = (String) importExcel.getCellValue(row,1);

+ 105 - 4
src/main/java/com/jeeplus/modules/sg/managementcenter/materialinfo/web/MaterialInfoController.java

@@ -149,9 +149,10 @@ public class MaterialInfoController extends BaseController {
     @RequestMapping(value = "import")
    	public AjaxJson importFile(@RequestParam("file")MultipartFile file, HttpServletResponse response, HttpServletRequest request) {
 		String batch = request.getParameter("batch");
+		String itemBatch = request.getParameter("itemBatch");
 		AjaxJson j = new AjaxJson();
 		try {
-			materialInfoService.export(file,batch);
+			materialInfoService.export(file,batch,itemBatch);
 			j.setMsg("导入成功");
 		} catch (Exception e) {
 			j.setSuccess(false);
@@ -161,8 +162,30 @@ public class MaterialInfoController extends BaseController {
     }
 
 
+    /**
+     * 多文件导入
+     */
+    @ResponseBody
+    @RequiresPermissions("managementcenter:materialinfo:import")
+    @RequestMapping(value = "imports")
+    public AjaxJson importFile(@RequestParam("file")MultipartFile[] file, HttpServletResponse response, HttpServletRequest request) {
+        String batch = request.getParameter("batch");
+        String itemBatch = request.getParameter("itemBatch");
+        AjaxJson j = new AjaxJson();
+        try {
+            for(int i=0;i<file.length;i++) {
+                materialInfoService.export(file[i], batch,itemBatch);
+            }
+            j.setMsg("导入成功");
+        } catch (Exception e) {
+            j.setSuccess(false);
+            j.setMsg("导入失败!失败信息:"+e.getMessage());
+        }
+        return j;
+    }
 
-	/**
+
+    /**
 	 * 导入文件页面
 	 * @return
 	 */
@@ -173,20 +196,98 @@ public class MaterialInfoController extends BaseController {
 		return "modules/sg/managementcenter/materialinfo/importexcel";
 	}
 
+
+	/**
+	 * 多文件导出页面
+	 */
+	@RequestMapping(value = "/importMore/Form")
+	public String importMoreForm(Model model){
+		List<MaterialProject> list = materialProjectService.findBatch();
+		model.addAttribute("batch",list);
+		return "modules/sg/managementcenter/materialinfo/importmore";
+	}
+
+
+
+
+
+	/**
+	 * 项目验证
+	 * @param file
+	 * @param batch
+	 * @return
+	 * @throws IOException
+	 * @throws InvalidFormatException
+	 */
+
 	@ResponseBody
 	@RequestMapping(value = "importValidation")
-	public AjaxJson importValidation(Model model) {
+	public AjaxJson importValidation(@RequestParam("file")MultipartFile file,String batch,String itemBatch){
 		AjaxJson j = new AjaxJson();
-		List<MaterialInfo> list = materialInfoService.findProjectName();
+		try {
+		ImportExcel mo = new ImportExcel(file,1,"模块表");
+		Row row = mo.getRow(0);
+		String projectName1 = (String) mo.getCellValue(row, 1);
+		String projectName = projectName1.trim();
+		MaterialProject materialProject = new MaterialProject();
+		materialProject.setReserveProjectName(projectName);
+		List<MaterialProject> list = materialProjectService.findList(materialProject);
 		if(list != null && list.size()>0){
 			j.setSuccess(true);
 		}else {
+			materialInfoService.export(file,batch,itemBatch);
+			j.setSuccess(true);
+			j.setErrorCode("0");
+			j.setMsg("导入成功");
+		}
+		} catch (Exception e) {
 			j.setSuccess(false);
+			j.setMsg("导入失败!失败信息:"+e.getMessage());
 		}
 		return j;
 	}
 
 
+    /**
+     * 多文件验证
+     */
+    @ResponseBody
+    @RequestMapping(value = "importValidations")
+    public AjaxJson importValidations(@RequestParam("file")MultipartFile[] file,String batch,String itemBatch){
+        AjaxJson j = new AjaxJson();
+        List<MaterialProject> materialProjects = new ArrayList<>();
+        try {
+            for(int i = 0;i<file.length;i++) {
+                ImportExcel mo = new ImportExcel(file[i], 1, "模块表");
+                Row row = mo.getRow(0);
+                String projectName1 = (String) mo.getCellValue(row, 1);
+                String projectName = projectName1.trim();
+                MaterialProject materialProject = new MaterialProject();
+                materialProject.setReserveProjectName(projectName);
+                materialProjects.add(materialProject);
+            }
+            List<MaterialProject> list = materialProjectService.findByList(materialProjects);
+            if(list != null && list.size()>0){
+            	StringBuilder stringBuilder = new StringBuilder();
+            	for(MaterialProject materialProject : list){
+            		stringBuilder.append(materialProject.getReserveProjectName()+",");
+				}
+            	j.setMsg(stringBuilder.toString());
+                j.setSuccess(true);
+            }else {
+                for(int k=0;k<file.length;k++) {
+                    materialInfoService.export(file[k], batch,itemBatch);
+                }
+                j.setSuccess(true);
+                j.setErrorCode("0");
+                j.setMsg("导入成功");
+            }
+        } catch (Exception e) {
+            j.setSuccess(false);
+            j.setMsg("导入失败!失败信息:"+e.getMessage());
+        }
+        return j;
+    }
 
 
 

+ 0 - 1
src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/entity/MaterialProject.java

@@ -77,7 +77,6 @@ public class MaterialProject extends DataEntity<MaterialProject> {
         this.projectBatch = projectBatch;
     }
 
-    @ExcelField(title="物料批次", align=2, sort=8)
     public String getSuppliesBatch() {
         return suppliesBatch;
     }

+ 1 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/mapper/MaterialProjectMapper.java

@@ -14,5 +14,6 @@ import java.util.List;
 @MyBatisMapper
 public interface MaterialProjectMapper extends BaseMapper<MaterialProject> {
     List<MaterialProject> findBatch();
+    List<MaterialProject> findByList(@Param("list") List<MaterialProject> list);
 
 }

+ 12 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/mapper/xml/MaterialProjectMapper.xml

@@ -70,6 +70,18 @@
 			</otherwise>
 		</choose>
 	</select>
+
+	<select id="findByList" resultType="MaterialProject">
+		SELECT
+		<include refid="infoColumns"/>
+		FROM xm_material_project a
+		<where>
+			a.reserve_project_name in
+			<foreach collection="list" item="item" open="(" close=")" separator=",">
+				#{item.reserveProjectName}
+			</foreach>
+		</where>
+	</select>
 	
 	<select id="findAllList" resultType="MaterialProject" >
 		SELECT 

+ 4 - 0
src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/service/MaterialProjectService.java

@@ -34,6 +34,10 @@ public class MaterialProjectService extends CrudService<MaterialProjectMapper, M
 	public List<MaterialProject> findBatch(){
 		return materialProjectMapper.findBatch();
 	}
+
+	public List<MaterialProject> findByList(List<MaterialProject> list){
+		return materialProjectMapper.findByList(list);
+	}
 	
 	public Page<MaterialProject> findPage(Page<MaterialProject> page, MaterialProject materialProject) {
 		return super.findPage(page, materialProject);

+ 34 - 7
src/main/java/com/jeeplus/modules/sg/managementcenter/materialproject/web/MaterialProjectController.java

@@ -142,28 +142,55 @@ public class MaterialProjectController extends BaseController {
 	}
 	
 	/**
-	 * 导出excel文件
+	 * 物料列表导出
 	 */
 	@ResponseBody
 	@RequiresPermissions("managementcenter:materialproject:export")
     @RequestMapping(value = "export")
     public AjaxJson exportFile(MaterialProject materialProject, HttpServletRequest request, HttpServletResponse response) throws IOException {
 		AjaxJson j = new AjaxJson();
-//		try {
+		try {
             String fileName = "物料"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
             List<MaterialProject> list = materialProjectService.findList(materialProject);
             List<MaterialInfo> materialInfos = materialInfoService.findByBatch(list);
     		new ExportExcel(null, MaterialInfo.class).setDataList(materialInfos).write(response, fileName).dispose();
     		j.setSuccess(true);
     		j.setMsg("导出成功!");
-//    		return j;
-//		} catch (Exception e) {
-//			j.setSuccess(false);
-//			j.setMsg("导出失败!失败信息:"+e.getMessage());
-//		}
+    		return j;
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导出失败!失败信息:"+e.getMessage());
+		}
 			return j;
     }
 
+	/**
+	 * 项目列表导出
+	 * @param materialProject
+	 * @param request
+	 * @param response
+	 * @return
+	 */
+	@ResponseBody
+	@RequiresPermissions("managementcenter:materialproject:export")
+	@RequestMapping(value = "exportpro")
+	public AjaxJson exportPro(MaterialProject materialProject, HttpServletRequest request, HttpServletResponse response) {
+		AjaxJson j = new AjaxJson();
+		try {
+			String fileName = "项目列表"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+//			Page<MaterialProject> page = materialProjectService.findPage(new Page<MaterialProject>(request, response, -1), materialProject);
+			List<MaterialProject> list = materialProjectService.findList(materialProject);
+			new ExportExcel(null, MaterialProject.class).setDataList(list).write(response, fileName).dispose();
+			j.setSuccess(true);
+			j.setMsg("导出成功!");
+			return j;
+		} catch (Exception e) {
+			j.setSuccess(false);
+			j.setMsg("导出失败!失败信息:"+e.getMessage());
+		}
+		return j;
+	}
+
 
 	
 

+ 1 - 1
src/main/resources/j2cache/j2cache.properties

@@ -89,7 +89,7 @@ redis.namespace =
 
 ## connection
 #redis.hosts = 127.0.0.1:6379
-redis.hosts = 192.168.2.4:6379
+redis.hosts = 192.168.2.4:6380
 redis.timeout = 2000
 redis.password =
 redis.database = 0

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

@@ -0,0 +1,325 @@
+<%@ 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}/sg/financial/erpCredit/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="erpCredit" action="${ctx}/sg/financial/erpCredit/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">
+						<form:input path="itemId" htmlEscape="false" class="form-control required"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>项目名称:</label></td>
+					<td class="width-35">
+						<form:input path="itemName" htmlEscape="false"    class="form-control required"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">实际投资:</label></td>
+					<td class="width-35">
+						<form:input path="actualInvestment" htmlEscape="false"    class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="">移交生产的资产总值:</label></td>
+					<td class="width-35">
+						<form:input path="transferAssets" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">建筑费:</label></td>
+					<td class="width-35">
+						<form:input path="consBuildingFee" htmlEscape="false"    class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="">安装费:</label></td>
+					<td class="width-35">
+						<form:input path="consInstallFee" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">施工费:合计:</label></td>
+					<td class="width-35">
+						<form:input path="consTotalFee" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">监理费:</label></td>
+					<td class="width-35">
+						<form:input path="otherSupervisorFee" htmlEscape="false"    class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="">设计费:</label></td>
+					<td class="width-35">
+						<form:input path="otherDesignFee" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">项目前期工作费:</label></td>
+					<td class="width-35">
+						<form:input path="otherBeWorkFee" htmlEscape="false"    class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="">建设期贷款利息:</label></td>
+					<td class="width-35">
+						<form:input path="otherBuildLoan" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">线路施工赔偿费:</label></td>
+					<td class="width-35">
+						<form:input path="otherLineDamages" htmlEscape="false"    class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="">法人管理费:</label></td>
+					<td class="width-35">
+						<form:input path="otherLegalManage" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">其他费用:合计:</label></td>
+					<td class="width-35">
+						<form:input path="otherTotalFee" htmlEscape="false"    class="form-control"/>
+					</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">10KV线路信息</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>单位</th>
+						<th>台数</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="erpCreditChild1s[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+						<input id="testDataChild11List{{idx}}_delFlag" name="erpCreditChild1s[{{idx}}].delFlag" type="hidden" value="0"/>
+					</td>
+					<td  class="max-width-250">
+						<input  name="erpCreditChild1s[{{idx}}].eqmMaterialDetails1" class="form-control required" type="text" value="{{row.eqmMaterialDetails1}}"/>
+					</td>
+					<td  class="max-width-250">
+						<input  name="erpCreditChild1s[{{idx}}].eqmUnit" class="form-control" type="text" value="{{row.eqmUnit}}"/>
+					</td>
+					<td>
+						<input  name="erpCreditChild1s[{{idx}}].eqmNumbers" class="form-control" type="text" value="{{row.eqmNumbers}}"/>
+					</td>
+					<td>
+						<input  name="erpCreditChild1s[{{idx}}].eqmTotalCapacity" class="form-control" type="text" value="{{row.eqmTotalCapacity}}"/>
+					</td>
+					<td>
+						<input  name="erpCreditChild1s[{{idx}}].eqmBookedFee1" class="form-control" type="text" value="{{row.eqmBookedFee1}}"/>
+					</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(erpCredit.erpCreditChild1s)};
+					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>入账金额(不含税价)</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="erpCreditChild2s[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+						<input id="testDataChild12List{{idx}}_delFlag" name="erpCreditChild2s[{{idx}}].delFlag" type="hidden" value="0"/>
+					</td>
+					
+					<td  class="max-width-250">
+						<input  name="erpCreditChild2s[{{idx}}].eqmMaterialDetails2" class="form-control required" type="text" value="{{row.eqmMaterialDetails2}}"/>
+					</td>
+					
+					
+					<td  class="max-width-250">
+						<input  name="erpCreditChild2s[{{idx}}].mtlBookedFee2" class="form-control" type="text" value="{{row.mtlBookedFee2}}"/>
+					</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(erpCredit.erpCreditChild2s)};
+					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>10KV电缆、架空导线型号</th>
+						<th>单位</th>
+						<th>长度</th>
+						<th>10KV线路长度(KM)</th>
+						<th>其中:10KV线路</th>
+						<th>其中:400V及以下</th>
+						<th width="10">&nbsp;</th>
+					</tr>
+				</thead>
+				<tbody id="testDataChild13List">
+				</tbody>
+			</table>
+			<script type="text/template" id="testDataChild13Tpl">
+				<tr id="testDataChild13List{{idx}}">
+					<td class="hide">
+						<input id="testDataChild13List{{idx}}_id" name="erpCreditChild3s[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+						<input id="testDataChild13List{{idx}}_delFlag" name="erpCreditChild3s[{{idx}}].delFlag" type="hidden" value="0"/>
+					</td>
+					<td  class="max-width-250">
+						<input  name="erpCreditChild3s[{{idx}}].tenKvModel" class="form-control required" type="text" value="{{row.tenKvModel}}"/>
+					</td>
+					<td  class="max-width-250">
+						<input  name="erpCreditChild3s[{{idx}}].tenKvUnit" class="form-control" type="text" value="{{row.tenKvUnit}}"/>
+					</td>
+					<td  class="max-width-250">
+						<input  name="erpCreditChild3s[{{idx}}].tenKvLength" class="form-control" type="text" value="{{row.tenKvLength}}"/>
+					</td>
+					<td  class="max-width-250">
+						<input  name="erpCreditChild3s[{{idx}}].tenKvLineLength" class="form-control" type="text" value="{{row.tenKvLineLength}}"/>
+					</td>
+					<td  class="max-width-250">
+						<input  name="erpCreditChild3s[{{idx}}].tenKvItsLine" class="form-control" type="text" value="{{row.tenKvItsLine}}"/>
+					</td>
+					<td  class="max-width-250">
+						<input  name="erpCreditChild3s[{{idx}}].tenKvItesFhvFollow" class="form-control" type="text" value="{{row.tenKvItesFhvFollow}}"/>
+					</td>
+					<td class="text-center" width="10">
+						{{#delBtn}}<span class="close" onclick="delRow(this, '#testDataChild13List{{idx}}')" title="删除">&times;</span>{{/delBtn}}
+					</td>
+				</tr>
+			</script>
+			<script type="text/javascript">
+				var testDataChild13RowIdx = 0, testDataChild13Tpl = $("#testDataChild13Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+				$(document).ready(function() {
+					var data = ${fns:toJson(erpCredit.erpCreditChild3s)};
+					for (var i=0; i<data.length; i++){
+						addRow('#testDataChild13List', testDataChild13RowIdx, testDataChild13Tpl, data[i]);
+						testDataChild13RowIdx = testDataChild13RowIdx + 1;
+					}
+				});
+			</script>
+			</div>
+		</div>
+		</div>
+		</form:form>
+</body>
+</html>

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

@@ -0,0 +1,479 @@
+<%@ 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;
+		if(data1!=null){
+			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;
+    	if(data2!=null){
+			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;
+    	if(data3!=null){
+			for (var i=0; i<data3.length; i++){
+				// data3[i].dict = {};
+				// data3[i].dict.isHave = jp.getDictLabel(${fns:toJson(fns:getDictList('yes_no'))}, data3[i].isHave, "-");
+				addRow('#testDataMain1Child-'+row.id+'-3-List', testDataMain1Child3RowIdx, testDataMain1Child3Tpl, data3[i]);
+				testDataMain1Child3RowIdx = testDataMain1Child3RowIdx + 1;
+			}
+		}
+      	  			
+      })
+     
+        return html;
+    }
+  
+	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="100"  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>

+ 95 - 14
src/main/webapp/webpage/modules/sg/managementcenter/materialinfo/importexcel.jsp

@@ -7,10 +7,87 @@
     <script>
         function importExcel(url, fn) {
             var importForm =$("#importForm")[0];
+            var file = $("#uploadFile").val();
+            var itemBatch = $("#itemBatch").val();
+            var suppliesBatch = $("#suppliesBatch").val();
+            if(file.length === 0){
+                layer.msg("请选择文件",{icon: 3,offset:['40%','40%']});
+                return false;
+            }
+            if(itemBatch == null || itemBatch === ''){
+                layer.msg("请输入项目批次",{icon: 3,offset:['40%','40%']});
+                return false;
+            }
+            if(suppliesBatch == null || suppliesBatch === ''){
+                layer.msg("请选择物料批次",{icon: 3,offset:['40%','40%']});
+                return false;
+            }
             jp.loading('  正在导入,请稍等...');
-            jp.uploadFile(importForm, url,function (data) {
-               fn(data);
-            })
+            // jp.uploadFile(importForm, url,function (data) {
+            //    fn(data);
+            // })
+                var data = new FormData(importForm);
+                // data.append("CustomField", "This is some extra data, testing");//如果要添加参数
+                $.ajax({
+                    type: "POST",
+                    enctype: 'multipart/form-data',
+                    url: url,
+                    data: data,
+                    processData: false, //prevent jQuery from automatically transforming the data into a query string
+                    contentType: false,
+                    cache: false,
+                    timeout: 600000,
+                    success: function (result) {
+                        if(result.success && result.errorCode === '-1'){
+                            jp.confirm('该项目已存在,确定覆盖嘛?', function(){
+                                jp.loading('  正在导入,请稍等...');
+                                $.ajax({
+                                    type: "POST",
+                                    enctype: 'multipart/form-data',
+                                    url: '${ctx}/managementcenter/materialinfo/import',
+                                    data: data,
+                                    processData: false, //prevent jQuery from automatically transforming the data into a query string
+                                    contentType: false,
+                                    cache: false,
+                                    timeout: 600000,
+                                    success: function (result) {
+                                        fn(result);
+                                    }
+                                })
+                            });
+                        }else if((result.success && result.errorCode === '0')){
+                                   fn(result)
+                        }
+                        // fn(result);
+                    },
+                    error:function(xhr, textStatus){
+                        if(xhr.status == 0){
+                            jp.info("连接失败,请检查网络!")
+                        }else if(xhr.status == 404){
+                            var errDetail ="<font color='red'>404,请求地址不存在!</font>";
+                            top.layer.alert(errDetail , {
+                                icon: 2,
+                                area:['auto','auto'],
+                                title:"请求出错"
+                            })
+                        }else if(xhr.status && xhr.responseText){
+                            var errDetail ="<font color='red'>"+ xhr.responseText.replace(/[\r\n]/g,"<br>").replace(/[\r]/g,"<br>").replace(/[\n]/g,"<br>")+"</font>";
+                            top.layer.alert(errDetail , {
+                                icon: 2,
+                                area:['80%','70%'],
+                                title:xhr.status+"错误"
+                            })
+                        }else{
+                            var errDetail =xhr.responseText=="<font color='red'>未知错误!</font>";
+                            top.layer.alert(errDetail , {
+                                icon: 2,
+                                area:['auto','auto'],
+                                title:"真悲剧,后台抛出异常了"
+                            })
+                        }
+
+                    }
+                })
         }
     </script>
 </head>
@@ -19,19 +96,23 @@
         <div id="importBox" >
             <form id="importForm" action="${url}" method="post" enctype="multipart/form-data"
                   style="padding-left:20px;text-align:center;" onsubmit="loading('正在导入,请稍等...');">
-             <div>
-                 <label class="label-item single-overflow pull-left" title="选择文件:">选择文件:</label>
-                <input id="uploadFile" name="file" type="file" class="form-control" style="width:300px"/>
-             </div>
                 <div>
-                    <label class="label-item single-overflow pull-left" title="选择物料库:">选择物料库:</label>
-                    <select name="batch"  class="form-control   simple-select" style="width:300px">
-                        <option value="" label=""/>
-                        <c:forEach var="item" items="${batch}">
-                            <option value="${item.suppliesBatch}" label="${item.suppliesBatch}"/>
-                        </c:forEach>
-                    </select>
+                    <label class="label-item single-overflow pull-left" title="选择文件:">选择文件:</label>
+                <input id="uploadFile" name="file" type="file" class="form-control" style="width:300px"/>
+                </div>
+                <div style="margin-top: 4px;">
+                    <label class="label-item single-overflow pull-left" title="项目批次:">项目批次:</label>
+                    <input id="itemBatch" name="itemBatch" type="text" class="form-control" style="width:300px"/>
+                </div>
+                <div style="margin-top: 4px;">
+                    <label class="label-item single-overflow pull-left" title="物料批次:">物料批次:</label>
+                <select name="batch"  class="form-control   simple-select" id="suppliesBatch" style="width:300px"/>
+                    <c:forEach var="item" items="${batch}">
+                        <option value="${item.suppliesBatch}" label="${item.suppliesBatch}"></option>
+                    </c:forEach>
+                </select>
                 </div> 
+
             </form>
         </div>
     </div>

+ 268 - 0
src/main/webapp/webpage/modules/sg/managementcenter/materialinfo/importmore.jsp

@@ -0,0 +1,268 @@
+<%@ page contentType="text/html;charset=UTF-8"%>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<link rel="stylesheet" href="${ctxStatic}/plugin/layui/dist/css/layui.css">
+<script src="${pageContext.request.contextPath}/act/rest/js/common/jquery-1.8.3.js"></script>
+<script src="${ctxStatic}/plugin/layui/dist/layui.js"></script>
+<script src="${ctxStatic}/common/js/jeeplus.js"></script>
+
+<html>
+<head>
+    <title>添加</title>
+    <meta http-equiv=Content-Type content=“text/html;charset=utf-8″>
+    <meta http-equiv=X-UA-Compatible content=IE=EmulateIE7>
+    <meta name="renderer" content="webkit">
+    <style>
+        .layui-input{ height: 28px;margin-top: 6px;line-height: 28px}
+        .layui-table-view .layui-table {width:100%}
+        .myselect{border: none;padding: 5px 7px;min-height: 20px;color: #666666;line-height: 20px}
+        .mydiv{padding: 5px 7px;min-height: 20px;border: whitesmoke;line-height: 20px}
+        .mydiv:empty:before{content: attr(placeholder);color:#999999;}
+        .mydiv:focus:before{content:none}
+        .layui-table-tips-main{display:none}
+        .layui-table-tips-c{display:none}
+    </style>
+</head>
+<body style="height: 100%;line-height: 100%">
+<div style="padding: 10px;">
+    <div class="layui-main-bgc">
+        <div class="layui-row layui-col-space15">
+            <div class="layui-col-md12">
+                <div class="layui-card">
+                        <div class="layui-card-body" style="margin-top: 2px;">
+                            <form class="layui-form">
+                            <div class="layui-form-item">
+                                <div class="layui-inline">
+                                    <label class="layui-form-label">*项目批次</label>
+                                    <div class="layui-input-inline">
+                                        <input type="text" id="myinput" autocomplete="off" placeholder=""  class="layui-input">
+                                    </div>
+                                </div>
+                                <div class="layui-inline">
+                                    <label class="layui-form-label">*物料批次</label>
+                                    <div class="layui-input-inline">
+                                        <select name="suppliesBatch"  id="suppliesBatch">
+                                            <option value="">请选择</option>
+                                            <c:forEach var="item" items="${batch}">
+                                                <option value="${item.suppliesBatch}">${item.suppliesBatch}</option>
+                                            </c:forEach>
+                                        </select>
+                                    </div>
+                                </div>
+                            </div>
+                            </form>
+                            <div class="layui-upload">
+                                <button type="button" class="layui-btn layui-btn-normal" id="add_List">添加文件</button>
+                                <div class="layui-upload-list">
+                                        <table class="layui-table" id="mytable">
+                                        <thead>
+                                        <tr>
+                                            <th width="45%">*文件名称</th>
+                                            <%--<th width="17%">*项目类型</th>--%>
+                                            <%--<th width="25%">*结算书编号</th>--%>
+                                            <%--<th width="33%">*供应商</th>--%>
+                                            <th width="22%" style="text-align: center">操作</th>
+                                        </tr></thead>
+                                        <tbody id="tbody_List">
+
+                                        </tbody>
+                                    </table>
+                                </div>
+                             <%--<div style="margin-top: 20px">--%>
+                                <%--<button id="mybtn" type="button" class="layui-btn" style="width: 70px;" onclick="okSubmit()">确定</button>--%>
+                            <%--</div>--%>
+                        </div>
+                    </div>
+                </div>
+             </div>
+        </div>
+    </div>
+</div>
+</body>
+<script type="text/javascript">
+    /*//定义存放文件数组*/
+    var arrayFile=[];
+    /*加载layui文件上传*/
+    layui.use('upload', function(){
+        var $ = layui.jquery
+            ,upload = layui.upload;
+        //多文件列表示例
+        var tbodyListView = $('#tbody_List')
+            ,uploadListIns = upload.render({
+            elem: '#add_List'
+            ,accept: 'file'
+            ,exts:'xls|xlsx'
+            ,multiple: true
+            ,auto: false
+            ,choose: function(obj){
+                // var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
+                //读取本地文件
+                obj.preview(function(index, file, result){
+                    //添加 id 到数组
+                    arrayFile.push(index);
+                    //添加文件到数组
+                    arrayFile.push(file);
+                    //拼接生成表格
+                    var tr = $(['<tr id='+index+'>'
+                        ,'<td hidden><div class="td_id">'+index+'</div></td>'
+                        ,'<td><div contenteditable="true" class="mydiv1 mydiv" placeholder="请输入项目名称">'+file.name.split(".")[0]+'</div></td>'
+                        // ,'<td>'
+                        // ,' <select name="type" class="myselect"><option value="">请选择项目类型</option><option value="1">架空线路工程</option><option value="2">电缆工程</option><option value="3">变电站工程</option></select>'
+                        // ,'<td><div contenteditable="true" class="mydiv2 mydiv" placeholder="请输入项目编号"></div></td>'
+                        // ,'<td><div contenteditable="true" class="mydiv3 mydiv" placeholder="请输入供应商"></div></td>'
+                        ,'<td style="text-align: center">'
+                        ,'<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>'
+                        ,'</td>'
+                        ,'</tr>'].join(''));
+                    //删除
+                    tr.find('.demo-delete').on('click', function(){
+                        // delete files[index]; //删除对应的文件
+                        tr.remove();//删除tr
+                        //清空input file当中已经存在文件
+                        uploadListIns.config.elem.next()[0].value = '';
+                    });
+
+                    tbodyListView.append(tr);
+                    //清空input file当中已经存在文件
+                    uploadListIns.config.elem.next()[0].value = '';
+                });
+            }
+        });
+    });
+
+    function importExcel(url, fn) {
+        var formdata = new FormData();
+
+        // 获取表格id的值
+        var itemBatch = $("#myinput").val();
+        var suppliesBatch = $("#suppliesBatch").val();
+        var file = $(":file").val;
+
+
+        //获取输入的项目名称
+        var div1 =  $(".mydiv1");
+
+        //判断列表中项目名称是否为空
+        if (div1.length<=0){
+            layer.msg("请选择文件",{icon: 3,offset:['40%','40%']});
+            return false;
+        }
+        //存储列表中 输入项目名称的值
+        var divvalue=[];
+        //存储列表中 输入项目名称的值
+        var div_val=[];
+        //循环获取当前项目列表的项目名称
+
+        for (var i = 0; i < div1.length; i++) {
+            //存放到集合当中
+            divvalue[i]=div1[i].innerHTML;
+            div_val[i]=div1[i].innerHTML;
+        }
+        //判断项目名称是否重复
+        for (var i = 0; i < divvalue.length; i++) {
+            if (divvalue[i] === ""||divvalue[i]==null){
+                layer.msg("请选择文件",{icon: 3,offset:['40%','40%']});
+                throw SyntaxError;
+            }
+            if(div_val[i] === divvalue[i+1]){
+                layer.msg("选择文件重复",{icon: 5,offset:['40%','40%']});
+                throw SyntaxError;
+            }
+        }
+        // if(file.length === 0){
+        //     layer.msg("请选择文件",{icon: 3,offset:['40%','40%']});
+        //     return false;
+        // }
+        if(itemBatch == null || itemBatch === ''){
+            layer.msg("请输入项目批次",{icon: 3,offset:['40%','40%']});
+            return false;
+        }
+        var td_id=document.getElementsByClassName("td_id");
+        //存放id的数组
+        var array_id = [];
+        //循环遍历id
+        for (var i = 0; i < td_id.length; i++) {
+            array_id[i]=td_id[i].innerHTML;
+        }
+        //根据id获取对象文件传入后台
+        for (var i = 0; i < array_id.length; i++) {
+            for (var j = 0; j < arrayFile.length; j++) {
+                if (array_id[i]==arrayFile[j]){
+                    //追加文件到表单当中
+                    formdata.append("file",arrayFile[j+1]);
+                }
+            }
+        }
+        formdata.append("itemBatch",itemBatch);
+
+        jp.loading('  正在导入,请稍等...');
+        $.ajax({
+            type: "POST",
+            enctype: 'multipart/form-data',
+            url: url,
+            data: formdata,
+            processData: false, //prevent jQuery from automatically transforming the data into a query string
+            contentType: false,
+            cache: false,
+            timeout: 600000,
+            success: function (result) {
+                if(result.success && result.errorCode === '-1'){
+                    jp.confirm('项目'+result.msg+'已存在,确定覆盖嘛?', function(){
+                        jp.loading('  正在导入,请稍等...');
+                        $.ajax({
+                            type: "POST",
+                            enctype: 'multipart/form-data',
+                            url: '${ctx}/managementcenter/materialinfo/imports',
+                            data: formdata,
+                            processData: false, //prevent jQuery from automatically transforming the data into a query string
+                            contentType: false,
+                            cache: false,
+                            timeout: 600000,
+                            success: function (result) {
+                                fn(result);
+                            }
+                        })
+                    });
+                }else if((result.success && result.errorCode === '0')){
+                    fn(result)
+                }
+                // fn(result);
+            },
+            error:function(xhr, textStatus){
+                if(xhr.status == 0){
+                    jp.info("连接失败,请检查网络!")
+                }else if(xhr.status == 404){
+                    var errDetail ="<font color='red'>404,请求地址不存在!</font>";
+                    top.layer.alert(errDetail , {
+                        icon: 2,
+                        area:['auto','auto'],
+                        title:"请求出错"
+                    })
+                }else if(xhr.status && xhr.responseText){
+                    var errDetail ="<font color='red'>"+ xhr.responseText.replace(/[\r\n]/g,"<br>").replace(/[\r]/g,"<br>").replace(/[\n]/g,"<br>")+"</font>";
+                    top.layer.alert(errDetail , {
+                        icon: 2,
+                        area:['80%','70%'],
+                        title:xhr.status+"错误"
+                    })
+                }else{
+                    var errDetail =xhr.responseText=="<font color='red'>未知错误!</font>";
+                    top.layer.alert(errDetail , {
+                        icon: 2,
+                        area:['auto','auto'],
+                        title:"真悲剧,后台抛出异常了"
+                    })
+                }
+
+            }
+        })
+
+    }
+
+</script>
+<script>
+    layui.use('form',function () {
+        var  form = layui.form;
+        form.render();
+    })
+</script>
+</html>

+ 62 - 15
src/main/webapp/webpage/modules/sg/managementcenter/materialinfo/materialInfoList.js

@@ -74,9 +74,11 @@ $(document).ready(function() {
                       
                    } 
                },
-              
                onClickRow: function(row, $el){
                },
+               onLoadSuccess: function () {  //加载成功时执行
+                   getTdValue();
+               },
                	onShowSearch: function () {
 			$("#search-collapse").slideToggle();
 		},
@@ -121,6 +123,11 @@ $(document).ready(function() {
                        field: 'note',
                        title: '备注'
                    }
+               ,{
+                       field: 'state',
+                       title : '状态'
+                   }
+
 		     ]
 		
 		});
@@ -141,30 +148,60 @@ $(document).ready(function() {
     $("#btnImport").click(function(){
              jp.open({
                        type: 2,
-                       area: [500, 200],
+                       area: [500, 300],
                        auto: true,
                        title:"导入数据",
+                       // content: "${ctx}/managementcenter/materialinfo/importExcel" ,
                        content: "${ctx}/managementcenter/materialinfo/importExcel" ,
                        btn: ['确定', '关闭'],
-              btn1: function(index, layero){
-                     var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
-                     iframeWin.contentWindow.importExcel('${ctx}/managementcenter/materialinfo/import', function (data) {
-                     if(data.success){
-                         jp.success(data.msg);
-                           refresh();
-                     }else{
-                        jp.error(data.msg);
-                      }
-                    jp.close(index);
-                    });//调用保存事件
-                   return false;
-                    },
+                       btn1: function(index, layero){
+                             var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                             iframeWin.contentWindow.importExcel('${ctx}/managementcenter/materialinfo/importValidation', function (data) {
+                             if(data.success){
+                                jp.success(data.msg);
+                                 refresh();
+                             }else{
+                                jp.error(data.msg);
+                             }
+                            jp.close(index);
+                      });//调用保存事件
+                       return false;
+                     },
 
               btn2: function(index){
                         jp.close(index);
                       }
                    });
              });
+
+
+    $("#moreImport").click(function(){
+         jp.open({
+                      type: 2,
+                      area: [800, 400],
+                      auto: true,
+                      title:"导入数据",
+                       content: "${ctx}/managementcenter/materialinfo/importMore/Form" ,
+                       btn: ['确定', '关闭'],
+                      btn1: function(index, layero){
+                      var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+                      iframeWin.contentWindow.importExcel('${ctx}/managementcenter/materialinfo/importValidations', function (data) {
+                      if(data.success){
+                           jp.success(data.msg);
+                            refresh();
+                      }else{
+                           jp.error(data.msg);
+                      }
+                      jp.close(index);
+                   });//调用保存事件
+                return false;
+          },
+
+                     btn2: function(index){
+                         jp.close(index);
+                      }
+                  });
+               });
 		
 		
 	 $("#export").click(function(){//导出Excel文件
@@ -193,6 +230,16 @@ $(document).ready(function() {
             return row.id
         });
     }
+
+    function getTdValue(){
+            var tableId = document.getElementById("dataTable");
+             for(var i = 1;i < tableId.rows.length;i++) {
+                 if(tableId.rows[i].cells[10].innerHTML.indexOf("0") != -1 ){
+                   tableId.rows[i].setAttribute("style","color: red;");
+                   }
+             }
+    }
+
   
   function deleteAll(){
 

+ 3 - 3
src/main/webapp/webpage/modules/sg/managementcenter/materialinfo/materialInfoList.jsp

@@ -83,9 +83,9 @@
 		<shiro:hasPermission name="managementcenter:materialinfo:import">
 			<button id="btnImport" class="btn btn-info"><i class="fa fa-folder-open-o"></i> 导入</button>
 		</shiro:hasPermission>
-			<shiro:hasPermission name="managementcenter:materialinfo:export">
-	        		<button id="export" class="btn btn-warning">
-					<i class="fa fa-file-excel-o"></i> 导出
+			<shiro:hasPermission name="managementcenter:materialinfo:import">
+	        		<button id="moreImport" class="btn btn-warning">
+					<i class="fa fa-file-excel-o"></i> 多文件导入
 				</button>
 			 </shiro:hasPermission>
 	                 <%--<shiro:hasPermission name="managementcenter:materialinfo:view">--%>

+ 2 - 2
src/main/webapp/webpage/modules/sg/managementcenter/materialproject/materialProjectForm.jsp

@@ -44,7 +44,7 @@
 				<tr>
 					<td class="width-15 active"><label class="pull-right">储备项目暂定名称:</label></td>
 					<td class="width-35">
-						<form:input path="reserveProjectName" htmlEscape="false"    class="form-control required"/>
+						<form:input path="reserveProjectName" htmlEscape="false"    class="form-control required" readonly="true"/>
 					</td>
 					<td class="width-15 active"><label class="pull-right">项目名称:</label></td>
 					<td class="width-35">
@@ -74,7 +74,7 @@
 				<tr>
 					<td class="width-15 active"><label class="pull-right">项目批次:</label></td>
 					<td class="width-35">
-						<form:input path="projectBatch" htmlEscape="false"    class="form-control "/>
+						<form:input path="projectBatch" htmlEscape="false"    class="form-control required"/>
 					</td>
 					<td class="width-15 active"><label class="pull-right">物料批次:</label></td>
 					<td class="width-35">

+ 5 - 0
src/main/webapp/webpage/modules/sg/managementcenter/materialproject/materialProjectList.js

@@ -156,6 +156,11 @@ $(document).ready(function() {
 			jp.downloadFile('${ctx}/managementcenter/materialproject/export?projectBatch='+batch);
 	  });
 
+    $("#exportpro").click(function(){//导出Excel文件
+         var batch = $("#bat").val();
+         jp.downloadFile('${ctx}/managementcenter/materialproject/exportpro?projectBatch='+batch);
+    });
+
 		    
 	  $("#search").click("click", function() {// 绑定查询按扭
 		  $('#dataTable').bootstrapTable('refresh');

+ 12 - 7
src/main/webapp/webpage/modules/sg/managementcenter/materialproject/materialProjectList.jsp

@@ -50,7 +50,7 @@
 					<form:input path="projectBatch" htmlEscape="false" maxlength="64"  class=" form-control" id="bat"/>
 				</div>
 				<div class="col-xs-12 col-sm-6 col-md-4">
-					<label class="label-item single-overflow pull-left" title="项目批次:">物料批次:</label>
+					<label class="label-item single-overflow pull-left" title="物料批次:">物料批次:</label>
 					<form:input path="suppliesBatch" htmlEscape="false" maxlength="64"  class=" form-control"/>
 				</div>
 		 <div class="col-xs-12 col-sm-6 col-md-4">
@@ -65,11 +65,11 @@
 	
 	<!-- 工具栏 -->
 	<div id="toolbar">
-			<shiro:hasPermission name="managementcenter:materialproject:add">
-				<button id="add" class="btn btn-primary" onclick="add()">
-					<i class="glyphicon glyphicon-plus"></i> 新建
-				</button>
-			</shiro:hasPermission>
+			<%--<shiro:hasPermission name="managementcenter:materialproject:add">--%>
+				<%--<button id="add" class="btn btn-primary" onclick="add()">--%>
+					<%--<i class="glyphicon glyphicon-plus"></i> 新建--%>
+				<%--</button>--%>
+			<%--</shiro:hasPermission>--%>
 			<shiro:hasPermission name="managementcenter:materialproject:edit">
 			    <button id="edit" class="btn btn-success" disabled onclick="edit()">
 	            	<i class="glyphicon glyphicon-edit"></i> 修改
@@ -82,7 +82,7 @@
 			</shiro:hasPermission>
 			<shiro:hasPermission name="managementcenter:materialproject:export">
 	        		<button id="export" class="btn btn-warning">
-					<i class="fa fa-file-excel-o"></i> 导出
+					<i class="fa fa-file-excel-o"></i> 导出物料
 				</button>
 			 </shiro:hasPermission>
 	                 <shiro:hasPermission name="managementcenter:materialproject:view">
@@ -90,6 +90,11 @@
 					<i class="fa fa-search-plus"></i> 查看
 				</button>
 			</shiro:hasPermission>
+				<shiro:hasPermission name="managementcenter:materialproject:export">
+					<button id="exportpro" class="btn btn-warning">
+						<i class="fa fa-file-excel-o"></i> 导出项目
+					</button>
+				</shiro:hasPermission>
 		    </div>
 		
 	<!-- 表格 -->