|
@@ -11,6 +11,7 @@ import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
|
import org.jeecg.common.system.util.JwtUtil;
|
|
import org.jeecg.common.system.util.JwtUtil;
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
|
+import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.RedisUtil;
|
|
import org.jeecg.common.util.RedisUtil;
|
|
import org.jeecg.modules.Index.entity.pojo.LreInfoByDate;
|
|
import org.jeecg.modules.Index.entity.pojo.LreInfoByDate;
|
|
import org.jeecg.modules.Index.entity.pojo.ReceivedByDate;
|
|
import org.jeecg.modules.Index.entity.pojo.ReceivedByDate;
|
|
@@ -201,6 +202,12 @@ public class IndexServiceImpl implements IndexService {
|
|
Calendar instance = Calendar.getInstance();
|
|
Calendar instance = Calendar.getInstance();
|
|
setZeroMonth(instance);
|
|
setZeroMonth(instance);
|
|
instance.add(Calendar.MONTH, 1);
|
|
instance.add(Calendar.MONTH, 1);
|
|
|
|
+ instance.setTime(new Date());
|
|
|
|
+ instance.add(Calendar.DAY_OF_MONTH,1);
|
|
|
|
+ instance.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ instance.set(Calendar.MINUTE, 0);
|
|
|
|
+ instance.set(Calendar.SECOND, 0);
|
|
|
|
+ instance.set(Calendar.MILLISECOND, 0);
|
|
Date currentYearEndDate = instance.getTime();
|
|
Date currentYearEndDate = instance.getTime();
|
|
setZeroYear(instance);
|
|
setZeroYear(instance);
|
|
Date currentYearBeginDate = instance.getTime();
|
|
Date currentYearBeginDate = instance.getTime();
|
|
@@ -230,6 +237,13 @@ public class IndexServiceImpl implements IndexService {
|
|
setZeroMonth(instance);
|
|
setZeroMonth(instance);
|
|
instance.add(Calendar.MONTH, 1);
|
|
instance.add(Calendar.MONTH, 1);
|
|
//去年的今日
|
|
//去年的今日
|
|
|
|
+ instance.setTime(new Date());
|
|
|
|
+ instance.add(Calendar.YEAR, -1);
|
|
|
|
+ instance.add(Calendar.DAY_OF_MONTH,1);
|
|
|
|
+ instance.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ instance.set(Calendar.MINUTE, 0);
|
|
|
|
+ instance.set(Calendar.SECOND, 0);
|
|
|
|
+ instance.set(Calendar.MILLISECOND, 0);
|
|
Date LastTqEndDate = instance.getTime();
|
|
Date LastTqEndDate = instance.getTime();
|
|
setZeroYear(instance);
|
|
setZeroYear(instance);
|
|
Date LastYearBeginDate = instance.getTime();
|
|
Date LastYearBeginDate = instance.getTime();
|
|
@@ -256,7 +270,13 @@ public class IndexServiceImpl implements IndexService {
|
|
instance.setTime(new Date());
|
|
instance.setTime(new Date());
|
|
setZeroMonth(instance);
|
|
setZeroMonth(instance);
|
|
Date currentMothBginDate = instance.getTime();
|
|
Date currentMothBginDate = instance.getTime();
|
|
- instance.add(Calendar.MONTH, 1);
|
|
|
|
|
|
+// instance.add(Calendar.MONTH, 1);
|
|
|
|
+ instance.setTime(new Date());
|
|
|
|
+ instance.add(Calendar.DAY_OF_MONTH,1);
|
|
|
|
+ instance.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ instance.set(Calendar.MINUTE, 0);
|
|
|
|
+ instance.set(Calendar.SECOND, 0);
|
|
|
|
+ instance.set(Calendar.MILLISECOND, 0);
|
|
Date currentMothEndDate = instance.getTime();
|
|
Date currentMothEndDate = instance.getTime();
|
|
|
|
|
|
|
|
|
|
@@ -280,6 +300,13 @@ public class IndexServiceImpl implements IndexService {
|
|
//上月同期已收款,例:>= 2023-11-01 00:00:00 < 2023-12-01 00:00:00
|
|
//上月同期已收款,例:>= 2023-11-01 00:00:00 < 2023-12-01 00:00:00
|
|
instance.setTime(new Date());
|
|
instance.setTime(new Date());
|
|
setZeroMonth(instance);
|
|
setZeroMonth(instance);
|
|
|
|
+ instance.setTime(new Date());
|
|
|
|
+ instance.add(Calendar.MONTH, -1);
|
|
|
|
+ instance.add(Calendar.DAY_OF_MONTH,1);
|
|
|
|
+ instance.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ instance.set(Calendar.MINUTE, 0);
|
|
|
|
+ instance.set(Calendar.SECOND, 0);
|
|
|
|
+ instance.set(Calendar.MILLISECOND, 0);
|
|
Date LastMothTqEndDate = instance.getTime();
|
|
Date LastMothTqEndDate = instance.getTime();
|
|
setZeroMonth(instance);
|
|
setZeroMonth(instance);
|
|
Date LastMothTqBeginDate = instance.getTime();
|
|
Date LastMothTqBeginDate = instance.getTime();
|
|
@@ -306,7 +333,14 @@ public class IndexServiceImpl implements IndexService {
|
|
instance.setTime(new Date());
|
|
instance.setTime(new Date());
|
|
instance.add(Calendar.YEAR, -1);
|
|
instance.add(Calendar.YEAR, -1);
|
|
setZeroMonth(instance);
|
|
setZeroMonth(instance);
|
|
- instance.add(Calendar.MONTH, 1);
|
|
|
|
|
|
+// instance.add(Calendar.MONTH, 1);
|
|
|
|
+ instance.setTime(new Date());
|
|
|
|
+ instance.add(Calendar.YEAR, -1);
|
|
|
|
+ instance.add(Calendar.DAY_OF_MONTH,1);
|
|
|
|
+ instance.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ instance.set(Calendar.MINUTE, 0);
|
|
|
|
+ instance.set(Calendar.SECOND, 0);
|
|
|
|
+ instance.set(Calendar.MILLISECOND, 0);
|
|
Date lastYearMonthTqEndDate = instance.getTime();
|
|
Date lastYearMonthTqEndDate = instance.getTime();
|
|
setZeroMonth(instance);
|
|
setZeroMonth(instance);
|
|
Date lastYearMonthTqBeginDate = instance.getTime();
|
|
Date lastYearMonthTqBeginDate = instance.getTime();
|
|
@@ -506,6 +540,12 @@ public class IndexServiceImpl implements IndexService {
|
|
Calendar instance = Calendar.getInstance();
|
|
Calendar instance = Calendar.getInstance();
|
|
setZeroMonth(instance);
|
|
setZeroMonth(instance);
|
|
instance.add(Calendar.MONTH, 1);
|
|
instance.add(Calendar.MONTH, 1);
|
|
|
|
+ instance.setTime(new Date());
|
|
|
|
+ instance.add(Calendar.DAY_OF_MONTH,1);
|
|
|
|
+ instance.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ instance.set(Calendar.MINUTE, 0);
|
|
|
|
+ instance.set(Calendar.SECOND, 0);
|
|
|
|
+ instance.set(Calendar.MILLISECOND, 0);
|
|
Date currentYearEndDate = instance.getTime();
|
|
Date currentYearEndDate = instance.getTime();
|
|
setZeroYear(instance);
|
|
setZeroYear(instance);
|
|
Date currentYearBeginDate = instance.getTime();
|
|
Date currentYearBeginDate = instance.getTime();
|
|
@@ -535,6 +575,13 @@ public class IndexServiceImpl implements IndexService {
|
|
setZeroMonth(instance);
|
|
setZeroMonth(instance);
|
|
instance.add(Calendar.MONTH, 1);
|
|
instance.add(Calendar.MONTH, 1);
|
|
//去年的今日
|
|
//去年的今日
|
|
|
|
+ instance.setTime(new Date());
|
|
|
|
+ instance.add(Calendar.YEAR, -1);
|
|
|
|
+ instance.add(Calendar.DAY_OF_MONTH,1);
|
|
|
|
+ instance.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ instance.set(Calendar.MINUTE, 0);
|
|
|
|
+ instance.set(Calendar.SECOND, 0);
|
|
|
|
+ instance.set(Calendar.MILLISECOND, 0);
|
|
Date LastTqEndDate = instance.getTime();
|
|
Date LastTqEndDate = instance.getTime();
|
|
setZeroYear(instance);
|
|
setZeroYear(instance);
|
|
Date LastYearBeginDate = instance.getTime();
|
|
Date LastYearBeginDate = instance.getTime();
|
|
@@ -560,7 +607,13 @@ public class IndexServiceImpl implements IndexService {
|
|
instance.setTime(new Date());
|
|
instance.setTime(new Date());
|
|
setZeroMonth(instance);
|
|
setZeroMonth(instance);
|
|
Date currentMothBginDate = instance.getTime();
|
|
Date currentMothBginDate = instance.getTime();
|
|
- instance.add(Calendar.MONTH, 1);
|
|
|
|
|
|
+// instance.add(Calendar.MONTH, 1);
|
|
|
|
+ instance.setTime(new Date());
|
|
|
|
+ instance.add(Calendar.DAY_OF_MONTH,1);
|
|
|
|
+ instance.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ instance.set(Calendar.MINUTE, 0);
|
|
|
|
+ instance.set(Calendar.SECOND, 0);
|
|
|
|
+ instance.set(Calendar.MILLISECOND, 0);
|
|
Date currentMothEndDate = instance.getTime();
|
|
Date currentMothEndDate = instance.getTime();
|
|
|
|
|
|
CompletableFuture<BigDecimal> currentMonthTotalFuture = CompletableFuture.supplyAsync(() -> {
|
|
CompletableFuture<BigDecimal> currentMonthTotalFuture = CompletableFuture.supplyAsync(() -> {
|
|
@@ -583,6 +636,13 @@ public class IndexServiceImpl implements IndexService {
|
|
//上月同期已收款,例:>= 2023-11-01 00:00:00 < 2023-12-01 00:00:00
|
|
//上月同期已收款,例:>= 2023-11-01 00:00:00 < 2023-12-01 00:00:00
|
|
instance.setTime(new Date());
|
|
instance.setTime(new Date());
|
|
setZeroMonth(instance);
|
|
setZeroMonth(instance);
|
|
|
|
+ instance.setTime(new Date());
|
|
|
|
+ instance.add(Calendar.MONTH, -1);
|
|
|
|
+ instance.add(Calendar.DAY_OF_MONTH,1);
|
|
|
|
+ instance.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ instance.set(Calendar.MINUTE, 0);
|
|
|
|
+ instance.set(Calendar.SECOND, 0);
|
|
|
|
+ instance.set(Calendar.MILLISECOND, 0);
|
|
Date LastMothTqEndDate = instance.getTime();
|
|
Date LastMothTqEndDate = instance.getTime();
|
|
setZeroMonth(instance);
|
|
setZeroMonth(instance);
|
|
Date LastMothTqBeginDate = instance.getTime();
|
|
Date LastMothTqBeginDate = instance.getTime();
|
|
@@ -609,7 +669,14 @@ public class IndexServiceImpl implements IndexService {
|
|
instance.setTime(new Date());
|
|
instance.setTime(new Date());
|
|
instance.add(Calendar.YEAR, -1);
|
|
instance.add(Calendar.YEAR, -1);
|
|
setZeroMonth(instance);
|
|
setZeroMonth(instance);
|
|
- instance.add(Calendar.MONTH, 1);
|
|
|
|
|
|
+// instance.add(Calendar.MONTH, 1);
|
|
|
|
+ instance.setTime(new Date());
|
|
|
|
+ instance.add(Calendar.YEAR, -1);
|
|
|
|
+ instance.add(Calendar.DAY_OF_MONTH,1);
|
|
|
|
+ instance.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ instance.set(Calendar.MINUTE, 0);
|
|
|
|
+ instance.set(Calendar.SECOND, 0);
|
|
|
|
+ instance.set(Calendar.MILLISECOND, 0);
|
|
Date lastYearMonthTqEndDate = instance.getTime();
|
|
Date lastYearMonthTqEndDate = instance.getTime();
|
|
setZeroMonth(instance);
|
|
setZeroMonth(instance);
|
|
Date lastYearMonthTqBeginDate = instance.getTime();
|
|
Date lastYearMonthTqBeginDate = instance.getTime();
|
|
@@ -655,7 +722,7 @@ public class IndexServiceImpl implements IndexService {
|
|
return incomeYearTb;
|
|
return incomeYearTb;
|
|
});
|
|
});
|
|
|
|
|
|
- //环比
|
|
|
|
|
|
+ //环比
|
|
CompletableFuture<BigDecimal> mothHbFuture = CompletableFuture.supplyAsync(() -> {
|
|
CompletableFuture<BigDecimal> mothHbFuture = CompletableFuture.supplyAsync(() -> {
|
|
BigDecimal MothDifference = currentMonthTotal.subtract(lastMothTqTotal);
|
|
BigDecimal MothDifference = currentMonthTotal.subtract(lastMothTqTotal);
|
|
BigDecimal incomeMothHb = BigDecimal.valueOf(1);
|
|
BigDecimal incomeMothHb = BigDecimal.valueOf(1);
|
|
@@ -663,7 +730,7 @@ public class IndexServiceImpl implements IndexService {
|
|
incomeMothHb = MothDifference.divide(lastMothTqTotal, 2, RoundingMode.HALF_UP);
|
|
incomeMothHb = MothDifference.divide(lastMothTqTotal, 2, RoundingMode.HALF_UP);
|
|
return incomeMothHb;
|
|
return incomeMothHb;
|
|
});
|
|
});
|
|
- //同期
|
|
|
|
|
|
+ //同期
|
|
CompletableFuture<BigDecimal> yearMothTbFuture = CompletableFuture.supplyAsync(() -> {
|
|
CompletableFuture<BigDecimal> yearMothTbFuture = CompletableFuture.supplyAsync(() -> {
|
|
BigDecimal yearMothDifference = currentMonthTotal.subtract(lastYearMonthTqTotal);
|
|
BigDecimal yearMothDifference = currentMonthTotal.subtract(lastYearMonthTqTotal);
|
|
BigDecimal incomeYearMothTb = BigDecimal.valueOf(1);
|
|
BigDecimal incomeYearMothTb = BigDecimal.valueOf(1);
|
|
@@ -874,27 +941,85 @@ public class IndexServiceImpl implements IndexService {
|
|
List<ContractAmount> contractAmountList;
|
|
List<ContractAmount> contractAmountList;
|
|
if (YEAR.equals(Time)) {
|
|
if (YEAR.equals(Time)) {
|
|
if (AuthMark.DEPT_LEADER.equals(role)) {
|
|
if (AuthMark.DEPT_LEADER.equals(role)) {
|
|
- /** 采集的合同信息表 */
|
|
|
|
- //contractAmountList = exchangeMapper.getContractAmountandNumByYear(tasknoList, beginDate, endDate);
|
|
|
|
- /** 导入的合同信息表 */
|
|
|
|
- contractAmountList = exchangeNewMapper.getContractAmountandNumByYear(tasknoList, beginDate, endDate);
|
|
|
|
|
|
+ int curronYear = DateUtils.getYear();
|
|
|
|
+ // 如果查询的结束日期包含了当前年 那么截止日期为 当前日期
|
|
|
|
+ if (String.valueOf(curronYear).equals(indexInfoParamDto.getEndDate())){
|
|
|
|
+ Calendar instance = Calendar.getInstance();
|
|
|
|
+ instance.setTime(new Date());
|
|
|
|
+ instance.add(Calendar.DAY_OF_MONTH,1);
|
|
|
|
+ instance.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ instance.set(Calendar.MINUTE, 0);
|
|
|
|
+ instance.set(Calendar.SECOND, 0);
|
|
|
|
+ instance.set(Calendar.MILLISECOND, 0);
|
|
|
|
+ Date currentEndDate = instance.getTime();
|
|
|
|
+ contractAmountList = exchangeNewMapper.getContractAmountandNumByYear1(tasknoList, beginDate, currentEndDate);
|
|
|
|
+ }else {
|
|
|
|
+ /** 采集的合同信息表 */
|
|
|
|
+ //contractAmountList = exchangeMapper.getContractAmountandNumByYear(tasknoList, beginDate, endDate);
|
|
|
|
+ /** 导入的合同信息表 */
|
|
|
|
+ contractAmountList = exchangeNewMapper.getContractAmountandNumByYear(tasknoList, beginDate, endDate);
|
|
|
|
+ }
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
- /** 采集的合同信息表 */
|
|
|
|
- //contractAmountList = exchangeMapper.getContractAmountandNumByYearIfBoss(tasknoList, beginDate, endDate);
|
|
|
|
- /** 导入的合同信息表 */
|
|
|
|
- contractAmountList = exchangeNewMapper.getContractAmountandNumByYearIfBoss(tasknoList, beginDate, endDate);
|
|
|
|
|
|
+ int curronYear = DateUtils.getYear();
|
|
|
|
+ // 如果查询的结束日期包含了当前年 那么截止日期为 当前日期
|
|
|
|
+ if (String.valueOf(curronYear).equals(indexInfoParamDto.getEndDate())){
|
|
|
|
+ Calendar instance = Calendar.getInstance();
|
|
|
|
+ instance.setTime(new Date());
|
|
|
|
+ instance.add(Calendar.DAY_OF_MONTH,1);
|
|
|
|
+ instance.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ instance.set(Calendar.MINUTE, 0);
|
|
|
|
+ instance.set(Calendar.SECOND, 0);
|
|
|
|
+ instance.set(Calendar.MILLISECOND, 0);
|
|
|
|
+ Date currentEndDate = instance.getTime();
|
|
|
|
+ contractAmountList = exchangeNewMapper.getContractAmountandNumByYearIfBoss1(tasknoList, beginDate, currentEndDate);
|
|
|
|
+ }else {
|
|
|
|
+ /** 采集的合同信息表 */
|
|
|
|
+ //contractAmountList = exchangeMapper.getContractAmountandNumByYearIfBoss(tasknoList, beginDate, endDate);
|
|
|
|
+ /** 导入的合同信息表 */
|
|
|
|
+ contractAmountList = exchangeNewMapper.getContractAmountandNumByYearIfBoss(tasknoList, beginDate, endDate);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
if (AuthMark.DEPT_LEADER.equals(role)) {
|
|
if (AuthMark.DEPT_LEADER.equals(role)) {
|
|
- /** 采集的合同信息表 */
|
|
|
|
- //contractAmountList = exchangeMapper.getContractAmountandNumByMonth(tasknoList, beginDate, endDate);
|
|
|
|
- /** 导入的合同信息表 */
|
|
|
|
- contractAmountList = exchangeNewMapper.getContractAmountandNumByMonth(tasknoList, beginDate, endDate);
|
|
|
|
|
|
+ String selectMonth = DateUtils.formatDate(endDate).split("-")[1];
|
|
|
|
+ String currontMonth = DateUtils.formatDate(DateUtils.getDate()).split("-")[1];
|
|
|
|
+ if (currontMonth.equals(selectMonth)){
|
|
|
|
+ Calendar instance = Calendar.getInstance();
|
|
|
|
+ instance.setTime(new Date());
|
|
|
|
+ instance.add(Calendar.DAY_OF_MONTH,1);
|
|
|
|
+ instance.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ instance.set(Calendar.MINUTE, 0);
|
|
|
|
+ instance.set(Calendar.SECOND, 0);
|
|
|
|
+ instance.set(Calendar.MILLISECOND, 0);
|
|
|
|
+ Date currentEndDate = instance.getTime();
|
|
|
|
+ contractAmountList = exchangeNewMapper.getContractAmountandNumByMonth1(tasknoList, beginDate, currentEndDate);
|
|
|
|
+ }else {
|
|
|
|
+ /** 采集的合同信息表 */
|
|
|
|
+ //contractAmountList = exchangeMapper.getContractAmountandNumByMonth(tasknoList, beginDate, endDate);
|
|
|
|
+ /** 导入的合同信息表 */
|
|
|
|
+ contractAmountList = exchangeNewMapper.getContractAmountandNumByMonth(tasknoList, beginDate, endDate);
|
|
|
|
+ }
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
- /** 采集的合同信息表 */
|
|
|
|
- //contractAmountList = exchangeMapper.getContractAmountandNumByMonthIfBoss(tasknoList, beginDate, endDate);
|
|
|
|
- /** 导入的合同信息表 */
|
|
|
|
- contractAmountList = exchangeNewMapper.getContractAmountandNumByMonthIfBoss(tasknoList, beginDate, endDate);
|
|
|
|
|
|
+ String selectMonth = DateUtils.formatDate(endDate).split("-")[1];
|
|
|
|
+ String currontMonth = DateUtils.formatDate(DateUtils.getDate()).split("-")[1];
|
|
|
|
+ if (currontMonth.equals(selectMonth)){
|
|
|
|
+ Calendar instance = Calendar.getInstance();
|
|
|
|
+ instance.setTime(new Date());
|
|
|
|
+ instance.add(Calendar.DAY_OF_MONTH,1);
|
|
|
|
+ instance.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ instance.set(Calendar.MINUTE, 0);
|
|
|
|
+ instance.set(Calendar.SECOND, 0);
|
|
|
|
+ instance.set(Calendar.MILLISECOND, 0);
|
|
|
|
+ Date currentEndDate = instance.getTime();
|
|
|
|
+ contractAmountList = exchangeNewMapper.getContractAmountandNumByMonthIfBoss1(tasknoList, beginDate, currentEndDate);
|
|
|
|
+ }else {
|
|
|
|
+ /** 采集的合同信息表 */
|
|
|
|
+ //contractAmountList = exchangeMapper.getContractAmountandNumByMonthIfBoss(tasknoList, beginDate, endDate);
|
|
|
|
+ /** 导入的合同信息表 */
|
|
|
|
+ contractAmountList = exchangeNewMapper.getContractAmountandNumByMonthIfBoss(tasknoList, beginDate, endDate);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
ContractChartInfoVo newResVo = new ContractChartInfoVo();
|
|
ContractChartInfoVo newResVo = new ContractChartInfoVo();
|
|
@@ -2378,42 +2503,49 @@ public class IndexServiceImpl implements IndexService {
|
|
indexChartInfoVo.setXAxisData(timeRangeList);
|
|
indexChartInfoVo.setXAxisData(timeRangeList);
|
|
//添加纵坐标列表
|
|
//添加纵坐标列表
|
|
indexChartInfoVo.setSeriesData(seriesDataList);
|
|
indexChartInfoVo.setSeriesData(seriesDataList);
|
|
-// //添加横坐标列表
|
|
|
|
-// indexChartInfoVo.setXAxisData(timeRangeList);
|
|
|
|
-// //添加纵坐标列表
|
|
|
|
-// indexChartInfoVo.setSeriesData(seriesDataList);
|
|
|
|
-
|
|
|
|
-// List<String> tasknoList = projectCostMapper.queryTasknoListAll();
|
|
|
|
-// System.out.println("查到的所有部门对应的任务号列表:");
|
|
|
|
-// System.out.println(tasknoList);
|
|
|
|
-// if (tasknoList.isEmpty()) return indexChartInfoVo;
|
|
|
|
-// System.out.println(indexChartInfoVo);
|
|
|
|
|
|
|
|
//4.计算该时间列表中某年或某月对应的总收款
|
|
//4.计算该时间列表中某年或某月对应的总收款
|
|
List<ReceivedByDate> receivedByDates = new ArrayList<>();
|
|
List<ReceivedByDate> receivedByDates = new ArrayList<>();
|
|
if (timeType.equals("year")) {
|
|
if (timeType.equals("year")) {
|
|
- /** 采集的合同信息表 */
|
|
|
|
- //receivedByDates = exchangeMapper.getReceivedAllByYear(startString, endString);
|
|
|
|
- /** 导入的合同信息表 */
|
|
|
|
- receivedByDates = exchangeNewMapper.getReceivedAllByYear(startString, endString);
|
|
|
|
-// System.out.println("已收款二层按年查询结果:");
|
|
|
|
-// for(ReceivedByDate receivedByDate:receivedByDates){
|
|
|
|
-// System.out.println(receivedByDate.getDate());
|
|
|
|
-// System.out.println(receivedByDate.getReceived());
|
|
|
|
-// }
|
|
|
|
-// System.out.println(receivedByDates);
|
|
|
|
-
|
|
|
|
|
|
+ int curronYear = DateUtils.getYear();
|
|
|
|
+ // 如果查询的结束日期包含了当前年 那么截止日期为 当前日期
|
|
|
|
+ if (String.valueOf(curronYear).equals(endString)){
|
|
|
|
+ Calendar instance = Calendar.getInstance();
|
|
|
|
+ instance.setTime(new Date());
|
|
|
|
+ instance.add(Calendar.DAY_OF_MONTH,1);
|
|
|
|
+ instance.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ instance.set(Calendar.MINUTE, 0);
|
|
|
|
+ instance.set(Calendar.SECOND, 0);
|
|
|
|
+ instance.set(Calendar.MILLISECOND, 0);
|
|
|
|
+ Date currentYearEndDate = instance.getTime();
|
|
|
|
+ String formatDate = DateUtils.formatDate(currentYearEndDate);
|
|
|
|
+ receivedByDates = exchangeNewMapper.getReceivedAllByYear2(startString, formatDate);
|
|
|
|
+ }else {
|
|
|
|
+ /** 采集的合同信息表 */
|
|
|
|
+ //receivedByDates = exchangeMapper.getReceivedAllByYear(startString, endString);
|
|
|
|
+ /** 导入的合同信息表 */
|
|
|
|
+ receivedByDates = exchangeNewMapper.getReceivedAllByYear(startString, endString);
|
|
|
|
+ }
|
|
} else if (timeType.equals("month")) {
|
|
} else if (timeType.equals("month")) {
|
|
- /** 采集的合同信息表 */
|
|
|
|
- //receivedByDates = exchangeMapper.getReceivedAllByYMonth(startString, endString);
|
|
|
|
- /** 导入的合同信息表 */
|
|
|
|
- receivedByDates = exchangeNewMapper.getReceivedAllByYMonth(startString, endString);
|
|
|
|
-// System.out.println("已收款二层按月查询结果:");
|
|
|
|
-// for(ReceivedByDate receivedByDate:receivedByDates){
|
|
|
|
-// System.out.println(receivedByDate.getDate());
|
|
|
|
-// System.out.println(receivedByDate.getReceived());
|
|
|
|
-// }
|
|
|
|
-// System.out.println(receivedByDates);
|
|
|
|
|
|
+ String selectMonth = endString.split("-")[1];
|
|
|
|
+ String currontMonth = DateUtils.formatDate(DateUtils.getDate()).split("-")[1];
|
|
|
|
+ if (currontMonth.equals(selectMonth)){
|
|
|
|
+ Calendar instance = Calendar.getInstance();
|
|
|
|
+ instance.setTime(new Date());
|
|
|
|
+ instance.add(Calendar.DAY_OF_MONTH,1);
|
|
|
|
+ instance.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ instance.set(Calendar.MINUTE, 0);
|
|
|
|
+ instance.set(Calendar.SECOND, 0);
|
|
|
|
+ instance.set(Calendar.MILLISECOND, 0);
|
|
|
|
+ Date currentYearEndDate = instance.getTime();
|
|
|
|
+ String formatDate = DateUtils.formatDate(currentYearEndDate);
|
|
|
|
+ receivedByDates = exchangeNewMapper.getReceivedAllByYMonth1(startString, formatDate);
|
|
|
|
+ }else {
|
|
|
|
+ /** 采集的合同信息表 */
|
|
|
|
+ //receivedByDates = exchangeMapper.getReceivedAllByYMonth(startString, endString);
|
|
|
|
+ /** 导入的合同信息表 */
|
|
|
|
+ receivedByDates = exchangeNewMapper.getReceivedAllByYMonth(startString, endString);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (receivedByDates.isEmpty()) return indexChartInfoVo;
|
|
if (receivedByDates.isEmpty()) return indexChartInfoVo;
|
|
|
|
|
|
@@ -2427,58 +2559,6 @@ public class IndexServiceImpl implements IndexService {
|
|
indexChartInfoVo.setXAxisData(timeRangeList);
|
|
indexChartInfoVo.setXAxisData(timeRangeList);
|
|
//添加纵坐标列表
|
|
//添加纵坐标列表
|
|
indexChartInfoVo.setSeriesData(seriesDataList);
|
|
indexChartInfoVo.setSeriesData(seriesDataList);
|
|
-
|
|
|
|
- /*
|
|
|
|
-
|
|
|
|
- //4.计算该时间列表中某年或某月对应的总收款
|
|
|
|
- //创建CompletableFuture集合,因为allOf()方法参数可变参数
|
|
|
|
- List<CompletableFuture<BigDecimal>> futures = new ArrayList<>();
|
|
|
|
- for (String timeRange2 : timeRangeList) {
|
|
|
|
- CompletableFuture<BigDecimal> future = CompletableFuture.supplyAsync(() -> {
|
|
|
|
- // 子线程处理任务
|
|
|
|
- BigDecimal yearTotal = initValue;
|
|
|
|
-
|
|
|
|
- if (timeType.equals("year")) {
|
|
|
|
- //1.根据实际时间查询任务列表
|
|
|
|
- yearTotal = exchangeMapper.getReceivedAllByYear(timeRange2);
|
|
|
|
- if (yearTotal == null) {
|
|
|
|
- yearTotal = initValue;
|
|
|
|
- }
|
|
|
|
- } else if (timeType.equals("month")) {
|
|
|
|
- yearTotal = exchangeMapper.getReceivedAllByYMonth(timeRange2);
|
|
|
|
- if (yearTotal == null) {
|
|
|
|
- yearTotal = initValue;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-// System.out.println(timeRange2 + "的总收款为:");
|
|
|
|
-// System.out.println(yearTotal);
|
|
|
|
- if (ObjectUtils.isEmpty(yearTotal)) return initValue;
|
|
|
|
- return yearTotal;
|
|
|
|
- });
|
|
|
|
- futures.add(future);
|
|
|
|
- }
|
|
|
|
- //allOf() 方法可以用于等待所有 CompletableFuture 对象的计算结果
|
|
|
|
- CompletableFuture<Void> futureAll = CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]));
|
|
|
|
- futureAll.join();
|
|
|
|
- List<BigDecimal> seriesDataList2 = new ArrayList<>();
|
|
|
|
- futures.forEach(i -> {
|
|
|
|
- try {
|
|
|
|
- seriesDataList2.add(i.get());
|
|
|
|
- } catch (InterruptedException | ExecutionException e) {
|
|
|
|
- seriesDataList2.add(initValue);//出现异常当前利润额赋为0
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- System.out.println("获取的已收款列表为:");
|
|
|
|
- System.out.println(seriesDataList2);
|
|
|
|
-
|
|
|
|
- //添加横纵坐标列表
|
|
|
|
- indexChartInfoVo.setXAxisData(timeRangeList);
|
|
|
|
- indexChartInfoVo.setSeriesData(seriesDataList2);
|
|
|
|
-
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
-
|
|
|
|
return indexChartInfoVo;
|
|
return indexChartInfoVo;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2555,10 +2635,26 @@ public class IndexServiceImpl implements IndexService {
|
|
//4.计算该时间列表中某年或某月对应的总收款
|
|
//4.计算该时间列表中某年或某月对应的总收款
|
|
List<ReceivedByDate> receivedByDates = new ArrayList<>();
|
|
List<ReceivedByDate> receivedByDates = new ArrayList<>();
|
|
if (timeType.equals("year")) {
|
|
if (timeType.equals("year")) {
|
|
- /** 采集的合同信息表 */
|
|
|
|
- //receivedByDates = exchangeMapper.getReceivedByYear2(sysDepartNames, startString, endString);
|
|
|
|
- /** 导入的合同信息表 */
|
|
|
|
- receivedByDates = exchangeNewMapper.getReceivedByYear2(sysDepartNames, startString, endString);
|
|
|
|
|
|
+ int curronYear = DateUtils.getYear();
|
|
|
|
+ // 如果查询的结束日期包含了当前年 那么截止日期为 当前日期
|
|
|
|
+ if (String.valueOf(curronYear).equals(endString)){
|
|
|
|
+ Calendar instance = Calendar.getInstance();
|
|
|
|
+ instance.setTime(new Date());
|
|
|
|
+ instance.add(Calendar.DAY_OF_MONTH,1);
|
|
|
|
+ instance.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ instance.set(Calendar.MINUTE, 0);
|
|
|
|
+ instance.set(Calendar.SECOND, 0);
|
|
|
|
+ instance.set(Calendar.MILLISECOND, 0);
|
|
|
|
+ Date currentYearEndDate = instance.getTime();
|
|
|
|
+ String formatDate = DateUtils.formatDate(currentYearEndDate);
|
|
|
|
+ receivedByDates = exchangeNewMapper.getReceivedByYear21(sysDepartNames,startString, formatDate);
|
|
|
|
+ }else {
|
|
|
|
+ /** 采集的合同信息表 */
|
|
|
|
+ //receivedByDates = exchangeMapper.getReceivedByYear2(sysDepartNames, startString, endString);
|
|
|
|
+ /** 导入的合同信息表 */
|
|
|
|
+ receivedByDates = exchangeNewMapper.getReceivedByYear2(sysDepartNames, startString, endString);
|
|
|
|
+ }
|
|
|
|
+
|
|
System.out.println("部门领导已收款二层按年查询结果:");
|
|
System.out.println("部门领导已收款二层按年查询结果:");
|
|
for (ReceivedByDate receivedByDate : receivedByDates) {
|
|
for (ReceivedByDate receivedByDate : receivedByDates) {
|
|
System.out.println(receivedByDate.getDate());
|
|
System.out.println(receivedByDate.getDate());
|
|
@@ -2567,10 +2663,25 @@ public class IndexServiceImpl implements IndexService {
|
|
System.out.println(receivedByDates);
|
|
System.out.println(receivedByDates);
|
|
|
|
|
|
} else if (timeType.equals("month")) {
|
|
} else if (timeType.equals("month")) {
|
|
- /** 采集的合同信息表 */
|
|
|
|
- //receivedByDates = exchangeMapper.getReceivedByYMonth2(sysDepartNames, startString, endString);
|
|
|
|
- /** 导入的合同信息表 */
|
|
|
|
- receivedByDates = exchangeNewMapper.getReceivedByYMonth2(sysDepartNames, startString, endString);
|
|
|
|
|
|
+ String selectMonth = endString.split("-")[1];
|
|
|
|
+ String currontMonth = DateUtils.formatDate(DateUtils.getDate()).split("-")[1];
|
|
|
|
+ if (currontMonth.equals(selectMonth)){
|
|
|
|
+ Calendar instance = Calendar.getInstance();
|
|
|
|
+ instance.setTime(new Date());
|
|
|
|
+ instance.add(Calendar.DAY_OF_MONTH,1);
|
|
|
|
+ instance.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ instance.set(Calendar.MINUTE, 0);
|
|
|
|
+ instance.set(Calendar.SECOND, 0);
|
|
|
|
+ instance.set(Calendar.MILLISECOND, 0);
|
|
|
|
+ Date currentYearEndDate = instance.getTime();
|
|
|
|
+ String formatDate = DateUtils.formatDate(currentYearEndDate);
|
|
|
|
+ receivedByDates = exchangeNewMapper.getReceivedByYMonth21(sysDepartNames,startString, formatDate);
|
|
|
|
+ }else {
|
|
|
|
+ /** 采集的合同信息表 */
|
|
|
|
+ //receivedByDates = exchangeMapper.getReceivedByYMonth2(sysDepartNames, startString, endString);
|
|
|
|
+ /** 导入的合同信息表 */
|
|
|
|
+ receivedByDates = exchangeNewMapper.getReceivedByYMonth2(sysDepartNames, startString, endString);
|
|
|
|
+ }
|
|
System.out.println("部门领导已收款二层按月查询结果:");
|
|
System.out.println("部门领导已收款二层按月查询结果:");
|
|
for (ReceivedByDate receivedByDate : receivedByDates) {
|
|
for (ReceivedByDate receivedByDate : receivedByDates) {
|
|
System.out.println(receivedByDate.getDate());
|
|
System.out.println(receivedByDate.getDate());
|
|
@@ -2871,9 +2982,9 @@ public class IndexServiceImpl implements IndexService {
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
String role = commonMethod.getRole(sysUser.getUsername());
|
|
String role = commonMethod.getRole(sysUser.getUsername());
|
|
if (AuthMark.BOSS.equals(role) && departNameList != null && !departNameList.isEmpty()) role = AuthMark.DEPT_LEADER;
|
|
if (AuthMark.BOSS.equals(role) && departNameList != null && !departNameList.isEmpty()) role = AuthMark.DEPT_LEADER;
|
|
- if (role == null) {
|
|
|
|
- return indexChartInfoVo;
|
|
|
|
- }
|
|
|
|
|
|
+ if (role == null) {
|
|
|
|
+ return indexChartInfoVo;
|
|
|
|
+ }
|
|
//如果是所长,查看所有 部门领导查看本部门 员工后期增加
|
|
//如果是所长,查看所有 部门领导查看本部门 员工后期增加
|
|
if (role.equals(AuthMark.BOSS)) {
|
|
if (role.equals(AuthMark.BOSS)) {
|
|
System.out.println("当前账户权限:所长");
|
|
System.out.println("当前账户权限:所长");
|