厨房首页 设备问题修复

This commit is contained in:
liux 2025-07-07 09:22:17 +08:00
parent 2a4a4a97c2
commit 65ac48eda9
2 changed files with 16 additions and 11 deletions

View File

@ -104,7 +104,7 @@ public class KitchenDeviceInfoServiceImpl extends ServiceImpl<KitchenDeviceInfoM
.eq(KitchenDeviceInfo::getDeviceName, kitchenDeviceInfo.getDeviceName())
);
if(bean !=null) {
throw new ServiceException("设备编号已存在,请检查后重新输入");
throw new ServiceException("设备名称已存在,请检查后重新输入");
}
bean = kitchenDeviceInfoMapper.selectOne(
Wrappers.<KitchenDeviceInfo>lambdaQuery()

View File

@ -111,18 +111,23 @@ public class KitchenHomePageerviceImpl implements IKitchenHomePageService {
//过期状态
int expireCount = 0;
for(KitchenStaffInfo kitchenStaffInfo : selectKitchenStaffInfoList){
try {
LocalDate healthCertExpire = kitchenStaffInfo.getHealthCertExpire();
System.err.println("111: " + ChronoUnit.DAYS.between(healthCertExpire,LocalDate.now()));
System.err.println("222: " + ChronoUnit.DAYS.between(LocalDate.now(),healthCertExpire));
if(healthCertExpire == null){
lackCount ++;
}else if(ChronoUnit.DAYS.between(LocalDate.now(), healthCertExpire)<inemValue && ChronoUnit.DAYS.between(LocalDate.now(), healthCertExpire)>0){
}else if(ChronoUnit.DAYS.between(LocalDate.now(), healthCertExpire)<inemValue && ChronoUnit.DAYS.between(LocalDate.now(), healthCertExpire)>=0){
adventCount ++;
}else if (ChronoUnit.DAYS.between(LocalDate.now(),healthCertExpire)<0){
expireCount ++;
}else{
normalCount ++;
}
}catch (Exception e){
lackCount ++;
// e.printStackTrace(); // 定位实际抛出 NPE 的代码行
// throw new ServiceException("健康证到期时间格式错误");
}
}
IndexMapCountVO normal = new IndexMapCountVO();
IndexMapCountVO lack = new IndexMapCountVO();