|
@@ -735,171 +735,163 @@ public class ProduceReportServiceImpl extends BaseServiceImpl<ProduceReportMappe
|
|
|
* @param no
|
|
|
*/
|
|
|
private void generateHyAgain(LocalDate date, String prefix, String no) {
|
|
|
- try {
|
|
|
- ProduceData produceData = produceDataService.selectByNo(prefix + no);
|
|
|
|
|
|
- // 找到当日耗用
|
|
|
- Weekend<ProduceReport> weekend = new Weekend<>(ProduceReport.class);
|
|
|
- WeekendCriteria<ProduceReport, Object> weekendCriteria = weekend.weekendCriteria();
|
|
|
- weekendCriteria.andEqualTo(ProduceReport::getDataId, produceData.getId())
|
|
|
- .andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
- .andEqualTo(ProduceReport::getMonth, date.getMonthValue()).andEqualTo(ProduceReport::getDate, date);
|
|
|
- ProduceReport report = mapper.selectOneByExample(weekend);
|
|
|
+ ProduceData produceData = produceDataService.selectByNo(prefix + no);
|
|
|
|
|
|
- // 找到当日库存
|
|
|
- Weekend<ProduceReport> weekend2 = new Weekend<>(ProduceReport.class);
|
|
|
- WeekendCriteria<ProduceReport, Object> weekendCriteria2 = weekend2.weekendCriteria();
|
|
|
- weekendCriteria2.andEqualTo(ProduceReport::getNo, "hy_" + no.replace("_hy", "_stock"))
|
|
|
- .andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
- .andEqualTo(ProduceReport::getMonth, date.getMonthValue())
|
|
|
- .andEqualTo(ProduceReport::getDay, date.getDayOfMonth())
|
|
|
- .andEqualTo(ProduceReport::getDate, date);
|
|
|
- ProduceReport reportStock = mapper.selectOneByExample(weekend2);
|
|
|
-
|
|
|
- // 找到前一天库存
|
|
|
- LocalDate preDate = date.plusDays(-1);
|
|
|
- Weekend<ProduceReport> weekend3 = new Weekend<>(ProduceReport.class);
|
|
|
- WeekendCriteria<ProduceReport, Object> weekendCriteria3 = weekend3.weekendCriteria();
|
|
|
- weekendCriteria3.andEqualTo(ProduceReport::getNo, "hy_" + no.replace("_hy", "_stock"))
|
|
|
- .andEqualTo(ProduceReport::getYear, preDate.getYear())
|
|
|
- .andEqualTo(ProduceReport::getMonth, preDate.getMonthValue())
|
|
|
- .andEqualTo(ProduceReport::getDay, preDate.getDayOfMonth())
|
|
|
- .andEqualTo(ProduceReport::getDate, preDate);
|
|
|
- ProduceReport reportStockPre = mapper.selectOneByExample(weekend3);
|
|
|
-
|
|
|
- // 找到当日入库
|
|
|
- Weekend<ProduceReport> weekend4 = new Weekend<>(ProduceReport.class);
|
|
|
- WeekendCriteria<ProduceReport, Object> weekendCriteria4 = weekend4.weekendCriteria();
|
|
|
- weekendCriteria4.andEqualTo(ProduceReport::getNo, "ck_" + no.replace("_hy", ""))
|
|
|
- .andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
- .andEqualTo(ProduceReport::getMonth, date.getMonthValue())
|
|
|
- .andEqualTo(ProduceReport::getDay, date.getDayOfMonth())
|
|
|
- .andEqualTo(ProduceReport::getDate, date);
|
|
|
- ProduceReport inStock = mapper.selectOneByExample(weekend4);
|
|
|
-
|
|
|
- // 更新
|
|
|
- log.info("no: " + no + ", 液位库存: " + reportStock.getValue() + ", 当日入库: " + inStock.getValue() + ", 昨天液位: " + reportStockPre.getValue());
|
|
|
- report.setValue(new BigDecimal(reportStock.getValue()).add(new BigDecimal(inStock.getValue())).subtract(new BigDecimal(reportStockPre.getValue())).toString());
|
|
|
- this.modModelByPrimaryKey(report);
|
|
|
-
|
|
|
- // 重新计算当日单耗和月均单耗
|
|
|
- // 每单当日单耗和977生产量,如果生产量为0,则当日单耗为0
|
|
|
- Weekend<ProduceReport> weekendDanhao = new Weekend<>(ProduceReport.class);
|
|
|
- WeekendCriteria<ProduceReport, Object> weekendCriteriaDanhao = weekendDanhao.weekendCriteria();
|
|
|
- weekendCriteriaDanhao.andEqualTo(ProduceReport::getNo, "hy_" + no.replace("_hy", ""))
|
|
|
- .andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
- .andEqualTo(ProduceReport::getMonth, date.getMonthValue())
|
|
|
- .andEqualTo(ProduceReport::getDay, date.getDayOfMonth())
|
|
|
- .andEqualTo(ProduceReport::getDate, date);
|
|
|
- ProduceReport danhao = mapper.selectOneByExample(weekendDanhao);
|
|
|
-
|
|
|
- // 默认977
|
|
|
- String sclNo = "scl_0300027";
|
|
|
- BigDecimal rate = new BigDecimal(1);
|
|
|
- if (no.equals("0100010_hy") || no.equals("0100065_hy") || no.equals("0100120_hy") || no.equals("0100160_hy") || no.equals("0100086_hy")) {
|
|
|
- sclNo = "scl_0600032";// 902
|
|
|
- rate = new BigDecimal(1);
|
|
|
- }
|
|
|
- Weekend<ProduceReport> weekend977 = new Weekend<>(ProduceReport.class);
|
|
|
- WeekendCriteria<ProduceReport, Object> weekendCriteria977 = weekend977.weekendCriteria();
|
|
|
- weekendCriteria977.andEqualTo(ProduceReport::getNo, sclNo)
|
|
|
- .andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
- .andEqualTo(ProduceReport::getMonth, date.getMonthValue())
|
|
|
- .andEqualTo(ProduceReport::getDay, date.getDayOfMonth())
|
|
|
- .andEqualTo(ProduceReport::getDate, date);
|
|
|
- ProduceReport cs077 = mapper.selectOneByExample(weekend977);
|
|
|
+ // 找到当日耗用
|
|
|
+ Weekend<ProduceReport> weekend = new Weekend<>(ProduceReport.class);
|
|
|
+ WeekendCriteria<ProduceReport, Object> weekendCriteria = weekend.weekendCriteria();
|
|
|
+ weekendCriteria.andEqualTo(ProduceReport::getDataId, produceData.getId())
|
|
|
+ .andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
+ .andEqualTo(ProduceReport::getMonth, date.getMonthValue()).andEqualTo(ProduceReport::getDate, date);
|
|
|
+ ProduceReport report = mapper.selectOneByExample(weekend);
|
|
|
|
|
|
- if (StringUtils.isBlank(cs077.getValue()) || new BigDecimal(cs077.getValue()).compareTo(new BigDecimal(0)) == 0 || new BigDecimal(cs077.getValue()).compareTo(new BigDecimal(0)) == 0) {
|
|
|
- danhao.setValue("0");
|
|
|
- } else {
|
|
|
- danhao.setValue(new BigDecimal(report.getValue()).divide(new BigDecimal(cs077.getValue()).multiply(rate), RoundingMode.HALF_UP).setScale(2, RoundingMode.HALF_UP).toString());
|
|
|
- }
|
|
|
- this.modModelByPrimaryKey(danhao);
|
|
|
-
|
|
|
- // 更新本月耗用和本年耗用
|
|
|
- // 年累计
|
|
|
- ProduceReportDTO month1 = new ProduceReportDTO();
|
|
|
- month1.setDataId(produceData.getId());
|
|
|
- month1.setYear(date.getYear());
|
|
|
- month1.setDateStart(DateUtils.getFirstDayOfThisYear(date.getYear()).toLocalDate());
|
|
|
- month1.setDateEnd(date);
|
|
|
- ProduceReportVO yearVO = this.sumMonthYear(month1);
|
|
|
- log.info("yearVO.getTotalValue(): " + yearVO.getTotalValue());
|
|
|
+ // 找到当日库存
|
|
|
+ Weekend<ProduceReport> weekend2 = new Weekend<>(ProduceReport.class);
|
|
|
+ WeekendCriteria<ProduceReport, Object> weekendCriteria2 = weekend2.weekendCriteria();
|
|
|
+ weekendCriteria2.andEqualTo(ProduceReport::getNo, "hy_" + no.replace("_hy", "_stock"))
|
|
|
+ .andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
+ .andEqualTo(ProduceReport::getMonth, date.getMonthValue())
|
|
|
+ .andEqualTo(ProduceReport::getDay, date.getDayOfMonth())
|
|
|
+ .andEqualTo(ProduceReport::getDate, date);
|
|
|
+ ProduceReport reportStock = mapper.selectOneByExample(weekend2);
|
|
|
|
|
|
- // 查找年
|
|
|
- ProduceReport yearReport = new ProduceReport();
|
|
|
- yearReport.setNo(prefix + no + "_year");
|
|
|
- yearReport.setDate(date);
|
|
|
- yearReport.setYear(date.getYear());
|
|
|
- yearReport = super.getModelListByModel(yearReport).get(0);
|
|
|
- log.info(yearReport.toString());
|
|
|
- yearReport.setValue(new BigDecimal(yearVO.getTotalValue()).setScale(2, RoundingMode.HALF_UP).toString());
|
|
|
- yearReport.setUpdateTime(LocalDateTime.now());
|
|
|
- yearReport.setUpdateUserId(SecurityUtils.getUserInfo().getUserId());
|
|
|
- mapper.updateByPrimaryKey(yearReport);
|
|
|
+ // 找到前一天库存
|
|
|
+ LocalDate preDate = date.plusDays(-1);
|
|
|
+ Weekend<ProduceReport> weekend3 = new Weekend<>(ProduceReport.class);
|
|
|
+ WeekendCriteria<ProduceReport, Object> weekendCriteria3 = weekend3.weekendCriteria();
|
|
|
+ weekendCriteria3.andEqualTo(ProduceReport::getNo, "hy_" + no.replace("_hy", "_stock"))
|
|
|
+ .andEqualTo(ProduceReport::getYear, preDate.getYear())
|
|
|
+ .andEqualTo(ProduceReport::getMonth, preDate.getMonthValue())
|
|
|
+ .andEqualTo(ProduceReport::getDay, preDate.getDayOfMonth())
|
|
|
+ .andEqualTo(ProduceReport::getDate, preDate);
|
|
|
+ ProduceReport reportStockPre = mapper.selectOneByExample(weekend3);
|
|
|
+
|
|
|
+ // 找到当日入库
|
|
|
+ Weekend<ProduceReport> weekend4 = new Weekend<>(ProduceReport.class);
|
|
|
+ WeekendCriteria<ProduceReport, Object> weekendCriteria4 = weekend4.weekendCriteria();
|
|
|
+ weekendCriteria4.andEqualTo(ProduceReport::getNo, "ck_" + no.replace("_hy", ""))
|
|
|
+ .andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
+ .andEqualTo(ProduceReport::getMonth, date.getMonthValue())
|
|
|
+ .andEqualTo(ProduceReport::getDay, date.getDayOfMonth())
|
|
|
+ .andEqualTo(ProduceReport::getDate, date);
|
|
|
+ ProduceReport inStock = mapper.selectOneByExample(weekend4);
|
|
|
+
|
|
|
+ // 更新
|
|
|
+ log.info("no: " + no + ", 液位库存: " + reportStock.getValue() + ", 当日入库: " + inStock.getValue() + ", 昨天液位: " + reportStockPre.getValue());
|
|
|
+ report.setValue(new BigDecimal(reportStock.getValue()).add(new BigDecimal(inStock.getValue())).subtract(new BigDecimal(reportStockPre.getValue())).toString());
|
|
|
+ this.modModelByPrimaryKey(report);
|
|
|
+
|
|
|
+ // 重新计算当日单耗和月均单耗
|
|
|
+ // 每单当日单耗和977生产量,如果生产量为0,则当日单耗为0
|
|
|
+ Weekend<ProduceReport> weekendDanhao = new Weekend<>(ProduceReport.class);
|
|
|
+ WeekendCriteria<ProduceReport, Object> weekendCriteriaDanhao = weekendDanhao.weekendCriteria();
|
|
|
+ weekendCriteriaDanhao.andEqualTo(ProduceReport::getNo, "hy_" + no.replace("_hy", ""))
|
|
|
+ .andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
+ .andEqualTo(ProduceReport::getMonth, date.getMonthValue())
|
|
|
+ .andEqualTo(ProduceReport::getDay, date.getDayOfMonth())
|
|
|
+ .andEqualTo(ProduceReport::getDate, date);
|
|
|
+ ProduceReport danhao = mapper.selectOneByExample(weekendDanhao);
|
|
|
+
|
|
|
+ // 默认977
|
|
|
+ String sclNo = "scl_0300027";
|
|
|
+ BigDecimal rate = new BigDecimal(1);
|
|
|
+ if (no.equals("0100010_hy") || no.equals("0100065_hy") || no.equals("0100120_hy") || no.equals("0100160_hy") || no.equals("0100086_hy")) {
|
|
|
+ sclNo = "scl_0600032";// 902
|
|
|
+ rate = new BigDecimal(1);
|
|
|
+ }
|
|
|
+ Weekend<ProduceReport> weekend977 = new Weekend<>(ProduceReport.class);
|
|
|
+ WeekendCriteria<ProduceReport, Object> weekendCriteria977 = weekend977.weekendCriteria();
|
|
|
+ weekendCriteria977.andEqualTo(ProduceReport::getNo, sclNo)
|
|
|
+ .andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
+ .andEqualTo(ProduceReport::getMonth, date.getMonthValue())
|
|
|
+ .andEqualTo(ProduceReport::getDay, date.getDayOfMonth())
|
|
|
+ .andEqualTo(ProduceReport::getDate, date);
|
|
|
+ ProduceReport cs077 = mapper.selectOneByExample(weekend977);
|
|
|
|
|
|
- // 本月耗用:更新
|
|
|
- month1.setMonth(date.getMonthValue());
|
|
|
- month1.setDateStart(DateUtils.getFirstDayOfMonth(date).toLocalDate());
|
|
|
- month1.setDateEnd(date);
|
|
|
- ProduceReportVO monthVO = this.sumMonthYear(month1);
|
|
|
- log.info("monthVO.getTotalValue(): " + monthVO.getTotalValue());
|
|
|
+ if (StringUtils.isBlank(cs077.getValue()) || new BigDecimal(cs077.getValue()).compareTo(new BigDecimal(0)) == 0 || new BigDecimal(cs077.getValue()).compareTo(new BigDecimal(0)) == 0) {
|
|
|
+ danhao.setValue("0");
|
|
|
+ } else {
|
|
|
+ danhao.setValue(new BigDecimal(report.getValue()).divide(new BigDecimal(cs077.getValue()).multiply(rate), RoundingMode.HALF_UP).setScale(2, RoundingMode.HALF_UP).toString());
|
|
|
+ }
|
|
|
+ this.modModelByPrimaryKey(danhao);
|
|
|
|
|
|
- // 查找月
|
|
|
- ProduceReport monthReport = new ProduceReport();
|
|
|
- monthReport.setNo(prefix + no + "_month");
|
|
|
- monthReport.setDate(date);
|
|
|
- monthReport.setYear(date.getYear());
|
|
|
- monthReport.setMonth(date.getMonthValue());
|
|
|
- monthReport = super.getModelListByModel(monthReport).get(0);
|
|
|
- monthReport.setValue(new BigDecimal(monthVO.getTotalValue()).setScale(2, RoundingMode.HALF_UP).toString());
|
|
|
- monthReport.setUpdateTime(LocalDateTime.now());
|
|
|
- monthReport.setUpdateUserId(SecurityUtils.getUserInfo().getUserId());
|
|
|
- mapper.updateByPrimaryKey(monthReport);
|
|
|
+ // 更新本月耗用和本年耗用
|
|
|
+ // 年累计
|
|
|
+ ProduceReportDTO month1 = new ProduceReportDTO();
|
|
|
+ month1.setDataId(produceData.getId());
|
|
|
+ month1.setYear(date.getYear());
|
|
|
+ month1.setDateStart(DateUtils.getFirstDayOfThisYear(date.getYear()).toLocalDate());
|
|
|
+ month1.setDateEnd(date);
|
|
|
+ ProduceReportVO yearVO = this.sumMonthYear(month1);
|
|
|
+ log.info("yearVO.getTotalValue(): " + yearVO.getTotalValue());
|
|
|
+
|
|
|
+ // 查找年
|
|
|
+ ProduceReport yearReport = new ProduceReport();
|
|
|
+ yearReport.setNo(prefix + no + "_year");
|
|
|
+ yearReport.setDate(date);
|
|
|
+ yearReport.setYear(date.getYear());
|
|
|
+ yearReport = super.getModelListByModel(yearReport).get(0);
|
|
|
+ log.info(yearReport.toString());
|
|
|
+ yearReport.setValue(new BigDecimal(yearVO.getTotalValue()).setScale(2, RoundingMode.HALF_UP).toString());
|
|
|
+ yearReport.setUpdateTime(LocalDateTime.now());
|
|
|
+ mapper.updateByPrimaryKey(yearReport);
|
|
|
+
|
|
|
+ // 本月耗用:更新
|
|
|
+ month1.setMonth(date.getMonthValue());
|
|
|
+ month1.setDateStart(DateUtils.getFirstDayOfMonth(date).toLocalDate());
|
|
|
+ month1.setDateEnd(date);
|
|
|
+ ProduceReportVO monthVO = this.sumMonthYear(month1);
|
|
|
+ log.info("monthVO.getTotalValue(): " + monthVO.getTotalValue());
|
|
|
+
|
|
|
+ // 查找月
|
|
|
+ ProduceReport monthReport = new ProduceReport();
|
|
|
+ monthReport.setNo(prefix + no + "_month");
|
|
|
+ monthReport.setDate(date);
|
|
|
+ monthReport.setYear(date.getYear());
|
|
|
+ monthReport.setMonth(date.getMonthValue());
|
|
|
+ monthReport = super.getModelListByModel(monthReport).get(0);
|
|
|
+ monthReport.setValue(new BigDecimal(monthVO.getTotalValue()).setScale(2, RoundingMode.HALF_UP).toString());
|
|
|
+ monthReport.setUpdateTime(LocalDateTime.now());
|
|
|
+ mapper.updateByPrimaryKey(monthReport);
|
|
|
+
|
|
|
+ // 月均单耗=本月耗用/月累计产量,月均单耗和月产量977生产量,如果生产量为0,则单耗为0
|
|
|
+ Weekend<ProduceReport> weekendHyoMonth = new Weekend<>(ProduceReport.class);
|
|
|
+ WeekendCriteria<ProduceReport, Object> weekendCriteriaHyMonth = weekendHyoMonth.weekendCriteria();
|
|
|
+ weekendCriteriaHyMonth.andEqualTo(ProduceReport::getNo, "hy_" + no.replace("_hy", "_month"))
|
|
|
+ .andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
+ .andEqualTo(ProduceReport::getMonth, date.getMonthValue())
|
|
|
+ .andEqualTo(ProduceReport::getDay, date.getDayOfMonth())
|
|
|
+ .andEqualTo(ProduceReport::getDate, date);
|
|
|
+ ProduceReport danhaoMonth = mapper.selectOneByExample(weekendHyoMonth);
|
|
|
|
|
|
- // 月均单耗=本月耗用/月累计产量,月均单耗和月产量977生产量,如果生产量为0,则单耗为0
|
|
|
- Weekend<ProduceReport> weekendHyoMonth = new Weekend<>(ProduceReport.class);
|
|
|
- WeekendCriteria<ProduceReport, Object> weekendCriteriaHyMonth = weekendHyoMonth.weekendCriteria();
|
|
|
- weekendCriteriaHyMonth.andEqualTo(ProduceReport::getNo, "hy_" + no.replace("_hy", "_month"))
|
|
|
- .andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
- .andEqualTo(ProduceReport::getMonth, date.getMonthValue())
|
|
|
- .andEqualTo(ProduceReport::getDay, date.getDayOfMonth())
|
|
|
- .andEqualTo(ProduceReport::getDate, date);
|
|
|
- ProduceReport danhaoMonth = mapper.selectOneByExample(weekendHyoMonth);
|
|
|
-
|
|
|
- log.info("no: " + no);
|
|
|
- Weekend<ProduceReport> weekendDanhaoMonth = new Weekend<>(ProduceReport.class);
|
|
|
- WeekendCriteria<ProduceReport, Object> weekendCriteriaDanhaoMonth = weekendDanhaoMonth.weekendCriteria();
|
|
|
- weekendCriteriaDanhaoMonth.andEqualTo(ProduceReport::getNo, "ck_" + no.replace("_hy", "_hy_month"))
|
|
|
- .andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
- .andEqualTo(ProduceReport::getMonth, date.getMonthValue())
|
|
|
- .andEqualTo(ProduceReport::getDay, date.getDayOfMonth())
|
|
|
- .andEqualTo(ProduceReport::getDate, date);
|
|
|
- ProduceReport month = mapper.selectOneByExample(weekendDanhaoMonth);
|
|
|
+ log.info("no: " + no);
|
|
|
+ Weekend<ProduceReport> weekendDanhaoMonth = new Weekend<>(ProduceReport.class);
|
|
|
+ WeekendCriteria<ProduceReport, Object> weekendCriteriaDanhaoMonth = weekendDanhaoMonth.weekendCriteria();
|
|
|
+ weekendCriteriaDanhaoMonth.andEqualTo(ProduceReport::getNo, "ck_" + no.replace("_hy", "_hy_month"))
|
|
|
+ .andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
+ .andEqualTo(ProduceReport::getMonth, date.getMonthValue())
|
|
|
+ .andEqualTo(ProduceReport::getDay, date.getDayOfMonth())
|
|
|
+ .andEqualTo(ProduceReport::getDate, date);
|
|
|
+ ProduceReport month = mapper.selectOneByExample(weekendDanhaoMonth);
|
|
|
|
|
|
- Weekend<ProduceReport> weekend977Month = new Weekend<>(ProduceReport.class);
|
|
|
- WeekendCriteria<ProduceReport, Object> weekendCriteria977Month = weekend977Month.weekendCriteria();
|
|
|
- weekendCriteria977Month.andEqualTo(ProduceReport::getNo, sclNo + "_month")
|
|
|
- .andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
- .andEqualTo(ProduceReport::getMonth, date.getMonthValue())
|
|
|
- .andEqualTo(ProduceReport::getDay, date.getDayOfMonth())
|
|
|
- .andEqualTo(ProduceReport::getDate, date);
|
|
|
- ProduceReport cs077Month = mapper.selectOneByExample(weekend977Month);
|
|
|
- log.info("month: " + month.getValue());
|
|
|
- log.info("cs077Month: " + cs077Month.getValue());
|
|
|
- if (StringUtils.isBlank(cs077Month.getValue()) || new BigDecimal(cs077Month.getValue()).compareTo(new BigDecimal(0)) == 0) {
|
|
|
- danhaoMonth.setValue("0");
|
|
|
- } else {
|
|
|
- danhaoMonth.setValue(new BigDecimal(month.getValue()).divide(new BigDecimal(cs077Month.getValue()).multiply(rate), RoundingMode.HALF_UP).setScale(2, RoundingMode.HALF_UP).toString());
|
|
|
- }
|
|
|
- this.modModelByPrimaryKey(danhaoMonth);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- log.error(e.getStackTrace().toString());
|
|
|
- log.error(e.getMessage());
|
|
|
- log.error(e.getCause().getMessage());
|
|
|
- log.error(e.getCause().toString());
|
|
|
+ Weekend<ProduceReport> weekend977Month = new Weekend<>(ProduceReport.class);
|
|
|
+ WeekendCriteria<ProduceReport, Object> weekendCriteria977Month = weekend977Month.weekendCriteria();
|
|
|
+ weekendCriteria977Month.andEqualTo(ProduceReport::getNo, sclNo + "_month")
|
|
|
+ .andEqualTo(ProduceReport::getYear, date.getYear())
|
|
|
+ .andEqualTo(ProduceReport::getMonth, date.getMonthValue())
|
|
|
+ .andEqualTo(ProduceReport::getDay, date.getDayOfMonth())
|
|
|
+ .andEqualTo(ProduceReport::getDate, date);
|
|
|
+ ProduceReport cs077Month = mapper.selectOneByExample(weekend977Month);
|
|
|
+ log.info("month: " + month.getValue());
|
|
|
+ log.info("cs077Month: " + cs077Month.getValue());
|
|
|
+ if (StringUtils.isBlank(cs077Month.getValue()) || new BigDecimal(cs077Month.getValue()).compareTo(new BigDecimal(0)) == 0) {
|
|
|
+ danhaoMonth.setValue("0");
|
|
|
+ } else {
|
|
|
+ danhaoMonth.setValue(new BigDecimal(month.getValue()).divide(new BigDecimal(cs077Month.getValue()).multiply(rate), RoundingMode.HALF_UP).setScale(2, RoundingMode.HALF_UP).toString());
|
|
|
}
|
|
|
+ this.modModelByPrimaryKey(danhaoMonth);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|