@Scheduled(cron = "0 0 10 * * ?")
private void returnEquipmentTask() {
Example exampleReturn = new Example(DeviceEntity.class);
Example.Criteria criteriaReturn = exampleReturn.createCriteria();
criteriaReturn.andEqualTo("state", 3);
List<DeviceEntity> deviceLendRecordEntitiesReturn = deviceMapper.selectByExample(exampleReturn);
deviceLendRecordEntitiesReturn.forEach(deviceLendRecordEntity -> {
Long dateTime = System.currentTimeMillis();
if (deviceLendRecordEntity.getReturnTime().getTime() <= dateTime) {
if((dateTime - deviceLendRecordEntity.getReturnTime().getTime()) / (24 * 60 * 60 * 1000)!=0){
...
}else{
if (Math.abs(deviceLendRecordEntity.getReturnTime().getTime() - dateTime) <= 24 * 60 * 60 * 1000 && deviceLendRecordEntity.getReturnTime().getTime() > dateTime) {
...
}
}
}
});
}