Преглед на файлове

Merge remote-tracking branch 'origin/master'

yue преди 5 години
родител
ревизия
c6fc0f6e58

+ 27 - 16
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/entity/ErpCredit.java

@@ -31,6 +31,7 @@ public class ErpCredit extends DataEntity<ErpCredit>{
     private Double tenKvItsLine;//10kv线路其中
     private Double tenKvItesFhvFollow;//400v以下
     private String supplierName;//供应商名称
+    private String cableTube;//电缆管信息
     private String status;//状态
     private List<ErpCreditEquipment> erpCreditChild1s = new ArrayList<ErpCreditEquipment>();
     private List<ErpCreditMaterial> erpCreditChild2s = new ArrayList<ErpCreditMaterial>();
@@ -223,6 +224,30 @@ public class ErpCredit extends DataEntity<ErpCredit>{
         this.supplierName = supplierName;
     }
 
+    public String getCableTube() {
+        return cableTube;
+    }
+
+    public void setCableTube(String cableTube) {
+        this.cableTube = cableTube;
+    }
+
+    public List<ErpCreditEquipment> getErpCreditChild1s() {
+        return erpCreditChild1s;
+    }
+
+    public void setErpCreditChild1s(List<ErpCreditEquipment> erpCreditChild1s) {
+        this.erpCreditChild1s = erpCreditChild1s;
+    }
+
+    public List<ErpCreditMaterial> getErpCreditChild2s() {
+        return erpCreditChild2s;
+    }
+
+    public void setErpCreditChild2s(List<ErpCreditMaterial> erpCreditChild2s) {
+        this.erpCreditChild2s = erpCreditChild2s;
+    }
+
     @Override
     public String toString() {
         return "ErpCredit{" +
@@ -248,24 +273,10 @@ public class ErpCredit extends DataEntity<ErpCredit>{
                 ", tenKvItsLine=" + tenKvItsLine +
                 ", tenKvItesFhvFollow=" + tenKvItesFhvFollow +
                 ", supplierName='" + supplierName + '\'' +
+                ", cableTube='" + cableTube + '\'' +
+                ", status='" + status + '\'' +
                 ", erpCreditChild1s=" + erpCreditChild1s +
                 ", erpCreditChild2s=" + erpCreditChild2s +
                 '}';
     }
-
-    public List<ErpCreditEquipment> getErpCreditChild1s() {
-        return erpCreditChild1s;
-    }
-
-    public void setErpCreditChild1s(List<ErpCreditEquipment> erpCreditChild1s) {
-        this.erpCreditChild1s = erpCreditChild1s;
-    }
-
-    public List<ErpCreditMaterial> getErpCreditChild2s() {
-        return erpCreditChild2s;
-    }
-
-    public void setErpCreditChild2s(List<ErpCreditMaterial> erpCreditChild2s) {
-        this.erpCreditChild2s = erpCreditChild2s;
-    }
 }

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

@@ -32,7 +32,8 @@
 		a.tenkv_ites_fhv_follow As "tenKvItesFhvFollow",
 		a.the_input_tax As "theInputTax",
 		a.ten_supplier_name As "supplierName",
-		a.status As "status"
+	  	a.cable_tube As "cableTube",
+ 		a.status As "status"
 	</sql>
 
 	<select id="get" resultType="ErpCredit" >
@@ -115,6 +116,7 @@
 			tenkv_ites_fhv_follow,
 			the_input_tax,
 			ten_supplier_name,
+			cable_tube,
 			status
 		) VALUES (
 			#{id},
@@ -146,6 +148,7 @@
     		#{tenKvItesFhvFollow},
     		#{theInputTax},
     		#{supplierName},
+    		#{cableTube},
     		#{status}
 		)
 	</insert>

+ 49 - 5
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ErpInfo.java

@@ -1,6 +1,10 @@
 package com.jeeplus.modules.sg.financial.erpcredit.util;
 
-import com.jeeplus.modules.sg.financial.erpcredit.entity.*;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpAccount;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCredit;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCreditEquipment;
+import com.jeeplus.modules.sg.financial.erpcredit.entity.ErpCreditMaterial;
+import groovy.util.IFileNameFinder;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.usermodel.Row;
 
