use of com.monitor.model.dailyinventorysummary.PanoramicDailyInventorySummary in project new-cloud by xie-summer.
the class PanoramicDailyInventorySummaryServiceImpl method saveOrUpdateRecord.
private void saveOrUpdateRecord(String date, List<PanoramicDailyInventorySummary> records, List<PanoramicDailyInventorySummary> curRecords, List<PanoramicDailyInventorySummary> summaryList) {
if (null != records && records.size() > 0) {
records.forEach(e -> {
setRecordValue(date, e);
e.setId(null);
curRecords.add(e);
});
} else {
List<PanoramicRawMaterials> rawMaterialsList = rawMaterialsService.listSummaryCategory();
if (null != rawMaterialsList && rawMaterialsList.size() > 0) {
rawMaterialsList.forEach((PanoramicRawMaterials e) -> {
Double value = rawMaterialsService.summaryByCodeAndDate(e.getCode(), date);
value = value < 0 ? 0 : value;
PanoramicDailyInventorySummary record = getPanoramicDailyInventorySummary(value, 1);
record.setCode(e.getCode());
record.setName(e.getName());
curRecords.add(record);
});
}
List<PanoramicProductMaterials> categoryList = productMaterialsService.listRealTimeProductSummaryCategoryTask();
if (null != categoryList && categoryList.size() > 0) {
categoryList.forEach((PanoramicProductMaterials e) -> {
Double value = productMaterialsService.summaryByCodeAndDate(e.getCode(), date);
value = value < 0 ? 0 : value;
PanoramicDailyInventorySummary record = getPanoramicDailyInventorySummary(value, 2);
record.setCode(e.getCode());
record.setName(e.getName());
curRecords.add(record);
});
}
}
if (null == summaryList || summaryList.size() == 0) {
dailyInventorySummaryMapper.insertList(curRecords);
} else {
dailyInventorySummaryMapper.updateBatch(curRecords);
}
}
use of com.monitor.model.dailyinventorysummary.PanoramicDailyInventorySummary in project new-cloud by xie-summer.
the class PanoramicDailyInventorySummaryServiceImpl method listByDateAndCode.
@Override
public List<PanoramicDailyInventorySummary> listByDateAndCode(String date, List<String> codeList) {
List<PanoramicDailyInventorySummary> records = Lists.newArrayList();
codeList.forEach((String e) -> {
PanoramicDailyInventorySummary dailyInventorySummary = this.queryByDateAndCode(e, date);
records.add(dailyInventorySummary);
});
return records;
}
Aggregations