From 2105e835225ffd54709a011df79fa2f42e8926f8 Mon Sep 17 00:00:00 2001 From: "autumn.g@foxmail.com" Date: Wed, 21 Jun 2023 10:16:33 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=8A=A0=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PileBillingTemplateServiceImpl.java | 8 ++++---- .../jsowell/pile/vo/web/BillingTemplateVO.java | 16 ++++++++++------ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java index 5ba7ca921..8cf4e4e86 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java @@ -571,7 +571,7 @@ public class PileBillingTemplateServiceImpl implements IPileBillingTemplateServi byte[] PlanLossRatio = Constants.zeroByteArray; // 48个时段费率(半小时为一个时段) - Map> timeMap = billingTemplateVO.getTimeMap(); + Map> timeMap = billingTemplateVO.getTimeMap(); List periodOfTime = DateUtils.getPeriodOfTime(); byte[] timeArray = new byte[periodOfTime.size()]; for (int i = 0; i < periodOfTime.size(); i++) { @@ -596,14 +596,14 @@ public class PileBillingTemplateServiceImpl implements IPileBillingTemplateServi * @param timeMap 尖峰平谷4个类型的时间段,每个类型都包含一个时间段集合 * @return */ - private byte getTimeType(String timeRange, Map> timeMap) { + private byte getTimeType(String timeRange, Map> timeMap) { byte b = 5; // 这里的timeRange是00:00-00:30 这样的格式 String[] split = timeRange.split("-"); LocalTime startTime1 = DateUtils.getLocalTime(split[0]); LocalTime endTime1 = DateUtils.getLocalTime(split[1]); - for (Map.Entry> entry : timeMap.entrySet()) { + for (Map.Entry> entry : timeMap.entrySet()) { List value = entry.getValue().stream().filter(StringUtils::isNotBlank).collect(Collectors.toList()); // 每个类型时间段集合 if (CollectionUtils.isEmpty(value)) { continue; @@ -616,7 +616,7 @@ public class PileBillingTemplateServiceImpl implements IPileBillingTemplateServi boolean overlap = DateUtils.isOverlap(startTime1, endTime1, startTime2, endTime2, false); if (overlap) { - return (byte) entry.getKey().intValue(); + return (byte) Integer.parseInt(entry.getKey()); } } } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/BillingTemplateVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/BillingTemplateVO.java index 3d15d66ba..d7237d561 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/BillingTemplateVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/BillingTemplateVO.java @@ -89,19 +89,23 @@ public class BillingTemplateVO { .toString(); } - public Map> getTimeMap() { - Map> resultMap = Maps.newHashMap(); + public Map> getTimeMap() { + Map> resultMap = Maps.newHashMap(); if (StringUtils.isNotBlank(this.getSharpApplyDate())) { - resultMap.put(0x00, Lists.newArrayList(this.getSharpApplyDate().split(","))); + // resultMap.put(0x00, Lists.newArrayList(this.getSharpApplyDate().split(","))); + resultMap.put("00", Lists.newArrayList(this.getSharpApplyDate().split(","))); } if (StringUtils.isNotBlank(this.getPeakApplyDate())) { - resultMap.put(0x01, Lists.newArrayList(this.getPeakApplyDate().split(","))); + // resultMap.put(0x01, Lists.newArrayList(this.getPeakApplyDate().split(","))); + resultMap.put("01", Lists.newArrayList(this.getPeakApplyDate().split(","))); } if (StringUtils.isNotBlank(this.getFlatApplyDate())) { - resultMap.put(0x02, Lists.newArrayList(this.getFlatApplyDate().split(","))); + // resultMap.put(0x02, Lists.newArrayList(this.getFlatApplyDate().split(","))); + resultMap.put("02", Lists.newArrayList(this.getFlatApplyDate().split(","))); } if (StringUtils.isNotBlank(this.getValleyApplyDate())) { - resultMap.put(0x03, Lists.newArrayList(this.getValleyApplyDate().split(","))); + // resultMap.put(0x03, Lists.newArrayList(this.getValleyApplyDate().split(","))); + resultMap.put("03", Lists.newArrayList(this.getValleyApplyDate().split(","))); } return resultMap; }