|
@@ -78,246 +78,7 @@ public class IndexKpiServiceImpl implements IndexKpiService {
|
|
|
*
|
|
|
* @return IndexKpiDataDepart
|
|
|
*/
|
|
|
-// public IndexKpiDataDepart getCompletRateByDate(IndexKpiParamDto indexKpiParamDto){
|
|
|
-// //初始化
|
|
|
-// IndexKpiDataDepart indexKpiDataDepart = new IndexKpiDataDepart();
|
|
|
-// List<IndexKpiCompletByDate> kpiDataZrbmList = new ArrayList<>();//责任部门排行
|
|
|
-// List<IndexKpiCompletByDate> kpiDataJycsList = new ArrayList<>();//下达部门排行
|
|
|
-// indexKpiDataDepart.setZrbmCharts(kpiDataZrbmList);//初始化放入空列表
|
|
|
-// indexKpiDataDepart.setJycsCharts(kpiDataJycsList);
|
|
|
-// //查询所有部门 将所有部门的指标和完成度赋为空,合同额和已收款赋为0
|
|
|
-// List<String> departList = indexKpiMapper.getDepartName();
|
|
|
-// System.out.println(departList);
|
|
|
-// //此处是否需要去重???
|
|
|
-// if(departList.isEmpty()) return indexKpiDataDepart;
|
|
|
-// for(String depart:departList){
|
|
|
-// IndexKpiCompletByDate indexKpiCompletByDate = new IndexKpiCompletByDate();
|
|
|
-// indexKpiCompletByDate.setDepart(depart);
|
|
|
-// indexKpiCompletByDate.setDepartKpi(null);
|
|
|
-// indexKpiCompletByDate.setContractAmount(new BigDecimal(0));
|
|
|
-// indexKpiCompletByDate.setReceived(new BigDecimal(0));
|
|
|
-// indexKpiCompletByDate.setKpiCompletRate(null);
|
|
|
-// IndexKpiCompletByDate indexKpiCompletByDate2 = new IndexKpiCompletByDate();
|
|
|
-// indexKpiCompletByDate2.setDepart(depart);
|
|
|
-// indexKpiCompletByDate2.setDepartKpi(null);
|
|
|
-// indexKpiCompletByDate2.setContractAmount(new BigDecimal(0));
|
|
|
-// indexKpiCompletByDate2.setReceived(new BigDecimal(0));
|
|
|
-// indexKpiCompletByDate2.setKpiCompletRate(null);
|
|
|
-// kpiDataZrbmList.add(indexKpiCompletByDate);
|
|
|
-// kpiDataJycsList.add(indexKpiCompletByDate2);
|
|
|
-// }
|
|
|
-//// System.out.println(kpiDataZrbmList);
|
|
|
-//// System.out.println(kpiDataJycsList);
|
|
|
-// // TODO: 初始化结束
|
|
|
-//
|
|
|
-// //目前是算某个月的指标,不涉及范围
|
|
|
-// //年/月
|
|
|
-// String timeType = indexKpiParamDto.getTime();
|
|
|
-// //日期
|
|
|
-// String dateString = indexKpiParamDto.getBeginDate();
|
|
|
-// /*
|
|
|
-// //起始时间
|
|
|
-// String startString = indexKpiParamDto.getBeginDate();
|
|
|
-// //结束时间
|
|
|
-// String endString = indexKpiParamDto.getEndDate();
|
|
|
-// */
|
|
|
-// //获取当前时间的年月
|
|
|
-// LocalDate currentDate = LocalDate.now();
|
|
|
-// // 获取当前年份
|
|
|
-// int currentDateYear = currentDate.getYear();
|
|
|
-// // 获取当前年月
|
|
|
-// String currentYm = String.format("%d-%d", currentDateYear, currentDate.getMonthValue());
|
|
|
-// //用来存放要看的年末或月末的年月日期 上一年末或上一月末的日期
|
|
|
-// String dateYm = "";
|
|
|
-// String dateLastYm = "";
|
|
|
-// boolean isCurrentDate = true;//是否是当年或当月,当年或当月要从项目成本表中获取数据
|
|
|
-//
|
|
|
-// List<IndexKpiCompletByDate> kpiList = new ArrayList<>(); //用来保存部门指标表中的部门和指标
|
|
|
-// List<IndexKpiCompletByDate> htereceivedZrbmList = new ArrayList<>();//用来保存部门该月合计的合同额、已收款以及责任部门
|
|
|
-// List<IndexKpiCompletByDate> htereceivedJycsList = new ArrayList<>();//用来保存部门该月合计的合同额、已收款以及下达部门
|
|
|
-// List<IndexKpiCompletByDate> htereceivedZrbmLastList = new ArrayList<>();//用来保存部门上月合计的合同额、已收款以及责任部门
|
|
|
-// List<IndexKpiCompletByDate> htereceivedJycsLastList = new ArrayList<>();//用来保存部门上月合计的合同额、已收款以及下达部门
|
|
|
-// try{
|
|
|
-// if(timeType.equals("year")){
|
|
|
-// isCurrentDate = dateString.equals(String.valueOf(currentDateYear));
|
|
|
-// dateYm = String.format("%s-%d", currentDateYear, 12);
|
|
|
-// dateLastYm = String.format("%d-%d", Integer.parseInt(dateString)-1, 12);
|
|
|
-// }else if(timeType.equals("month")){
|
|
|
-// isCurrentDate = dateString.equals(currentYm);
|
|
|
-// dateYm = dateString;
|
|
|
-// dateLastYm = getLastMonthString(currentYm);
|
|
|
-// }
|
|
|
-// }catch (ParseException e){
|
|
|
-// System.out.println("部门指标排行传送的日期字符串错误!!!");
|
|
|
-// return indexKpiDataDepart;
|
|
|
-// }
|
|
|
-//
|
|
|
-// //获取部门指标数据 kpi
|
|
|
-// boolean finalIsCurrentDate = isCurrentDate;
|
|
|
-// String finalDateYm = dateYm;
|
|
|
-// String finalDateLastYm = dateLastYm;
|
|
|
-// CompletableFuture<List<IndexKpiCompletByDate>> getKpiListFuture = CompletableFuture.supplyAsync(() -> {
|
|
|
-// if(timeType.equals("year")){
|
|
|
-// return indexKpiMapper.getKpiYear(Integer.parseInt(dateString));
|
|
|
-// }else{
|
|
|
-// return indexKpiMapper.getKpiMonth(dateString);
|
|
|
-// }
|
|
|
-//
|
|
|
-// });
|
|
|
-// //获取选择年月的数据 合同额、已收款
|
|
|
-// CompletableFuture<List<IndexKpiCompletByDate>> getHtereceivedZrbmListFuture = CompletableFuture.supplyAsync(() -> {
|
|
|
-// //如果选择的日期是当年当月,则从项目成本表里取数据,否则从每月月底项目进度考核表中取
|
|
|
-// if(finalIsCurrentDate){
|
|
|
-// return indexKpiMapper.getHteReceivedZrbmCost();
|
|
|
-// }else{
|
|
|
-// return indexKpiMapper.getHteReceivedZrbmYm(finalDateYm);
|
|
|
-// }
|
|
|
-//
|
|
|
-// });
|
|
|
-// CompletableFuture<List<IndexKpiCompletByDate>> getHtereceivedJycsListFuture = CompletableFuture.supplyAsync(() -> {
|
|
|
-// //如果选择的日期是当年当月,则从项目成本表里取数据,否则从每月月底项目进度考核表中取
|
|
|
-// if(finalIsCurrentDate){
|
|
|
-// return indexKpiMapper.getHteReceivedJycsCost();
|
|
|
-// }else{
|
|
|
-// return indexKpiMapper.getHteReceivedJycsYm(finalDateYm);
|
|
|
-// }
|
|
|
-//
|
|
|
-// });
|
|
|
-// //获取选择年月上月的数据 合同额、已收款
|
|
|
-// CompletableFuture<List<IndexKpiCompletByDate>> getHtereceivedZrbmLastListFuture = CompletableFuture.supplyAsync(() -> {
|
|
|
-// return indexKpiMapper.getHteReceivedZrbmYm(finalDateLastYm);
|
|
|
-// });
|
|
|
-// CompletableFuture<List<IndexKpiCompletByDate>> getHtereceivedJycsLastListFuture = CompletableFuture.supplyAsync(() -> {
|
|
|
-// return indexKpiMapper.getHteReceivedJycsYm(finalDateLastYm);
|
|
|
-// });
|
|
|
-// CompletableFuture<Void> future1 = CompletableFuture.allOf(getKpiListFuture, getHtereceivedZrbmListFuture, getHtereceivedJycsListFuture, getHtereceivedZrbmLastListFuture, getHtereceivedJycsLastListFuture);
|
|
|
-// future1.join();
|
|
|
-// kpiList = getKpiListFuture.join();
|
|
|
-// htereceivedZrbmList = getHtereceivedZrbmListFuture.join();
|
|
|
-// htereceivedJycsList = getHtereceivedJycsListFuture.join();
|
|
|
-// htereceivedZrbmLastList = getHtereceivedZrbmLastListFuture.join();
|
|
|
-// htereceivedJycsLastList = getHtereceivedJycsLastListFuture.join();
|
|
|
-//
|
|
|
-// System.out.println(kpiList);
|
|
|
-// System.out.println(htereceivedZrbmList);
|
|
|
-// System.out.println(htereceivedJycsList);
|
|
|
-// System.out.println(htereceivedZrbmLastList);
|
|
|
-// System.out.println(htereceivedJycsLastList);
|
|
|
-//
|
|
|
-//
|
|
|
-// List<IndexKpiCompletByDate> finalHtereceivedZrbmList = htereceivedZrbmList;
|
|
|
-// List<IndexKpiCompletByDate> finalHtereceivedZrbmLastList = htereceivedZrbmLastList;
|
|
|
-// List<IndexKpiCompletByDate> finalKpiList = kpiList;
|
|
|
-// List<IndexKpiCompletByDate> finalHtereceivedJycsList = htereceivedJycsList;
|
|
|
-// List<IndexKpiCompletByDate> finalHtereceivedJycsLastList = htereceivedJycsLastList;
|
|
|
-// CompletableFuture<Void> setKpiDataZrbmList = CompletableFuture.runAsync(() -> {
|
|
|
-// //责任部门列表计算合同额和已收款差额得到选择月份的合同额和已收款
|
|
|
-// for(IndexKpiCompletByDate htereceivedZrbm: finalHtereceivedZrbmList){
|
|
|
-// BigDecimal hteLast = new BigDecimal(0);
|
|
|
-// BigDecimal receivedLast = new BigDecimal(0);
|
|
|
-// for(IndexKpiCompletByDate htereceivedZrbmLast: finalHtereceivedZrbmLastList){
|
|
|
-// if(htereceivedZrbm.getDepart().equals(htereceivedZrbmLast.getDepart())){
|
|
|
-// hteLast = htereceivedZrbmLast.getContractAmount();
|
|
|
-// receivedLast = htereceivedZrbmLast.getReceived();
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// htereceivedZrbm.setContractAmount(htereceivedZrbm.getContractAmount().subtract(hteLast));
|
|
|
-// htereceivedZrbm.setReceived(htereceivedZrbm.getReceived().subtract(receivedLast));
|
|
|
-// }
|
|
|
-//// System.out.println(finalHtereceivedZrbmList);
|
|
|
-// //责任部门列表填充kpi
|
|
|
-// for(IndexKpiCompletByDate kpiDataZrbm:kpiDataZrbmList){
|
|
|
-// //根据部门输入部门指标
|
|
|
-// for(IndexKpiCompletByDate kpiDepart: finalKpiList){
|
|
|
-// if(kpiDataZrbm.getDepart().equals(kpiDepart.getDepart())){
|
|
|
-// kpiDataZrbm.setDepartKpi(kpiDepart.getDepartKpi());
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// //责任部门列表填充合同额、已收款、完成度
|
|
|
-// for(IndexKpiCompletByDate kpiDataZrbm2:kpiDataZrbmList){
|
|
|
-// for(IndexKpiCompletByDate htereceivedZrbm: finalHtereceivedZrbmList){
|
|
|
-// if(kpiDataZrbm2.getDepart().equals(htereceivedZrbm.getDepart())){
|
|
|
-// kpiDataZrbm2.setContractAmount(htereceivedZrbm.getContractAmount());//合同额
|
|
|
-// kpiDataZrbm2.setReceived(htereceivedZrbm.getReceived());//已收款
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// //计算完成度 合同额(是计算的某个月或某个年的合同额 增量)/ 指标
|
|
|
-// if(kpiDataZrbm2.getDepartKpi() != null){
|
|
|
-// if(kpiDataZrbm2.getDepartKpi().equals(BigDecimal.valueOf(0))){
|
|
|
-// kpiDataZrbm2.setKpiCompletRate(BigDecimal.valueOf(1));
|
|
|
-// }else{
|
|
|
-// kpiDataZrbm2.setKpiCompletRate(kpiDataZrbm2.getContractAmount().divide(kpiDataZrbm2.getDepartKpi(), 2, RoundingMode.HALF_UP));
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-//// System.out.println("kpiDataZrbmList");
|
|
|
-// //责任部门指标完成度排序
|
|
|
-// kpiDataZrbmList.sort(Comparator.comparing(IndexKpiCompletByDate::getKpiCompletRate, Comparator.nullsFirst(BigDecimal::compareTo)).reversed());
|
|
|
-//// System.out.println(kpiDataZrbmList);
|
|
|
-// });
|
|
|
-// CompletableFuture<Void> setKpiDataJycsList = CompletableFuture.runAsync(() -> {
|
|
|
-// //下达部门列表计算合同额和已收款差额得到选择月份的合同额和已收款
|
|
|
-// for(IndexKpiCompletByDate htereceivedJycs: finalHtereceivedJycsList){
|
|
|
-// BigDecimal hteLast = new BigDecimal(0);
|
|
|
-// BigDecimal receivedLast = new BigDecimal(0);
|
|
|
-// for(IndexKpiCompletByDate htereceivedJycsLast: finalHtereceivedJycsLastList){
|
|
|
-// if(htereceivedJycs.getDepart().equals(htereceivedJycsLast.getDepart())){
|
|
|
-// hteLast = htereceivedJycsLast.getContractAmount();
|
|
|
-// receivedLast = htereceivedJycsLast.getReceived();
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// htereceivedJycs.setContractAmount(htereceivedJycs.getContractAmount().subtract(hteLast));
|
|
|
-// htereceivedJycs.setReceived(htereceivedJycs.getReceived().subtract(receivedLast));
|
|
|
-// }
|
|
|
-//// System.out.println(finalHtereceivedJycsList);
|
|
|
-// //下达部门列表填充kpi
|
|
|
-// for(IndexKpiCompletByDate kpiDataJycs:kpiDataJycsList){
|
|
|
-// //根据部门输入部门指标
|
|
|
-// for(IndexKpiCompletByDate kpiDepart: finalKpiList){
|
|
|
-// if(kpiDataJycs.getDepart().equals(kpiDepart.getDepart())){
|
|
|
-// kpiDataJycs.setDepartKpi(kpiDepart.getDepartKpi());
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// //下达部门列表填充合同额、已收款、完成度
|
|
|
-// for(IndexKpiCompletByDate kpiDataJycs2:kpiDataJycsList){
|
|
|
-// for(IndexKpiCompletByDate htereceivedJycs: finalHtereceivedJycsList){
|
|
|
-// if(kpiDataJycs2.getDepart().equals(htereceivedJycs.getDepart())){
|
|
|
-// kpiDataJycs2.setContractAmount(htereceivedJycs.getContractAmount());//合同额
|
|
|
-// kpiDataJycs2.setReceived(htereceivedJycs.getReceived());//已收款
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// //计算完成度 合同额(是计算的某个月或某个年的合同额 增量)/ 指标
|
|
|
-// if(kpiDataJycs2.getDepartKpi() != null){
|
|
|
-// if(kpiDataJycs2.getDepartKpi().equals(BigDecimal.valueOf(0))){
|
|
|
-// kpiDataJycs2.setKpiCompletRate(BigDecimal.valueOf(1));
|
|
|
-// }else{
|
|
|
-// kpiDataJycs2.setKpiCompletRate(kpiDataJycs2.getContractAmount().divide(kpiDataJycs2.getDepartKpi(), 2, RoundingMode.HALF_UP));
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-//// System.out.println(kpiDataJycsList);
|
|
|
-// //下达部门指标完成度排序
|
|
|
-// kpiDataJycsList.sort(Comparator.comparing(IndexKpiCompletByDate::getKpiCompletRate, Comparator.nullsFirst(BigDecimal::compareTo)).reversed());
|
|
|
-//// System.out.println(kpiDataJycsList);
|
|
|
-// });
|
|
|
-// CompletableFuture<Void> future2 = CompletableFuture.allOf(setKpiDataZrbmList, setKpiDataJycsList);
|
|
|
-// future2.join();
|
|
|
-//// System.out.println(kpiDataZrbmList);
|
|
|
-//// System.out.println(kpiDataJycsList);
|
|
|
-// indexKpiDataDepart.setZrbmCharts(kpiDataZrbmList);
|
|
|
-// indexKpiDataDepart.setJycsCharts(kpiDataJycsList);
|
|
|
-//
|
|
|
-// return indexKpiDataDepart;
|
|
|
-// }
|
|
|
+
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -363,18 +124,12 @@ public class IndexKpiServiceImpl implements IndexKpiService {
|
|
|
//目前是算某个月的指标,不涉及范围
|
|
|
String timeType = indexKpiParamDto.getTime();//年/月
|
|
|
String dateString = indexKpiParamDto.getBeginDate();//日期
|
|
|
- /*
|
|
|
- //起始时间
|
|
|
- String startString = indexKpiParamDto.getBeginDate();
|
|
|
- //结束时间
|
|
|
- String endString = indexKpiParamDto.getEndDate();
|
|
|
- */
|
|
|
//获取当前时间的年月
|
|
|
LocalDate currentDate = LocalDate.now();
|
|
|
// 获取当前年份
|
|
|
int currentDateYear = currentDate.getYear();
|
|
|
// 获取当前年月
|
|
|
- String currentYm = String.format("%d-%d", currentDateYear, currentDate.getMonthValue());
|
|
|
+ String currentYm = String.format("%d-%02d", currentDateYear, currentDate.getMonthValue());
|
|
|
//用来存放要看的年末或月末的年月日期 上一年末或上一月末的日期
|
|
|
String dateYm = "";
|
|
|
String dateLastYm = "";
|
|
@@ -399,7 +154,6 @@ public class IndexKpiServiceImpl implements IndexKpiService {
|
|
|
|
|
|
//得到各数据列表,处理各个列表 转成map
|
|
|
//获取部门指标数据 kpi
|
|
|
-// Map<String, IndexKpiCompletByDate> kpiMap = new TreeMap<>();//用来保存部门指标表中的部门和指标,根据部门查找对应数据
|
|
|
List<String> departList = new ArrayList<>();//用来存放需要进行排行的部门
|
|
|
List<String> zrbmList = new ArrayList<>();//用来存放需要进行排行的部门 (责任部门)
|
|
|
List<String> xdbmList = new ArrayList<>();//用来存放需要进行排行的部门 (下达部门)
|
|
@@ -428,12 +182,6 @@ public class IndexKpiServiceImpl implements IndexKpiService {
|
|
|
kpiDataJycsList.add(kpiData);
|
|
|
xdbmList.add(kpiData.getDepart());
|
|
|
}
|
|
|
- //kpiData.setContractAmount(initDecimalNum);
|
|
|
- //kpiData.setReceived(initDecimalNum);
|
|
|
- //kpiData.setKpiCompletRate(initDecimalNum);
|
|
|
- //kpiDataZrbmList.add(kpiData);
|
|
|
- //kpiDataJycsList.add((IndexKpiCompletByDate) kpiData.clone());
|
|
|
- //departList.add(kpiData.getDepart());
|
|
|
}
|
|
|
if(zrbmList.isEmpty() && xdbmList.isEmpty()) return indexKpiDataDepart;
|
|
|
|
|
@@ -661,7 +409,6 @@ public class IndexKpiServiceImpl implements IndexKpiService {
|
|
|
List<IndexKpiCompletByDate> htereceivedZrbmList;
|
|
|
//如果选择的日期是当年当月,则从项目成本表里取数据,否则从每月月底项目进度考核表中取
|
|
|
if(finalIsCurrentDate){
|
|
|
- //htereceivedZrbmList = indexKpiMapper.getHteReceivedZrbmCost(departList);
|
|
|
htereceivedZrbmList = indexKpiMapper.getHteReceivedZrbmCost(zrbmList);
|
|
|
}else{
|
|
|
htereceivedZrbmList = indexKpiMapper.getHteReceivedZrbmYm(finalDateYm, zrbmList);
|
|
@@ -682,35 +429,6 @@ public class IndexKpiServiceImpl implements IndexKpiService {
|
|
|
}
|
|
|
return htereceivedZrbmLastMap;
|
|
|
});
|
|
|
- //下达部门 获取选择年月的数据 合同额、已收款
|
|
|
- //CompletableFuture<Map<String, IndexKpiCompletByDate>> getHtereceivedJycsMapFuture = CompletableFuture.supplyAsync(() -> {
|
|
|
- // Map<String, IndexKpiCompletByDate> htereceivedJycsMap = new TreeMap<>();//用来保存部门该月合计的合同额、已收款以及下达部门
|
|
|
- // List<IndexKpiCompletByDate> htereceivedJycsList;
|
|
|
- // //如果选择的日期是当年当月,则从项目成本表里取数据,否则从每月月底项目进度考核表中取
|
|
|
- // if(finalIsCurrentDate){
|
|
|
- // //htereceivedJycsList = indexKpiMapper.getHteReceivedJycsCost(departList);
|
|
|
- // htereceivedJycsList = indexKpiMapper.getHteReceivedJycsCost(xdbmList);
|
|
|
- // }else{
|
|
|
- // htereceivedJycsList = indexKpiMapper.getHteReceivedJycsYm(finalDateYm, xdbmList);
|
|
|
- // }
|
|
|
- //
|
|
|
- // for(IndexKpiCompletByDate htereceivedJycs:htereceivedJycsList){
|
|
|
- // htereceivedJycsMap.put(htereceivedJycs.getDepart(), htereceivedJycs);
|
|
|
- // }
|
|
|
- // return htereceivedJycsMap;
|
|
|
- //});
|
|
|
- ////下达部门 获取选择年月上月的数据 合同额、已收款
|
|
|
- //CompletableFuture<Map<String, IndexKpiCompletByDate>> getHtereceivedJycsLastMapFuture = CompletableFuture.supplyAsync(() -> {
|
|
|
- // Map<String, IndexKpiCompletByDate> htereceivedJycsLastMap = new TreeMap<>();//用来保存部门上月合计的合同额、已收款以及下达部门
|
|
|
- // //List<IndexKpiCompletByDate> htereceivedJycsLastList = indexKpiMapper.getHteReceivedJycsYm(finalDateLastYm, departList);
|
|
|
- // List<IndexKpiCompletByDate> htereceivedJycsLastList = indexKpiMapper.getHteReceivedJycsYm(finalDateLastYm, xdbmList);
|
|
|
- // for(IndexKpiCompletByDate htereceivedJycsLast:htereceivedJycsLastList){
|
|
|
- // htereceivedJycsLastMap.put(htereceivedJycsLast.getDepart(), htereceivedJycsLast);
|
|
|
- // }
|
|
|
- // return htereceivedJycsLastMap;
|
|
|
- //});
|
|
|
- //CompletableFuture<Void> future1 = CompletableFuture.allOf(getHtereceivedZrbmMapFuture, getHtereceivedZrbmLastMapFuture, getHtereceivedJycsMapFuture, getHtereceivedJycsLastMapFuture);
|
|
|
-
|
|
|
// 求下达部门的合同额
|
|
|
CompletableFuture<Map<String,IndexKpiCompletByDate>> getHtereceivedXdbmHteMapFuture = CompletableFuture.supplyAsync(() -> {
|
|
|
Map<String, IndexKpiCompletByDate> htereceivedXdbmHteMap = new TreeMap<>();//用来保存部门上月合计的合同额、已收款以及责任部门
|
|
@@ -733,16 +451,12 @@ public class IndexKpiServiceImpl implements IndexKpiService {
|
|
|
return htereceivedXdbmYskMap;
|
|
|
});
|
|
|
|
|
|
- //CompletableFuture<Void> future1 = CompletableFuture.allOf(getHtereceivedZrbmMapFuture, getHtereceivedZrbmLastMapFuture);
|
|
|
CompletableFuture<Void> future1 = CompletableFuture.allOf(getHtereceivedZrbmMapFuture, getHtereceivedZrbmLastMapFuture,getHtereceivedXdbmHteMapFuture,getHtereceivedXdbmYskMapFuture);
|
|
|
future1.join();
|
|
|
Map<String, IndexKpiCompletByDate> htereceivedZrbmMap = getHtereceivedZrbmMapFuture.join();
|
|
|
Map<String, IndexKpiCompletByDate> htereceivedZrbmLastMap = getHtereceivedZrbmLastMapFuture.join();
|
|
|
Map<String, IndexKpiCompletByDate> htereceivedXdbmHteMap = getHtereceivedXdbmHteMapFuture.join();
|
|
|
Map<String, IndexKpiCompletByDate> htereceivedXdbmYskMap = getHtereceivedXdbmYskMapFuture.join();
|
|
|
- //Map<String, IndexKpiCompletByDate> htereceivedJycsMap = getHtereceivedJycsMapFuture.join();
|
|
|
- //Map<String, IndexKpiCompletByDate> htereceivedJycsLastMap = getHtereceivedJycsLastMapFuture.join();
|
|
|
-
|
|
|
// 责任部门 完成度
|
|
|
CompletableFuture<Void> setKpiDataZrbmList = CompletableFuture.runAsync(() -> {
|
|
|
//责任部门列表填充合同额、已收款、完成度
|
|
@@ -762,10 +476,9 @@ public class IndexKpiServiceImpl implements IndexKpiService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-// System.out.println("kpiDataZrbmList");
|
|
|
+
|
|
|
//责任部门指标完成度排序
|
|
|
kpiDataZrbmList.sort(Comparator.comparing(IndexKpiCompletByDate::getKpiCompletRate, Comparator.nullsFirst(BigDecimal::compareTo)).reversed());
|
|
|
-// System.out.println(kpiDataZrbmList);
|
|
|
});
|
|
|
|
|
|
//下达部门 完成度
|
|
@@ -808,8 +521,7 @@ public class IndexKpiServiceImpl implements IndexKpiService {
|
|
|
});
|
|
|
CompletableFuture<Void> future2 = CompletableFuture.allOf(setKpiDataZrbmList, setKpiDataJycsList);
|
|
|
future2.join();
|
|
|
-// System.out.println(kpiDataZrbmList);
|
|
|
-// System.out.println(kpiDataJycsList);
|
|
|
+
|
|
|
indexKpiDataDepart.setZrbmCharts(kpiDataZrbmList);
|
|
|
indexKpiDataDepart.setJycsCharts(kpiDataJycsList);
|
|
|
}
|