|
@@ -405,13 +405,13 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
|
|
|
switch (dateType) {
|
|
|
case "r":
|
|
|
- dto.setValue(i.getRfwjsl().divide(new BigDecimal(pointCode.getRatio())));
|
|
|
+ dto.setValue(compare100(i.getRfwjsl().divide(new BigDecimal(pointCode.getRatio()))));
|
|
|
break;
|
|
|
case "y":
|
|
|
- dto.setValue(i.getYfwjsl().divide(new BigDecimal(pointCode.getRatio())));
|
|
|
+ dto.setValue(compare100(i.getYfwjsl().divide(new BigDecimal(pointCode.getRatio()))));
|
|
|
break;
|
|
|
case "n":
|
|
|
- dto.setValue(i.getNfwjsl().divide(new BigDecimal(pointCode.getRatio())));
|
|
|
+ dto.setValue(compare100(i.getNfwjsl().divide(new BigDecimal(pointCode.getRatio()))));
|
|
|
break;
|
|
|
}
|
|
|
dtos.add(dto);
|
|
@@ -434,13 +434,13 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
|
|
|
switch (dateType) {
|
|
|
case "r":
|
|
|
- dto.setValue(i.getRztzhjsl().divide(new BigDecimal(pointCode.getRatio())));
|
|
|
+ dto.setValue(compare100(i.getRztzhjsl().divide(new BigDecimal(pointCode.getRatio()))));
|
|
|
break;
|
|
|
case "y":
|
|
|
- dto.setValue(i.getYztzhjsl().divide(new BigDecimal(pointCode.getRatio())));
|
|
|
+ dto.setValue(compare100(i.getYztzhjsl().divide(new BigDecimal(pointCode.getRatio()))));
|
|
|
break;
|
|
|
case "n":
|
|
|
- dto.setValue(i.getNztzhjsl().divide(new BigDecimal(pointCode.getRatio())));
|
|
|
+ dto.setValue(compare100(i.getNztzhjsl().divide(new BigDecimal(pointCode.getRatio()))));
|
|
|
break;
|
|
|
}
|
|
|
dtos.add(dto);
|
|
@@ -463,13 +463,13 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
|
|
|
switch (dateType) {
|
|
|
case "r":
|
|
|
- dto.setValue(i.getRgzxqjsl().divide(new BigDecimal(pointCode.getRatio())));
|
|
|
+ dto.setValue(compare100(i.getRgzxqjsl().divide(new BigDecimal(pointCode.getRatio()))));
|
|
|
break;
|
|
|
case "y":
|
|
|
- dto.setValue(i.getYgzxqjsl().divide(new BigDecimal(pointCode.getRatio())));
|
|
|
+ dto.setValue(compare100(i.getYgzxqjsl().divide(new BigDecimal(pointCode.getRatio()))));
|
|
|
break;
|
|
|
case "n":
|
|
|
- dto.setValue(i.getNgzxqjsl().divide(new BigDecimal(pointCode.getRatio())));
|
|
|
+ dto.setValue(compare100(i.getNgzxqjsl().divide(new BigDecimal(pointCode.getRatio()))));
|
|
|
break;
|
|
|
}
|
|
|
dtos.add(dto);
|
|
@@ -633,11 +633,21 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
private BigDecimal compare100(BigDecimal a) {
|
|
|
BigDecimal b = new BigDecimal(100);
|
|
|
+
|
|
|
+ if (null == a) {
|
|
|
+ a = new BigDecimal(0);
|
|
|
+
|
|
|
+ }
|
|
|
if (b.compareTo(a) == -1) {
|
|
|
a = new BigDecimal(100);
|
|
|
- ;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (a.compareTo(BigDecimal.ZERO) == -1) {
|
|
|
+ a = new BigDecimal(0);
|
|
|
}
|
|
|
return a;
|
|
|
|