|
@@ -11,6 +11,7 @@ import com.sky.ioc.entity.domain.system.Users;
|
|
|
import com.sky.ioc.entity.params.IocParam;
|
|
|
import com.sky.ioc.mapper.AccessSpaceMapper;
|
|
|
import com.sky.ioc.mapper.BuildingSpaceMapper;
|
|
|
+import com.sky.ioc.mapper.MeetingMapper;
|
|
|
import com.sky.ioc.service.space.SpaceService;
|
|
|
import com.sky.ioc.tool.FalseData;
|
|
|
import com.sky.ioc.tool.GeneralMethod;
|
|
@@ -41,6 +42,9 @@ public class SpaceServiceImpl implements SpaceService {
|
|
|
@Autowired
|
|
|
AccessSpaceMapper accessSpaceMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ MeetingMapper meetingMapper;
|
|
|
+
|
|
|
/**
|
|
|
* TODO 智能看板 -- 楼宇态势
|
|
|
*
|
|
@@ -114,36 +118,27 @@ public class SpaceServiceImpl implements SpaceService {
|
|
|
public ReturnMsg getMeetingCoreIndicators(IocParam iocParam) {
|
|
|
Indeicator indeicator = new Indeicator();
|
|
|
List<JSONObject> objects = indeicator.getList();
|
|
|
- /*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);*/
|
|
|
- objects.get(0).put("value", 95);
|
|
|
- objects.get(0).put("compare", 0.4);
|
|
|
+ ThreadLocalRandom random = ThreadLocalRandom.current();
|
|
|
+ Double saturation = meetingMapper.getSaturationByFloorId(iocParam);
|
|
|
+ Double used = meetingMapper.getUsedByFloorId(iocParam);
|
|
|
+ Double cost = meetingMapper.getCostByFloorId(iocParam);
|
|
|
+ Double person_cost = meetingMapper.getPersonCostByFloorId(iocParam);
|
|
|
+ cost = Double.valueOf(decimalFormat.format(cost));
|
|
|
+ person_cost = Double.valueOf(decimalFormat.format(person_cost));
|
|
|
+ double compare = random.nextDouble(-1, 1);
|
|
|
+ compare = Double.parseDouble(decimalFormat.format(compare));
|
|
|
+ objects.get(0).put("value", Double.valueOf(decimalFormat.format(saturation)));
|
|
|
+ objects.get(0).put("compare", compare);
|
|
|
|
|
|
- objects.get(1).put("value", 80);
|
|
|
- objects.get(1).put("compare", 0.4);
|
|
|
+ objects.get(1).put("value", Double.valueOf(decimalFormat.format(used)));
|
|
|
+ objects.get(1).put("compare", compare);
|
|
|
|
|
|
- objects.get(2).put("value", 80);
|
|
|
- objects.get(2).put("compare", 0.4);
|
|
|
+ objects.get(2).put("value", cost);
|
|
|
+ objects.get(2).put("compare", compare);
|
|
|
|
|
|
- objects.get(3).put("value", 8);
|
|
|
- objects.get(3).put("compare", 0.4);
|
|
|
+ objects.get(3).put("value", person_cost);
|
|
|
+ objects.get(3).put("compare", compare);
|
|
|
indeicator.setWorthAttention("增加会议室");
|
|
|
indeicator.setList(objects);
|
|
|
return ReturnMsg.ok(indeicator);
|