Browse Source

#视频平台配置功能

zhongwei
yang_shj 9 months ago
parent
commit
b086e174a4
  1. 10
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/video/entity/VideoPlatformEntity.java
  2. 3
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java
  3. 49
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/DutyServiceImpl.java
  4. 3
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/plate/DataService.java
  5. 46
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/plate/impl/DataServiceImpl.java
  6. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java

10
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/video/entity/VideoPlatformEntity.java

@ -1,7 +1,5 @@
package com.hnac.hzims.operational.video.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ -11,7 +9,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.springblade.core.tenant.mp.TenantEntity;
import javax.validation.constraints.NotBlank;
@ -19,7 +16,10 @@ import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
@EqualsAndHashCode
/**
* @author ysj
*/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("HZIMS_VIDEO_PLATFORM")
@ApiModel(value = "视频平台实体类",description = "视频平台实体类")
@ -40,11 +40,13 @@ public class VideoPlatformEntity extends TenantEntity implements Serializable {
@Size(min = 1,max = 50,groups = Create.class)
private String videoHost;
@ApiModelProperty("秘钥appKey")
@NotBlank
@Size(min = 1,max = 50,groups = Create.class)
private String appKey;
@ApiModelProperty("秘钥appSecret")
@NotBlank
@Size(min = 1,max = 100,groups = Create.class)

3
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java

@ -4,6 +4,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.scheduled.mapper.inspect.TaskMapper;
import com.hnac.hzims.scheduled.service.inspect.TaskService;
import com.hnac.hzinfo.inspect.task.TaskContants;
import com.hnac.hzinfo.inspect.task.entity.TaskEntity;
import com.hnac.hzinfo.inspect.task.vo.DutyInspectTaskVO;
import lombok.AllArgsConstructor;
@ -49,7 +50,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> imp
task.setInspectTaskIds(tasks.stream().map(TaskEntity::getId).map(Object::toString).collect(Collectors.joining(",")));
task.setInspectTaskSum(tasks.size());
// 所有处理完成巡检任务
List<TaskEntity> finshList = tasks.stream().filter(o-> null != o.getStatus() && o.getStatus().equals(4)).collect(Collectors.toList());
List<TaskEntity> finshList = tasks.stream().filter(o-> null != o.getStatus() && TaskContants.TaskStatusEnum.FINISH_STATUS.getStatus().equals(String.valueOf(o.getStatus()))).collect(Collectors.toList());
if(CollectionUtil.isEmpty(finshList)){
return task;
}

49
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/DutyServiceImpl.java

@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springframework.stereotype.Service;
@ -97,12 +98,16 @@ public class DutyServiceImpl extends BaseServiceImpl<DutyMapper, ImsDutyMainEnti
eq(ImsDutyMainPersonEntity::getDutyMainId, dutyMainInfoVo.getId());
last(" LIMIT 1");
}});
dutyMainInfoVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson().toString());
if(ObjectUtil.isNotEmpty(imsDutyMainPersonEntity)){
dutyMainInfoVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson().toString());
}
} else {
ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(dutyMainInfoVo.getDutyGroupId());
dutyMainInfoVo.setGroupName(imsDutyGroupEntity.getGroupName());
dutyMainInfoVo.setDutyGroupId(imsDutyGroupEntity.getId());
dutyMainInfoVo.setManagerId(imsDutyGroupEntity.getManagerId().toString());
if(ObjectUtil.isNotEmpty(imsDutyGroupEntity)){
dutyMainInfoVo.setGroupName(imsDutyGroupEntity.getGroupName());
dutyMainInfoVo.setDutyGroupId(imsDutyGroupEntity.getId());
dutyMainInfoVo.setManagerId(imsDutyGroupEntity.getManagerId().toString());
}
}
if (ObjectUtil.isEmpty(dutyMainInfoVo)) {
return null;
@ -140,11 +145,13 @@ public class DutyServiceImpl extends BaseServiceImpl<DutyMapper, ImsDutyMainEnti
NextDutyInfoVo dutyInfoVo = new NextDutyInfoVo();
dutyInfoVo.setGroupName(dutyMainInfoVo.getGroupName());
dutyInfoVo.setClassName(dutyMainInfoVo.getClassName());
// 负责人
User user = UserCache.getUser(Long.valueOf(dutyMainInfoVo.getManagerId()));
if (ObjectUtil.isNotEmpty(user)) {
dutyInfoVo.setManagerName(user.getRealName());
dutyInfoVo.setManagerPhone(user.getPhone());
if(StringUtil.isNotBlank(dutyMainInfoVo.getManagerId())){
// 负责人
User user = UserCache.getUser(Long.valueOf(dutyMainInfoVo.getManagerId()));
if (ObjectUtil.isNotEmpty(user)) {
dutyInfoVo.setManagerName(user.getRealName());
dutyInfoVo.setManagerPhone(user.getPhone());
}
}
dutyInfoVo.setGeneratingCapacity(0);
return dutyInfoVo;
@ -165,12 +172,16 @@ public class DutyServiceImpl extends BaseServiceImpl<DutyMapper, ImsDutyMainEnti
eq(ImsDutyMainPersonEntity::getDutyMainId, dutyMainInfoVo.getId());
last("limit 1");
}});
dutyMainInfoVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson().toString());
if(ObjectUtil.isNotEmpty(imsDutyMainPersonEntity)){
dutyMainInfoVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson().toString());
}
} else {
ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(dutyMainInfoVo.getDutyGroupId());
dutyMainInfoVo.setGroupName(imsDutyGroupEntity.getGroupName());
dutyMainInfoVo.setDutyGroupId(imsDutyGroupEntity.getId());
dutyMainInfoVo.setManagerId(imsDutyGroupEntity.getManagerId().toString());
if(ObjectUtil.isNotEmpty(imsDutyGroupEntity)){
dutyMainInfoVo.setGroupName(imsDutyGroupEntity.getGroupName());
dutyMainInfoVo.setDutyGroupId(imsDutyGroupEntity.getId());
dutyMainInfoVo.setManagerId(imsDutyGroupEntity.getManagerId().toString());
}
}
if (ObjectUtil.isEmpty(dutyMainInfoVo)) {
return null;
@ -180,11 +191,13 @@ public class DutyServiceImpl extends BaseServiceImpl<DutyMapper, ImsDutyMainEnti
dutyMainInfoVo.setDateTime(dutyMainInfoVo.getDateTime());
dutyMainInfoVo.setStartTime(dutyMainInfoVo.getStartTime());
dutyMainInfoVo.setEndTime(dutyMainInfoVo.getEndTime());
// 负责人
User user = UserCache.getUser(Long.valueOf(dutyMainInfoVo.getManagerId()));
if (ObjectUtil.isNotEmpty(user)) {
dutyMainInfoVo.setManagerName(user.getRealName());
dutyMainInfoVo.setManagerPhone(user.getPhone());
if(StringUtil.isNotBlank(dutyMainInfoVo.getManagerId())){
// 负责人
User user = UserCache.getUser(Long.valueOf(dutyMainInfoVo.getManagerId()));
if (ObjectUtil.isNotEmpty(user)) {
dutyMainInfoVo.setManagerName(user.getRealName());
dutyMainInfoVo.setManagerPhone(user.getPhone());
}
}
return dutyMainInfoVo;
}

3
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/plate/DataService.java

@ -8,6 +8,7 @@ import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO;
import org.springblade.core.tool.api.R;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
@ -26,5 +27,7 @@ public interface DataService {
List<AnalyzeDataConditionVO> periodTargetSignages(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, List<String> signages);
List<Map<String, String>> lastFirstBySignage(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, String signages);
Float periodTargetFloat(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, Double ride ,String signages);
}

46
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/plate/impl/DataServiceImpl.java

@ -11,10 +11,14 @@ import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO;
import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO;
import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO;
import com.hnac.hzinfo.sdk.core.response.Result;
import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient;
import com.hnac.hzinfo.sdk.v5.device.dto.HisDataDeviceDTO;
import com.hnac.hzinfo.sdk.v5.device.dto.ReductionAttrDataDTO;
import com.hnac.hzinfo.sdk.v5.device.dto.ReductionDataDTO;
import com.hnac.hzinfo.sdk.v5.device.vo.ReductionDataVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
@ -27,7 +31,7 @@ import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -151,6 +155,44 @@ public class DataServiceImpl implements DataService {
return result.getData();
}
/**
* 最后值减最初值
* @param startTime 开始时间
* @param endTime 结束时间
* @param accessRules 取数规则 : 0=最早值 1=最大值 2=最小值 3=平均值 4=和值 5=差值 6=最新值 7=最后值减最初值
* @param cycleType 间隔周期 : 0-> 1-> 2-> 小时 3-> 4-> 5-> 6->
* @param deviceCode 设备编号
* @param signage 属性
* @return
*/
@Override
public List<Map<String, String>> lastFirstBySignage(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, String signage) {
ReductionDataDTO reduction = new ReductionDataDTO();
reduction.setFull(1);
reduction.setDeviceCode(deviceCode);
reduction.setSaveTimeType(cycleType);
reduction.setTimeInterval(1);
reduction.setNeedPage(false);
reduction.setBeginTime(LocalDateTime.parse(DateUtil.format(new Date(), startTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
reduction.setEndTime(LocalDateTime.parse(DateUtil.format(new Date(), endTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
// 属性列表
List<ReductionAttrDataDTO> atts = new ArrayList<>();
ReductionAttrDataDTO attr = new ReductionAttrDataDTO();
attr.setAccessRules(accessRules);
attr.setKeepFigures(4);
attr.setSignage(signage);
atts.add(attr);
reduction.setDtos(atts);
Result<ReductionDataVO> result = deviceDataClient.pageDeviceCodeAndSignages(reduction);
if (!result.isSuccess() || ObjectUtil.isEmpty(result.getData())) {
return new ArrayList<>();
}
if(MapUtils.isEmpty(result.getData().getFieldMap()) || CollectionUtil.isEmpty(result.getData().getDataList())){
return new ArrayList<>();
}
return result.getData().getDataList();
}
/***
* 指标数据列表查询
* @param startTime 开始时间

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java

@ -1217,6 +1217,7 @@ public class TargetServiceImpl implements TargetService {
}
}};
IPage pages = accessTaskService.page(page, queryWrapper);
pages.setRecords(OperAccessTaskWrapper.build().listVOExtras(pages.getRecords()));
return pages;
}

Loading…
Cancel
Save