新增过期提醒

pull/1/head
lqh 2 months ago
parent 95850657f2
commit e768a4011f
  1. 14
      lab-service/lab-capital/src/main/java/org/springblade/lims/goods/controller/GoodsController.java

@ -122,6 +122,20 @@ public class GoodsController extends BladeController {
if (CollectionUtils.isNotEmpty(contractDetail)) { if (CollectionUtils.isNotEmpty(contractDetail)) {
goods1.setNotNum(contractDetail.stream().mapToInt(ContractDetail::getNotNum).sum()); goods1.setNotNum(contractDetail.stream().mapToInt(ContractDetail::getNotNum).sum());
} }
LambdaQueryWrapper<ProductStoreDetial> timeWrapper = new LambdaQueryWrapper<>();
timeWrapper.eq(ProductStoreDetial::getGoodsId, goods1.getId())
.orderByAsc(ProductStoreDetial::getBeyondTime) // 按过期时间降序
.last("LIMIT 1"); // 只取第一条
ProductStoreDetial detialWithTime = productStoreDetialService.getOne(timeWrapper);
if (detialWithTime != null && detialWithTime.getBeyondTime() != null) {
// 为Goods对象的beyondtime字段赋值
goods1.setBeyondTime(detialWithTime.getBeyondTime());
} else {
// 无过期时间时赋值为null(或根据业务设置默认值)
goods1.setBeyondTime(null);
}
} }
return page; return page;
} }

Loading…
Cancel
Save