|
|
|
@ -2265,12 +2265,28 @@ public class PhysicalInventoryServiceImpl extends ServiceImpl<PhysicalInventoryM |
|
|
|
month= (lastCompletedCycleIndex ) * cycle; |
|
|
|
} |
|
|
|
// 获取当前年份 |
|
|
|
Date lastPandian; |
|
|
|
if(month>0) { |
|
|
|
int currentYear = LocalDate.now().getYear(); |
|
|
|
YearMonth yearMonth = YearMonth.of(currentYear, month); |
|
|
|
LocalDate lastDay = yearMonth.atEndOfMonth(); |
|
|
|
LocalDateTime lastDayTime = lastDay.atTime(23, 59, 59); |
|
|
|
Date lastPandian=Date.from(lastDayTime.atZone(ZoneId.of("Asia/Shanghai")).toInstant()); |
|
|
|
lastPandian = Date.from(lastDayTime.atZone(ZoneId.of("Asia/Shanghai")).toInstant()); |
|
|
|
log.info("获得上次盘点结束日期: {}", lastPandian.toString()); |
|
|
|
}else { |
|
|
|
// 获取当前日期(系统默认时区) |
|
|
|
LocalDate today = LocalDate.now(); |
|
|
|
|
|
|
|
// 获取去年的年份 |
|
|
|
int lastYear = today.getYear() - 1; |
|
|
|
|
|
|
|
// 构造去年的最后一天:12月31日 |
|
|
|
LocalDate lastDayOfLastYear = LocalDate.of(lastYear, 12, 31); |
|
|
|
|
|
|
|
// 转换为 Date(使用系统默认时区) |
|
|
|
lastPandian = Date.from(lastDayOfLastYear.atStartOfDay(ZoneId.systemDefault()).toInstant()); |
|
|
|
|
|
|
|
} |
|
|
|
baseMapper.updateLastPandianHU(site, lastPandian); |
|
|
|
//开启盘点模式 |
|
|
|
|
|
|
|
|