diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/MonthReportServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/MonthReportServiceImpl.java index 67af29e..cced0d9 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/MonthReportServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/MonthReportServiceImpl.java @@ -26,7 +26,9 @@ import org.springblade.system.vo.DeptVO; import org.springframework.stereotype.Service; import java.io.IOException; +import java.time.LocalDate; import java.time.YearMonth; +import java.time.format.DateTimeFormatter; import java.util.List; @Service @@ -65,7 +67,7 @@ public class MonthReportServiceImpl extends ServiceImpl2&&month.equals(YearMonth.now().toString())); + LocalDate localDatePlus = currentDate.plusMonths(1); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM"); + String formattedDate = localDatePlus.format(formatter); + boolean flag2=(dayNow<2&&month.equals(formattedDate)); +// 每个月月报的数据重新生成时间截至至下个月的2号 + if (flag || flag2) { if (ObjectUtil.isNotEmpty(operMonthReportEntityByMonth)) { this.removeById(operMonthReportEntityByMonth.getId()); }