parent
43441e4212
commit
82faf95eff
|
@ -213,7 +213,7 @@ public class AbilityCenterControllerV2 {
|
||||||
tAbilityApplicationDTO.setEnclosureName(abilityBatchApplicationDTO.getEnclosureName());
|
tAbilityApplicationDTO.setEnclosureName(abilityBatchApplicationDTO.getEnclosureName());
|
||||||
tAbilityApplicationDTO.setCreateDate(new Date());
|
tAbilityApplicationDTO.setCreateDate(new Date());
|
||||||
tAbilityApplicationDTO.setExpireDate(abilityBatchApplicationDTO.getExpireDate());
|
tAbilityApplicationDTO.setExpireDate(abilityBatchApplicationDTO.getExpireDate());
|
||||||
tAbilityApplicationDTO.setResourceOwnerDept(sysDeptService.getByName(index.get("managementUnitName")));
|
//tAbilityApplicationDTO.setResourceOwnerDept(sysDeptService.getByName(index.get("managementUnitName")));
|
||||||
|
|
||||||
|
|
||||||
// 归为同一次申请
|
// 归为同一次申请
|
||||||
|
@ -233,7 +233,6 @@ public class AbilityCenterControllerV2 {
|
||||||
}).filter(ObjectUtil::isNotNull).collect(Collectors.toList()); // 申请入库
|
}).filter(ObjectUtil::isNotNull).collect(Collectors.toList()); // 申请入库
|
||||||
if (!tAbilityApplicationDTOList.isEmpty()) {
|
if (!tAbilityApplicationDTOList.isEmpty()) {
|
||||||
codeGenerationUtils.setApplyNumber("NLSY", tAbilityApplicationDTOList.stream().map(TAbilityApplicationDTO::getId).collect(Collectors.toList()), jdbcTemplate);
|
codeGenerationUtils.setApplyNumber("NLSY", tAbilityApplicationDTOList.stream().map(TAbilityApplicationDTO::getId).collect(Collectors.toList()), jdbcTemplate);
|
||||||
|
|
||||||
Map<Long, List<TAbilityApplicationDTO>> temp = tAbilityApplicationDTOList.stream()
|
Map<Long, List<TAbilityApplicationDTO>> temp = tAbilityApplicationDTOList.stream()
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.filter(index -> StringUtils.isNotEmpty(index.getResourceId()))
|
.filter(index -> StringUtils.isNotEmpty(index.getResourceId()))
|
||||||
|
@ -262,7 +261,7 @@ public class AbilityCenterControllerV2 {
|
||||||
|
|
||||||
CompletableFuture.runAsync(() -> {
|
CompletableFuture.runAsync(() -> {
|
||||||
String[] sqls = dtoList.stream().map(index -> String.format("UPDATE t_ability_application SET resource_owner_dept = '%s' WHERE id = %s", JSON.toJSONString(sysDeptDTO), index.getId())).collect(Collectors.toList()).toArray(new String[dtoList.size()]);
|
String[] sqls = dtoList.stream().map(index -> String.format("UPDATE t_ability_application SET resource_owner_dept = '%s' WHERE id = %s", JSON.toJSONString(sysDeptDTO), index.getId())).collect(Collectors.toList()).toArray(new String[dtoList.size()]);
|
||||||
jdbcTemplate.batchUpdate(sqls); // 批量更新资源所属部门信息
|
jdbcTemplate.batchUpdate(sqls);// 批量更新资源所属部门信息
|
||||||
logger.info("批量更新申请的资源的部门信息完成");
|
logger.info("批量更新申请的资源的部门信息完成");
|
||||||
}, executor);
|
}, executor);
|
||||||
|
|
||||||
|
|
|
@ -1953,19 +1953,63 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
public Object selectInfrastructureList() {
|
public Object selectInfrastructureList() {
|
||||||
HashMap<String, Object> resultMap = new HashMap<>();
|
HashMap<String, Object> resultMap = new HashMap<>();
|
||||||
//云资源
|
//云资源
|
||||||
CompletableFuture<Void> yzy = CompletableFuture.runAsync(() -> {
|
CompletableFuture<Void> yzy = CompletableFuture.runAsync(() -> resultMap.put("云资源", resourceDao.selectYzyCount()), executor);
|
||||||
resultMap.put("云资源", resourceDao.selectYzyCount());
|
|
||||||
}, executor);
|
|
||||||
|
|
||||||
//视频资源
|
//视频资源
|
||||||
CompletableFuture<Void> jcss = CompletableFuture.runAsync(() -> {
|
switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
|
||||||
|
case TSINGTAO_XHA: { // 青岛西海岸
|
||||||
QueryWrapper<CameraChannel> queryWrapper = new QueryWrapper<>();
|
CompletableFuture allAmount = CompletableFuture.supplyAsync(() -> { // 获取平台总基础设施数目
|
||||||
queryWrapper.eq("check_status", 1).ne("gps_x", "").ne("gps_y", "").isNotNull("gps_x").isNotNull("gps_y");
|
List<Long> result = new CopyOnWriteArrayList<>();
|
||||||
resultMap.put("视频资源", cameraChannelMapper.selectCount(queryWrapper));
|
CompletableFuture cloud = CompletableFuture.runAsync(() -> { // 云脑专网
|
||||||
|
String url = tsingtao_xhaProperties.getCamCount();
|
||||||
|
logger.info(url);
|
||||||
}, executor);
|
Request request = new Request.Builder().url(url).build();
|
||||||
|
try (Response response = client.newCall(request).execute()) {
|
||||||
|
if (response.isSuccessful()) {
|
||||||
|
JSONObject jsonObject = JSON.parseObject(response.body().string());
|
||||||
|
if (jsonObject.containsKey("errorNo") && jsonObject.getLongValue("errorNo") == 200) {
|
||||||
|
result.add(jsonObject.getLongValue("body"));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
logger.error("青岛西海岸获取失败");
|
||||||
|
}
|
||||||
|
} catch (Exception exception) {
|
||||||
|
logger.error("青岛西海岸失败", exception);
|
||||||
|
}
|
||||||
|
}, executor);
|
||||||
|
CompletableFuture local = CompletableFuture.runAsync(() -> { // 金宏网
|
||||||
|
String url = tsingtao_xhaProperties.getLocalcam();
|
||||||
|
logger.info(url);
|
||||||
|
Request request = new Request.Builder().url(url).build();
|
||||||
|
try (Response response = client.newCall(request).execute()) {
|
||||||
|
if (response.isSuccessful()) {
|
||||||
|
JSONObject jsonObject = JSON.parseObject(response.body().string());
|
||||||
|
if (jsonObject.containsKey("errorNo") && jsonObject.getLongValue("errorNo") == 200) {
|
||||||
|
result.add(jsonObject.getLongValue("body"));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
logger.error("青岛西海岸获取失败");
|
||||||
|
}
|
||||||
|
} catch (Exception exception) {
|
||||||
|
logger.error("青岛西海岸失败", exception);
|
||||||
|
}
|
||||||
|
}, executor);
|
||||||
|
CompletableFuture all = CompletableFuture.allOf(cloud, local);
|
||||||
|
all.join();
|
||||||
|
return result.stream().filter(Objects::nonNull).findAny().orElse(0L);
|
||||||
|
}).thenAccept(sum -> resultMap.put("视频资源", sum));
|
||||||
|
allAmount.join();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case TSINGTAO: {
|
||||||
|
QueryWrapper<CameraChannel> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("check_status", 1).ne("gps_x", "").ne("gps_y", "").isNotNull("gps_x").isNotNull("gps_y");
|
||||||
|
resultMap.put("视频资源", cameraChannelMapper.selectCount(queryWrapper));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
//新增会客厅和视频会议统计
|
//新增会客厅和视频会议统计
|
||||||
//会客厅
|
//会客厅
|
||||||
|
@ -1977,10 +2021,9 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
}, executor);
|
}, executor);
|
||||||
|
|
||||||
//视频会议
|
//视频会议
|
||||||
CompletableFuture<Void> sphy = CompletableFuture.runAsync(() -> {
|
CompletableFuture<Void> sphy = CompletableFuture.runAsync(() -> resultMap.put("视频会议", enkeService.page(new HashMap<>()).getTotal()), executor);
|
||||||
resultMap.put("视频会议", enkeService.page(new HashMap<>()).getTotal());
|
|
||||||
}, executor);
|
CompletableFuture<Void> all = CompletableFuture.allOf(yzy, hkt, sphy);
|
||||||
CompletableFuture<Void> all = CompletableFuture.allOf(jcss, hkt, sphy);
|
|
||||||
all.join();
|
all.join();
|
||||||
|
|
||||||
return resultMap;
|
return resultMap;
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class SecurityUser {
|
||||||
logger.error("————————————————————————————user为null,返回空对象————————————————————————————");
|
logger.error("————————————————————————————user为null,返回空对象————————————————————————————");
|
||||||
return new UserDetail();
|
return new UserDetail();
|
||||||
}
|
}
|
||||||
|
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package io.renren.modules.sys.service.impl;
|
package io.renren.modules.sys.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import io.renren.common.service.impl.BaseServiceImpl;
|
import io.renren.common.service.impl.BaseServiceImpl;
|
||||||
import io.renren.modules.security.user.SecurityUser;
|
import io.renren.modules.security.user.SecurityUser;
|
||||||
import io.renren.modules.sys.controller.SysUserController;
|
import io.renren.modules.sys.controller.SysUserController;
|
||||||
|
|
Loading…
Reference in New Issue