@@ -58,6 +62,8 @@ public  class ErpInfo {
     public final static String CON_OICAC="架空绝缘导线";
     public final static String CON_PRCAC="电力电缆";
 
+    public final static String CON_CABLE="电缆保护管";
+
     public final static String  CON_lINE = "-";
 
     public final static String CON_PlPlQ=CON_PROJECT+CON_lINE+CON_PES+CON_lINE+CON_OTR;//工程成本-待摊支出-其他
@@ -151,6 +157,7 @@ public  class ErpInfo {
             if (flag){//如果为true
                 //施工费合计 赋值为安装费(有 设备费入账金额 或者 材料费入账金额)
                 erpCredit.setConsInstallFee(erpCredit.getConsTotalFee());
+                erpCredit.setCableTube("");
             }else {
                 //施工费合计 赋值为 建筑费(无 设备费入账金额 以及 材料费入账金额)
                 erpCredit.setConsBuildingFee(erpCredit.getConsTotalFee());
@@ -185,6 +192,7 @@ public  class ErpInfo {
                         erpCredit=getOtherFee(erpCredit,erpAccount,flag);
                         erpCredit=getTenKvLineInformation(erpCredit,erpAccount,flag);
                         erpCredit = getFourHundredInformation(erpCredit,erpAccount,flag);
+                        erpCredit = getcableTube(erpCredit,erpAccount,flag);
                         break;
                     }
                 }
@@ -197,6 +205,7 @@ public  class ErpInfo {
                 erpCredit = getActualAndConstruction(erpCredit,erpAccount,flag);
                 erpCredit = getOtherFee(erpCredit,erpAccount,flag);
                 erpCredit = getTenKvLineInformation(erpCredit,erpAccount,flag);
+                erpCredit = getcableTube(erpCredit,erpAccount,flag);
                 erpCredits.add(erpCredit);
             }
             if (null!=erpCredit.getTenKvItesFhvFollow()&&null!=erpCredit.getTenKvItsLine()){
@@ -212,6 +221,41 @@ public  class ErpInfo {
         }
         return erpCredits;
     }
+
+    /**
+     * 电缆型号
+     * @param erpCredit
+     * @param erpAccount
+     * @param flag
+     * @return
+     */
+    public static ErpCredit getcableTube(ErpCredit erpCredit, ErpAccount erpAccount, boolean flag){
+        String cableTube = "";
+        Double subErpCredit = 0.0;//获取数值
+        Double subAccount = 0.0;//读取电缆
+        String[] cableTubes;
+         if (flag){
+             if (null!=erpAccount.getMaterialDetails()&&erpAccount.getMaterialDetails().contains(CON_CABLE)){
+                 erpCredit.setCableTube(erpAccount.getMaterialDetails());
+             }
+         }else {
+             if (null!=erpAccount.getMaterialDetails()&&erpAccount.getMaterialDetails().contains(CON_CABLE)){
+                 if (null!=erpCredit.getCableTube()){
+                    cableTubes = erpCredit.getCableTube().split(",");
+                    cableTube = cableTubes[cableTubes.length-1];
+                     subErpCredit = Double.parseDouble(cableTube.substring(1,cableTube.length()));
+                     //读取电缆
+                     cableTubes = erpAccount.getMaterialDetails().split(",");
+                     cableTube = cableTubes[cableTubes.length-1];
+                     subAccount = Double.parseDouble(cableTube.substring(1,cableTube.length()));
+                     if (subAccount>subErpCredit){
+                         erpCredit.setCableTube(erpAccount.getMaterialDetails());
+                     }
+                 }
+             }
+         }
+         return erpCredit;
+    }
     /**
      * 400
      * @param erpCredit
@@ -219,7 +263,7 @@ public  class ErpInfo {
      * @param flag
      * @return
      */
-    public static ErpCredit getFourHundredInformation(ErpCredit erpCredit,ErpAccount erpAccount,boolean flag){
+    public static ErpCredit getFourHundredInformation(ErpCredit erpCredit, ErpAccount erpAccount, boolean flag){
         double fourHundredKvLength=0.0;//10kv线路信息长度
         //400
         if (!erpAccount.getTheNumber().isEmpty()){
@@ -250,7 +294,7 @@ public  class ErpInfo {
      * @param flag
      * @return
      */
-    public static ErpCredit getTenKvLineInformation(ErpCredit erpCredit,ErpAccount erpAccount,boolean flag){
+    public static ErpCredit getTenKvLineInformation(ErpCredit erpCredit, ErpAccount erpAccount, boolean flag){
         String materialDetails = erpAccount.getMaterialDetails();//物料描述
         double tenKvLength=0.0;//长度
         double tenKvItsLine=0.0;//10kv线路
@@ -331,7 +375,7 @@ public  class ErpInfo {
      * @param flag
      * @return
      */
-    public static ErpCredit getActualAndConstruction(ErpCredit erpCredit,ErpAccount erpAccount,boolean flag){
+    public static ErpCredit getActualAndConstruction(ErpCredit erpCredit, ErpAccount erpAccount, boolean flag){
         double actualInvestment = 0.0;//实际投资
         double consTotalFee=0.0;//施工费:合计
         double theInputNumer=0.0;//进项税额
@@ -398,7 +442,7 @@ public  class ErpInfo {
      * @param flag
      * @return
      */
-    public static ErpCredit getOtherFee(ErpCredit erpCredit,ErpAccount erpAccount,boolean flag){
+    public static ErpCredit getOtherFee(ErpCredit erpCredit, ErpAccount erpAccount, boolean flag){
         double otherSupervisorFee=0.0;//其他费用:监理费:入账金额
         double otherDesignFee = 0.0;//其他费用:设计费:入账金额
         double otherBuildLoan=0.0;//其他费用:建设期贷款利息

+ 58 - 54
src/main/java/com/jeeplus/modules/sg/financial/erpcredit/util/ExportUtil1.java

@@ -3,10 +3,12 @@ package com.jeeplus.modules.sg.financial.erpcredit.util;
 import com.jeeplus.modules.sg.financial.erpcredit.entity.*;
 import com.jeeplus.modules.sg.financial.settlement.entity.MaintainData;
 
-import javax.xml.crypto.Data;
 import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.TreeSet;
 
 /**
  * 导出数据计算类
@@ -30,7 +32,7 @@ public class ExportUtil1 {
      * @param maintainDataList
      * @return
      */
-    public static List<Schedule> getScheduleList(List<ErpCredit> erpCreditList,List<MaintainData> maintainDataList){
+    public static List<Schedule> getScheduleList(List<ErpCredit> erpCreditList, List<MaintainData> maintainDataList){
         DecimalFormat decimalFormat   = new DecimalFormat("#0.00");
         String itemNameAll="合计";//工程名称
         Double budgetBuildProjectAll=0.0;//预算建筑工程
@@ -110,7 +112,7 @@ public class ExportUtil1 {
         return schedules;
     }
     //一览表 实际较预算增减
-    public static Schedule getActualRelative(Schedule schedule,ErpCredit erpCredit,List<MaintainData> maintainDataList){
+    public static Schedule getActualRelative(Schedule schedule, ErpCredit erpCredit, List<MaintainData> maintainDataList){
         DecimalFormat decimalFormat   = new DecimalFormat("#0.00");
         Schedule scheduleBudget = getScheduleBudget(schedule,erpCredit,maintainDataList);//得到预算合计费用
         Schedule scheduleActual = getScheduleActual(scheduleBudget,erpCredit);//得到实际费用
@@ -137,7 +139,7 @@ public class ExportUtil1 {
         return scheduleActual;
     }
     //获取:一览表 预算价值
-    public static Schedule getScheduleBudget(Schedule schedule,ErpCredit erpCredit,List<MaintainData> maintainDataList){
+    public static Schedule getScheduleBudget(Schedule schedule, ErpCredit erpCredit, List<MaintainData> maintainDataList){
         DecimalFormat decimalFormat   = new DecimalFormat("#0.00");
         if (null!=maintainDataList&&maintainDataList.size()>0){
             for (MaintainData maintainData:maintainDataList){
@@ -162,7 +164,7 @@ public class ExportUtil1 {
     //计算一览表合计
 
     //获取:一览表 实际价值
-    public static Schedule getScheduleActual(Schedule schedule,ErpCredit erpCredit){
+    public static Schedule getScheduleActual(Schedule schedule, ErpCredit erpCredit){
         DecimalFormat decimalFormat   = new DecimalFormat("#0.00");
         boolean flag = false;
         List<ErpCreditMaterial> erpCreditChild2s = null;//得到材料费金额
@@ -173,14 +175,14 @@ public class ExportUtil1 {
         schedule.setItemId(erpCredit.getItemId());//得到项目定义编号
         schedule.setItemName(erpCredit.getItemName());//得到项目名称
         netAmount = getErpCreditMaterial(erpCredit);//得到材料费
-        if (null!=erpCredit.getConsInstallFee()){
+        if (null!=erpCredit.getConsInstallFee()&&erpCredit.getTenKvModel()!=null){
             schedule.setActualIntallProject(decimalFormat.format(netAmount+erpCredit.getConsInstallFee()));
-            actualTotalFee+=netAmount+erpCredit.getConsInstallFee();//合计金额累加
+            actualTotalFee=actualTotalFee+netAmount+erpCredit.getConsInstallFee();//合计金额累加
         }
         if (null!=erpCredit.getConsBuildingFee()){//如果建筑费不为空
             //得到实际建筑工程
             schedule.setActualBuildProject(decimalFormat.format(erpCredit.getConsBuildingFee()+netAmount));
-            actualTotalFee+=erpCredit.getConsBuildingFee();//合计金额加上
+            actualTotalFee+=erpCredit.getConsBuildingFee()+netAmount;//合计金额加上
         }
         netAmount = 0.0;
         erpCreditChild1s = erpCredit.getErpCreditChild1s();//得到设备费
@@ -193,8 +195,15 @@ public class ExportUtil1 {
                 }
             }
             if (flag){
-                schedule.setActualEquipmentValue(decimalFormat.format(netAmount));//实际设备价值
-                actualTotalFee+=netAmount;//实际费用累加
+                if (null!=erpCredit.getConsInstallFee()){
+                   if (null==erpCredit.getTenKvModel()){
+                       schedule.setActualEquipmentValue(decimalFormat.format(netAmount+erpCredit.getConsInstallFee()));//实际设备价值
+                       actualTotalFee+=netAmount+erpCredit.getConsInstallFee();//实际费用累加
+                   }else {
+                       schedule.setActualEquipmentValue(decimalFormat.format(netAmount));//实际设备价值
+                       actualTotalFee+=netAmount;//实际费用累加
+                   }
+                }
             }
             flag=false;//数据清0
             netAmount=0.0;
@@ -486,6 +495,9 @@ public class ExportUtil1 {
             if (null!=erpCredit.getTenKvModel()){//10kv电缆架空导线型号
                 transferOfPower1.setPowerTenKvCableType(erpCredit.getTenKvModel());
             }
+            if (null!=erpCredit.getCableTube()){
+                transferOfPower1.setPowerTenKvCableType(erpCredit.getCableTube());
+            }
             if (null!=erpCredit.getConsBuildingFee()){//建筑费
                 transferOfPower1.setPowerBuildFee(decimalFormat.format(erpCredit.getConsBuildingFee()+materialTotal));
                 powerDeliveredAssets+=erpCredit.getConsBuildingFee()+materialTotal;//交付使用资产价值
@@ -521,7 +533,7 @@ public class ExportUtil1 {
                 standInFeeAll+=standInFee;//摊入费用合计
             }
             //添加交付使用资产价值
-            if (!transferOfPower1.getPowerInstallFee().equals("-")){
+            if (!transferOfPower1.getPowerInstallFee().equals("-")||null!=transferOfPower1.getPowerBuildFee()){
                 transferOfPower1.setPowerDeliveredAssets(decimalFormat.format(powerDeliveredAssets));
                 powerDeliveredAssetsAll+=powerDeliveredAssets;//交付费用合计
             }
@@ -554,7 +566,7 @@ public class ExportUtil1 {
         Double materialTotal = 0.0;//材料费总计
 
         Double powerValue = 0.0;
-        Double eqmNumbers = 0.0;//获取总数量
+        Double eqmFtIntalls = 0.0;//获取分摊安装费
         Double powerInstallFee = 0.0;//安装费用(线路)
         Double powerEqmMater=0.0;//物料材料合计
         Double powerStandInFee = 0.0;//摊入费用
@@ -578,16 +590,13 @@ public class ExportUtil1 {
                 powerInstallFee = erpCredit.getConsBuildingFee()+materialTotal;//赋值powerInstallfe为建筑费
             }
             if (null!=erpCreditChild1s && erpCreditChild1s.size()>=0){//
-                eqmNumbers = 0.0;//定义台数初始值
-                for (ErpCreditEquipment erpCreditChild11:erpCreditChild1s){//循环集合
-                    if (null!=erpCreditChild11.getEqmNumbers()){//当前项目定义号所有的台数合计
-                        eqmNumbers+=erpCreditChild11.getEqmNumbers();
-                    }
-                }
-                if (null!=erpCredit.getConsInstallFee()){//得到分摊后安装费
-                    eqmNumbers=eqmNumbers/erpCredit.getConsTotalFee();
-                }
+//                for (ErpCreditEquipment erpCreditChild11:erpCreditChild1s){//循环集合
+//                    if (null!=erpCreditChild11.getEqmNumbers()){//当前项目定义号所有的台数合计
+//                        eqmNumbers+=erpCreditChild11.getEqmNumbers();
+//                    }
+//                }
                 for (ErpCreditEquipment erpCreditChild1:erpCreditChild1s){
+                    eqmFtIntalls = 0.0;//定义台数初始值
                     powerDeliveredAssets=0.0;//交付使用价值初始值
                     powerEqmMater=0.0;//物料材料合计
                     powerValue = 0.0;//赋予初始值
@@ -597,6 +606,10 @@ public class ExportUtil1 {
                     transferOfPower2.setPowerName(erpCredit.getItemName());//添加项目名称
                     transferOfPower2.setPowerArea("-");//线路起始地带
                     transferOfPower2.setPowerDepartment(ExportUtil1.POWER_DEPARTMENT);//添加保管
+                    if (null!=erpCredit.getConsInstallFee()&& null != erpCreditChild1.getEqmBookedFee1()){//得到分摊后安装费
+                        eqmFtIntalls=erpCredit.getConsTotalFee()/erpCreditChild1.getEqmBookedFee1();
+                        eqmFtIntalls = eqmFtIntalls*erpCreditChild1.getEqmBookedFee1();
+                    }
                     if (null!=erpCreditChild1.getEqmNumbers()){//得到配变数量(erp账户中设备台数)
                         transferOfPower2.setPowerNumber(decimalFormat1.format(erpCreditChild1.getEqmNumbers()));
                         eqmNumbersAll+=erpCreditChild1.getEqmNumbers();//配电数量合计金额累加
@@ -608,8 +621,8 @@ public class ExportUtil1 {
                     transferOfPower2.setPowerCapacity(erpCreditChild1.getEqmMaterialDetails1());
                     //设备价值
                     if (null!=erpCreditChild1.getEqmBookedFee1()){//如果入账金额不为空
-                        if (transferOfPower2.getPowerNumber()!=null&&erpCredit.getTenKvModel()==null){
-                            powerValue=erpCreditChild1.getEqmBookedFee1()+eqmNumbers;//价值合计 设备入账金额+安装费
+                        if (null!=transferOfPower2.getPowerCapacity()&& null == erpCredit.getTenKvModel()){
+                            powerValue=erpCreditChild1.getEqmBookedFee1()+eqmFtIntalls;//价值合计 设备入账金额+安装费
                             transferOfPower2.setPowerValue(decimalFormat.format(powerValue));//赋值设备价值
                         }else {
                             powerValue=erpCreditChild1.getEqmBookedFee1();//价值合计 设备入账金额
@@ -630,9 +643,16 @@ public class ExportUtil1 {
                     }else {
                         powerStandInFee =0.0;
                     }
+                    if (null==erpCredit.getTenKvModel()){
+                        powerStandInFee = erpCredit.getOtherTotalFee();
+                    }
                     transferOfPower2.setPowerStandInFee(decimalFormat.format(powerStandInFee));//赋值设备分摊费用
-                    powerDeliveredAssets+=powerStandInFee;//交付使用费用累加
-                    powerStandInFeeAll+=powerStandInFee;//分摊费用累加
+                    if (null!=erpCredit.getConsInstallFee()){
+                        powerDeliveredAssets+=powerStandInFee;//交付使用费用累加
+                        powerStandInFeeAll+=powerStandInFee;//分摊费用累加W
+                    }else {
+                        transferOfPower2.setPowerStandInFee("-");//赋值设备分摊费用
+                    }
 
                     //添加资产类别
                     if (transferOfPower2.getPowerCapacity().contains(POWER_BDZ)){
@@ -671,10 +691,10 @@ public class ExportUtil1 {
         Double tenKvLength=0.0;//其中:10kv线路
         Double fourKvLength=0.0;//400v及以下
         List<String> organDataList = new ArrayList<String>();//预算批准机关、日期、文号
-        List<Date> commencementDateList =new ArrayList<Date>();//开工日期
+        TreeSet<Date>  commencementDateSet =new TreeSet<Date>();//开工日期
+        TreeSet<Date> completionDateSet = new TreeSet<Date>();//竣工时间
         Date beforeDate=null;
         Date endDate = null;
-        List<Date> completionDateList = new ArrayList<Date>();//竣工日期
         String organData = "";//文号
         Double investmentBudget=0.0;//预算投资
         Double actualInvestment=0.0;//实际投资
@@ -710,10 +730,10 @@ public class ExportUtil1 {
                     organDataList.add(maintainData.getApprovalNumber());
                 }
                 if (null!=maintainData.getStartDate()&&maintainData.getStartDate().toString().length()>0){
-                    commencementDateList.add(maintainData.getStartDate());
+                    commencementDateSet.add(maintainData.getStartDate());
                 }
                 if (null!=maintainData.getEndDate()&&maintainData.getEndDate().toString().length()>0){
-                    completionDateList.add(maintainData.getEndDate());
+                    completionDateSet.add(maintainData.getEndDate());
                 }
                 investmentBudget+=maintainData.getDesignFee()+maintainData.getSupervisionFee()+maintainData.getPreliminaryWorkFee()
                         +maintainData.getDamages()+maintainData.getManagementFee()+maintainData.getBuildingFee()+maintainData.getInstallFee()
@@ -733,29 +753,13 @@ public class ExportUtil1 {
 //                }
                 generalSituation.setOrganDataNumber(organDataList.get(1));
             }
-            if (null!=commencementDateList&&commencementDateList.size()>0){
-                for (Date date:commencementDateList){
-                    beforeDate = date;
-                    if (beforeDate!=null){
-                        if (beforeDate.before(date)){
-                            beforeDate=date;
-                        }
-                    }
-                }
-                generalSituation.setCommencementDate(sdf.format(beforeDate));
-            }
-            if (null!=completionDateList&&completionDateList.size()>0){
-                for (Date date:completionDateList){
-                    endDate = date;
-                    if (endDate!=null){
-                        if (date.before(endDate)){
-                            endDate=date;
-                        }
-                    }
-                }
-                generalSituation.setCompletionDate(sdf.format(endDate));
+            if (null!=commencementDateSet&&commencementDateSet.size()>0){
+                generalSituation.setCommencementDate(sdf.format(commencementDateSet.first()));
+            }
+            if (null!=completionDateSet&&completionDateSet.size()>0){
+                generalSituation.setCompletionDate(sdf.format(completionDateSet.last()));
             }
-            generalSituation.setInvestmentBudget(String.valueOf(decimalFormat.format(investmentBudget)));
+            generalSituation.setInvestmentBudget(decimalFormat.format(investmentBudget));
         }
         return generalSituation;
     }
@@ -805,7 +809,7 @@ public class ExportUtil1 {
                     costSharing1+=Double.parseDouble(transferOfPower2s.get(i).getPowerStandInFee());
                 }
                 if (null!=transferOfPower2s.get(i).getPowerDeliveredAssets()){
-                    deliveryCostValue1 = Double.parseDouble(transferOfPower2s.get(i).getPowerDeliveredAssets());
+                    deliveryCostValue1 += Double.parseDouble(transferOfPower2s.get(i).getPowerDeliveredAssets());
                 }
             }
         }
@@ -824,7 +828,7 @@ public class ExportUtil1 {
         return theAssetsTotals;
     }
     //竣 工 工 程 财 务 决 算 表
-    public static MCompletionProject getMCompletionProject(List<ErpCredit> erpCredits,List<MaintainData> maintainDataList){
+    public static MCompletionProject getMCompletionProject(List<ErpCredit> erpCredits, List<MaintainData> maintainDataList){
         DecimalFormat decimalFormat   = new DecimalFormat("#0.00");
         MCompletionProject mCompletionProject = new MCompletionProject();
         Double appropriatedFunds=0.0;//上级拨入资金

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

@@ -165,4 +165,14 @@ public class Test {
             System.out.println(machineId+String.format("%010d",hashCodeV));
 
     }
+
+    @org.junit.Test
+    public void getTest6(){
+        String s = "电缆保护管,MPP,φ200";
+        String[] split = s.split(",");
+        String s1 = split[split.length-1];
+        System.out.println(s1);
+        String substring = s1.substring(1, s1.length());
+        System.out.println(substring);
+    }
 }

+ 26 - 2
src/main/java/com/jeeplus/modules/sys/web/OfficeController.java

@@ -10,9 +10,11 @@ import com.jeeplus.common.json.AjaxJson;
 import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.core.web.BaseController;
 import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.entity.Role;
 import com.jeeplus.modules.sys.entity.User;
 import com.jeeplus.modules.sys.mapper.UserMapper;
 import com.jeeplus.modules.sys.service.OfficeService;
+import com.jeeplus.modules.sys.service.SystemService;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.sys.utils.UserUtils;
 import org.apache.shiro.authz.annotation.Logical;
@@ -27,6 +29,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletResponse;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
 import java.util.*;
 
 /**
@@ -43,6 +47,8 @@ public class OfficeController extends BaseController {
 
 	@Autowired
 	private UserMapper userMapper;
+	@Autowired
+	private SystemService systemService;
 	
 	@ModelAttribute("office")
 	public Office get(@RequestParam(required=false) String id) {
@@ -171,18 +177,36 @@ public class OfficeController extends BaseController {
 	@ResponseBody
 	@RequiresPermissions("user")
 	@RequestMapping(value = "treeData")
-	public List<Map<String, Object>> treeData(@RequestParam(required=false) String extId, @RequestParam(required=false) String type,
+	public List<Map<String, Object>> treeData(@RequestParam(required=false) String extId,String roleNeedName, @RequestParam(required=false) String type,
 			@RequestParam(required=false) Long grade, @RequestParam(required=false) Boolean isAll, HttpServletResponse response) {
+
 		List<Map<String, Object>> mapList = Lists.newArrayList();
 		List<Office> offices = officeService.findList(isAll);
 		List<Office> list = new ArrayList<Office>();
 		List<String> strings = new ArrayList<String>();//存放父类id
 		List<String> strings1 = new ArrayList<String>();//存放父类id
+		//获取字符串
 		User user = new User();
 		Boolean flag = false;
 		String[] sts = {};//字符串数组
 		String str = "";
-		List<User> users = userMapper.findAllList(user);
+		try {
+			roleNeedName = URLDecoder.decode(roleNeedName, "UTF-8");
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+		}
+		String[] split = roleNeedName.split(";");
+		if (split != null && split.length > 0) {
+			Role role = null;
+			List<Role> roles = new ArrayList<>();
+			for (int i = 0; i < split.length; i++) {
+				role = new Role();
+				role.setName(split[i]);
+				roles.add(role);
+			}
+			user.setRoleList(roles);
+		}
+		List<User> users = systemService.findUser(user);
 		for (Office office:offices){
 			flag = false;
 			for (User user1:users){

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


+ 2 - 1
src/main/webapp/webpage/modules/common/userSelect.jsp

@@ -9,13 +9,14 @@
 	<script type="text/javascript">
 		$(document).ready(function() {
 			//bootstrap treeview初始化
+            var roleNeedName = $("#roleNeedName").val();
 			$('#jstree').jstree({
 				'core' : {
 					"multiple" : false,
 					"animation" : 0,
 					"themes" : { "variant" : "large", "icons":true , "stripes":true},
 					'data' : {
-						"url" : "${ctx}/sys/office/treeData",
+						"url" : "${ctx}/sys/office/treeData?roleNeedName="+encodeURI(encodeURI(roleNeedName)),
 						"dataType" : "json" // needed only if you do not supply JSON headers
 					}
 				},

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

@@ -260,6 +260,13 @@ $(document).ready(function() {
                        sortName: 'supplierName'
 
                    }
+                   ,{
+                       field: 'cableTube',
+                       title: '电缆管信息',
+                       sortable: true,
+                       sortName: 'cableTube'
+
+                   }
 		     ]
 		
 		});