|
|
@ -26,7 +26,9 @@ import org.springblade.system.vo.DeptVO; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
|
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.YearMonth; |
|
|
|
import java.time.YearMonth; |
|
|
|
|
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
@Service |
|
|
|
@Service |
|
|
@ -65,7 +67,7 @@ public class MonthReportServiceImpl extends ServiceImpl<MonthReportMapper, OperM |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
//修改为每运行一次,保存一次
|
|
|
|
//修改为每运行一次,保存一次
|
|
|
|
this.save(operMonthReportEntity); |
|
|
|
this.save(saved); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//历史查询定时任务生成的数据
|
|
|
|
//历史查询定时任务生成的数据
|
|
|
@ -88,7 +90,15 @@ public class MonthReportServiceImpl extends ServiceImpl<MonthReportMapper, OperM |
|
|
|
eq(OperMonthReportEntity::getIsDeleted, 0); |
|
|
|
eq(OperMonthReportEntity::getIsDeleted, 0); |
|
|
|
last("limit 1;"); |
|
|
|
last("limit 1;"); |
|
|
|
}}); |
|
|
|
}}); |
|
|
|
if (ObjectUtil.isEmpty(operMonthReportEntityByMonth) || month.equals(YearMonth.now().toString())) { |
|
|
|
LocalDate currentDate = LocalDate.now(); |
|
|
|
|
|
|
|
int dayNow = currentDate.getDayOfMonth(); |
|
|
|
|
|
|
|
boolean flag=(dayNow>2&&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)) { |
|
|
|
if (ObjectUtil.isNotEmpty(operMonthReportEntityByMonth)) { |
|
|
|
this.removeById(operMonthReportEntityByMonth.getId()); |
|
|
|
this.removeById(operMonthReportEntityByMonth.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|