|
@@ -768,7 +768,41 @@ public class ProduceReportServiceImpl extends BaseServiceImpl<ProduceReportMappe
|
|
}
|
|
}
|
|
this.modModelByPrimaryKey(danhaoMonth);
|
|
this.modModelByPrimaryKey(danhaoMonth);
|
|
|
|
|
|
|
|
+ // 更新本月耗用和本年耗用
|
|
|
|
+ // 年累计
|
|
|
|
+ ProduceRecordDTO month1 = new ProduceRecordDTO();
|
|
|
|
+ month1.setProductNo(prefix + no);
|
|
|
|
+ month1.setDateStart(DateUtils.getFirstDayOfThisYear(date.getYear()));
|
|
|
|
+ month1.setDateEnd(DateUtils.getLastDayOfThisYear(date.getYear()));
|
|
|
|
+ month1.setType(ProduceRecordTypeEnum.CL_CK.getValue());
|
|
|
|
+ ProduceRecordVO yearVO = produceRecordService.sumMonthYear(month1);
|
|
|
|
+
|
|
|
|
+ Weekend<ProduceReport> year = new Weekend<>(ProduceReport.class);
|
|
|
|
+ WeekendCriteria<ProduceReport, Object> weekendCriteriaYear = year.weekendCriteria();
|
|
|
|
+ weekendCriteriaYear.andEqualTo(ProduceReport::getNo, prefix + no + "_year")
|
|
|
|
+ .andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
|
+ .andEqualTo(ProduceReport::getMonth, date.getMonthValue())
|
|
|
|
+ .andEqualTo(ProduceReport::getDay, date.getDayOfMonth())
|
|
|
|
+ .andEqualTo(ProduceReport::getDate, date);
|
|
|
|
+ ProduceReport yearReport = mapper.selectOneByExample(year);
|
|
|
|
+ yearReport.setValue(yearVO.getTotalValue().toString());
|
|
|
|
+ this.modModelByPrimaryKey(yearReport);
|
|
|
|
|
|
|
|
+ // 月累计
|
|
|
|
+ month1.setDateStart(DateUtils.getFirstDayOfMonth(date));
|
|
|
|
+ month1.setDateEnd(DateUtils.getLastDayOfMonth(date));
|
|
|
|
+ ProduceRecordVO monthVO = produceRecordService.sumMonthYear(month1);
|
|
|
|
+
|
|
|
|
+ Weekend<ProduceReport> monthValue = new Weekend<>(ProduceReport.class);
|
|
|
|
+ WeekendCriteria<ProduceReport, Object> weekendCriteriaMonth = monthValue.weekendCriteria();
|
|
|
|
+ weekendCriteriaMonth.andEqualTo(ProduceReport::getNo, prefix + no + "_year")
|
|
|
|
+ .andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
|
+ .andEqualTo(ProduceReport::getMonth, date.getMonthValue())
|
|
|
|
+ .andEqualTo(ProduceReport::getDay, date.getDayOfMonth())
|
|
|
|
+ .andEqualTo(ProduceReport::getDate, date);
|
|
|
|
+ ProduceReport monthReport = mapper.selectOneByExample(monthValue);
|
|
|
|
+ monthReport.setValue(monthVO.getTotalValue().toString());
|
|
|
|
+ this.modModelByPrimaryKey(monthReport);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|