|
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.sy.coinage.core.constants.CacheKey;
|
|
|
import com.sy.coinage.core.redis.RedisService;
|
|
|
+import com.sy.coinage.core.util.Arith;
|
|
|
import com.sy.coinage.core.util.DateUtils;
|
|
|
import com.sy.coinage.core.util.RandomUtil;
|
|
|
import com.sy.coinage.core.vo.OptVO;
|
|
@@ -207,9 +208,9 @@ public class ScreenComponent {
|
|
|
}
|
|
|
ScreenProportionVO info = new ScreenProportionVO();
|
|
|
info.setProportionStr1("纪念币库存占比");
|
|
|
- info.setProportion1(proportion1 * 100 / total);
|
|
|
+ info.setProportion1(Arith.div(proportion1 * 100, total, 2));
|
|
|
info.setProportionStr2("流通币库存占比");
|
|
|
- info.setProportion2(proportion2 * 100 / total);
|
|
|
+ info.setProportion2(Arith.div(proportion2 * 100, total, 2));
|
|
|
this.redisService.set("screen_proportion", JSON.toJSONString(info));
|
|
|
}
|
|
|
|
|
@@ -219,8 +220,8 @@ public class ScreenComponent {
|
|
|
if (list != null && list.size() > 0) {
|
|
|
List<String> securities = list.stream().map(item -> item.getSecurities()).collect(Collectors.toList());
|
|
|
data.setName(securities);
|
|
|
- List<Integer> production = new ArrayList<>();
|
|
|
- List<Integer> inventory = new ArrayList<>();
|
|
|
+ List<Double> production = new ArrayList<>();
|
|
|
+ List<Double> inventory = new ArrayList<>();
|
|
|
// 获取所有解缴单
|
|
|
for (ProductPlan productPlan : list) {
|
|
|
Integer totalBox = this.getTotalBox(productPlan.getCrownFrom(), productPlan.getCrownTo());
|
|
@@ -228,10 +229,11 @@ public class ScreenComponent {
|
|
|
if (out != null && out.size() > 0 && totalBox > 0) {
|
|
|
// 取合计箱数
|
|
|
Integer total = out.stream().mapToInt(s -> s.getTotalBoxAmount()).sum();
|
|
|
- Integer r = total * 100 / totalBox;
|
|
|
+ // Integer r = total * 100 / totalBox;
|
|
|
+ Double r = Arith.div(total * 100, totalBox, 2);
|
|
|
production.add(r);
|
|
|
} else {
|
|
|
- production.add(0);
|
|
|
+ production.add(0D);
|
|
|
}
|
|
|
// 获取所有发货计划
|
|
|
Integer totalPalnBox = this.deliveryPlanTotal(productPlan.getProductId());
|
|
@@ -240,10 +242,11 @@ public class ScreenComponent {
|
|
|
if (delivery != null && delivery.size() > 0 && totalPalnBox > 0) {
|
|
|
// 取合计箱数
|
|
|
Integer total = delivery.stream().mapToInt(s -> s.getPlanTotalBox()).sum();
|
|
|
- Integer r = total * 100 / totalPalnBox;
|
|
|
+// Integer r = total * 100 / totalPalnBox;
|
|
|
+ Double r = Arith.div(total * 100, totalPalnBox, 2);
|
|
|
inventory.add(r);
|
|
|
} else {
|
|
|
- inventory.add(0);
|
|
|
+ inventory.add(0D);
|
|
|
}
|
|
|
}
|
|
|
data.setProduction(production);
|