diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/video/entity/VideoPlatformEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/video/entity/VideoPlatformEntity.java index 96c151d..56463bc 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/video/entity/VideoPlatformEntity.java +++ b/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) diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java index a0f0c99..292a9bc 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java +++ b/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 imp task.setInspectTaskIds(tasks.stream().map(TaskEntity::getId).map(Object::toString).collect(Collectors.joining(","))); task.setInspectTaskSum(tasks.size()); // 所有处理完成巡检任务 - List finshList = tasks.stream().filter(o-> null != o.getStatus() && o.getStatus().equals(4)).collect(Collectors.toList()); + List 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; } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/DutyServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/DutyServiceImpl.java index f1ce357..55531a5 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/DutyServiceImpl.java +++ b/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 periodTargetSignages(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, List signages); + List> 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); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/plate/impl/DataServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/plate/impl/DataServiceImpl.java index c55036d..ffd6086 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/plate/impl/DataServiceImpl.java +++ b/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> 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 atts = new ArrayList<>(); + ReductionAttrDataDTO attr = new ReductionAttrDataDTO(); + attr.setAccessRules(accessRules); + attr.setKeepFigures(4); + attr.setSignage(signage); + atts.add(attr); + reduction.setDtos(atts); + Result 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 开始时间 diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java index 824cc41..b43c4bb 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java +++ b/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; }