فهرست منبع

Merge branch 'dailyReport'

zhangcl 3 روز پیش
والد
کامیت
3152bf453c

+ 7 - 5
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotrydailyreport/IotRyDailyReportMapper.java

@@ -128,9 +128,10 @@ public interface IotRyDailyReportMapper extends BaseMapperX<IotRyDailyReportDO>
         if (reportDate == null) {
             return BigDecimal.ZERO;
         }
-
-        int year = reportDate.getYear();
-        int month = reportDate.getMonthValue();
+        // 获取 reportDate 的前一天日期
+        LocalDateTime previousDay = reportDate.minusDays(1);
+        int year = previousDay.getYear();
+        int month = previousDay.getMonthValue();
 
         List<IotRyDailyReportDO> list = selectList(new LambdaQueryWrapperX<IotRyDailyReportDO>()
                 .eq(ObjUtil.isNotNull(deptId), IotRyDailyReportDO::getDeptId, deptId)
@@ -154,8 +155,9 @@ public interface IotRyDailyReportMapper extends BaseMapperX<IotRyDailyReportDO>
         if (reportDate == null) {
             return BigDecimal.ZERO;
         }
-
-        int year = reportDate.getYear();
+        // 获取 reportDate 的前一天日期
+        LocalDateTime previousDay = reportDate.minusDays(1);
+        int year = previousDay.getYear();
 
         List<IotRyDailyReportDO> list = selectList(new LambdaQueryWrapperX<IotRyDailyReportDO>()
                 .eq(ObjUtil.isNotNull(deptId), IotRyDailyReportDO::getDeptId, deptId)

+ 2 - 2
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotrydailyreport/IotRyDailyReportServiceImpl.java

@@ -101,8 +101,8 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
         // 所在的月份相匹配 且 create_time < reportDate 的记录的 ’daily_footage‘ 字段值累加计算得出
         BigDecimal historyMonthlyFootage = iotRyDailyReportMapper.monthlyFootages(createReqVO.getDeptId(), reportDate);
 
-        // 查询指定部门、指定时间段 填写的日报记录的 ’月进尺数据‘(逻辑细则:reportDate 所在的月份与数据表的字段 construction_start_date
-        // 所在的份相匹配 且 create_time < reportDate 的记录的 ’daily_footage‘ 字段值累加计算得出
+        // 查询指定部门、指定时间段 填写的日报记录的 ’年进尺数据‘(逻辑细则:reportDate 所在的年份与数据表的字段 construction_start_date
+        // 所在的份相匹配 且 create_time < reportDate 的记录的 ’daily_footage‘ 字段值累加计算得出
         BigDecimal historyAnnualFootage = iotRyDailyReportMapper.annualFootages(createReqVO.getDeptId(), reportDate);
 
         // 当前井深 计算 日进尺 月进尺 年累计进尺