Commit 0958f32d by 杨伟程

时长分布string转integer报错

parent b93fe24b
package com.makeit.utils.data.convert; package com.makeit.utils.data.convert;
import com.makeit.utils.old.StringUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
public class MathUtil { public class MathUtil {
public static Integer stringToInteger(String s) {
if (StringUtils.isBlank(s)) {
return null;
}
return Integer.valueOf(s + "");
}
public static int divideZero(int a, int b) { public static int divideZero(int a, int b) {
if (b == 0) { if (b == 0) {
return 0; return 0;
......
...@@ -18,6 +18,7 @@ import com.makeit.service.platform.alarm.PlatAlarmRecordService; ...@@ -18,6 +18,7 @@ import com.makeit.service.platform.alarm.PlatAlarmRecordService;
import com.makeit.service.platform.alarm.PlatDayDurationRecordService; import com.makeit.service.platform.alarm.PlatDayDurationRecordService;
import com.makeit.service.platform.elder.*; import com.makeit.service.platform.elder.*;
import com.makeit.utils.LongTimestampUtil; import com.makeit.utils.LongTimestampUtil;
import com.makeit.utils.data.convert.MathUtil;
import com.makeit.utils.data.convert.StreamUtil; import com.makeit.utils.data.convert.StreamUtil;
import com.makeit.utils.data.validate.CollectionUtils; import com.makeit.utils.data.validate.CollectionUtils;
import com.makeit.utils.old.StringUtils; import com.makeit.utils.old.StringUtils;
...@@ -290,7 +291,7 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe ...@@ -290,7 +291,7 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe
//vo.setRoomId(e.get); //vo.setRoomId(e.get);
vo.setRoomName(e.getRegionName()); vo.setRoomName(e.getRegionName());
vo.setDuration(Integer.valueOf(e.getAbnormalValue() + "")); vo.setDuration(MathUtil.stringToInteger(e.getAbnormalValue()));
return vo; return vo;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment