Browse Source

完善出库

hfxc226 2 years ago
parent
commit
3b0093efa6

+ 2 - 2
platform-common/src/main/java/com/platform/common/util/DateUtils.java

@@ -487,8 +487,8 @@ public class DateUtils {
         // 每年的 一月一号,零时零分零秒
         for(int i = 1;i<month;i++){
             Map<String, LocalDateTime> dateTimeMap = new HashMap<String, LocalDateTime>();
-            LocalDateTime searchStartTimeMonth = getFirstDayOfMonth(year, i).plusDays(-1);
-            LocalDateTime searchEndTimeMonth = getLastDayOfMonth(year, i).plusDays(1);
+            LocalDateTime searchStartTimeMonth = getFirstDayOfMonth(year, i);
+            LocalDateTime searchEndTimeMonth = getLastDayOfMonth(year, i);
             dateTimeMap.put("searchStartTimeMonth", searchStartTimeMonth);
             dateTimeMap.put("searchEndTimeMonth",searchEndTimeMonth);
             monthStartAndEndList.add(dateTimeMap);

+ 3 - 0
platform-rest/src/main/java/com/platform/rest/controller/report/RepairReportController.java

@@ -3,6 +3,7 @@ package com.platform.rest.controller.report;
 import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.platform.common.exception.BusinessException;
 import com.platform.common.util.BeanConverterUtil;
 import com.platform.common.util.DateUtils;
 import com.platform.common.util.R;
@@ -261,6 +262,8 @@ public class RepairReportController {
                     List<RepairFee> detailList = vo.getDetailList();
                     if (CollectionUtil.isNotEmpty(detailList)) {
                         ExcelUtil.exportResponseDict(response, ExportRepairFeeVO.class, BeanConverterUtil.copyListProperties(detailList, ExportRepairFeeVO.class), fileName);
+                    }else{
+                        ExcelUtil.exportResponseDict(response, ExportRepairFeeVO.class, BeanConverterUtil.copyListProperties(detailList, ExportRepairFeeVO.class), fileName);
                     }
                 }
             }

+ 4 - 4
platform-service/src/main/java/com/platform/service/repair/impl/RepairFeeServiceImpl.java

@@ -155,10 +155,10 @@ public class RepairFeeServiceImpl extends BaseServiceImpl<RepairFeeMapper, Repai
     @Override
     public List<RepairReportFee> getMonthReport(RepairFeeDTO repairApplicationFormDTO, Integer searchYear, LocalDate startMonth, LocalDate endMonth) {
 
-        List<Map<String, LocalDateTime>> monthStartAndEndList = new ArrayList<Map<String, LocalDateTime>>();
+        List<Map<String, LocalDateTime>> monthStartAndEndList = new ArrayList<>();
         LocalDateTime searchStartTime = null;
         LocalDateTime searchEndTime = null;
-        if (searchYear != null) {
+        /*if (searchYear != null) {
             LocalDate localDate = LocalDate.now();
             int year = localDate.getYear();
             // 如2021-10-15号码,则month=10,需要计算到11月份,需要加1
@@ -171,11 +171,11 @@ public class RepairFeeServiceImpl extends BaseServiceImpl<RepairFeeMapper, Repai
             // 当前年份只统计到当前月,历史年份统计全年
             searchStartTime = DateUtils.getFirstDayOfThisYear(year);
             searchEndTime = DateUtils.getLastDayOfMonth(year, month);
-        } else {
+        } else {*/
             monthStartAndEndList = DateUtils.getMonthStartAndEndByYear(startMonth, endMonth);
             searchStartTime = DateUtils.getFirstDayOfMonth(startMonth);
             searchEndTime = DateUtils.getLastDayOfMonth(endMonth);
-        }
+        //}
 
         repairApplicationFormDTO.setSearchStartTime(searchStartTime);
         repairApplicationFormDTO.setSearchEndTime(searchEndTime);