|
@@ -16,10 +16,7 @@ import com.sky.ioc.mapper.space.BuildingRoomMapper;
|
|
import com.sky.ioc.mapper.space.BuildingStationMapper;
|
|
import com.sky.ioc.mapper.space.BuildingStationMapper;
|
|
import com.sky.ioc.service.space.BuildingFloorService;
|
|
import com.sky.ioc.service.space.BuildingFloorService;
|
|
import com.sky.ioc.service.space.SpaceService;
|
|
import com.sky.ioc.service.space.SpaceService;
|
|
-import com.sky.ioc.tool.DateUtil;
|
|
|
|
-import com.sky.ioc.tool.FalseData;
|
|
|
|
-import com.sky.ioc.tool.GeneralMethod;
|
|
|
|
-import com.sky.ioc.tool.ReturnMsg;
|
|
|
|
|
|
+import com.sky.ioc.tool.*;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -224,24 +221,13 @@ public class SpaceServiceImpl implements SpaceService {
|
|
List<JSONObject> objects = indeicator.getList();
|
|
List<JSONObject> objects = indeicator.getList();
|
|
ThreadLocalRandom random = ThreadLocalRandom.current();
|
|
ThreadLocalRandom random = ThreadLocalRandom.current();
|
|
DecimalFormat decimalFormat = new DecimalFormat("#.0");
|
|
DecimalFormat decimalFormat = new DecimalFormat("#.0");
|
|
- Integer result = 0;
|
|
|
|
|
|
+ double result = 0;
|
|
Long totalStation = buildingStationMapper.selectCount(new LambdaQueryWrapper<BuildingStation>().eq(BuildingStation::getIsDel,0));
|
|
Long totalStation = buildingStationMapper.selectCount(new LambdaQueryWrapper<BuildingStation>().eq(BuildingStation::getIsDel,0));
|
|
Long usedStation = buildingStationMapper.selectCount(new LambdaQueryWrapper<BuildingStation>().eq(BuildingStation::getIsDel,0).eq(BuildingStation::getStatus,2));
|
|
Long usedStation = buildingStationMapper.selectCount(new LambdaQueryWrapper<BuildingStation>().eq(BuildingStation::getIsDel,0).eq(BuildingStation::getStatus,2));
|
|
- // 创建一个数值格式化对象
|
|
|
|
- NumberFormat numberFormat = NumberFormat.getInstance();
|
|
|
|
- // 设置精确到小数点后2位
|
|
|
|
- numberFormat.setMaximumFractionDigits(0);
|
|
|
|
- if (totalStation>0) {
|
|
|
|
- result = Integer.parseInt(numberFormat.format((float) usedStation / (float) totalStation * 100));
|
|
|
|
- }
|
|
|
|
|
|
+ result = MathUtils.division(usedStation,totalStation,2);
|
|
Long flowStation = buildingStationMapper.selectCount(new LambdaQueryWrapper<BuildingStation>().eq(BuildingStation::getIsDel,0).eq(BuildingStation::getIsBlock,1));
|
|
Long flowStation = buildingStationMapper.selectCount(new LambdaQueryWrapper<BuildingStation>().eq(BuildingStation::getIsDel,0).eq(BuildingStation::getIsBlock,1));
|
|
-
|
|
|
|
Long fixedStation = buildingStationMapper.selectCount(new LambdaQueryWrapper<BuildingStation>().eq(BuildingStation::getIsDel,0).eq(BuildingStation::getIsBlock,0));
|
|
Long fixedStation = buildingStationMapper.selectCount(new LambdaQueryWrapper<BuildingStation>().eq(BuildingStation::getIsDel,0).eq(BuildingStation::getIsBlock,0));
|
|
-
|
|
|
|
- // int siteUsed = random.nextInt(10, 100);
|
|
|
|
int meettingUsed = random.nextInt(10, 100);
|
|
int meettingUsed = random.nextInt(10, 100);
|
|
- /* int flowCount = random.nextInt(100, 500);
|
|
|
|
- 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) {
|