|
@@ -559,7 +559,7 @@ public class ProduceReportServiceImpl extends BaseServiceImpl<ProduceReportMappe
|
|
|
param.put("a3", a3.doubleValue());
|
|
|
generateYeweiTotalReport(date, param);
|
|
|
|
|
|
- // 计算耗用
|
|
|
+ // 计算耗用,耗用等于库存-液位
|
|
|
generateYeweiReport(date, "ck_", "0100087_hy", SysConfigEnum.PRODUCE_YEWEI_903_HY.name());// 903
|
|
|
generateYeweiReport(date, "ck_", "0100083_hy", SysConfigEnum.PRODUCE_YEWEI_905_HY.name());// 905
|
|
|
generateYeweiReport(date, "ck_", "0100003_hy", SysConfigEnum.PRODUCE_YEWEI_907_HY.name());// 907
|
|
@@ -651,12 +651,21 @@ public class ProduceReportServiceImpl extends BaseServiceImpl<ProduceReportMappe
|
|
|
.andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
.andEqualTo(ProduceReport::getMonth, date.getMonthValue()).andEqualTo(ProduceReport::getDate, date);
|
|
|
ProduceReport report = mapper.selectOneByExample(weekend2);
|
|
|
- if (report != null) {
|
|
|
+ if (report != null) {// 说明存在了,是当日消耗,这个时候需要找到库存减去现在的数据就行了
|
|
|
ProduceReportDTO dto = BeanConverterUtil.copyObjectProperties(report, ProduceReportDTO.class);
|
|
|
// 数据除以1000,换算成吨
|
|
|
total = total.divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_UP);
|
|
|
- dto.setValue(total.toString());
|
|
|
dto.setUpdateTime(LocalDateTime.now());
|
|
|
+ Weekend<ProduceReport> weekend3 = new Weekend<>(ProduceReport.class);
|
|
|
+ WeekendCriteria<ProduceReport, Object> weekendCriteria3 = weekend3.weekendCriteria();
|
|
|
+ weekendCriteria3.andEqualTo(ProduceReport::getNo, "hy_" + no + "_stock")
|
|
|
+ .andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
+ .andEqualTo(ProduceReport::getMonth, date.getMonthValue())
|
|
|
+ .andEqualTo(ProduceReport::getDay, date.getDayOfMonth())
|
|
|
+ .andEqualTo(ProduceReport::getDate, date);
|
|
|
+ ProduceReport reportStock = mapper.selectOneByExample(weekend3);
|
|
|
+ total = total.subtract(new BigDecimal(reportStock.getValue()));
|
|
|
+ dto.setValue(total.toString());
|
|
|
this.modModelByDTO(dto);
|
|
|
} else {
|
|
|
report = BeanConverterUtil.copyObjectProperties(produceData, ProduceReport.class);
|