Commit e5285847 zshaohui

内仓看板过期信息修改

1 个父辈 b6cfa5f8
......@@ -202,7 +202,7 @@ public class InnerKanbanController {
Date startDate = DateUtil.addDays(new Date(), -30);
String startDateStr = DateUtil.toDateString(startDate, "yyyy-MM-dd");
startDate = DateUtil.toDate(startDateStr, "yyyy-MM-dd");
Query query = new Query().addCriteria(Criteria.where("barcode").exists(true).and("barcode.expireDate").lte(startDate));
Query query = new Query().addCriteria(Criteria.where("barcode").exists(true).and("barcode.expireDate").gte(startDate).lt(new Date()));
List<StoragePos> storagePosList = storagePosManager.findByQuery(query);
long zeroToServen = storagePosList.stream().filter(item -> {
Barcode barcode = item.getBarcode();
......@@ -223,6 +223,16 @@ public class InnerKanbanController {
return false;
}).count();
long expire = storagePosList.stream().filter(item -> {
Barcode barcode = item.getBarcode();
Date expireDate = barcode.getExpireDate();
long days = cn.hutool.core.date.DateUtil.between(expireDate, new Date(), DateUnit.DAY) + 1;
if (days >= 1) {
return true;
}
return false;
}).count();
List<Criteria> orCriList = new ArrayList<>();
orCriList.add(Criteria.where("barcode").exists(true).and("barcode.expireDate").gt(new Date()));
orCriList.add(Criteria.where("barcode").exists(true).and("barcode.expireDate").exists(false));
......@@ -230,7 +240,7 @@ public class InnerKanbanController {
expireMap.put("noExpire", (long) noExpire);
expireMap.put("zeroToServen", zeroToServen);
expireMap.put("servenToThirty", servenToThirty);
expireMap.put("expire", storagePosList == null ? 0l : storagePosList.size());
expireMap.put("expire", expire);
expireMap.put("lastSaveTime", System.currentTimeMillis());
}
return ResultBean.newOkResult(expireMap);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!