From 8085bc4860f7efdf5c7fc7c9f891ccfe0bfd8312 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期五, 11 八月 2023 11:32:00 +0800 Subject: [PATCH] 1 --- src/main/java/com/yssh/service/XlsReportService.java | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/yssh/service/XlsReportService.java b/src/main/java/com/yssh/service/XlsReportService.java index c8ea350..8e8d642 100644 --- a/src/main/java/com/yssh/service/XlsReportService.java +++ b/src/main/java/com/yssh/service/XlsReportService.java @@ -169,7 +169,7 @@ double ljjz = mapper.selectYearAccumulate(yyyy + "%", name); // 浠婂勾绱鍧囧�� double qnLjjz = mapper.selectYearAccumulate(lastYear + "%", name); // 鍘诲勾绱鍧囧�� - double ljtb = CalculateUtils.round2((ljjz - qnLjjz) / qnLjjz * 100); // 绱鍚屾瘮 + String ljtb = 0 == qnLjjz ? "--" : CalculateUtils.round2((ljjz - qnLjjz) / qnLjjz * 100) + "%"; // 绱鍚屾瘮 MonitorPointPosition point = commonService.select3dCheckPointByName(name); String id = point.getId().substring(0, point.getId().lastIndexOf("_") + 1) + "0"; @@ -177,7 +177,7 @@ List<SuYuan700> suList = mapper.selectSuYuanByStartAndEnd(id, name, yjz, dayStart, end); String ys = getYs(suList); // 鍙楀奖鍝嶅洜绱犲強鍘熷洜 - list.add(new DayExcel(rjz + "", lj + "", ljtb + "%", ys, "", "", "")); + list.add(new DayExcel("" + rjz, "" + lj, ljtb, ys, "", "", "")); } saveResult("day", yesterday, list); } catch (Exception ex) { @@ -217,28 +217,28 @@ double sz = mapper.selectAccumulate(intMon, intSun, name); // 涓婂懆 double ssz = mapper.selectAccumulate(intLastMon, intLastSun, name); // 涓婁笂鍛� - double zhb = CalculateUtils.round2((sz - ssz) / ssz * 100); // 鍛ㄧ幆姣� + String zhb = 0 == ssz ? "--" : CalculateUtils.round2((sz - ssz) / ssz * 100) + "%"; // 鍛ㄧ幆姣� double qntq = mapper.selectAccumulate(intLastYear1, intLastYear7, name); // 鍘诲勾鍚屾湡 - double ztq = CalculateUtils.round2((sz - qntq) / qntq * 100); // 鍛ㄥ悓鏈� + String ztq = 0 == qntq ? "--" : CalculateUtils.round2((sz - qntq) / qntq * 100) + "%"; // 鍛ㄥ悓鏈� double qntz = mapper.selectAccumulate(intLastYearMon, intLastYearSun, name); // 鍘诲勾鍚屽懆 - double ztb = CalculateUtils.round2((sz - qntz) / qntz * 100); // 鍛ㄥ悓姣� + String ztb = 0 == qntz ? "--" : CalculateUtils.round2((sz - qntz) / qntz * 100) + "%"; // 鍛ㄥ悓姣� double lj = mapper.selectAccumulate(yearStart, intSun, name); // 绱 double ljjz = mapper.selectYearAccumulate(yyyy + "%", name); // 浠婂勾绱鍧囧�� double qnLjjz = mapper.selectYearAccumulate(lastYear + "%", name); // 鍘诲勾绱鍧囧�� - double ljtb = CalculateUtils.round2((ljjz - qnLjjz) / qnLjjz * 100); // 绱鍚屾瘮 + String ljtb = 0 == qnLjjz ? "--" : CalculateUtils.round2((ljjz - qnLjjz) / qnLjjz * 100) + "%"; // 绱鍚屾瘮 - double syn = CalculateUtils.round2((ljjz - qnLjjz) / qnLjjz * 100); // 杈冧笂涓�骞村害鍙樺寲骞呭害 + String syn = 0 == qnLjjz ? "--" : CalculateUtils.round2((ljjz - qnLjjz) / qnLjjz * 100) + "%"; // 杈冧笂涓�骞村害鍙樺寲骞呭害 MonitorPointPosition point = commonService.select3dCheckPointByName(name); String id = point.getId().substring(0, point.getId().lastIndexOf("_") + 1) + "0"; List<SuYuan700> suList = mapper.selectSuYuanByStartAndEnd(id, name, yjz, intMon, intSun); String ys = getYs(suList); // 鍙楀奖鍝嶅洜绱犲強鍘熷洜 - list.add(new WeekExcel(sz + "", zhb + "%", ztq + "", ztb + "%", lj + "", ljtb + "", syn + "", ys, "", "", "")); + list.add(new WeekExcel("" + sz, zhb, ztq, ztb, "" + lj, ljtb, syn, ys, "", "", "")); } saveResult("week", sun, list); } catch (Exception ex) { -- Gitblit v1.9.3