|
|
|
@ -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; |
|
|
|
} |
|
|
|
} |
|
|
|
|