|
@@ -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.erpcredit.entity.*;
|
|
import com.jeeplus.modules.sg.financial.settlement.entity.MaintainData;
|
|
import com.jeeplus.modules.sg.financial.settlement.entity.MaintainData;
|
|
|
|
|
|
-import javax.xml.crypto.Data;
|
|
|
|
import java.text.DecimalFormat;
|
|
import java.text.DecimalFormat;
|
|
import java.text.SimpleDateFormat;
|
|
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
|
|
* @param maintainDataList
|
|
* @return
|
|
* @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");
|
|
DecimalFormat decimalFormat = new DecimalFormat("#0.00");
|
|
String itemNameAll="合计";//工程名称
|
|
String itemNameAll="合计";//工程名称
|
|
Double budgetBuildProjectAll=0.0;//预算建筑工程
|
|
Double budgetBuildProjectAll=0.0;//预算建筑工程
|
|
@@ -110,7 +112,7 @@ public class ExportUtil1 {
|
|
return schedules;
|
|
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");
|
|
DecimalFormat decimalFormat = new DecimalFormat("#0.00");
|
|
Schedule scheduleBudget = getScheduleBudget(schedule,erpCredit,maintainDataList);//得到预算合计费用
|
|
Schedule scheduleBudget = getScheduleBudget(schedule,erpCredit,maintainDataList);//得到预算合计费用
|
|
Schedule scheduleActual = getScheduleActual(scheduleBudget,erpCredit);//得到实际费用
|
|
Schedule scheduleActual = getScheduleActual(scheduleBudget,erpCredit);//得到实际费用
|
|
@@ -137,7 +139,7 @@ public class ExportUtil1 {
|
|
return scheduleActual;
|
|
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");
|
|
DecimalFormat decimalFormat = new DecimalFormat("#0.00");
|
|
if (null!=maintainDataList&&maintainDataList.size()>0){
|
|
if (null!=maintainDataList&&maintainDataList.size()>0){
|
|
for (MaintainData maintainData:maintainDataList){
|
|
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");
|
|
DecimalFormat decimalFormat = new DecimalFormat("#0.00");
|
|
boolean flag = false;
|
|
boolean flag = false;
|
|
List<ErpCreditMaterial> erpCreditChild2s = null;//得到材料费金额
|
|
List<ErpCreditMaterial> erpCreditChild2s = null;//得到材料费金额
|
|
@@ -175,12 +177,12 @@ public class ExportUtil1 {
|
|
netAmount = getErpCreditMaterial(erpCredit);//得到材料费
|
|
netAmount = getErpCreditMaterial(erpCredit);//得到材料费
|
|
if (null!=erpCredit.getConsInstallFee()){
|
|
if (null!=erpCredit.getConsInstallFee()){
|
|
schedule.setActualIntallProject(decimalFormat.format(netAmount+erpCredit.getConsInstallFee()));
|
|
schedule.setActualIntallProject(decimalFormat.format(netAmount+erpCredit.getConsInstallFee()));
|
|
- actualTotalFee+=netAmount+erpCredit.getConsInstallFee();//合计金额累加
|
|
|
|
|
|
+ actualTotalFee=actualTotalFee+netAmount+erpCredit.getConsInstallFee();//合计金额累加
|
|
}
|
|
}
|
|
if (null!=erpCredit.getConsBuildingFee()){//如果建筑费不为空
|
|
if (null!=erpCredit.getConsBuildingFee()){//如果建筑费不为空
|
|
//得到实际建筑工程
|
|
//得到实际建筑工程
|
|
schedule.setActualBuildProject(decimalFormat.format(erpCredit.getConsBuildingFee()+netAmount));
|
|
schedule.setActualBuildProject(decimalFormat.format(erpCredit.getConsBuildingFee()+netAmount));
|
|
- actualTotalFee+=erpCredit.getConsBuildingFee();//合计金额加上
|
|
|
|
|
|
+ actualTotalFee+=erpCredit.getConsBuildingFee()+netAmount;//合计金额加上
|
|
}
|
|
}
|
|
netAmount = 0.0;
|
|
netAmount = 0.0;
|
|
erpCreditChild1s = erpCredit.getErpCreditChild1s();//得到设备费
|
|
erpCreditChild1s = erpCredit.getErpCreditChild1s();//得到设备费
|
|
@@ -521,7 +523,7 @@ public class ExportUtil1 {
|
|
standInFeeAll+=standInFee;//摊入费用合计
|
|
standInFeeAll+=standInFee;//摊入费用合计
|
|
}
|
|
}
|
|
//添加交付使用资产价值
|
|
//添加交付使用资产价值
|
|
- if (!transferOfPower1.getPowerInstallFee().equals("-")){
|
|
|
|
|
|
+ if (!transferOfPower1.getPowerInstallFee().equals("-")||null!=transferOfPower1.getPowerBuildFee()){
|
|
transferOfPower1.setPowerDeliveredAssets(decimalFormat.format(powerDeliveredAssets));
|
|
transferOfPower1.setPowerDeliveredAssets(decimalFormat.format(powerDeliveredAssets));
|
|
powerDeliveredAssetsAll+=powerDeliveredAssets;//交付费用合计
|
|
powerDeliveredAssetsAll+=powerDeliveredAssets;//交付费用合计
|
|
}
|
|
}
|
|
@@ -671,10 +673,10 @@ public class ExportUtil1 {
|
|
Double tenKvLength=0.0;//其中:10kv线路
|
|
Double tenKvLength=0.0;//其中:10kv线路
|
|
Double fourKvLength=0.0;//400v及以下
|
|
Double fourKvLength=0.0;//400v及以下
|
|
List<String> organDataList = new ArrayList<String>();//预算批准机关、日期、文号
|
|
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 beforeDate=null;
|
|
Date endDate = null;
|
|
Date endDate = null;
|
|
- List<Date> completionDateList = new ArrayList<Date>();//竣工日期
|
|
|
|
String organData = "";//文号
|
|
String organData = "";//文号
|
|
Double investmentBudget=0.0;//预算投资
|
|
Double investmentBudget=0.0;//预算投资
|
|
Double actualInvestment=0.0;//实际投资
|
|
Double actualInvestment=0.0;//实际投资
|
|
@@ -710,10 +712,10 @@ public class ExportUtil1 {
|
|
organDataList.add(maintainData.getApprovalNumber());
|
|
organDataList.add(maintainData.getApprovalNumber());
|
|
}
|
|
}
|
|
if (null!=maintainData.getStartDate()&&maintainData.getStartDate().toString().length()>0){
|
|
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){
|
|
if (null!=maintainData.getEndDate()&&maintainData.getEndDate().toString().length()>0){
|
|
- completionDateList.add(maintainData.getEndDate());
|
|
|
|
|
|
+ completionDateSet.add(maintainData.getEndDate());
|
|
}
|
|
}
|
|
investmentBudget+=maintainData.getDesignFee()+maintainData.getSupervisionFee()+maintainData.getPreliminaryWorkFee()
|
|
investmentBudget+=maintainData.getDesignFee()+maintainData.getSupervisionFee()+maintainData.getPreliminaryWorkFee()
|
|
+maintainData.getDamages()+maintainData.getManagementFee()+maintainData.getBuildingFee()+maintainData.getInstallFee()
|
|
+maintainData.getDamages()+maintainData.getManagementFee()+maintainData.getBuildingFee()+maintainData.getInstallFee()
|
|
@@ -733,29 +735,13 @@ public class ExportUtil1 {
|
|
// }
|
|
// }
|
|
generalSituation.setOrganDataNumber(organDataList.get(1));
|
|
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!=commencementDateSet&&commencementDateSet.size()>0){
|
|
|
|
+ generalSituation.setCommencementDate(sdf.format(commencementDateSet.first()));
|
|
}
|
|
}
|
|
- 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!=completionDateSet&&completionDateSet.size()>0){
|
|
|
|
+ generalSituation.setCompletionDate(sdf.format(completionDateSet.last()));
|
|
}
|
|
}
|
|
- generalSituation.setInvestmentBudget(String.valueOf(decimalFormat.format(investmentBudget)));
|
|
|
|
|
|
+ generalSituation.setInvestmentBudget(decimalFormat.format(investmentBudget));
|
|
}
|
|
}
|
|
return generalSituation;
|
|
return generalSituation;
|
|
}
|
|
}
|
|
@@ -805,7 +791,7 @@ public class ExportUtil1 {
|
|
costSharing1+=Double.parseDouble(transferOfPower2s.get(i).getPowerStandInFee());
|
|
costSharing1+=Double.parseDouble(transferOfPower2s.get(i).getPowerStandInFee());
|
|
}
|
|
}
|
|
if (null!=transferOfPower2s.get(i).getPowerDeliveredAssets()){
|
|
if (null!=transferOfPower2s.get(i).getPowerDeliveredAssets()){
|
|
- deliveryCostValue1 = Double.parseDouble(transferOfPower2s.get(i).getPowerDeliveredAssets());
|
|
|
|
|
|
+ deliveryCostValue1 += Double.parseDouble(transferOfPower2s.get(i).getPowerDeliveredAssets());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -824,7 +810,7 @@ public class ExportUtil1 {
|
|
return theAssetsTotals;
|
|
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");
|
|
DecimalFormat decimalFormat = new DecimalFormat("#0.00");
|
|
MCompletionProject mCompletionProject = new MCompletionProject();
|
|
MCompletionProject mCompletionProject = new MCompletionProject();
|
|
Double appropriatedFunds=0.0;//上级拨入资金
|
|
Double appropriatedFunds=0.0;//上级拨入资金
|