|
@@ -30,8 +30,27 @@ public class AssetServiceImpl implements AssetService {
|
|
public ReturnMsg getInvestmentDistribution() {
|
|
public ReturnMsg getInvestmentDistribution() {
|
|
String[] param = {"investment1","investment2","investment3","investment4","rateReturn"};
|
|
String[] param = {"investment1","investment2","investment3","investment4","rateReturn"};
|
|
String[] labKey = {"1季度","2季度","3季度","4季度"};
|
|
String[] labKey = {"1季度","2季度","3季度","4季度"};
|
|
|
|
+ ThreadLocalRandom random = ThreadLocalRandom.current();
|
|
List<Label> labels1 = GeneralMethod.getInstance().dataGeneration(param, labKey);
|
|
List<Label> labels1 = GeneralMethod.getInstance().dataGeneration(param, labKey);
|
|
- return ReturnMsg.ok(labels1);
|
|
|
|
|
|
+ List<Label> list = new ArrayList<>();
|
|
|
|
+ for (int i = 0; i < labKey.length; i++) {
|
|
|
|
+ Label label = new Label();
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
+ int i1 = random.nextInt(50, 150);
|
|
|
|
+ int i2 = random.nextInt(50, 150);
|
|
|
|
+ int i3 = random.nextInt(50, 150);
|
|
|
|
+ int i4 = random.nextInt(50, 150);
|
|
|
|
+ int i5 = random.nextInt(10, 100);
|
|
|
|
+ jsonObject.put(param[0],i1);
|
|
|
|
+ jsonObject.put(param[1],i2);
|
|
|
|
+ jsonObject.put(param[2],i3);
|
|
|
|
+ jsonObject.put(param[3],i4);
|
|
|
|
+ jsonObject.put(param[4],i5);
|
|
|
|
+ label.setJsonObject(jsonObject);
|
|
|
|
+ label.setLabel(labKey[i]);
|
|
|
|
+ list.add(label);
|
|
|
|
+ }
|
|
|
|
+ return ReturnMsg.ok(list);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|