|
@@ -236,13 +236,24 @@ public class AssetServiceImpl implements AssetService {
|
|
|
@Override
|
|
|
public ReturnMsg getAssetShareRanking(IocParam iocParam) {
|
|
|
List<Cake> list = new ArrayList<>();
|
|
|
+ ThreadLocalRandom random = ThreadLocalRandom.current();
|
|
|
+ List<Integer> datas = new ArrayList<>();
|
|
|
+ Integer total = 0;
|
|
|
+ for(int i=0;i<6;i++){
|
|
|
+ Integer data = random.nextInt(50,150);
|
|
|
+ datas.add(data);
|
|
|
+ total+=data;
|
|
|
+ }
|
|
|
+ for(int i=0;i<datas.size();i++){
|
|
|
+ Cake cake = new Cake();
|
|
|
+ int j = i+1;
|
|
|
+ cake.setName("资产"+j);
|
|
|
+ double p = MathUtils.division(datas.get(i),total,4)*100;
|
|
|
+ cake.setValue(MathUtils.division(p,1,2));
|
|
|
+ list.add(cake);
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
- list.add(new Cake("资产1"));
|
|
|
- list.add(new Cake("资产2"));
|
|
|
- list.add(new Cake("资产3"));
|
|
|
- list.add(new Cake("资产4"));
|
|
|
- list.add(new Cake("资产5"));
|
|
|
- list.add(new Cake("资产6"));
|
|
|
return ReturnMsg.ok(list);
|
|
|
}
|
|
|
|