Bläddra i källkod

库存量改成液位的库存量

hfxc226 3 veckor sedan
förälder
incheckning
fb10f0ef26

+ 5 - 2
platform-service/src/main/java/com/platform/service/produce/impl/ProduceReportServiceImpl.java

@@ -772,6 +772,7 @@ public class ProduceReportServiceImpl extends BaseServiceImpl<ProduceReportMappe
         month1.setDataId(produceData.getId());
         month1.setYear(date.getYear());
         ProduceReportVO yearVO = this.sumMonthYear(month1);
+        log.info("yearVO.getTotalValue(): " + yearVO.getTotalValue());
 
         // 查找年
         ProduceReport yearReport = new ProduceReport();
@@ -779,7 +780,7 @@ public class ProduceReportServiceImpl extends BaseServiceImpl<ProduceReportMappe
         yearReport.setDate(date);
         yearReport.setYear(date.getYear());
         yearReport = super.getModelListByModel(yearReport).get(0);
-        yearReport.setValue(yearVO.getTotalValue());
+        yearReport.setValue(new BigDecimal(yearVO.getTotalValue()).setScale(2).toString());
         yearReport.setUpdateTime(LocalDateTime.now());
         yearReport.setUpdateUserId(SecurityUtils.getUserInfo().getUserId());
         mapper.updateByPrimaryKey(yearReport);
@@ -787,6 +788,8 @@ public class ProduceReportServiceImpl extends BaseServiceImpl<ProduceReportMappe
         // 本月耗用:更新
         month1.setMonth(date.getMonthValue());
         ProduceReportVO monthVO = this.sumMonthYear(month1);
+        log.info("monthVO.getTotalValue(): " + monthVO.getTotalValue());
+
         // 查找月
         ProduceReport monthReport = new ProduceReport();
         monthReport.setNo(prefix + no + "_month");
@@ -794,7 +797,7 @@ public class ProduceReportServiceImpl extends BaseServiceImpl<ProduceReportMappe
         monthReport.setYear(date.getYear());
         monthReport.setMonth(date.getMonthValue());
         monthReport = super.getModelListByModel(monthReport).get(0);
-        monthReport.setValue(monthVO.getTotalValue());
+        monthReport.setValue(new BigDecimal(monthVO.getTotalValue()).setScale(2).toString());
         monthReport.setUpdateTime(LocalDateTime.now());
         monthReport.setUpdateUserId(SecurityUtils.getUserInfo().getUserId());
         mapper.updateByPrimaryKey(monthReport);