Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
package com.njcn.algorithm.pojo.param;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/3/30 16:23【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class CsEquipmentDeliveryAuditParm {
|
||||
|
||||
@ApiModelProperty(value = "id")
|
||||
@NotBlank(message="id不能为空!")
|
||||
private String id;
|
||||
/**
|
||||
* 装置名称
|
||||
*/
|
||||
@ApiModelProperty(value="装置名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 网关识别码
|
||||
*/
|
||||
@ApiModelProperty(value="网关识别码")
|
||||
private String ndid;
|
||||
|
||||
/**
|
||||
* 装置mac地址
|
||||
*/
|
||||
@ApiModelProperty(value="装置mac地址")
|
||||
private String mac;
|
||||
|
||||
/**
|
||||
* 装置用途(治理、监测...)
|
||||
*/
|
||||
@ApiModelProperty(value="装置用途")
|
||||
private String devUse;
|
||||
|
||||
/**
|
||||
* 装置类型(直连设备、网关设备)
|
||||
*/
|
||||
@ApiModelProperty(value="装置类型")
|
||||
private String devType;
|
||||
|
||||
/**
|
||||
* 装置型号(pqs588、pqs680...)
|
||||
*/
|
||||
@ApiModelProperty(value="装置型号")
|
||||
private String devModel;
|
||||
|
||||
/**
|
||||
* 装置程序版本
|
||||
*/
|
||||
@ApiModelProperty(value="装置程序版本")
|
||||
private String programVersion;
|
||||
|
||||
/**
|
||||
* 调试人员
|
||||
*/
|
||||
@ApiModelProperty(value="调试人员")
|
||||
private String debugPerson;
|
||||
|
||||
/**
|
||||
* 出厂日期
|
||||
*/
|
||||
@ApiModelProperty(value="出厂日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||
private Date producteTime;
|
||||
|
||||
/**
|
||||
* 检修日期
|
||||
*/
|
||||
@ApiModelProperty(value="检修日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||
private Date checkTime;
|
||||
|
||||
/**
|
||||
* 调试日期
|
||||
*/
|
||||
@ApiModelProperty(value="调试日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||
private Date debugTime;
|
||||
|
||||
/**
|
||||
* 合同号
|
||||
*/
|
||||
@ApiModelProperty(value="合同号")
|
||||
private String cntractNo;
|
||||
|
||||
/**
|
||||
* 营销经理
|
||||
*/
|
||||
@ApiModelProperty(value="营销经理")
|
||||
private String salesManager;
|
||||
|
||||
@TableField(value = "status")
|
||||
private String status;
|
||||
|
||||
}
|
||||
@@ -39,7 +39,7 @@ public class CsDevModelPO extends BaseEntity {
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
@TableField(value = "模板名称")
|
||||
@TableField(value = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
|
||||
@@ -110,7 +110,7 @@ public class CsEquipmentDeliveryPO extends BaseEntity {
|
||||
* 状态(0:删除 1:正常)
|
||||
*/
|
||||
@TableField(value = "status")
|
||||
private Integer status;
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
||||
@@ -79,8 +79,8 @@ public class DevModelController extends BaseController {
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryDevModelOne")
|
||||
@ApiOperation("设备模板列表查询")
|
||||
@ApiImplicitParam(name = "csDevModelQueryListParm", value = "信息", required = true)
|
||||
@ApiOperation("设备模板查询")
|
||||
@ApiImplicitParam(name = "csDevModelQueryListParm", value = "设备模板信息", required = true)
|
||||
public HttpResult<CsDevModelPageVO> queryDevModelOne(@RequestBody CsDevModelQueryListParm csDevModelQueryListParm){
|
||||
String methodDescribe = getMethodDescribe("queryDevModelOne");
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.algorithm.controller.Equipment;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.njcn.algorithm.pojo.param.CsEquipmentDeliveryAddParm;
|
||||
import com.njcn.algorithm.pojo.param.CsEquipmentDeliveryAuditParm;
|
||||
import com.njcn.algorithm.pojo.param.ProjectEquipmentQueryParm;
|
||||
import com.njcn.algorithm.pojo.vo.CsEquipmentDeliveryVO;
|
||||
import com.njcn.algorithm.pojo.vo.ProjectEquipmentVO;
|
||||
@@ -59,6 +60,17 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateEquipmentDelivery")
|
||||
@ApiOperation("修改出厂设备")
|
||||
@ApiImplicitParam(name = "csEquipmentDeliveryAuditParm", value = "新增项目参数", required = true)
|
||||
public HttpResult<Boolean> updateEquipmentDelivery(@RequestBody @Validated CsEquipmentDeliveryAuditParm csEquipmentDeliveryAuditParm ){
|
||||
String methodDescribe = getMethodDescribe("updateEquipmentDelivery");
|
||||
|
||||
Boolean flag = csEquipmentDeliveryService.updateEquipmentDelivery(csEquipmentDeliveryAuditParm);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.algorithm.service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.algorithm.pojo.param.CsEquipmentDeliveryAddParm;
|
||||
import com.njcn.algorithm.pojo.param.CsEquipmentDeliveryAuditParm;
|
||||
import com.njcn.algorithm.pojo.param.ProjectEquipmentQueryParm;
|
||||
import com.njcn.algorithm.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.algorithm.pojo.vo.CsEquipmentDeliveryVO;
|
||||
@@ -51,4 +52,6 @@ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDelivery
|
||||
* @Date: 2023/4/3
|
||||
*/
|
||||
IPage<ProjectEquipmentVO> queryEquipmentByProject(ProjectEquipmentQueryParm projectEquipmentQueryParm);
|
||||
|
||||
Boolean updateEquipmentDelivery(CsEquipmentDeliveryAuditParm csEquipmentDeliveryAuditParm);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.algorithm.enums.AlgorithmResponseEnum;
|
||||
import com.njcn.algorithm.mapper.CsEquipmentDeliveryMapper;
|
||||
import com.njcn.algorithm.pojo.param.CsEquipmentDeliveryAddParm;
|
||||
import com.njcn.algorithm.pojo.param.CsEquipmentDeliveryAuditParm;
|
||||
import com.njcn.algorithm.pojo.param.ProjectEquipmentQueryParm;
|
||||
import com.njcn.algorithm.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.algorithm.pojo.vo.CsEquipmentDeliveryVO;
|
||||
@@ -42,7 +43,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
CsEquipmentDeliveryPO csEquipmentDeliveryPO = new CsEquipmentDeliveryPO();
|
||||
|
||||
BeanUtils.copyProperties (csEquipmentDeliveryAddParm,csEquipmentDeliveryPO);
|
||||
csEquipmentDeliveryPO.setStatus (1);
|
||||
csEquipmentDeliveryPO.setStatus ("1");
|
||||
boolean save = this.save (csEquipmentDeliveryPO);
|
||||
return save;
|
||||
}
|
||||
@@ -70,6 +71,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
public CsEquipmentDeliveryPO queryEquipmentPOByndid(String ndid) {
|
||||
QueryWrapper<CsEquipmentDeliveryPO> wrapper = new QueryWrapper();
|
||||
wrapper.eq ("ndid", ndid);
|
||||
wrapper.eq("status",2);
|
||||
CsEquipmentDeliveryPO csEquipmentDeliveryPO = this.baseMapper.selectOne (wrapper);
|
||||
return csEquipmentDeliveryPO;
|
||||
}
|
||||
@@ -83,4 +85,12 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateEquipmentDelivery(CsEquipmentDeliveryAuditParm csEquipmentDeliveryAuditParm) {
|
||||
CsEquipmentDeliveryPO csEquipmentDeliveryPO = new CsEquipmentDeliveryPO();
|
||||
BeanUtils.copyProperties (csEquipmentDeliveryAuditParm, csEquipmentDeliveryPO);
|
||||
boolean b = this.updateById (csEquipmentDeliveryPO);
|
||||
return b;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -67,4 +67,9 @@ public interface OssPath {
|
||||
* 装置模板
|
||||
*/
|
||||
String DEV_MODEL = "algorithm/devModel/";
|
||||
|
||||
/***
|
||||
* 资源管理文件
|
||||
*/
|
||||
String RESOURCEADMINISTRATION = "resourceAdministration/";
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.device.pq.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@@ -15,7 +16,7 @@ import java.io.Serializable;
|
||||
* @date: 2023/03/20
|
||||
*/
|
||||
@Data
|
||||
public class LargeScreenParam implements Serializable {
|
||||
public class LargeScreenParam extends BaseParam implements Serializable {
|
||||
|
||||
@ApiModelProperty(name = "deptIndex", value = "部门索引", required = true)
|
||||
@NotBlank(message = "部门索引不可为空")
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.njcn.device.pq.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
* @author: zbj
|
||||
* @date: 2023/04/17
|
||||
*/
|
||||
@Data
|
||||
public class MiddleChildVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* base
|
||||
*/
|
||||
private Float base;
|
||||
|
||||
/**
|
||||
* ream
|
||||
*/
|
||||
private Float ream;
|
||||
|
||||
/**
|
||||
* statusValue
|
||||
*/
|
||||
private Float statusValue;
|
||||
|
||||
/**
|
||||
* name
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* ip
|
||||
*/
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
* port
|
||||
*/
|
||||
private String port;
|
||||
|
||||
/**
|
||||
* comFlag
|
||||
*/
|
||||
private String comFlag;
|
||||
}
|
||||
@@ -150,11 +150,14 @@ public class TerminalOnlineRateDataServiceImpl implements TerminalOnlineRateData
|
||||
terminalOnlineRateDataVO.setLevel(0);
|
||||
|
||||
if (terminalOnlineRateDataParam.getStatisticalType().getCode().equalsIgnoreCase(StatisticsEnum.POWER_NETWORK.getCode())) {
|
||||
TerminalOnlineRateDataVO temp = gdList.stream().filter(t -> t.getAlgoDescribe() != null).min(Comparator.comparing(TerminalOnlineRateDataVO::getAlgoDescribe)).orElseGet(TerminalOnlineRateDataVO::new);
|
||||
TerminalOnlineRateDataVO temp = gdList.stream()
|
||||
.filter(t -> t.getAlgoDescribe() != null)
|
||||
.min(Comparator.comparing(TerminalOnlineRateDataVO::getAlgoDescribe))
|
||||
.orElseGet(TerminalOnlineRateDataVO::new);
|
||||
terminalOnlineRateDataVO.setAlgoDescribe(temp.getAlgoDescribe());
|
||||
terminalOnlineRateDataVO.setChildren(gdList);
|
||||
} else {
|
||||
//还需要额外处理省会
|
||||
// 还需要额外处理省会
|
||||
dealChildrenData(proList, gdList, false);
|
||||
terminalOnlineRateDataVO.setChildren(proList);
|
||||
}
|
||||
@@ -298,7 +301,7 @@ public class TerminalOnlineRateDataServiceImpl implements TerminalOnlineRateData
|
||||
List<TerminalOnlineRateDataVO> devs = subItem.getChildren();
|
||||
if (CollectionUtil.isNotEmpty(devs)) {
|
||||
for (TerminalOnlineRateDataVO devItem : devs) {
|
||||
if (Objects.nonNull(devItem.getAlgoDescribe())) {
|
||||
if (Objects.isNull(devItem.getChildren())) {
|
||||
if (mapAlarm.containsKey(devItem.getAlgoDescribe())) {
|
||||
if (devItem.getOnlineRate() != 3.14159 && devItem.getOnlineRate() > mapAlarm.get(devItem.getAlgoDescribe())) {
|
||||
devItem.setValueOver(1);
|
||||
@@ -306,6 +309,19 @@ public class TerminalOnlineRateDataServiceImpl implements TerminalOnlineRateData
|
||||
devItem.setValueOver(0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<TerminalOnlineRateDataVO> children = devItem.getChildren();
|
||||
for (TerminalOnlineRateDataVO child : children) {
|
||||
if (mapAlarm.containsKey(child.getAlgoDescribe())) {
|
||||
if (child.getOnlineRate() != 3.14159 && child.getOnlineRate() > mapAlarm.get(child.getAlgoDescribe())) {
|
||||
child.setValueOver(1);
|
||||
} else {
|
||||
child.setValueOver(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Double devAvg = children.stream().filter(item -> item.getOnlineRate() != 3.14159).collect(Collectors.averagingDouble(TerminalOnlineRateDataVO::getOnlineRate));
|
||||
devItem.setOnlineRate(devAvg);
|
||||
}
|
||||
}
|
||||
Double devAvg = devs.stream().filter(item -> item.getOnlineRate() != 3.14159).collect(Collectors.averagingDouble(TerminalOnlineRateDataVO::getOnlineRate));
|
||||
|
||||
@@ -31,6 +31,7 @@ public enum EventResponseEnum {
|
||||
INDEX_OUT_OF_BOUNDS("A00655","集合索引越界异常"),
|
||||
|
||||
NOT_FOUND("A00656","没有查到数据"),
|
||||
NOT_LINEID("A00657","暂无监测点信息"),
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.event.pojo.po;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.InstantSerializer;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@@ -28,8 +29,8 @@ public class EventDetail {
|
||||
|
||||
@Column(name = "time")
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
@JsonSerialize(using = InstantSerializer.class)
|
||||
private Instant startTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS",timezone = "GMT+8")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Column(name = "event_describe")
|
||||
@ApiModelProperty(value = "事件描述")
|
||||
|
||||
@@ -86,7 +86,7 @@ public class RmpEventDetailPO implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS",timezone = "GMT+8")
|
||||
private String startTime;
|
||||
private LocalDateTime startTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "持续时间,单位秒")
|
||||
|
||||
@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -73,7 +74,7 @@ public class RmpEventDetailVO implements Serializable {
|
||||
*/
|
||||
@ApiModelProperty(name = "startTime",value = "开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS",timezone = "GMT+8")
|
||||
private Date startTime;
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 持续时间
|
||||
|
||||
@@ -16,6 +16,8 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
@@ -155,8 +157,9 @@ public class PqsEventDetailQuery extends QueryBuilder {
|
||||
* @return 数据
|
||||
*/
|
||||
public static BiFunction<DateTime, DateTime, List<EventDetail>> getBetweenTimeEventDetailList(List<EventDetail> eventDetailList) {
|
||||
ZoneId zone = ZoneId.systemDefault();
|
||||
return (beginTime, endTime) -> eventDetailList.stream().filter(eventDetail -> {
|
||||
Instant timeId = eventDetail.getStartTime();
|
||||
Instant timeId = eventDetail.getStartTime().atZone(zone).toInstant();
|
||||
return timeId.isAfter(beginTime.toInstant()) && timeId.isBefore(endTime.toInstant());
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.njcn.event.mapper.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.pq.pojo.vo.AllDataVO;
|
||||
import com.njcn.device.pq.pojo.vo.EventVO;
|
||||
import com.njcn.device.pq.pojo.vo.MiddleChildVO;
|
||||
import com.njcn.device.pq.pojo.vo.MiddleLimitRateVO;
|
||||
import com.njcn.harmonic.pojo.po.PQSComAssesPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -28,11 +30,11 @@ public interface LargeScreenMapper {
|
||||
|
||||
Map<String, Object> getDownCount (@Param("lineIds") List<String> lineIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
List<EventVO> getMiddleDown (@Param("lineIds") List<String> lineIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
List<EventVO> getMiddleDown (Page<EventVO> page,@Param("lineIds") List<String> lineIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
List<Map<String, Object>> getMiddleTerminal (@Param("deviceIds") List<String> deviceIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
List<MiddleChildVO> getMiddleTerminal (Page<MiddleChildVO> page,@Param("deviceIds") List<String> deviceIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
List<MiddleLimitRateVO> getMiddleLimitRate (@Param("lineIds") List<String> deviceIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
List<MiddleLimitRateVO> getMiddleLimitRate (Page<MiddleLimitRateVO> page,@Param("lineIds") List<String> deviceIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
List<Map<String,Object>> getHomeostasisArea (@Param("indexIds") List<String> indexIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
order by ed.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="getMiddleTerminal" resultType="java.util.Map">
|
||||
<select id="getMiddleTerminal" resultType="com.njcn.device.pq.pojo.vo.MiddleChildVO">
|
||||
SELECT
|
||||
pd.id,
|
||||
IFNULL(
|
||||
|
||||
@@ -36,6 +36,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -332,7 +333,6 @@ public class PwEventCategoryDetailsServiceImpl implements PwEventCategoryDetails
|
||||
return EventFeatureAmplitudeCurveVO.empty();
|
||||
}
|
||||
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
List<EventFeatureAmplitudeCurveVO.EventFeatureAmplitudeCurveDataList> curveDataList = rmpEventDetailList.parallelStream()
|
||||
.map(dto -> {
|
||||
@@ -341,11 +341,7 @@ public class PwEventCategoryDetailsServiceImpl implements PwEventCategoryDetails
|
||||
eventFeatureAmplitudeCurve.setFeatureAmplitude(dto.getFeatureAmplitude());
|
||||
eventFeatureAmplitudeCurve.setDuration(dto.getDuration());
|
||||
|
||||
// Instant instant = dto.getStartTime().toInstant();
|
||||
// ZoneId zoneId = ZoneId.systemDefault();
|
||||
//
|
||||
// eventFeatureAmplitudeCurve.setStartTime(LocalDateTime.ofInstant(instant, zoneId));
|
||||
eventFeatureAmplitudeCurve.setStartTime(LocalDateTime.parse( dto.getStartTime()));
|
||||
eventFeatureAmplitudeCurve.setStartTime(dto.getStartTime());
|
||||
|
||||
return eventFeatureAmplitudeCurve;
|
||||
})
|
||||
|
||||
@@ -12,9 +12,7 @@ import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||
import com.njcn.event.influxdb.PqsEventDetailQuery;
|
||||
import com.njcn.event.pojo.po.EventDetail;
|
||||
import com.njcn.event.pojo.po.RStatEventY;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import com.njcn.event.pojo.vo.AreaAnalysisVO;
|
||||
import com.njcn.event.pojo.vo.VoltageToleranceCurveVO;
|
||||
@@ -35,10 +33,8 @@ import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.njcn.event.influxdb.PqsEventDetailQuery.lineIdOr;
|
||||
import static com.njcn.event.influxdb.PqsEventDetailQuery.timeAndType;
|
||||
import static com.njcn.event.influxdb.QueryBuilder.*;
|
||||
import static org.influxdb.querybuilder.BuiltQuery.QueryBuilder.eq;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* pqs-event
|
||||
@@ -54,7 +50,7 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService {
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
private final LineFeignClient lineFeignClient;
|
||||
private final PqsEventDetailQuery pqsEventDetailQuery;
|
||||
|
||||
private final EventDetailService eventDetailService;
|
||||
@Override
|
||||
public AreaAnalysisVO getEventReason(DeviceInfoParam.BusinessParam deviceInfoParam) {
|
||||
@@ -151,7 +147,7 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService {
|
||||
voltageToleranceCurve.setLineId(dto.getLineId());
|
||||
voltageToleranceCurve.setPersistTime(dto.getDuration());
|
||||
voltageToleranceCurve.setEventValue(dto.getFeatureAmplitude());
|
||||
voltageToleranceCurve.setTime(LocalDateTime.ofInstant(dto.getStartTime(), ZoneId.systemDefault()));
|
||||
voltageToleranceCurve.setTime(dto.getStartTime());
|
||||
voltageToleranceCurve.setGdName(info.getGdName());
|
||||
voltageToleranceCurve.setSubName(info.getSubName());
|
||||
return voltageToleranceCurve;
|
||||
@@ -232,7 +228,7 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService {
|
||||
return reasonList;
|
||||
}
|
||||
|
||||
private List<AreaAnalysisVO.Children> assData(List<DictData> dicList, List<String> lineIds, String startTime, String endTime, String type) {
|
||||
/* private List<AreaAnalysisVO.Children> assData(List<DictData> dicList, List<String> lineIds, String startTime, String endTime, String type) {
|
||||
List<AreaAnalysisVO.Children> reasonList = new ArrayList<>();
|
||||
Integer allCount = 0;
|
||||
for (DictData reason : dicList) {
|
||||
@@ -284,5 +280,5 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService {
|
||||
allType.setValue(allCount);
|
||||
reasonList.add(allType);
|
||||
return reasonList;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -325,12 +325,9 @@ public class EventDistributionStatisticsServiceImpl implements EventDistribution
|
||||
eventFeatureAmplitudeCurve.setFeatureAmplitude(dto.getFeatureAmplitude());
|
||||
eventFeatureAmplitudeCurve.setDuration(dto.getDuration());
|
||||
|
||||
// eventFeatureAmplitudeCurve.setStartTime(LocalDateTime.ofInstant(dto.getStartTime().toInstant(), ZoneId.systemDefault()));
|
||||
eventFeatureAmplitudeCurve.setStartTime(LocalDateTime.parse(dto.getStartTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS")));
|
||||
eventFeatureAmplitudeCurve.setStartTime(dto.getStartTime());
|
||||
return eventFeatureAmplitudeCurve;
|
||||
})
|
||||
//.sorted(VoltageToleranceCurveDataList.sortAscTime())
|
||||
.collect(Collectors.toCollection(() -> Collections.synchronizedList(new ArrayList<>())));
|
||||
}).collect(Collectors.toCollection(() -> Collections.synchronizedList(new ArrayList<>())));
|
||||
|
||||
return EventFeatureAmplitudeCurveVO.buildVO(rmpEventDetailList.size(), curveDataList);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.event.service.majornetwork.Impl;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
@@ -373,7 +374,7 @@ public class LargeScreenServiceImpl implements LargeScreenService {
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceInfoClient.getPracticalAllDeviceInfo(deviceInfoParam).getData();
|
||||
//获取所有监测点集合
|
||||
List<String> lineIds = generalDeviceDTOList.stream().flatMap(dto -> dto.getLineIndexes().stream()).collect(Collectors.toList());
|
||||
return largeScreenMapper.getMiddleDown(lineIds, largeScreenParam.getSearchBeginTime(), largeScreenParam.getSearchEndTime());
|
||||
return largeScreenMapper.getMiddleDown(new Page<>(largeScreenParam.getPageNum(), largeScreenParam.getPageSize()),lineIds, largeScreenParam.getSearchBeginTime(), largeScreenParam.getSearchEndTime());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -398,25 +399,25 @@ public class LargeScreenServiceImpl implements LargeScreenService {
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceInfoClient.getPracticalAllDeviceInfo(deviceInfoParam).getData();
|
||||
//获取所有监测点集合
|
||||
List<String> deviceIds = generalDeviceDTOList.stream().flatMap(dto -> dto.getDeviceIndexes().stream()).collect(Collectors.toList());
|
||||
List<Map<String, Object>> map = largeScreenMapper.getMiddleTerminal(deviceIds, largeScreenParam.getSearchBeginTime(), largeScreenParam.getSearchEndTime());
|
||||
List<MiddleChildVO> map = largeScreenMapper.getMiddleTerminal(new Page<>(largeScreenParam.getPageNum(), largeScreenParam.getPageSize()),deviceIds, largeScreenParam.getSearchBeginTime(), largeScreenParam.getSearchEndTime());
|
||||
|
||||
float base = 0.0f;
|
||||
float ream = 0.0f;
|
||||
float statusValue = 0.0f;
|
||||
float v = 0.0f;
|
||||
String s = "";
|
||||
for (Map<String, Object> stringObjectMap : map) {
|
||||
for (MiddleChildVO middleChildVO : map) {
|
||||
MiddleTerminalVO vo = new MiddleTerminalVO();
|
||||
base = Float.parseFloat(stringObjectMap.get("base").toString());
|
||||
ream = Float.parseFloat(stringObjectMap.get("ream").toString());
|
||||
statusValue = Float.parseFloat(stringObjectMap.get("statusValue").toString());
|
||||
base = middleChildVO.getBase();
|
||||
ream = middleChildVO.getReam();
|
||||
statusValue = middleChildVO.getStatusValue();
|
||||
statusValue = statusValue / 1024.0f / 1024.0f;
|
||||
v = statusValue / (base + ream);
|
||||
s = formatFloat(v);
|
||||
vo.setName(stringObjectMap.get("name").toString());
|
||||
vo.setIp(stringObjectMap.get("ip").toString());
|
||||
vo.setPort(stringObjectMap.get("port").toString());
|
||||
vo.setComFlag(stringObjectMap.get("comFlag").toString());
|
||||
vo.setName(middleChildVO.getName());
|
||||
vo.setIp(middleChildVO.getIp());
|
||||
vo.setPort(middleChildVO.getPort());
|
||||
vo.setComFlag(middleChildVO.getComFlag());
|
||||
vo.setProportion(s);
|
||||
result.add(vo);
|
||||
}
|
||||
@@ -451,7 +452,7 @@ public class LargeScreenServiceImpl implements LargeScreenService {
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceInfoClient.getPracticalAllDeviceInfo(deviceInfoParam).getData();
|
||||
//获取所有监测点集合
|
||||
List<String> lineIds = generalDeviceDTOList.stream().flatMap(dto -> dto.getLineIndexes().stream()).collect(Collectors.toList());
|
||||
return largeScreenMapper.getMiddleLimitRate(lineIds, largeScreenParam.getSearchBeginTime(), largeScreenParam.getSearchEndTime());
|
||||
return largeScreenMapper.getMiddleLimitRate(new Page<>(largeScreenParam.getPageNum(), largeScreenParam.getPageSize()),lineIds, largeScreenParam.getSearchBeginTime(), largeScreenParam.getSearchEndTime());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.time.temporal.TemporalField;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -1362,10 +1363,8 @@ public class ReportServiceImpl implements ReportService {
|
||||
insertRow(doc, table, centerParagraph, true, "序号", "暂降发生时刻", "暂降赋值(%)", "持续时间(s)", "暂降类型", "暂降原因", "严重度");
|
||||
for (int j = 0; j < plot.size(); j++) {
|
||||
EventDetail eventDetail = plot.get(j);
|
||||
long l = eventDetail.getStartTime().toEpochMilli();
|
||||
Date date1 = new Date(l);
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
String s = simpleDateFormat.format(date1);
|
||||
String s = eventDetail.getStartTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"));
|
||||
|
||||
insertRow(doc, table, centerParagraph, false, j + 1 + "", s, eventDetail.getFeatureAmplitude() + "", eventDetail.getDuration() / 1000.0 + "", eventDetail.getAdvanceType(), eventDetail.getAdvanceReason(), eventDetail.getSeverity() + "");
|
||||
}
|
||||
i++;
|
||||
@@ -2091,6 +2090,9 @@ public class ReportServiceImpl implements ReportService {
|
||||
|
||||
InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
||||
//提前创建,不然获取不到(初始化数据)
|
||||
if (CollUtil.isEmpty(lineIds)) {
|
||||
throw new BusinessException(EventResponseEnum.NOT_FOUND);
|
||||
}
|
||||
List<EventDetailNew> eventDetailList = getEventDetailListInfo(areaReportParam, lineIds);
|
||||
List<GeneralDeviceDTO> voltageParamList = generalDeviceInfoClient.getPracticalAllDeviceInfo(areaReportParam).getData();
|
||||
|
||||
@@ -5283,6 +5285,9 @@ public class ReportServiceImpl implements ReportService {
|
||||
|
||||
InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
||||
//提前创建,不然获取不到(初始化数据)
|
||||
if (CollUtil.isEmpty(lineIds)) {
|
||||
throw new BusinessException(EventResponseEnum.NOT_LINEID);
|
||||
}
|
||||
List<EventDetailNew> eventDetailList = getEventDetailListInfo(areaReportParam, lineIds);
|
||||
if(CollectionUtil.isEmpty(eventDetailList)){
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA);
|
||||
|
||||
@@ -99,7 +99,7 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
||||
}
|
||||
|
||||
// 蒋监测点信息转换成map集合
|
||||
Map<String, String> monitorInfoMap = monitorInfo.stream().collect(Collectors.toMap(PmsMonitorDTO::getId, PmsMonitorDTO::getName));
|
||||
//Map<String, String> monitorInfoMap = monitorInfo.stream().collect(Collectors.toMap(PmsMonitorDTO::getId, PmsMonitorDTO::getName));
|
||||
// 将事件类型转换成map集合
|
||||
Map<String, String> eventStatisDataMap = eventStatisData.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
|
||||
|
||||
@@ -130,12 +130,9 @@ public class TransientServiceImpl implements TransientService {
|
||||
transientVO.setId(eventDetail.getLineId());
|
||||
transientVO.setNumber(i++);
|
||||
transientVO.setWaveName(eventDetail.getWavePath());
|
||||
Instant timeId = eventDetail.getStartTime();
|
||||
ZoneId zoneId = ZoneId.systemDefault();
|
||||
LocalDateTime localDateTime = LocalDateTime.ofInstant(timeId, zoneId);
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
String format = dateTimeFormatter.format(localDateTime);
|
||||
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
String format = dateTimeFormatter.format(eventDetail.getStartTime());
|
||||
transientVO.setTime(format);
|
||||
switch (eventDetail.getEventType()) {
|
||||
case 0+"":
|
||||
|
||||
@@ -48,7 +48,10 @@
|
||||
FROM
|
||||
r_stat_harmonic_org_m a
|
||||
WHERE
|
||||
a.org_no=c.org_no and
|
||||
a.org_no=c.org_no
|
||||
and a.data_Type = #{dataType}
|
||||
|
||||
and
|
||||
a.harmonic_type=c.harmonic_type
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND (data_date >= date(
|
||||
@@ -66,7 +69,9 @@
|
||||
FROM
|
||||
r_stat_harmonic_org_m a
|
||||
WHERE
|
||||
a.org_no=c.org_no and
|
||||
a.org_no=c.org_no
|
||||
and a.data_Type = #{dataType}
|
||||
and
|
||||
a.harmonic_type=c.harmonic_type
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND (data_date >= date(
|
||||
@@ -79,11 +84,13 @@
|
||||
) chainAccrued ,
|
||||
(
|
||||
SELECT
|
||||
over_limit_measurement_accrued
|
||||
over_limit_measurement_average
|
||||
FROM
|
||||
r_stat_harmonic_org_m a
|
||||
WHERE
|
||||
a.org_no=c.org_no and
|
||||
a.org_no=c.org_no
|
||||
and a.data_Type = #{dataType}
|
||||
and
|
||||
a.harmonic_type=c.harmonic_type
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND (data_date >= date(
|
||||
@@ -100,7 +107,9 @@
|
||||
FROM
|
||||
r_stat_harmonic_org_m a
|
||||
WHERE
|
||||
a.org_no=c.org_no and
|
||||
a.org_no=c.org_no
|
||||
and a.data_Type = #{dataType}
|
||||
and
|
||||
a.harmonic_type=c.harmonic_type
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND (data_date >= date(
|
||||
|
||||
@@ -48,7 +48,9 @@
|
||||
FROM
|
||||
r_stat_harmonic_org_q a
|
||||
WHERE
|
||||
a.org_no=c.org_no and
|
||||
a.org_no=c.org_no
|
||||
and a.data_Type = #{dataType}
|
||||
and
|
||||
a.harmonic_type=c.harmonic_type
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND (data_date >= date(
|
||||
@@ -66,7 +68,9 @@
|
||||
FROM
|
||||
r_stat_harmonic_org_q a
|
||||
WHERE
|
||||
a.org_no=c.org_no and
|
||||
a.org_no=c.org_no
|
||||
and a.data_Type = #{dataType}
|
||||
and
|
||||
a.harmonic_type=c.harmonic_type
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND (data_date >= date(
|
||||
@@ -79,11 +83,13 @@
|
||||
) chainAccrued ,
|
||||
(
|
||||
SELECT
|
||||
over_limit_measurement_accrued
|
||||
over_limit_measurement_average
|
||||
FROM
|
||||
r_stat_harmonic_org_q a
|
||||
WHERE
|
||||
a.org_no=c.org_no and
|
||||
a.org_no=c.org_no
|
||||
and a.data_Type = #{dataType}
|
||||
and
|
||||
a.harmonic_type=c.harmonic_type
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND (data_date >= date(
|
||||
@@ -100,7 +106,9 @@
|
||||
FROM
|
||||
r_stat_harmonic_org_q a
|
||||
WHERE
|
||||
a.org_no=c.org_no and
|
||||
a.org_no=c.org_no
|
||||
and a.data_Type = #{dataType}
|
||||
and
|
||||
a.harmonic_type=c.harmonic_type
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND (data_date >= date(
|
||||
|
||||
@@ -48,7 +48,9 @@
|
||||
FROM
|
||||
r_stat_harmonic_org_y a
|
||||
WHERE
|
||||
a.org_no=c.org_no and
|
||||
a.org_no=c.org_no
|
||||
and a.data_Type = #{dataType}
|
||||
and
|
||||
a.harmonic_type=c.harmonic_type
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND (data_date >= date(
|
||||
@@ -66,7 +68,9 @@
|
||||
FROM
|
||||
r_stat_harmonic_org_y a
|
||||
WHERE
|
||||
a.org_no=c.org_no and
|
||||
a.org_no=c.org_no
|
||||
and a.data_Type = #{dataType}
|
||||
and
|
||||
a.harmonic_type=c.harmonic_type
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND (data_date >= date(
|
||||
@@ -79,11 +83,13 @@
|
||||
) chainAccrued ,
|
||||
(
|
||||
SELECT
|
||||
over_limit_measurement_accrued
|
||||
over_limit_measurement_average
|
||||
FROM
|
||||
r_stat_harmonic_org_y a
|
||||
WHERE
|
||||
a.org_no=c.org_no and
|
||||
a.org_no=c.org_no
|
||||
and a.data_Type = #{dataType}
|
||||
and
|
||||
a.harmonic_type=c.harmonic_type
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND (data_date >= date(
|
||||
@@ -100,7 +106,9 @@
|
||||
FROM
|
||||
r_stat_harmonic_org_y a
|
||||
WHERE
|
||||
a.org_no=c.org_no and
|
||||
a.org_no=c.org_no
|
||||
and a.data_Type = #{dataType}
|
||||
and
|
||||
a.harmonic_type=c.harmonic_type
|
||||
<if test="param!=null and param.startTime != null and param.startTime !=''">
|
||||
AND (data_date >= date(
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.dto.OverLimitLineDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionParamDTO;
|
||||
import com.njcn.device.pq.pojo.dto.WarningSubstationDTO;
|
||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||
import com.njcn.harmonic.constant.Param;
|
||||
import com.njcn.harmonic.mapper.RStatLimitRateDMapper;
|
||||
import com.njcn.harmonic.pojo.excel.area.AreaExcel;
|
||||
@@ -301,7 +302,8 @@ public class AnalyzeServiceImpl implements IAnalyzeService {
|
||||
list.addAll(monMap.keySet());
|
||||
PollutionParamDTO pollutionParamDTO = new PollutionParamDTO();
|
||||
pollutionParamDTO.setLineList(list);
|
||||
// List<AreaLineInfoVO> data = lineFeignClient.getBaseLineAreaInfo(list).getData();
|
||||
List<AreaLineInfoVO> data = lineFeignClient.getBaseLineAreaInfo(list).getData();
|
||||
System.out.println(data);
|
||||
List<OverLimitLineDTO> overLimitLineList = lineFeignClient.getOverLimitLineInfo(pollutionParamDTO).getData();
|
||||
List<RStatLimitRateDPO> rStatLimitRateDPOS = rateDMapper.selectList(new QueryWrapper<RStatLimitRateDPO>()
|
||||
.in("r_stat_limit_rate_d.my_index", list)
|
||||
|
||||
@@ -37,6 +37,7 @@ import java.math.BigDecimal;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Instant;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -78,9 +79,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
List<EventDetailVO> eventDetailVOList = new ArrayList<>();
|
||||
if (!eventDetailList.isEmpty()) {
|
||||
for (EventDetail eventdetail : eventDetailList) {
|
||||
Instant now = eventdetail.getStartTime();
|
||||
Long time = now.toEpochMilli();
|
||||
String timeText = format.format(time);
|
||||
String timeText = eventdetail.getStartTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"));
|
||||
EventDetailVO eventDetailVO = new EventDetailVO();
|
||||
eventDetailVO.setId(eventdetail.getLineId());
|
||||
eventDetailVO.setTime(timeText);
|
||||
|
||||
@@ -175,8 +175,8 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
|
||||
@Override
|
||||
public List<PollutionVO> getDeptSubstationRelations(HarmonicPublicParam harmonicPublicParam) {
|
||||
List<PollutionVO> list = new ArrayList<>();
|
||||
String pollutionType = harmonicPublicParam.getStatisticalType ( ).getId ();
|
||||
String searchBeginTime = harmonicPublicParam.getSearchBeginTime ( ).substring (0,10);
|
||||
String pollutionType = harmonicPublicParam.getStatisticalType ().getId ();
|
||||
String searchBeginTime = harmonicPublicParam.getSearchBeginTime ().substring (0,10);
|
||||
if (StringUtils.isBlank(RequestUtil.getDeptIndex())){
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -115,10 +115,14 @@ public class RStatHarmonicOrgMServiceImpl extends ServiceImpl<StatHarmonicOrgMMa
|
||||
if (ObjectUtil.isNotNull(data1)) {
|
||||
r.setHarmonicName(data1.getName());
|
||||
r.setSort(data1.getSort());
|
||||
if(r.getOverDay()!=0){
|
||||
DecimalFormat df = new DecimalFormat("###.00");
|
||||
Float averageOverDay = Float.parseFloat(
|
||||
df.format(r.getOverDay() / (r.getOverLimitMeasurementAccrued() * 1.0)));
|
||||
r.setAverageOverDay(averageOverDay);
|
||||
}else{
|
||||
r.setAverageOverDay(0.0f);
|
||||
}
|
||||
b.add(r);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.njcn.system.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zbj
|
||||
* @since 2023-04-17
|
||||
*/
|
||||
@Data
|
||||
@TableName("pqs_resinformation")
|
||||
public class Resinformation {
|
||||
|
||||
/**
|
||||
* 资源序号
|
||||
*/
|
||||
@TableField(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 资源名称
|
||||
*/
|
||||
@TableField(value = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 资源描述
|
||||
*/
|
||||
@TableField(value = "description")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 资源路径
|
||||
*/
|
||||
@TableField(value = "res_url")
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 数据更新人ID(外键user表)
|
||||
*/
|
||||
@TableField(value = "updateuser")
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
* 数据更新时间
|
||||
*/
|
||||
@TableField(value = "updatetime")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 数据状态(0: 删除; 1: 正常)
|
||||
*/
|
||||
@TableField(value = "state")
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 系统类型Guid
|
||||
*/
|
||||
@TableField(value = "systype")
|
||||
private String systemType;
|
||||
|
||||
/**
|
||||
* 资源类型
|
||||
*/
|
||||
@TableField(value = "type")
|
||||
private String type;
|
||||
|
||||
}
|
||||
@@ -52,6 +52,12 @@
|
||||
<artifactId>okio</artifactId>
|
||||
<version>2.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-oss</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.njcn.system.controller;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.system.service.IResourceAdministrationService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
* @author: zbj
|
||||
* @date: 2023/04/17
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "资源管理")
|
||||
@RestController
|
||||
@RequestMapping("/resourceAdministration")
|
||||
@RequiredArgsConstructor
|
||||
public class ResourceAdministrationController extends BaseController {
|
||||
|
||||
private final IResourceAdministrationService iResourceAdministrationService;
|
||||
|
||||
/**
|
||||
* 上传资源
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/uploadFile")
|
||||
@ApiOperation("上传资源")
|
||||
public HttpResult<Boolean> uploadFile(@ApiParam(value = "文件", required = true)@RequestPart("multipartFile") MultipartFile multipartFile,
|
||||
@ApiParam(value = "资源名称", required = true)String name,
|
||||
@ApiParam(value = "资源类型", required = true) String type,
|
||||
@ApiParam(value = "资源描述", required = false)String describe,
|
||||
@ApiParam(value = "系统类型Guid", required = true) String systemType) {
|
||||
String methodDescribe = getMethodDescribe("uploadFile");
|
||||
Boolean flag = iResourceAdministrationService.uploadFile(multipartFile, name, type, describe, systemType);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.system.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.system.pojo.po.Resinformation;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
* @author: zbj
|
||||
* @date: 2023/04/17
|
||||
*/
|
||||
@Mapper
|
||||
public interface ResourceAdministrationMapper extends BaseMapper<Resinformation> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.system.mapper.ResourceAdministrationMapper">
|
||||
</mapper>
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.njcn.system.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.system.pojo.po.Resinformation;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
* @author: zbj
|
||||
* @date: 2023/04/17
|
||||
*/
|
||||
public interface IResourceAdministrationService extends IService<Resinformation> {
|
||||
|
||||
Boolean uploadFile(MultipartFile multipartFile, String name, String type, String describe,String systemType);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.njcn.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.system.mapper.ResourceAdministrationMapper;
|
||||
import com.njcn.system.pojo.po.Resinformation;
|
||||
import com.njcn.system.service.IResourceAdministrationService;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
* @author: zbj
|
||||
* @date: 2023/04/17
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class ResourceAdministrationServiceImpl extends ServiceImpl<ResourceAdministrationMapper, Resinformation> implements IResourceAdministrationService {
|
||||
|
||||
private final ResourceAdministrationMapper resourceAdministrationMapper;
|
||||
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
|
||||
@Override
|
||||
public Boolean uploadFile(MultipartFile multipartFile, String name, String type, String describe, String systemType) {
|
||||
//通过封装好的文件工具类来传入文件和文件夹名称来获取文件路径
|
||||
String url = fileStorageUtil.uploadMultipart(multipartFile, OssPath.RESOURCEADMINISTRATION);
|
||||
//创建对象
|
||||
Resinformation resinformation = new Resinformation();
|
||||
resinformation.setName(name);
|
||||
if (Objects.nonNull(describe)) {
|
||||
resinformation.setDescription(describe);
|
||||
}
|
||||
resinformation.setUrl(url);
|
||||
//获取用户id
|
||||
String userIndex = RequestUtil.getUserIndex();
|
||||
//String userIndex = "123456";
|
||||
resinformation.setUpdateUser(userIndex);
|
||||
resinformation.setUpdateTime(LocalDateTime.now());
|
||||
resinformation.setState(1);
|
||||
resinformation.setSystemType(systemType);
|
||||
resinformation.setType(type);
|
||||
return this.save(resinformation);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user