|
@@ -19,11 +19,15 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.text.DecimalFormat;
|
|
import java.text.DecimalFormat;
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
import java.util.concurrent.ThreadLocalRandom;
|
|
import java.util.concurrent.ThreadLocalRandom;
|
|
|
|
|
|
/**
|
|
/**
|
|
* TODO 空间
|
|
* TODO 空间
|
|
|
|
+ *
|
|
* @Description
|
|
* @Description
|
|
* @Author LunCe
|
|
* @Author LunCe
|
|
* @Date 2023/2/22 11:44
|
|
* @Date 2023/2/22 11:44
|
|
@@ -39,6 +43,7 @@ public class SpaceServiceImpl implements SpaceService {
|
|
|
|
|
|
/**
|
|
/**
|
|
* TODO 智能看板 -- 楼宇态势
|
|
* TODO 智能看板 -- 楼宇态势
|
|
|
|
+ *
|
|
* @Description
|
|
* @Description
|
|
* @Return com.sky.ioc.tool.ReturnMsg
|
|
* @Return com.sky.ioc.tool.ReturnMsg
|
|
* @Author LunCe
|
|
* @Author LunCe
|
|
@@ -47,10 +52,10 @@ public class SpaceServiceImpl implements SpaceService {
|
|
@Override
|
|
@Override
|
|
public ReturnMsg getBuildingSituation() {
|
|
public ReturnMsg getBuildingSituation() {
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
- jsonObject.put("builtArea",112893);
|
|
|
|
- jsonObject.put("layersInt",21);
|
|
|
|
- jsonObject.put("serviceLife",60);
|
|
|
|
- jsonObject.put("constructionPeriod",80);
|
|
|
|
|
|
+ jsonObject.put("builtArea", 112893);
|
|
|
|
+ jsonObject.put("layersInt", 21);
|
|
|
|
+ jsonObject.put("serviceLife", 60);
|
|
|
|
+ jsonObject.put("constructionPeriod", 80);
|
|
return ReturnMsg.ok(jsonObject);
|
|
return ReturnMsg.ok(jsonObject);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -59,24 +64,24 @@ public class SpaceServiceImpl implements SpaceService {
|
|
Indeicator indeicator = new Indeicator();
|
|
Indeicator indeicator = new Indeicator();
|
|
List<JSONObject> objects = indeicator.getList();
|
|
List<JSONObject> objects = indeicator.getList();
|
|
BuildingSpace buildingSpace = buildingSpaceMapper.getByTier(iocParam);
|
|
BuildingSpace buildingSpace = buildingSpaceMapper.getByTier(iocParam);
|
|
- if(buildingSpace!=null){
|
|
|
|
- objects.get(0).put("value",buildingSpace.getUsedStation());
|
|
|
|
- objects.get(1).put("value",buildingSpace.getStationCount());
|
|
|
|
- objects.get(2).put("value",buildingSpace.getWorkArea());
|
|
|
|
- objects.get(3).put("value",buildingSpace.getMeetingArea());
|
|
|
|
|
|
+ if (buildingSpace != null) {
|
|
|
|
+ objects.get(0).put("value", buildingSpace.getUsedStation());
|
|
|
|
+ objects.get(1).put("value", buildingSpace.getStationCount());
|
|
|
|
+ objects.get(2).put("value", buildingSpace.getWorkArea());
|
|
|
|
+ objects.get(3).put("value", buildingSpace.getMeetingArea());
|
|
objects.add(new JSONObject());
|
|
objects.add(new JSONObject());
|
|
objects.add(new JSONObject());
|
|
objects.add(new JSONObject());
|
|
- objects.get(4).put("value",buildingSpace.getLeadArea());
|
|
|
|
- objects.get(5).put("value",buildingSpace.getOtherArea());
|
|
|
|
- }else {
|
|
|
|
- objects.get(0).put("value",0);
|
|
|
|
- objects.get(1).put("value",0);
|
|
|
|
- objects.get(2).put("value",0);
|
|
|
|
- objects.get(3).put("value",0);
|
|
|
|
|
|
+ objects.get(4).put("value", buildingSpace.getLeadArea());
|
|
|
|
+ objects.get(5).put("value", buildingSpace.getOtherArea());
|
|
|
|
+ } else {
|
|
|
|
+ objects.get(0).put("value", 0);
|
|
|
|
+ objects.get(1).put("value", 0);
|
|
|
|
+ objects.get(2).put("value", 0);
|
|
|
|
+ objects.get(3).put("value", 0);
|
|
objects.add(new JSONObject());
|
|
objects.add(new JSONObject());
|
|
objects.add(new JSONObject());
|
|
objects.add(new JSONObject());
|
|
- objects.get(4).put("value",0);
|
|
|
|
- objects.get(5).put("value",0);
|
|
|
|
|
|
+ objects.get(4).put("value", 0);
|
|
|
|
+ objects.get(5).put("value", 0);
|
|
}
|
|
}
|
|
|
|
|
|
indeicator.setList(objects);
|
|
indeicator.setList(objects);
|
|
@@ -91,8 +96,18 @@ public class SpaceServiceImpl implements SpaceService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public ReturnMsg getFloorList(IocParam iocParam) {
|
|
public ReturnMsg getFloorList(IocParam iocParam) {
|
|
-
|
|
|
|
- return null;
|
|
|
|
|
|
+ List<BuildingSpace> list = buildingSpaceMapper.getListByTier(iocParam);
|
|
|
|
+ List<Map<String, String>> lists = new ArrayList<>();
|
|
|
|
+ for (BuildingSpace buildingSpace:list) {
|
|
|
|
+ Map<String, String> map = new HashMap();
|
|
|
|
+ map.put("floor",buildingSpace.getTier()+"");
|
|
|
|
+ map.put("leader",buildingSpace.getLeadArea()+"");
|
|
|
|
+ map.put("meeting",buildingSpace.getMeetingArea()+"");
|
|
|
|
+ map.put("work",buildingSpace.getWorkArea()+"");
|
|
|
|
+ map.put("print",buildingSpace.getPrintArea()+"");
|
|
|
|
+ lists.add(map);
|
|
|
|
+ }
|
|
|
|
+ return ReturnMsg.ok(lists);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -118,17 +133,17 @@ public class SpaceServiceImpl implements SpaceService {
|
|
|
|
|
|
objects.get(3).put("value",personDayPrice);
|
|
objects.get(3).put("value",personDayPrice);
|
|
objects.get(3).put("compare",compare);*/
|
|
objects.get(3).put("compare",compare);*/
|
|
- objects.get(0).put("value",95);
|
|
|
|
- objects.get(0).put("compare",0.4);
|
|
|
|
|
|
+ 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(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(2).put("value", 80);
|
|
|
|
+ objects.get(2).put("compare", 0.4);
|
|
|
|
|
|
- objects.get(3).put("value",8);
|
|
|
|
- objects.get(3).put("compare",0.4);
|
|
|
|
|
|
+ objects.get(3).put("value", 8);
|
|
|
|
+ objects.get(3).put("compare", 0.4);
|
|
indeicator.setWorthAttention("增加会议室");
|
|
indeicator.setWorthAttention("增加会议室");
|
|
indeicator.setList(objects);
|
|
indeicator.setList(objects);
|
|
return ReturnMsg.ok(indeicator);
|
|
return ReturnMsg.ok(indeicator);
|
|
@@ -142,16 +157,16 @@ public class SpaceServiceImpl implements SpaceService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public ReturnMsg getMeetingCostTrend(IocParam iocParam) {
|
|
public ReturnMsg getMeetingCostTrend(IocParam iocParam) {
|
|
- String[] param = {"shichang","bangong","chanpin","zhihui","yewu","qita"};
|
|
|
|
- String[] labKey = {"1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"};
|
|
|
|
|
|
+ String[] param = {"shichang", "bangong", "chanpin", "zhihui", "yewu", "qita"};
|
|
|
|
+ String[] labKey = {"1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"};
|
|
List<Label> labels1 = GeneralMethod.getInstance().dataGeneration(param, labKey);
|
|
List<Label> labels1 = GeneralMethod.getInstance().dataGeneration(param, labKey);
|
|
return ReturnMsg.ok(labels1);
|
|
return ReturnMsg.ok(labels1);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public ReturnMsg getSpaceInfo(IocParam iocParam) {
|
|
public ReturnMsg getSpaceInfo(IocParam iocParam) {
|
|
- String[] param = {"administrativeArea","leisureArea"};
|
|
|
|
- String[] labKey = {"1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"};
|
|
|
|
|
|
+ String[] param = {"administrativeArea", "leisureArea"};
|
|
|
|
+ String[] labKey = {"1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"};
|
|
List<Label> labels1 = GeneralMethod.getInstance().dataGeneration(param, labKey);
|
|
List<Label> labels1 = GeneralMethod.getInstance().dataGeneration(param, labKey);
|
|
return ReturnMsg.ok(labels1);
|
|
return ReturnMsg.ok(labels1);
|
|
}
|
|
}
|
|
@@ -168,26 +183,26 @@ public class SpaceServiceImpl implements SpaceService {
|
|
int fixedCount = random.nextInt(300, 1000);
|
|
int fixedCount = random.nextInt(300, 1000);
|
|
int playCount = random.nextInt(100, 500);
|
|
int playCount = random.nextInt(100, 500);
|
|
int workCount = random.nextInt(300, 1000);
|
|
int workCount = random.nextInt(300, 1000);
|
|
- while (playCount>workCount){
|
|
|
|
|
|
+ while (playCount > workCount) {
|
|
playCount = random.nextInt(100, 500);
|
|
playCount = random.nextInt(100, 500);
|
|
}
|
|
}
|
|
float compare = (float) Math.random();
|
|
float compare = (float) Math.random();
|
|
compare = Float.parseFloat(decimalFormat.format(compare));
|
|
compare = Float.parseFloat(decimalFormat.format(compare));
|
|
|
|
|
|
- objects.get(0).put("value",siteUsed);
|
|
|
|
- objects.get(0).put("compare",compare);
|
|
|
|
|
|
+ objects.get(0).put("value", siteUsed);
|
|
|
|
+ objects.get(0).put("compare", compare);
|
|
|
|
|
|
- objects.get(1).put("value",meettingUsed);
|
|
|
|
- objects.get(1).put("compare",compare);
|
|
|
|
|
|
+ objects.get(1).put("value", meettingUsed);
|
|
|
|
+ objects.get(1).put("compare", compare);
|
|
|
|
|
|
- objects.get(2).put("value",flowCount);
|
|
|
|
- objects.get(2).put("compare",compare);
|
|
|
|
|
|
+ objects.get(2).put("value", flowCount);
|
|
|
|
+ objects.get(2).put("compare", compare);
|
|
|
|
|
|
- objects.get(3).put("value",fixedCount);
|
|
|
|
- objects.get(3).put("compare",compare);
|
|
|
|
|
|
+ objects.get(3).put("value", fixedCount);
|
|
|
|
+ objects.get(3).put("compare", compare);
|
|
objects.add(new JSONObject());
|
|
objects.add(new JSONObject());
|
|
- objects.get(4).put("value",playCount+"/"+workCount);
|
|
|
|
- objects.get(4).put("compare",compare);
|
|
|
|
|
|
+ objects.get(4).put("value", playCount + "/" + workCount);
|
|
|
|
+ objects.get(4).put("compare", compare);
|
|
|
|
|
|
indeicator.setWorthAttention("会议室使用率过低,建议出租");
|
|
indeicator.setWorthAttention("会议室使用率过低,建议出租");
|
|
indeicator.setList(objects);
|
|
indeicator.setList(objects);
|
|
@@ -198,26 +213,26 @@ public class SpaceServiceImpl implements SpaceService {
|
|
public ReturnMsg getSpaceOverview() {
|
|
public ReturnMsg getSpaceOverview() {
|
|
JSONArray jsonArray = new JSONArray();
|
|
JSONArray jsonArray = new JSONArray();
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
- jsonObject.put("total",2000);
|
|
|
|
- jsonObject.put("occupancy",1800);
|
|
|
|
- jsonObject.put("percentage",0.75);
|
|
|
|
|
|
+ jsonObject.put("total", 2000);
|
|
|
|
+ jsonObject.put("occupancy", 1800);
|
|
|
|
+ jsonObject.put("percentage", 0.75);
|
|
|
|
|
|
JSONObject jsonObject2 = new JSONObject();
|
|
JSONObject jsonObject2 = new JSONObject();
|
|
- jsonObject2.put("total",2000);
|
|
|
|
- jsonObject2.put("occupancy",1800);
|
|
|
|
- jsonObject2.put("percentage",0.97);
|
|
|
|
|
|
+ jsonObject2.put("total", 2000);
|
|
|
|
+ jsonObject2.put("occupancy", 1800);
|
|
|
|
+ jsonObject2.put("percentage", 0.97);
|
|
|
|
|
|
JSONObject jsonObject3 = new JSONObject();
|
|
JSONObject jsonObject3 = new JSONObject();
|
|
- jsonObject3.put("total",2000);
|
|
|
|
- jsonObject3.put("occupancy",1800);
|
|
|
|
- jsonObject3.put("percentage",0.93);
|
|
|
|
|
|
+ jsonObject3.put("total", 2000);
|
|
|
|
+ jsonObject3.put("occupancy", 1800);
|
|
|
|
+ jsonObject3.put("percentage", 0.93);
|
|
jsonArray.add(jsonObject);
|
|
jsonArray.add(jsonObject);
|
|
jsonArray.add(jsonObject2);
|
|
jsonArray.add(jsonObject2);
|
|
jsonArray.add(jsonObject3);
|
|
jsonArray.add(jsonObject3);
|
|
|
|
|
|
|
|
|
|
JSONObject jsonObject1 = new JSONObject();
|
|
JSONObject jsonObject1 = new JSONObject();
|
|
- jsonObject1.put("data",jsonArray);
|
|
|
|
|
|
+ jsonObject1.put("data", jsonArray);
|
|
return ReturnMsg.ok(jsonObject1);
|
|
return ReturnMsg.ok(jsonObject1);
|
|
}
|
|
}
|
|
}
|
|
}
|