|
@@ -11,7 +11,9 @@ import com.sky.ioc.tool.GeneralMethod;
|
|
|
import com.sky.ioc.tool.ReturnMsg;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.text.DecimalFormat;
|
|
|
import java.util.List;
|
|
|
+import java.util.concurrent.ThreadLocalRandom;
|
|
|
|
|
|
/**
|
|
|
* TODO 空间
|
|
@@ -43,14 +45,33 @@ public class SpaceServiceImpl implements SpaceService {
|
|
|
public ReturnMsg getFloorCoreIndicators(IocDateParam iocDateParam) {
|
|
|
Indeicator indeicator = new Indeicator();
|
|
|
List<JSONObject> objects = indeicator.getList();
|
|
|
- objects.get(0).put("value",90);
|
|
|
- objects.get(1).put("value",500);
|
|
|
- objects.get(2).put("value",380);
|
|
|
- objects.get(3).put("value",80);
|
|
|
+ ThreadLocalRandom random = ThreadLocalRandom.current();
|
|
|
+ int totalSite = random.nextInt(100, 800);
|
|
|
+ int total = random.nextInt(500,2000);
|
|
|
+ while (totalSite>total){
|
|
|
+ totalSite = random.nextInt(100, 800);
|
|
|
+ }
|
|
|
+ int meetting = random.nextInt(150,500);
|
|
|
+ while (meetting>total){
|
|
|
+ meetting = random.nextInt(150,500);
|
|
|
+ }
|
|
|
+ int leader = random.nextInt(15,300);
|
|
|
+ while (leader>total){
|
|
|
+ leader = random.nextInt(15,300);
|
|
|
+ }
|
|
|
+ int other = random.nextInt(15,200);
|
|
|
+ while (other>total){
|
|
|
+ other = random.nextInt(15,200);
|
|
|
+ }
|
|
|
+ int percent = random.nextInt(30,100);
|
|
|
+ objects.get(0).put("value",percent);
|
|
|
+ objects.get(1).put("value",totalSite);
|
|
|
+ objects.get(2).put("value",total);
|
|
|
+ objects.get(3).put("value",meetting);
|
|
|
objects.add(new JSONObject());
|
|
|
objects.add(new JSONObject());
|
|
|
- objects.get(4).put("value",40);
|
|
|
- objects.get(5).put("value",20);
|
|
|
+ objects.get(4).put("value",leader);
|
|
|
+ objects.get(5).put("value",other);
|
|
|
indeicator.setList(objects);
|
|
|
return ReturnMsg.ok(indeicator);
|
|
|
}
|
|
@@ -69,17 +90,25 @@ public class SpaceServiceImpl implements SpaceService {
|
|
|
public ReturnMsg getMeetingCoreIndicators(IocDateParam iocDateParam) {
|
|
|
Indeicator indeicator = new Indeicator();
|
|
|
List<JSONObject> objects = indeicator.getList();
|
|
|
- objects.get(0).put("value",95);
|
|
|
- objects.get(0).put("compare",0.4);
|
|
|
-
|
|
|
- objects.get(1).put("value",80);
|
|
|
- objects.get(1).put("compare",0.4);
|
|
|
-
|
|
|
- objects.get(2).put("value",80);
|
|
|
- objects.get(2).put("compare",0.4);
|
|
|
-
|
|
|
- objects.get(3).put("value",8);
|
|
|
- objects.get(3).put("compare",0.4);
|
|
|
+ ThreadLocalRandom random = ThreadLocalRandom.current();
|
|
|
+ int monthMeeting = random.nextInt(10, 100);
|
|
|
+ int dayMeeting = random.nextInt(10,100);
|
|
|
+ int dayPrice = random.nextInt(15,500);
|
|
|
+ int personDayPrice = dayPrice/10;
|
|
|
+ float compare = (float) Math.random();
|
|
|
+ DecimalFormat decimalFormat = new DecimalFormat("#.0");
|
|
|
+ compare = Float.parseFloat(decimalFormat.format(compare));
|
|
|
+ objects.get(0).put("value",monthMeeting);
|
|
|
+ objects.get(0).put("compare",compare);
|
|
|
+
|
|
|
+ objects.get(1).put("value",dayMeeting);
|
|
|
+ objects.get(1).put("compare",compare);
|
|
|
+
|
|
|
+ objects.get(2).put("value",dayPrice);
|
|
|
+ objects.get(2).put("compare",compare);
|
|
|
+
|
|
|
+ objects.get(3).put("value",personDayPrice);
|
|
|
+ objects.get(3).put("compare",compare);
|
|
|
indeicator.setWorthAttention("增加会议室");
|
|
|
indeicator.setList(objects);
|
|
|
return ReturnMsg.ok(indeicator);
|