mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 23:57:12 +08:00
bugfix
This commit is contained in:
@@ -8,6 +8,7 @@ import cn.lihongjie.coal.coalWashingDailyAnalysis.entity.CoalWashingDailyAnalysi
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.MappingConstants;
|
||||
import org.mapstruct.control.DeepClone;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
@@ -30,6 +31,12 @@ public interface RoundMapper {
|
||||
return d;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
return new BigDecimal(d).setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
} catch (Exception e) {
|
||||
LoggerFactory.getLogger(RoundMapper.class).info("error when round double: {}", d, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user