public IPage<ProductBatchStockDO> expirationDateWarning(Pageable<ProductBatchStockQuery, ProductBatchStockDO> pageable) { //计算到期时间 IPage<ProductBatchStockDO> productBatchStockIPage = this.baseMapper.expirationDateWarning(pageable, pageable.getCondition()); List<ProductBatchStockDO> records = productBatchStockIPage.getRecords(); for (ProductBatchStockDO record : records) { Calendar ca = Calendar.getInstance(); ca.setTime(record.getProductionDate()); ca.add(Calendar.DATE, record.getExpirationDate()); Date time = ca.getTime(); //到期时间 record.setExpirationTime(time); } productBatchStockIPage.setRecords(records); return productBatchStockIPage; } 123456789101112131415