|
@@ -437,7 +437,6 @@ public class ProduceReportServiceImpl extends BaseServiceImpl<ProduceReportMappe
|
|
|
public void generateDianReport(LocalDate date, List<ProduceReport> sclList) {
|
|
|
|
|
|
// 电力记录数据
|
|
|
- // 统计当天数据
|
|
|
ProduceRecord find = new ProduceRecord();
|
|
|
find.setProductNo("电");
|
|
|
find.setDate(date);
|
|
@@ -517,15 +516,16 @@ public class ProduceReportServiceImpl extends BaseServiceImpl<ProduceReportMappe
|
|
|
ProduceReport dayHy = BeanConverterUtil.copyObjectProperties(produceData, ProduceReport.class);
|
|
|
dayHy.setDate(date);
|
|
|
dayHy.setDataId(produceData.getId());
|
|
|
-
|
|
|
+ log.info("produceRecord.getNum():" + produceRecord.getNum() + ", dayScl.getValue():" + dayScl.getValue());
|
|
|
if (dayScl == null || dayScl.getValue().compareTo("1") == 0) {
|
|
|
dayHy.setValue("1");
|
|
|
} else {
|
|
|
if (new BigDecimal(dayScl.getValue()).compareTo(new BigDecimal("0")) == 0) {
|
|
|
- dayHy.setValue(produceRecord.getNum().setScale(0, RoundingMode.HALF_UP).toString());
|
|
|
+ dayHy.setValue("0");
|
|
|
} else {
|
|
|
- BigDecimal hyDayValue = new BigDecimal(produceRecord.getNum().toString()).divide(new BigDecimal(dayScl.getValue()).multiply(new BigDecimal(1)), BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(1000)).setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal hyDayValue = new BigDecimal(produceRecord.getNum().toString()).divide(new BigDecimal(dayScl.getValue()).multiply(new BigDecimal(1)), BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
dayHy.setValue(hyDayValue.toString());
|
|
|
+ log.info("dayHy" + dayHy);
|
|
|
}
|
|
|
}
|
|
|
dayHy.setYear(date.getYear());
|
|
@@ -545,7 +545,7 @@ public class ProduceReportServiceImpl extends BaseServiceImpl<ProduceReportMappe
|
|
|
monthScl.setValue("1");
|
|
|
} else {
|
|
|
if (new BigDecimal(monthScl.getValue()).compareTo(new BigDecimal("0")) == 0) {
|
|
|
- monthHy.setValue(new BigDecimal(monthVO.getTotalValue()).setScale(0, RoundingMode.HALF_UP).toString());
|
|
|
+ monthHy.setValue("0");
|
|
|
} else {
|
|
|
BigDecimal hyDayValue = new BigDecimal(monthVO.getTotalValue()).divide(new BigDecimal(monthScl.getValue()).multiply(new BigDecimal(1)), BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(1000)).setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
monthHy.setValue(hyDayValue.toString());
|
|
@@ -1502,12 +1502,10 @@ public class ProduceReportServiceImpl extends BaseServiceImpl<ProduceReportMappe
|
|
|
ProduceReport monthHy = BeanConverterUtil.copyObjectProperties(hyMonth, ProduceReport.class);
|
|
|
monthHy.setDate(date);
|
|
|
monthHy.setDataId(hyMonth.getId());
|
|
|
- log.info("monthVO.getTotalValue():" + monthReport.getValue() + ", monthScl.getValue():" + monthScl.getValue());
|
|
|
if (new BigDecimal("0").compareTo(new BigDecimal(monthReport.getValue())) == 0 || new BigDecimal(monthScl.getValue()).compareTo(new BigDecimal(0)) <= 0) {
|
|
|
monthHy.setValue("0");
|
|
|
} else {
|
|
|
BigDecimal hyMonthValue = (new BigDecimal(monthReport.getValue()).divide(new BigDecimal(monthScl.getValue()).multiply(new BigDecimal(1)), RoundingMode.HALF_UP)).setScale(2, RoundingMode.HALF_UP);
|
|
|
- log.info("hyMonthValue: " + hyMonthValue);
|
|
|
monthHy.setValue(hyMonthValue.toString());
|
|
|
}
|
|
|
monthHy.setYear(date.getYear());
|