1383 changed files with 103469 additions and 0 deletions
@ -0,0 +1,16 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<parent> |
||||||
|
<artifactId>hzinfo-ris-pxhd-service-api</artifactId> |
||||||
|
<groupId>org.springblade</groupId> |
||||||
|
<version>4.5.0.RELEASE</version> |
||||||
|
</parent> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
|
||||||
|
<artifactId>pxhd-dam-safety-monitor-api</artifactId> |
||||||
|
<name>${project.artifactId}</name> |
||||||
|
<packaging>jar</packaging> |
||||||
|
|
||||||
|
</project> |
||||||
@ -0,0 +1,24 @@ |
|||||||
|
package org.springblade.damsafety.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
/** |
||||||
|
* 建筑物信息表 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("t_building") |
||||||
|
public class TBuilding extends BaseEntity { |
||||||
|
@ApiModelProperty("水库编号") |
||||||
|
private String rscd; |
||||||
|
@ApiModelProperty("建筑物名称") |
||||||
|
private String name; |
||||||
|
@ApiModelProperty("建筑物分级路径") |
||||||
|
private String ipath; |
||||||
|
@ApiModelProperty("简介") |
||||||
|
private String brief; |
||||||
|
@ApiModelProperty("图片地址") |
||||||
|
private String attach; |
||||||
|
} |
||||||
@ -0,0 +1,38 @@ |
|||||||
|
package org.springblade.damsafety.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* 工程物信息表 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("t_projinfo") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class TProjInfo extends BaseEntity { |
||||||
|
@ApiModelProperty("水库编码") |
||||||
|
private String rscd; |
||||||
|
@ApiModelProperty("工程名称") |
||||||
|
private String projName; |
||||||
|
@ApiModelProperty("工程编号") |
||||||
|
private String projCode; |
||||||
|
@ApiModelProperty("开工日期") |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||||
|
private Date startDate; |
||||||
|
@ApiModelProperty("竣工日期") |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||||
|
private Date completeDate; |
||||||
|
@ApiModelProperty("蓄水日期") |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||||
|
private Date storeWaterDate; |
||||||
|
@ApiModelProperty("工程所在位置") |
||||||
|
private String location; |
||||||
|
@ApiModelProperty("备注") |
||||||
|
private String rm; |
||||||
|
} |
||||||
@ -0,0 +1,34 @@ |
|||||||
|
package org.springblade.damsafety.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.math.BigDecimal; |
||||||
|
|
||||||
|
/** |
||||||
|
* 大坝断面数据配置表 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("t_section_config") |
||||||
|
public class TSectionConfig implements Serializable { |
||||||
|
@ApiModelProperty("渗流量测点编号") |
||||||
|
@TableId(type = IdType.INPUT) |
||||||
|
private String stcd; |
||||||
|
@ApiModelProperty("断面编号") |
||||||
|
private String sectionNo; |
||||||
|
@ApiModelProperty("是否显示浸润线") |
||||||
|
private String opinion; |
||||||
|
@ApiModelProperty("x轴") |
||||||
|
private BigDecimal xzhou; |
||||||
|
@ApiModelProperty("y轴最大值") |
||||||
|
private BigDecimal ymax; |
||||||
|
@ApiModelProperty("y轴最小值") |
||||||
|
private BigDecimal ymin; |
||||||
|
@ApiModelProperty("警戒值") |
||||||
|
private BigDecimal warm; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,32 @@ |
|||||||
|
package org.springblade.damsafety.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* 断面特征点信息表 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("wrp_dams_b") |
||||||
|
public class WrpDamsB implements Serializable { |
||||||
|
@ApiModelProperty("断面编号") |
||||||
|
private String damcd; |
||||||
|
@ApiModelProperty("特征点编号") |
||||||
|
@TableId(type= IdType.INPUT) |
||||||
|
private String damscd; |
||||||
|
@ApiModelProperty("特征点名称") |
||||||
|
private String damsnm; |
||||||
|
@ApiModelProperty("起点距(m)") |
||||||
|
private BigDecimal redi; |
||||||
|
@ApiModelProperty("高程(m)") |
||||||
|
private BigDecimal poel; |
||||||
|
@ApiModelProperty("更新时间") |
||||||
|
private Date dtuptm; |
||||||
|
} |
||||||
@ -0,0 +1,56 @@ |
|||||||
|
package org.springblade.damsafety.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
*水平位移监测测点 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("wrp_dfr_srhrdsmp") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class WrpDfrSrhrdsmp extends BaseEntity { |
||||||
|
@ApiModelProperty("测站编码") |
||||||
|
private String stcd; |
||||||
|
@ApiModelProperty("断面编号") |
||||||
|
private String damcd; |
||||||
|
@ApiModelProperty("测点编号") |
||||||
|
private String mpcd; |
||||||
|
@ApiModelProperty("桩号") |
||||||
|
private String ch; |
||||||
|
@ApiModelProperty("轴距") |
||||||
|
private BigDecimal ofax; |
||||||
|
@ApiModelProperty("高程") |
||||||
|
private BigDecimal el; |
||||||
|
@ApiModelProperty("基准值 X") |
||||||
|
private BigDecimal stvlx; |
||||||
|
@ApiModelProperty("基准值 Y") |
||||||
|
private BigDecimal stvly; |
||||||
|
@ApiModelProperty("位移阈值") |
||||||
|
private BigDecimal xyhrds; |
||||||
|
@ApiModelProperty("型式") |
||||||
|
private String tp; |
||||||
|
@ApiModelProperty("基础情况") |
||||||
|
private String bsin; |
||||||
|
@ApiModelProperty("安装日期") |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||||
|
private Date indt; |
||||||
|
@ApiModelProperty("测定日期") |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||||
|
private Date dtdt; |
||||||
|
@ApiModelProperty("仪器编号") |
||||||
|
private String dvcd; |
||||||
|
@ApiModelProperty("经度") |
||||||
|
private BigDecimal eslg; |
||||||
|
@ApiModelProperty("纬度") |
||||||
|
private BigDecimal nrlt; |
||||||
|
@ApiModelProperty("备注") |
||||||
|
private String rm; |
||||||
|
} |
||||||
@ -0,0 +1,55 @@ |
|||||||
|
package org.springblade.damsafety.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* 监测基点表 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("wrp_dfr_srvrdsbp") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class WrpDfrSrvrdsbp extends BaseEntity { |
||||||
|
@ApiModelProperty("水库代码") |
||||||
|
private String rscd; |
||||||
|
@ApiModelProperty("水工建筑物id") |
||||||
|
private Long hycncd; |
||||||
|
@ApiModelProperty("基点编号") |
||||||
|
private String bpcd; |
||||||
|
@ApiModelProperty("考证信息日期") |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||||
|
private Date txindt; |
||||||
|
@ApiModelProperty("基点类型") |
||||||
|
private String bptp; |
||||||
|
@ApiModelProperty("桩号") |
||||||
|
private String ch; |
||||||
|
@ApiModelProperty("轴距") |
||||||
|
private BigDecimal ofax; |
||||||
|
@ApiModelProperty("高程") |
||||||
|
private BigDecimal el; |
||||||
|
@ApiModelProperty("型式") |
||||||
|
private String tp; |
||||||
|
@ApiModelProperty("基础情况") |
||||||
|
private String bsin; |
||||||
|
@ApiModelProperty("安装日期") |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||||
|
private Date indt; |
||||||
|
@ApiModelProperty("测定日期") |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||||
|
private Date dtdt; |
||||||
|
@ApiModelProperty("经度") |
||||||
|
private BigDecimal lgtd; |
||||||
|
@ApiModelProperty("纬度") |
||||||
|
private BigDecimal lttd; |
||||||
|
@ApiModelProperty("工作状态") |
||||||
|
private String wkcn; |
||||||
|
@ApiModelProperty("备注") |
||||||
|
private String rm; |
||||||
|
} |
||||||
@ -0,0 +1,53 @@ |
|||||||
|
package org.springblade.damsafety.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* 垂直位移监测测点 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("wrp_dfr_srvrdsmp") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class WrpDfrSrvrdsmp extends BaseEntity { |
||||||
|
@ApiModelProperty("测站编码") |
||||||
|
private String stcd; |
||||||
|
@ApiModelProperty("断面编号") |
||||||
|
private String damcd; |
||||||
|
@ApiModelProperty("测点编号") |
||||||
|
private String mpcd; |
||||||
|
@ApiModelProperty("桩号") |
||||||
|
private String ch; |
||||||
|
@ApiModelProperty("轴距") |
||||||
|
private BigDecimal ofax; |
||||||
|
@ApiModelProperty("初始高程") |
||||||
|
private BigDecimal inel; |
||||||
|
@ApiModelProperty("位移阈值") |
||||||
|
private BigDecimal vrds; |
||||||
|
@ApiModelProperty("型式") |
||||||
|
private String tp; |
||||||
|
@ApiModelProperty("基础情况") |
||||||
|
private String bsin; |
||||||
|
@ApiModelProperty("安装日期") |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||||
|
private Date indt; |
||||||
|
@ApiModelProperty("测定日期") |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||||
|
private Date dtdt; |
||||||
|
@ApiModelProperty("仪器编号") |
||||||
|
private String dvcd; |
||||||
|
@ApiModelProperty("经度") |
||||||
|
private BigDecimal eslg; |
||||||
|
@ApiModelProperty("纬度") |
||||||
|
private BigDecimal nrlt; |
||||||
|
@ApiModelProperty("备注") |
||||||
|
private String rm; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,38 @@ |
|||||||
|
package org.springblade.damsafety.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
|
||||||
|
/** |
||||||
|
* 大坝断面信息表 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("wrp_section_b") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class WrpSectionB extends BaseEntity { |
||||||
|
@ApiModelProperty("水库编号") |
||||||
|
private String rscd; |
||||||
|
@ApiModelProperty("建筑物id") |
||||||
|
private Long buildingId; |
||||||
|
@ApiModelProperty("断面编码") |
||||||
|
private String damcd; |
||||||
|
@ApiModelProperty("断面名称") |
||||||
|
private String damnm; |
||||||
|
@ApiModelProperty("防渗墙类型") |
||||||
|
private String wallType; |
||||||
|
@ApiModelProperty("断面长度") |
||||||
|
private BigDecimal damlen; |
||||||
|
@ApiModelProperty("断面宽度") |
||||||
|
private BigDecimal damwd; |
||||||
|
@ApiModelProperty("备注") |
||||||
|
private String rm; |
||||||
|
@ApiModelProperty("预留字段") |
||||||
|
private String text; |
||||||
|
@ApiModelProperty("图片地址") |
||||||
|
private String attach; |
||||||
|
} |
||||||
@ -0,0 +1,58 @@ |
|||||||
|
package org.springblade.damsafety.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* 测压管测点 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("wrp_spg_pztb") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class WrpSpgPztb extends BaseEntity { |
||||||
|
@ApiModelProperty("测站编码") |
||||||
|
private String stcd; |
||||||
|
@ApiModelProperty("测点编号") |
||||||
|
private String mpcd; |
||||||
|
@ApiModelProperty("断面编号") |
||||||
|
private String damcd; |
||||||
|
@ApiModelProperty("桩号") |
||||||
|
private String ch; |
||||||
|
@ApiModelProperty("坝轴距") |
||||||
|
private BigDecimal ofax; |
||||||
|
@ApiModelProperty("监测部位") |
||||||
|
private String msps; |
||||||
|
|
||||||
|
@ApiModelProperty("监测类型") |
||||||
|
private String mstp; |
||||||
|
@ApiModelProperty("安装高程") |
||||||
|
private BigDecimal el; |
||||||
|
@ApiModelProperty("进水段底高程") |
||||||
|
private BigDecimal ipbtel; |
||||||
|
@ApiModelProperty("进水段顶高程") |
||||||
|
private BigDecimal iptpel; |
||||||
|
@ApiModelProperty("管口高程") |
||||||
|
private BigDecimal tbtpel; |
||||||
|
@ApiModelProperty("管底高程") |
||||||
|
private BigDecimal tbbtel; |
||||||
|
@ApiModelProperty("水位阈值高程") |
||||||
|
private BigDecimal pztbtel; |
||||||
|
|
||||||
|
@ApiModelProperty("仪器编号") |
||||||
|
private String dvcd; |
||||||
|
@ApiModelProperty("经度") |
||||||
|
private BigDecimal eslg; |
||||||
|
@ApiModelProperty("纬度") |
||||||
|
private BigDecimal nrlt; |
||||||
|
@ApiModelProperty("备注") |
||||||
|
private String rm; |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,52 @@ |
|||||||
|
package org.springblade.damsafety.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* 渗流压力测点信息表 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("wrp_spg_spprmp") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class WrpSpgSpprmp extends BaseEntity { |
||||||
|
@ApiModelProperty("测站编码") |
||||||
|
private String stcd; |
||||||
|
@ApiModelProperty("断面编码") |
||||||
|
private String damcd; |
||||||
|
@ApiModelProperty("测点编号") |
||||||
|
private String mpcd; |
||||||
|
@ApiModelProperty("考证信息日期") |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||||
|
private Date txindt; |
||||||
|
@ApiModelProperty("桩号") |
||||||
|
private String ch; |
||||||
|
@ApiModelProperty("轴距") |
||||||
|
private BigDecimal ofax; |
||||||
|
@ApiModelProperty("高程") |
||||||
|
private BigDecimal el; |
||||||
|
@ApiModelProperty("监测类型") |
||||||
|
private String mstp; |
||||||
|
@ApiModelProperty("透水段底高程") |
||||||
|
private BigDecimal pmbtel; |
||||||
|
@ApiModelProperty("透水段顶高程") |
||||||
|
private BigDecimal pmtpel; |
||||||
|
@ApiModelProperty("安装日期") |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||||
|
private Date indt; |
||||||
|
@ApiModelProperty("仪器出厂编号") |
||||||
|
private String dvfccd; |
||||||
|
@ApiModelProperty("工作状态") |
||||||
|
private String wkcn; |
||||||
|
@ApiModelProperty("备注") |
||||||
|
private String rm; |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,45 @@ |
|||||||
|
package org.springblade.damsafety.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* 渗流量测点 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("wrp_spg_spqnmp") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class WrpSpgSpqnmp extends BaseEntity { |
||||||
|
@ApiModelProperty("测站编码") |
||||||
|
private String stcd; |
||||||
|
@ApiModelProperty("测点编号") |
||||||
|
private String mpcd; |
||||||
|
@ApiModelProperty("断面编号") |
||||||
|
private String damcd; |
||||||
|
@ApiModelProperty("桩号") |
||||||
|
private String ch; |
||||||
|
@ApiModelProperty("轴距") |
||||||
|
private BigDecimal ofax; |
||||||
|
@ApiModelProperty("高程") |
||||||
|
private BigDecimal el; |
||||||
|
@ApiModelProperty("渗流阈值") |
||||||
|
private BigDecimal spprwl; |
||||||
|
@ApiModelProperty("安装日期") |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||||
|
private Date indt; |
||||||
|
@ApiModelProperty("仪器编号") |
||||||
|
private String dvcd; |
||||||
|
@ApiModelProperty("经度") |
||||||
|
private BigDecimal eslg; |
||||||
|
@ApiModelProperty("纬度") |
||||||
|
private BigDecimal nrlt; |
||||||
|
@ApiModelProperty("备注") |
||||||
|
private String rm; |
||||||
|
} |
||||||
@ -0,0 +1,26 @@ |
|||||||
|
package org.springblade.damsafety.feign; |
||||||
|
|
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.damsafety.vo.WrpSectionBVO; |
||||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
@FeignClient( |
||||||
|
value = "dam-safety", |
||||||
|
url = "${feign.dam-safety:}" |
||||||
|
) |
||||||
|
public interface IWrpSectionBClient { |
||||||
|
String API_PREFIX = "/wrpSectionBClient"; |
||||||
|
String LIST = API_PREFIX + "/list"; |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取断面列表 |
||||||
|
* |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@GetMapping(LIST) |
||||||
|
R<List<WrpSectionBVO>> list(Map<String, Object> param); |
||||||
|
} |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
package org.springblade.damsafety.vo; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
import org.springblade.damsafety.entity.TBuilding; |
||||||
|
|
||||||
|
public class TBuildingVo extends TBuilding { |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,7 @@ |
|||||||
|
package org.springblade.damsafety.vo; |
||||||
|
|
||||||
|
import org.springblade.damsafety.entity.TProjInfo; |
||||||
|
|
||||||
|
public class TProjInfoVo extends TProjInfo { |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,7 @@ |
|||||||
|
package org.springblade.damsafety.vo; |
||||||
|
|
||||||
|
import org.springblade.damsafety.entity.WrpDfrSrhrdsmp; |
||||||
|
|
||||||
|
public class WrpDfrSrhrdsmpVo extends WrpDfrSrhrdsmp { |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,6 @@ |
|||||||
|
package org.springblade.damsafety.vo; |
||||||
|
|
||||||
|
import org.springblade.damsafety.entity.WrpDfrSrvrdsbp; |
||||||
|
|
||||||
|
public class WrpDfrSrvrdsbpVo extends WrpDfrSrvrdsbp { |
||||||
|
} |
||||||
@ -0,0 +1,6 @@ |
|||||||
|
package org.springblade.damsafety.vo; |
||||||
|
|
||||||
|
import org.springblade.damsafety.entity.WrpDfrSrvrdsmp; |
||||||
|
|
||||||
|
public class WrpDfrSrvrdsmpVo extends WrpDfrSrvrdsmp { |
||||||
|
} |
||||||
@ -0,0 +1,15 @@ |
|||||||
|
package org.springblade.damsafety.vo; |
||||||
|
|
||||||
|
import org.springblade.damsafety.entity.WrpDfrSrvrdsbp; |
||||||
|
import org.springblade.damsafety.entity.WrpSectionB; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@Data |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class WrpSectionBVO extends WrpSectionB { |
||||||
|
//测点集合
|
||||||
|
private List<WrpDfrSrvrdsbp> points; |
||||||
|
} |
||||||
@ -0,0 +1,6 @@ |
|||||||
|
package org.springblade.damsafety.vo; |
||||||
|
|
||||||
|
import org.springblade.damsafety.entity.WrpSpgPztb; |
||||||
|
|
||||||
|
public class WrpSpgPztbVo extends WrpSpgPztb { |
||||||
|
} |
||||||
@ -0,0 +1,6 @@ |
|||||||
|
package org.springblade.damsafety.vo; |
||||||
|
|
||||||
|
import org.springblade.damsafety.entity.WrpSpgSpprmp; |
||||||
|
|
||||||
|
public class WrpSpgSpprmpVo extends WrpSpgSpprmp { |
||||||
|
} |
||||||
@ -0,0 +1,6 @@ |
|||||||
|
package org.springblade.damsafety.vo; |
||||||
|
|
||||||
|
import org.springblade.damsafety.entity.WrpSpgSpqnmp; |
||||||
|
|
||||||
|
public class WrpSpgSpqnmpVo extends WrpSpgSpqnmp { |
||||||
|
} |
||||||
@ -0,0 +1,17 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<parent> |
||||||
|
<artifactId>hzinfo-ris-pxhd-service-api</artifactId> |
||||||
|
<groupId>org.springblade</groupId> |
||||||
|
<version>4.5.0.RELEASE</version> |
||||||
|
</parent> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
|
||||||
|
<artifactId>pxhd-engineering-management-api</artifactId> |
||||||
|
<name>${project.artifactId}</name> |
||||||
|
<packaging>jar</packaging> |
||||||
|
|
||||||
|
|
||||||
|
</project> |
||||||
@ -0,0 +1,33 @@ |
|||||||
|
package org.springblade.engineer_management.util; |
||||||
|
|
||||||
|
import org.apache.commons.io.FileUtils; |
||||||
|
import org.springframework.http.HttpHeaders; |
||||||
|
import org.springframework.http.HttpStatus; |
||||||
|
import org.springframework.http.MediaType; |
||||||
|
import org.springframework.http.ResponseEntity; |
||||||
|
|
||||||
|
import java.io.File; |
||||||
|
import java.io.IOException; |
||||||
|
import java.net.URLEncoder; |
||||||
|
|
||||||
|
public class DownLoadUtil { |
||||||
|
public DownLoadUtil() { |
||||||
|
} |
||||||
|
|
||||||
|
public static ResponseEntity<byte[]> downLoad(File downFile) throws IOException { |
||||||
|
if (!downFile.exists()) { |
||||||
|
// throw new HZException("500", "该文件不存在,请查证");
|
||||||
|
return null; |
||||||
|
} else { |
||||||
|
byte[] data = FileUtils.readFileToByteArray(downFile); |
||||||
|
return downLoad(data, downFile.getName()); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public static ResponseEntity<byte[]> downLoad(byte[] data, String downName) throws IOException { |
||||||
|
HttpHeaders headers = new HttpHeaders(); |
||||||
|
headers.setContentDispositionFormData("attachment", URLEncoder.encode(downName, "UTF-8")); |
||||||
|
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); |
||||||
|
return new ResponseEntity(data, headers, HttpStatus.OK); |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,16 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<parent> |
||||||
|
<artifactId>hzinfo-ris-pxhd-service-api</artifactId> |
||||||
|
<groupId>org.springblade</groupId> |
||||||
|
<version>4.5.0.RELEASE</version> |
||||||
|
</parent> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
|
||||||
|
<artifactId>pxhd-general-dispatching-api</artifactId> |
||||||
|
<name>${project.artifactId}</name> |
||||||
|
<packaging>jar</packaging> |
||||||
|
|
||||||
|
</project> |
||||||
@ -0,0 +1,16 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<parent> |
||||||
|
<artifactId>hzinfo-ris-pxhd-service-api</artifactId> |
||||||
|
<groupId>org.springblade</groupId> |
||||||
|
<version>4.5.0.RELEASE</version> |
||||||
|
</parent> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
|
||||||
|
<artifactId>pxhd-hz3000-real-data-api</artifactId> |
||||||
|
<name>${project.artifactId}</name> |
||||||
|
<packaging>jar</packaging> |
||||||
|
|
||||||
|
</project> |
||||||
@ -0,0 +1,39 @@ |
|||||||
|
package org.springblade.hz3000_real_data.entity; |
||||||
|
|
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
public class DataGridModel<T> implements Serializable { |
||||||
|
private static final long serialVersionUID = 8591890308861767849L; |
||||||
|
private long total = 0L; |
||||||
|
private List<T> rows; |
||||||
|
private List<T> footer; |
||||||
|
|
||||||
|
public DataGridModel() { |
||||||
|
} |
||||||
|
|
||||||
|
public List<T> getFooter() { |
||||||
|
return this.footer; |
||||||
|
} |
||||||
|
|
||||||
|
public void setFooter(List<T> footer) { |
||||||
|
this.footer = footer; |
||||||
|
} |
||||||
|
|
||||||
|
public long getTotal() { |
||||||
|
return this.total; |
||||||
|
} |
||||||
|
|
||||||
|
public void setTotal(long total) { |
||||||
|
this.total = total; |
||||||
|
} |
||||||
|
|
||||||
|
public List<T> getRows() { |
||||||
|
return this.rows; |
||||||
|
} |
||||||
|
|
||||||
|
public void setRows(List<T> rows) { |
||||||
|
this.rows = rows; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,28 @@ |
|||||||
|
package org.springblade.hz3000_real_data.entity; |
||||||
|
|
||||||
|
import java.util.Collections; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
public class ListPageUtil<T> { |
||||||
|
public ListPageUtil() { |
||||||
|
} |
||||||
|
|
||||||
|
public List<T> getPagedList(int pageNum, int pageSize, List<T> data) { |
||||||
|
if (pageNum > 0 && pageSize > 0) { |
||||||
|
int fromIndex = (pageNum - 1) * pageSize; |
||||||
|
if (fromIndex >= data.size()) { |
||||||
|
return Collections.emptyList(); |
||||||
|
} else { |
||||||
|
int toIndex = pageNum * pageSize; |
||||||
|
if (toIndex >= data.size()) { |
||||||
|
toIndex = data.size(); |
||||||
|
} |
||||||
|
|
||||||
|
return data.subList(fromIndex, toIndex); |
||||||
|
} |
||||||
|
} else { |
||||||
|
return data; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,47 @@ |
|||||||
|
package org.springblade.hz3000_real_data.entity; |
||||||
|
|
||||||
|
public class SystemPath { |
||||||
|
private static String SYSTEM_NAME = System.getProperty("os.name").toLowerCase(); |
||||||
|
|
||||||
|
public SystemPath() { |
||||||
|
} |
||||||
|
|
||||||
|
public static String getSysPath() { |
||||||
|
String path = Thread.currentThread().getContextClassLoader().getResource("").toString(); |
||||||
|
String temp = path.replaceFirst("file:/", "").replaceFirst("WEB-INF/classes/", ""); |
||||||
|
String separator = System.getProperty("file.separator"); |
||||||
|
String resultPath = temp.replaceAll("/", separator + separator); |
||||||
|
return resultPath; |
||||||
|
} |
||||||
|
|
||||||
|
public static String getClassPath() { |
||||||
|
String path = Thread.currentThread().getContextClassLoader().getResource("").toString(); |
||||||
|
String temp = path.replaceFirst("file:/", ""); |
||||||
|
String separator = System.getProperty("file.separator"); |
||||||
|
String resultPath = temp.replaceAll("/", separator + separator); |
||||||
|
return resultPath; |
||||||
|
} |
||||||
|
|
||||||
|
public static String getSystempPath() { |
||||||
|
return System.getProperty("java.io.tmpdir"); |
||||||
|
} |
||||||
|
|
||||||
|
public static String getSeparator() { |
||||||
|
return System.getProperty("file.separator"); |
||||||
|
} |
||||||
|
|
||||||
|
public static boolean isWindows() { |
||||||
|
return SYSTEM_NAME.indexOf("win") >= 0; |
||||||
|
} |
||||||
|
|
||||||
|
public static boolean isLinux() { |
||||||
|
return SYSTEM_NAME.indexOf("linux") >= 0; |
||||||
|
} |
||||||
|
|
||||||
|
// public static void main(String[] args) {
|
||||||
|
// System.out.println(getSysPath());
|
||||||
|
// System.out.println(System.getProperty("java.io.tmpdir"));
|
||||||
|
// System.out.println(getSeparator());
|
||||||
|
// System.out.println(getClassPath());
|
||||||
|
// }
|
||||||
|
} |
||||||
@ -0,0 +1,112 @@ |
|||||||
|
package org.springblade.hz3000_real_data.fac.entity; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
|
||||||
|
/** |
||||||
|
* 数据点基础类 |
||||||
|
* |
||||||
|
* @author ypj |
||||||
|
*/ |
||||||
|
@ApiModel("原始点") |
||||||
|
public class BasePoint extends Point { |
||||||
|
private static final long serialVersionUID = 6878843178471415799L; |
||||||
|
@ApiModelProperty(value = "组id") |
||||||
|
private String groupId; |
||||||
|
@ApiModelProperty(value = "组名称") |
||||||
|
private String groupName; |
||||||
|
@ApiModelProperty(value = "站点id") |
||||||
|
private String factoryId; |
||||||
|
@ApiModelProperty(value = "站点名称") |
||||||
|
private String factoryName; |
||||||
|
@ApiModelProperty(value = "通道号") |
||||||
|
private String channelIndex; |
||||||
|
@ApiModelProperty(value = "模块号") |
||||||
|
private String moduleIndex; |
||||||
|
@ApiModelProperty(value = "地址号") |
||||||
|
private String addressIndex; |
||||||
|
@ApiModelProperty(value = "数据类型") |
||||||
|
private Integer dataType; |
||||||
|
@ApiModelProperty(value = "站点id") |
||||||
|
private String stationId; |
||||||
|
|
||||||
|
public String getGroupId() { |
||||||
|
return groupId; |
||||||
|
} |
||||||
|
|
||||||
|
public void setGroupId(String groupId) { |
||||||
|
this.groupId = groupId; |
||||||
|
} |
||||||
|
|
||||||
|
public String getGroupName() { |
||||||
|
return groupName; |
||||||
|
} |
||||||
|
|
||||||
|
public void setGroupName(String groupName) { |
||||||
|
this.groupName = groupName; |
||||||
|
} |
||||||
|
|
||||||
|
public String getFactoryId() { |
||||||
|
return factoryId; |
||||||
|
} |
||||||
|
|
||||||
|
public void setFactoryId(String factoryId) { |
||||||
|
this.factoryId = factoryId; |
||||||
|
} |
||||||
|
|
||||||
|
public String getFactoryName() { |
||||||
|
return factoryName; |
||||||
|
} |
||||||
|
|
||||||
|
public void setFactoryName(String factoryName) { |
||||||
|
this.factoryName = factoryName; |
||||||
|
} |
||||||
|
|
||||||
|
public String getChannelIndex() { |
||||||
|
return channelIndex; |
||||||
|
} |
||||||
|
|
||||||
|
public void setChannelIndex(String channelIndex) { |
||||||
|
this.channelIndex = channelIndex; |
||||||
|
} |
||||||
|
|
||||||
|
public String getModuleIndex() { |
||||||
|
return moduleIndex; |
||||||
|
} |
||||||
|
|
||||||
|
public void setModuleIndex(String moduleIndex) { |
||||||
|
this.moduleIndex = moduleIndex; |
||||||
|
} |
||||||
|
|
||||||
|
public String getAddressIndex() { |
||||||
|
return addressIndex; |
||||||
|
} |
||||||
|
|
||||||
|
public void setAddressIndex(String addressIndex) { |
||||||
|
this.addressIndex = addressIndex; |
||||||
|
} |
||||||
|
|
||||||
|
public Integer getDataType() { |
||||||
|
return dataType; |
||||||
|
} |
||||||
|
|
||||||
|
public void setDataType(Integer dataType) { |
||||||
|
this.dataType = dataType; |
||||||
|
} |
||||||
|
|
||||||
|
public String getStationId() { |
||||||
|
return stationId; |
||||||
|
} |
||||||
|
|
||||||
|
public void setStationId(String stationId) { |
||||||
|
this.stationId = stationId; |
||||||
|
} |
||||||
|
|
||||||
|
public void setBaseInfo(String stationId, String factoryId, String factoryName, String groupId, String groupName) { |
||||||
|
this.stationId = stationId; |
||||||
|
this.factoryId = factoryId; |
||||||
|
this.factoryName = factoryName; |
||||||
|
this.groupId = groupId; |
||||||
|
this.groupName = groupName; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,192 @@ |
|||||||
|
package org.springblade.hz3000_real_data.fac.entity; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@ApiModel |
||||||
|
public class DataGroup extends Point { |
||||||
|
private static final long serialVersionUID = -5427155903332937386L; |
||||||
|
@ApiModelProperty(value = "厂id") |
||||||
|
private String factoryId; |
||||||
|
@ApiModelProperty(value = "厂名称") |
||||||
|
private String factoryName; |
||||||
|
@ApiModelProperty(value = "是否加锁") |
||||||
|
private Boolean unlock; |
||||||
|
@ApiModelProperty(value = "遥测列表") |
||||||
|
private List<YcPoint> telemetryPointList; |
||||||
|
@ApiModelProperty(value = "遥控列表") |
||||||
|
private List<YkPoint> telecontrolPointList; |
||||||
|
@ApiModelProperty(value = "遥信列表") |
||||||
|
private List<YxPoint> telesignalPointList; |
||||||
|
@ApiModelProperty(value = "事件列表") |
||||||
|
private List<SoePoint> eventPointList; |
||||||
|
@ApiModelProperty(value = "字符串列表") |
||||||
|
private List<BasePoint> strPointList; |
||||||
|
@ApiModelProperty(value = "告警总数") |
||||||
|
private Integer soeSize = 0; |
||||||
|
@ApiModelProperty(value = "遥测总数") |
||||||
|
private Integer ycSize = 0; |
||||||
|
@ApiModelProperty(value = "遥控总数") |
||||||
|
private Integer ykSize = 0; |
||||||
|
@ApiModelProperty(value = "遥信总数") |
||||||
|
private Integer yxSize = 0; |
||||||
|
@ApiModelProperty(value = "字符串总数") |
||||||
|
private Integer strSize = 0; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "事件组") |
||||||
|
private GroupType soeGroup; |
||||||
|
@ApiModelProperty(value = "遥测组") |
||||||
|
private GroupType ycGroup; |
||||||
|
@ApiModelProperty(value = "遥信组") |
||||||
|
private GroupType yxGroup; |
||||||
|
@ApiModelProperty(value = "遥控组") |
||||||
|
private GroupType ykGroup; |
||||||
|
@ApiModelProperty(value = "字符串组") |
||||||
|
private GroupType strGroup; |
||||||
|
|
||||||
|
public GroupType getSoeGroup() { |
||||||
|
return soeGroup; |
||||||
|
} |
||||||
|
|
||||||
|
public void setSoeGroup(GroupType soeGroup) { |
||||||
|
this.soeGroup = soeGroup; |
||||||
|
} |
||||||
|
|
||||||
|
public GroupType getYcGroup() { |
||||||
|
return ycGroup; |
||||||
|
} |
||||||
|
|
||||||
|
public void setYcGroup(GroupType ycGroup) { |
||||||
|
this.ycGroup = ycGroup; |
||||||
|
} |
||||||
|
|
||||||
|
public GroupType getYxGroup() { |
||||||
|
return yxGroup; |
||||||
|
} |
||||||
|
|
||||||
|
public void setYxGroup(GroupType yxGroup) { |
||||||
|
this.yxGroup = yxGroup; |
||||||
|
} |
||||||
|
|
||||||
|
public GroupType getYkGroup() { |
||||||
|
return ykGroup; |
||||||
|
} |
||||||
|
|
||||||
|
public void setYkGroup(GroupType ykGroup) { |
||||||
|
this.ykGroup = ykGroup; |
||||||
|
} |
||||||
|
|
||||||
|
public String getFactoryId() { |
||||||
|
return factoryId; |
||||||
|
} |
||||||
|
|
||||||
|
public void setFactoryId(String factoryId) { |
||||||
|
this.factoryId = factoryId; |
||||||
|
} |
||||||
|
|
||||||
|
public String getFactoryName() { |
||||||
|
return factoryName; |
||||||
|
} |
||||||
|
|
||||||
|
public void setFactoryName(String factoryName) { |
||||||
|
this.factoryName = factoryName; |
||||||
|
} |
||||||
|
|
||||||
|
public Boolean isUnlock() { |
||||||
|
return unlock; |
||||||
|
} |
||||||
|
|
||||||
|
public void setUnlock(Boolean unlock) { |
||||||
|
this.unlock = unlock; |
||||||
|
} |
||||||
|
|
||||||
|
public List<YcPoint> getTelemetryPointList() { |
||||||
|
return telemetryPointList; |
||||||
|
} |
||||||
|
|
||||||
|
public void setTelemetryPointList(List<YcPoint> telemetryPointList) { |
||||||
|
this.telemetryPointList = telemetryPointList; |
||||||
|
} |
||||||
|
|
||||||
|
public List<YkPoint> getTelecontrolPointList() { |
||||||
|
return telecontrolPointList; |
||||||
|
} |
||||||
|
|
||||||
|
public void setTelecontrolPointList(List<YkPoint> telecontrolPointList) { |
||||||
|
this.telecontrolPointList = telecontrolPointList; |
||||||
|
} |
||||||
|
|
||||||
|
public List<YxPoint> getTelesignalPointList() { |
||||||
|
return telesignalPointList; |
||||||
|
} |
||||||
|
|
||||||
|
public void setTelesignalPointList(List<YxPoint> telesignalPointList) { |
||||||
|
this.telesignalPointList = telesignalPointList; |
||||||
|
} |
||||||
|
|
||||||
|
public List<SoePoint> getEventPointList() { |
||||||
|
return eventPointList; |
||||||
|
} |
||||||
|
|
||||||
|
public void setEventPointList(List<SoePoint> eventPointList) { |
||||||
|
this.eventPointList = eventPointList; |
||||||
|
} |
||||||
|
|
||||||
|
public List<BasePoint> getStrPointList() { |
||||||
|
return strPointList; |
||||||
|
} |
||||||
|
|
||||||
|
public void setStrPointList(List<BasePoint> strPointList) { |
||||||
|
this.strPointList = strPointList; |
||||||
|
} |
||||||
|
|
||||||
|
public int getSoeSize() { |
||||||
|
return soeSize; |
||||||
|
} |
||||||
|
|
||||||
|
public void setSoeSize(Integer soeSize) { |
||||||
|
this.soeSize = soeSize; |
||||||
|
} |
||||||
|
|
||||||
|
public int getYcSize() { |
||||||
|
return ycSize; |
||||||
|
} |
||||||
|
|
||||||
|
public void setYcSize(Integer ycSize) { |
||||||
|
this.ycSize = ycSize; |
||||||
|
} |
||||||
|
|
||||||
|
public int getYkSize() { |
||||||
|
return ykSize; |
||||||
|
} |
||||||
|
|
||||||
|
public void setYkSize(Integer ykSize) { |
||||||
|
this.ykSize = ykSize; |
||||||
|
} |
||||||
|
|
||||||
|
public int getYxSize() { |
||||||
|
return yxSize; |
||||||
|
} |
||||||
|
|
||||||
|
public void setYxSize(Integer yxSize) { |
||||||
|
this.yxSize = yxSize; |
||||||
|
} |
||||||
|
|
||||||
|
public GroupType getStrGroup() { |
||||||
|
return strGroup; |
||||||
|
} |
||||||
|
|
||||||
|
public void setStrGroup(GroupType strGroup) { |
||||||
|
this.strGroup = strGroup; |
||||||
|
} |
||||||
|
|
||||||
|
public Integer getStrSize() { |
||||||
|
return strSize; |
||||||
|
} |
||||||
|
|
||||||
|
public void setStrSize(Integer strSize) { |
||||||
|
this.strSize = strSize; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,71 @@ |
|||||||
|
package org.springblade.hz3000_real_data.fac.entity; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import org.springblade.hz3000_real_data.fac.utils.LanguageUtils; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@ApiModel("厂信息") |
||||||
|
public class Factory extends Point { |
||||||
|
private static final long serialVersionUID = -4443313438904921892L; |
||||||
|
@ApiModelProperty(value = "站点编号") |
||||||
|
private String stationNum; |
||||||
|
@ApiModelProperty(value = "组编号") |
||||||
|
private String theGroupNum; |
||||||
|
@ApiModelProperty(value = "组集合") |
||||||
|
private List<DataGroup> groups; |
||||||
|
@ApiModelProperty(value = "组id") |
||||||
|
private String theGroupId; |
||||||
|
@ApiModelProperty(value = "组总数") |
||||||
|
private Integer groupSize = 0; |
||||||
|
|
||||||
|
public String getStationNum() { |
||||||
|
return stationNum; |
||||||
|
} |
||||||
|
|
||||||
|
public void setStationNum(String stationNum) { |
||||||
|
this.stationNum = stationNum; |
||||||
|
} |
||||||
|
|
||||||
|
public String getTheGroupNum() { |
||||||
|
return theGroupNum; |
||||||
|
} |
||||||
|
|
||||||
|
public void setTheGroupNum(String theGroupNum) { |
||||||
|
this.theGroupNum = theGroupNum; |
||||||
|
} |
||||||
|
|
||||||
|
public List<DataGroup> getGroups() { |
||||||
|
return groups; |
||||||
|
} |
||||||
|
|
||||||
|
public void setGroups(List<DataGroup> groups) { |
||||||
|
this.groups = groups; |
||||||
|
} |
||||||
|
|
||||||
|
public String getTheGroupId() { |
||||||
|
return theGroupId; |
||||||
|
} |
||||||
|
|
||||||
|
public void setTheGroupId(String theGroupId) { |
||||||
|
this.theGroupId = theGroupId; |
||||||
|
} |
||||||
|
|
||||||
|
public void toEnglishName() { |
||||||
|
LanguageUtils.toEnglishName(this); |
||||||
|
} |
||||||
|
|
||||||
|
public void toChineseName() { |
||||||
|
LanguageUtils.toChinessName(this); |
||||||
|
} |
||||||
|
|
||||||
|
public int getGroupSize() { |
||||||
|
return groupSize; |
||||||
|
} |
||||||
|
|
||||||
|
public void setGroupSize(Integer groupSize) { |
||||||
|
this.groupSize = groupSize; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,32 @@ |
|||||||
|
package org.springblade.hz3000_real_data.fac.entity; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@ApiModel("组类型") |
||||||
|
public class GroupType extends BasePoint { |
||||||
|
private static final long serialVersionUID = -5013035391910210737L; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "点列表") |
||||||
|
List<? extends BasePoint> pointList; |
||||||
|
|
||||||
|
Integer childrenCount = 0; |
||||||
|
|
||||||
|
public Integer getChildrenCount() { |
||||||
|
return childrenCount; |
||||||
|
} |
||||||
|
|
||||||
|
public void setChildrenCount(Integer childrenCount) { |
||||||
|
this.childrenCount = childrenCount; |
||||||
|
} |
||||||
|
|
||||||
|
public List<? extends BasePoint> getPointList() { |
||||||
|
return pointList; |
||||||
|
} |
||||||
|
|
||||||
|
public void setPointList(List<? extends BasePoint> pointList) { |
||||||
|
this.pointList = pointList; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,15 @@ |
|||||||
|
package org.springblade.hz3000_real_data.fac.entity; |
||||||
|
|
||||||
|
public interface LanguageInterface { |
||||||
|
String getName(); |
||||||
|
|
||||||
|
void setName(String name); |
||||||
|
|
||||||
|
String getEng(); |
||||||
|
|
||||||
|
void setEng(String eng); |
||||||
|
|
||||||
|
String getChn(); |
||||||
|
|
||||||
|
void setChn(String chn); |
||||||
|
} |
||||||
@ -0,0 +1,81 @@ |
|||||||
|
package org.springblade.hz3000_real_data.fac.entity; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
@ApiModel("点信息") |
||||||
|
public class Point implements Serializable ,LanguageInterface{ |
||||||
|
private static final long serialVersionUID = 4657709877092481867L; |
||||||
|
/** |
||||||
|
* id |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "id") |
||||||
|
private String id; |
||||||
|
/** |
||||||
|
* 名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "名称") |
||||||
|
private String name; |
||||||
|
/** |
||||||
|
* 中文 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "中文") |
||||||
|
private String chn; |
||||||
|
/** |
||||||
|
* 英文 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "英文") |
||||||
|
private String eng; |
||||||
|
/** |
||||||
|
* 节点类型 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "节点类型") |
||||||
|
private Integer pointType = 0; |
||||||
|
|
||||||
|
public Integer getPointType() { |
||||||
|
return pointType; |
||||||
|
} |
||||||
|
|
||||||
|
public void setPointType(Integer pointType) { |
||||||
|
this.pointType = pointType; |
||||||
|
} |
||||||
|
public String getId() { |
||||||
|
return id; |
||||||
|
} |
||||||
|
|
||||||
|
public void setId(String id) { |
||||||
|
this.id = id; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String getName() { |
||||||
|
return name; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void setName(String name) { |
||||||
|
this.name = name; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String getChn() { |
||||||
|
return chn; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void setChn(String chn) { |
||||||
|
this.chn = chn; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String getEng() { |
||||||
|
return eng; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void setEng(String eng) { |
||||||
|
this.eng = eng; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,95 @@ |
|||||||
|
package org.springblade.hz3000_real_data.fac.entity; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
|
||||||
|
@ApiModel("点信息") |
||||||
|
public class SoePoint extends BasePoint { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 4592781482217840848L; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型") |
||||||
|
private String type; |
||||||
|
@ApiModelProperty(value = "告警类型") |
||||||
|
private String alarmType; |
||||||
|
@ApiModelProperty(value = "告警声音") |
||||||
|
private String alarmSound; |
||||||
|
@ApiModelProperty(value = "动作列表") |
||||||
|
private String actionNameList; |
||||||
|
@ApiModelProperty(value = "动作单位列表") |
||||||
|
private String actionUnitList; |
||||||
|
@ApiModelProperty(value = "组id") |
||||||
|
private String groupId; |
||||||
|
@ApiModelProperty(value = "动作名称数组") |
||||||
|
private List<String> actionNameListArray; |
||||||
|
@ApiModelProperty(value = "动作单位数组") |
||||||
|
private List<String> actionUnitListArray; |
||||||
|
|
||||||
|
public String getType() { |
||||||
|
return type; |
||||||
|
} |
||||||
|
|
||||||
|
public void setType(String type) { |
||||||
|
this.type = type; |
||||||
|
} |
||||||
|
|
||||||
|
public String getAlarmType() { |
||||||
|
return alarmType; |
||||||
|
} |
||||||
|
|
||||||
|
public void setAlarmType(String alarmType) { |
||||||
|
this.alarmType = alarmType; |
||||||
|
} |
||||||
|
|
||||||
|
public String getAlarmSound() { |
||||||
|
return alarmSound; |
||||||
|
} |
||||||
|
|
||||||
|
public void setAlarmSound(String alarmSound) { |
||||||
|
this.alarmSound = alarmSound; |
||||||
|
} |
||||||
|
|
||||||
|
public String getActionNameList() { |
||||||
|
return actionNameList; |
||||||
|
} |
||||||
|
|
||||||
|
public void setActionNameList(String actionNameList) { |
||||||
|
this.actionNameList = actionNameList; |
||||||
|
} |
||||||
|
|
||||||
|
public String getActionUnitList() { |
||||||
|
return actionUnitList; |
||||||
|
} |
||||||
|
|
||||||
|
public void setActionUnitList(String actionUnitList) { |
||||||
|
this.actionUnitList = actionUnitList; |
||||||
|
} |
||||||
|
|
||||||
|
public String getGroupId() { |
||||||
|
return groupId; |
||||||
|
} |
||||||
|
|
||||||
|
public void setGroupId(String groupId) { |
||||||
|
this.groupId = groupId; |
||||||
|
} |
||||||
|
|
||||||
|
public List<String> getActionNameListArray() { |
||||||
|
return actionNameListArray; |
||||||
|
} |
||||||
|
|
||||||
|
public void setActionNameListArray(List<String> actionNameListArray) { |
||||||
|
this.actionNameListArray = actionNameListArray; |
||||||
|
} |
||||||
|
|
||||||
|
public List<String> getActionUnitListArray() { |
||||||
|
return actionUnitListArray; |
||||||
|
} |
||||||
|
|
||||||
|
public void setActionUnitListArray(List<String> actionUnitListArray) { |
||||||
|
this.actionUnitListArray = actionUnitListArray; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,10 @@ |
|||||||
|
package org.springblade.hz3000_real_data.fac.entity; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
|
||||||
|
@ApiModel("遥测点信息") |
||||||
|
public class YcPoint extends BasePoint { |
||||||
|
|
||||||
|
private static final long serialVersionUID = -4522390387219103139L; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,26 @@ |
|||||||
|
package org.springblade.hz3000_real_data.fac.entity; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
|
||||||
|
/** |
||||||
|
* |
||||||
|
* @author ypj |
||||||
|
* |
||||||
|
*/ |
||||||
|
@ApiModel("遥控点信息") |
||||||
|
public class YkPoint extends BasePoint { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 7000254579441509126L; |
||||||
|
@ApiModelProperty(value = "说明") |
||||||
|
private String explain; |
||||||
|
|
||||||
|
public String getExplain() { |
||||||
|
return explain; |
||||||
|
} |
||||||
|
|
||||||
|
public void setExplain(String explain) { |
||||||
|
this.explain = explain; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,26 @@ |
|||||||
|
package org.springblade.hz3000_real_data.fac.entity; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
|
||||||
|
/** |
||||||
|
* |
||||||
|
* @author ypj |
||||||
|
* |
||||||
|
*/ |
||||||
|
@ApiModel("遥信点信息") |
||||||
|
public class YxPoint extends BasePoint { |
||||||
|
|
||||||
|
private static final long serialVersionUID = -8093857719124678389L; |
||||||
|
@ApiModelProperty(value = "告警类型") |
||||||
|
private String alarmType; |
||||||
|
|
||||||
|
public String getAlarmType() { |
||||||
|
return alarmType; |
||||||
|
} |
||||||
|
|
||||||
|
public void setAlarmType(String alarmType) { |
||||||
|
this.alarmType = alarmType; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,20 @@ |
|||||||
|
package org.springblade.hz3000_real_data.fac.enums; |
||||||
|
|
||||||
|
public enum LanguageEnum { |
||||||
|
Chinese("cn", "汉语"), English("en", "英语"); |
||||||
|
private final String code; |
||||||
|
private final String desc; |
||||||
|
|
||||||
|
LanguageEnum(String code, String desc) { |
||||||
|
this.code = code; |
||||||
|
this.desc = desc; |
||||||
|
} |
||||||
|
|
||||||
|
public String getCode() { |
||||||
|
return code; |
||||||
|
} |
||||||
|
|
||||||
|
public String getDesc() { |
||||||
|
return desc; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,101 @@ |
|||||||
|
package org.springblade.hz3000_real_data.fac.utils; |
||||||
|
|
||||||
|
import org.springblade.hz3000_real_data.fac.entity.*; |
||||||
|
import org.springblade.hz3000_real_data.fac.enums.LanguageEnum; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
public class LanguageUtils { |
||||||
|
public static final String CURRENT_LANGUAGE = "currentLanguage"; |
||||||
|
|
||||||
|
public static void toEnglishName(LanguageInterface entity) { |
||||||
|
String eng = entity.getEng(); |
||||||
|
if (eng != null && eng.length() > 0) { |
||||||
|
entity.setName(eng); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public static void toChinessName(LanguageInterface entity) { |
||||||
|
String chn = entity.getChn(); |
||||||
|
if (chn != null && chn.length() > 0) { |
||||||
|
entity.setName(chn); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public static void toEnglishName(List<LanguageInterface> list) { |
||||||
|
for (LanguageInterface entity : list) { |
||||||
|
toEnglishName(entity); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public static void toChinessName(List<LanguageInterface> list) { |
||||||
|
for (LanguageInterface entity : list) { |
||||||
|
toChinessName(entity); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public void changeNameByLanguage(LanguageInterface entity, String language) { |
||||||
|
if (null != language) { |
||||||
|
if (LanguageEnum.English.equals(language)) { |
||||||
|
toEnglishName(entity); |
||||||
|
} else { |
||||||
|
toChinessName(entity); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public static void changeNameByLanguage(List<LanguageInterface> list, String language) { |
||||||
|
if (null != language) { |
||||||
|
if (LanguageEnum.English.equals(language)) { |
||||||
|
toEnglishName(list); |
||||||
|
} else { |
||||||
|
toChinessName(list); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public static void changeAllToEnglish(List<Factory> factoryList) { |
||||||
|
for (Factory factory : factoryList) { |
||||||
|
toEnglishName(factory); |
||||||
|
List<DataGroup> groupList = factory.getGroups(); |
||||||
|
if (null != groupList) { |
||||||
|
for (DataGroup group : groupList) { |
||||||
|
toEnglishName(group); |
||||||
|
List<YcPoint> ycPointList = group.getTelemetryPointList(); |
||||||
|
if (null != ycPointList) { |
||||||
|
for (YcPoint ycPoint : ycPointList) { |
||||||
|
toEnglishName(ycPoint); |
||||||
|
} |
||||||
|
} |
||||||
|
List<YxPoint> yxPointList = group.getTelesignalPointList(); |
||||||
|
if(null != yxPointList){ |
||||||
|
for(YxPoint yxPoint: yxPointList ){ |
||||||
|
toEnglishName(yxPoint); |
||||||
|
} |
||||||
|
} |
||||||
|
List<YkPoint> ykPointList = group.getTelecontrolPointList(); |
||||||
|
if(null != ykPointList){ |
||||||
|
for (YkPoint ykPoint : ykPointList){ |
||||||
|
toEnglishName(ykPoint); |
||||||
|
} |
||||||
|
} |
||||||
|
List<SoePoint> soePointList = group.getEventPointList(); |
||||||
|
if(null != soePointList){ |
||||||
|
for(SoePoint soePoint : soePointList){ |
||||||
|
toEnglishName(soePoint); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
// public static void main(String[] arg) {
|
||||||
|
// LanguageInterface entity = new YcPoint();
|
||||||
|
// entity.setName("中文");
|
||||||
|
// entity.setChn("粤语");
|
||||||
|
// entity.setEng("English");
|
||||||
|
// toEnglishName(entity);
|
||||||
|
// System.out.println(entity.getName());
|
||||||
|
// }
|
||||||
|
} |
||||||
@ -0,0 +1,24 @@ |
|||||||
|
package org.springblade.hz3000_real_data.feign; |
||||||
|
|
||||||
|
import org.springblade.hz3000_real_data.history.entity.HistoryRequestResult; |
||||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
@FeignClient( |
||||||
|
value = "hz3000-real-data", |
||||||
|
url = "${feign.hz3000-real-data:}" |
||||||
|
) |
||||||
|
public interface IHz3000HistoryDataClient { |
||||||
|
String API_PREFIX = "/hz3000HistoryDataClient"; |
||||||
|
String GET_HISTORY_DATA = API_PREFIX + "/queryHisDateOfTimeRange"; |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取测站详情 |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@GetMapping(GET_HISTORY_DATA) |
||||||
|
Map<String, List<HistoryRequestResult>> queryHisDateOfTimeRange(List<String> realIds, String start, String end); |
||||||
|
} |
||||||
@ -0,0 +1,29 @@ |
|||||||
|
package org.springblade.hz3000_real_data.feign; |
||||||
|
|
||||||
|
import org.springblade.hz3000_real_data.real.entity.Data; |
||||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
@FeignClient( |
||||||
|
value = "hz3000-real-data", |
||||||
|
url = "${feign.hz3000-real-data:}" |
||||||
|
) |
||||||
|
public interface IHz3000RealDataClient { |
||||||
|
String API_PREFIX = "/hz3000RealDataClient"; |
||||||
|
String GET_REAL_DATA_BY_ID = API_PREFIX + "/getRealDataById"; |
||||||
|
String GET_REAL_DATA = API_PREFIX + "/getRealData"; |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取测站详情 |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@GetMapping(GET_REAL_DATA_BY_ID) |
||||||
|
Map<String, Data> getRealDataById(String[] realIds, String stationId); |
||||||
|
|
||||||
|
@GetMapping(GET_REAL_DATA) |
||||||
|
List<Data> getRealData(List<String> ids,int type,String stationId); |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,72 @@ |
|||||||
|
package org.springblade.hz3000_real_data.history.entity; |
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
public class HisDataYc { |
||||||
|
private double val; |
||||||
|
private Date datatime; |
||||||
|
private int q; |
||||||
|
private int _msec; |
||||||
|
|
||||||
|
public double getVal() { |
||||||
|
return val; |
||||||
|
} |
||||||
|
|
||||||
|
public void setVal(double val) { |
||||||
|
this.val = val; |
||||||
|
} |
||||||
|
|
||||||
|
public Date getDatatime() { |
||||||
|
return datatime; |
||||||
|
} |
||||||
|
|
||||||
|
public void setDatatime(Date datatime) { |
||||||
|
this.datatime = datatime; |
||||||
|
} |
||||||
|
|
||||||
|
public int getQ() { |
||||||
|
return q; |
||||||
|
} |
||||||
|
|
||||||
|
public void setQ(int q) { |
||||||
|
this.q = q; |
||||||
|
} |
||||||
|
|
||||||
|
public int get_Msec() { |
||||||
|
return _msec; |
||||||
|
} |
||||||
|
|
||||||
|
public void set_Msec(int _msec) { |
||||||
|
this._msec = _msec; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public int hashCode() { |
||||||
|
final int prime = 31; |
||||||
|
int result = 1; |
||||||
|
result = prime * result + ((datatime == null) ? 0 : datatime.hashCode()); |
||||||
|
return result; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean equals(Object obj) { |
||||||
|
if (this == obj) |
||||||
|
return true; |
||||||
|
if (obj == null) |
||||||
|
return false; |
||||||
|
if (getClass() != obj.getClass()) |
||||||
|
return false; |
||||||
|
HisDataYc other = (HisDataYc) obj; |
||||||
|
if (datatime == null) { |
||||||
|
if (other.datatime != null) |
||||||
|
return false; |
||||||
|
} else if (!datatime.equals(other.datatime)) |
||||||
|
return false; |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String toString() { |
||||||
|
return "HisDataYc [val=" + val + ", datatime=" + datatime + ", q=" + q + ", _msec=" + _msec + "]"; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,95 @@ |
|||||||
|
package org.springblade.hz3000_real_data.history.entity; |
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||||
|
|
||||||
|
public class HistoryRequestResult { |
||||||
|
|
||||||
|
private String realId; |
||||||
|
|
||||||
|
private Double val; |
||||||
|
|
||||||
|
private String datatime; |
||||||
|
|
||||||
|
private int q; |
||||||
|
|
||||||
|
public HistoryRequestResult(String realId, String datatime) { |
||||||
|
this.realId = realId; |
||||||
|
this.datatime = datatime; |
||||||
|
} |
||||||
|
|
||||||
|
public HistoryRequestResult() { |
||||||
|
} |
||||||
|
|
||||||
|
@JsonProperty("hzrealid") |
||||||
|
public String getRealId() { |
||||||
|
return realId; |
||||||
|
} |
||||||
|
|
||||||
|
public void setRealId(String realId) { |
||||||
|
this.realId = realId; |
||||||
|
} |
||||||
|
|
||||||
|
public Double getVal() { |
||||||
|
return val; |
||||||
|
} |
||||||
|
|
||||||
|
public void setVal(Double val) { |
||||||
|
this.val = val; |
||||||
|
} |
||||||
|
|
||||||
|
public String getDatatime() { |
||||||
|
return datatime; |
||||||
|
} |
||||||
|
|
||||||
|
public void setDatatime(String datatime) { |
||||||
|
this.datatime = datatime; |
||||||
|
} |
||||||
|
|
||||||
|
public int getQ() { |
||||||
|
return q; |
||||||
|
} |
||||||
|
|
||||||
|
public void setQ(int q) { |
||||||
|
this.q = q; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public int hashCode() { |
||||||
|
final int prime = 31; |
||||||
|
int result = 1; |
||||||
|
result = prime * result + ((datatime == null) ? 0 : datatime.hashCode()); |
||||||
|
result = prime * result + q; |
||||||
|
result = prime * result + ((realId == null) ? 0 : realId.hashCode()); |
||||||
|
return result; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean equals(Object obj) { |
||||||
|
if (this == obj) |
||||||
|
return true; |
||||||
|
if (obj == null) |
||||||
|
return false; |
||||||
|
if (getClass() != obj.getClass()) |
||||||
|
return false; |
||||||
|
HistoryRequestResult other = (HistoryRequestResult) obj; |
||||||
|
if (datatime == null) { |
||||||
|
if (other.datatime != null) |
||||||
|
return false; |
||||||
|
} else if (!datatime.equals(other.datatime)) |
||||||
|
return false; |
||||||
|
if (q != other.q) |
||||||
|
return false; |
||||||
|
if (realId == null) { |
||||||
|
if (other.realId != null) |
||||||
|
return false; |
||||||
|
} else if (!realId.equals(other.realId)) |
||||||
|
return false; |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String toString() { |
||||||
|
return "HistoryRequestResult [realId=" + realId + ", val=" + val + ", datatime=" + datatime + ", q=" + q + "]"; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,55 @@ |
|||||||
|
//
|
||||||
|
// Source code recreated from a .class file by IntelliJ IDEA
|
||||||
|
// (powered by Fernflower decompiler)
|
||||||
|
//
|
||||||
|
|
||||||
|
package org.springblade.hz3000_real_data.real.entity; |
||||||
|
|
||||||
|
|
||||||
|
import org.springblade.hz3000_real_data.fac.entity.BasePoint; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
public class Data implements Serializable { |
||||||
|
private static final long serialVersionUID = -3968193306625634915L; |
||||||
|
private double value; |
||||||
|
private Date time; |
||||||
|
private BasePoint point; |
||||||
|
private int q; |
||||||
|
|
||||||
|
public Data() { |
||||||
|
} |
||||||
|
|
||||||
|
public double getValue() { |
||||||
|
return this.value; |
||||||
|
} |
||||||
|
|
||||||
|
public void setValue(double value) { |
||||||
|
this.value = value; |
||||||
|
} |
||||||
|
|
||||||
|
public Date getTime() { |
||||||
|
return this.time; |
||||||
|
} |
||||||
|
|
||||||
|
public void setTime(Date time) { |
||||||
|
this.time = time; |
||||||
|
} |
||||||
|
|
||||||
|
public BasePoint getPoint() { |
||||||
|
return this.point; |
||||||
|
} |
||||||
|
|
||||||
|
public void setPoint(BasePoint point) { |
||||||
|
this.point = point; |
||||||
|
} |
||||||
|
|
||||||
|
public int getQ() { |
||||||
|
return this.q; |
||||||
|
} |
||||||
|
|
||||||
|
public void setQ(int q) { |
||||||
|
this.q = q; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,183 @@ |
|||||||
|
package org.springblade.hz3000_real_data.util; |
||||||
|
|
||||||
|
import javax.crypto.Cipher; |
||||||
|
import java.math.BigInteger; |
||||||
|
import java.security.KeyFactory; |
||||||
|
import java.security.KeyPair; |
||||||
|
import java.security.KeyPairGenerator; |
||||||
|
import java.security.NoSuchAlgorithmException; |
||||||
|
import java.security.interfaces.RSAPrivateKey; |
||||||
|
import java.security.interfaces.RSAPublicKey; |
||||||
|
import java.security.spec.RSAPrivateKeySpec; |
||||||
|
import java.security.spec.RSAPublicKeySpec; |
||||||
|
import java.util.HashMap; |
||||||
|
|
||||||
|
public class RSAUtils { |
||||||
|
public static final String PUBLIC_KEY = "public"; |
||||||
|
public static final String PRIVATE_KEY = "private"; |
||||||
|
|
||||||
|
public RSAUtils() { |
||||||
|
} |
||||||
|
|
||||||
|
public static HashMap<String, Object> getKeys() throws NoSuchAlgorithmException { |
||||||
|
HashMap<String, Object> map = new HashMap(); |
||||||
|
KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance("RSA"); |
||||||
|
keyPairGen.initialize(1024); |
||||||
|
KeyPair keyPair = keyPairGen.generateKeyPair(); |
||||||
|
RSAPublicKey publicKey = (RSAPublicKey)keyPair.getPublic(); |
||||||
|
RSAPrivateKey privateKey = (RSAPrivateKey)keyPair.getPrivate(); |
||||||
|
map.put("public", publicKey); |
||||||
|
map.put("private", privateKey); |
||||||
|
return map; |
||||||
|
} |
||||||
|
|
||||||
|
public static RSAPublicKey getPublicKey(String modulus, String exponent) { |
||||||
|
try { |
||||||
|
BigInteger b1 = new BigInteger(modulus); |
||||||
|
BigInteger b2 = new BigInteger(exponent); |
||||||
|
KeyFactory keyFactory = KeyFactory.getInstance("RSA"); |
||||||
|
RSAPublicKeySpec keySpec = new RSAPublicKeySpec(b1, b2); |
||||||
|
return (RSAPublicKey)keyFactory.generatePublic(keySpec); |
||||||
|
} catch (Exception var6) { |
||||||
|
var6.printStackTrace(); |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public static RSAPrivateKey getPrivateKey(String modulus, String exponent) { |
||||||
|
try { |
||||||
|
BigInteger b1 = new BigInteger(modulus); |
||||||
|
BigInteger b2 = new BigInteger(exponent); |
||||||
|
KeyFactory keyFactory = KeyFactory.getInstance("RSA"); |
||||||
|
RSAPrivateKeySpec keySpec = new RSAPrivateKeySpec(b1, b2); |
||||||
|
return (RSAPrivateKey)keyFactory.generatePrivate(keySpec); |
||||||
|
} catch (Exception var6) { |
||||||
|
var6.printStackTrace(); |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public static String encryptByPublicKey(String data, RSAPublicKey publicKey) throws Exception { |
||||||
|
Cipher cipher = Cipher.getInstance("RSA"); |
||||||
|
cipher.init(1, publicKey); |
||||||
|
int key_len = publicKey.getModulus().bitLength() / 8; |
||||||
|
String[] datas = splitString(data, key_len - 11); |
||||||
|
String mi = ""; |
||||||
|
String[] var6 = datas; |
||||||
|
int var7 = datas.length; |
||||||
|
|
||||||
|
for(int var8 = 0; var8 < var7; ++var8) { |
||||||
|
String s = var6[var8]; |
||||||
|
mi = mi + bcd2Str(cipher.doFinal(s.getBytes())); |
||||||
|
} |
||||||
|
|
||||||
|
return mi; |
||||||
|
} |
||||||
|
|
||||||
|
public static String decryptByPrivateKey(String data, RSAPrivateKey privateKey) throws Exception { |
||||||
|
Cipher cipher = Cipher.getInstance("RSA"); |
||||||
|
cipher.init(2, privateKey); |
||||||
|
int key_len = privateKey.getModulus().bitLength() / 8; |
||||||
|
byte[] bytes = data.getBytes(); |
||||||
|
byte[] bcd = ASCII_To_BCD(bytes, bytes.length); |
||||||
|
String ming = ""; |
||||||
|
byte[][] arrays = splitArray(bcd, key_len); |
||||||
|
byte[][] var8 = arrays; |
||||||
|
int var9 = arrays.length; |
||||||
|
|
||||||
|
for(int var10 = 0; var10 < var9; ++var10) { |
||||||
|
byte[] arr = var8[var10]; |
||||||
|
ming = ming + new String(cipher.doFinal(arr)); |
||||||
|
} |
||||||
|
|
||||||
|
return ming; |
||||||
|
} |
||||||
|
|
||||||
|
public static byte[] ASCII_To_BCD(byte[] ascii, int asc_len) { |
||||||
|
byte[] bcd = new byte[asc_len / 2]; |
||||||
|
int j = 0; |
||||||
|
|
||||||
|
for(int i = 0; i < (asc_len + 1) / 2; ++i) { |
||||||
|
bcd[i] = asc_to_bcd(ascii[j++]); |
||||||
|
bcd[i] = (byte)((j >= asc_len ? 0 : asc_to_bcd(ascii[j++])) + (bcd[i] << 4)); |
||||||
|
} |
||||||
|
|
||||||
|
return bcd; |
||||||
|
} |
||||||
|
|
||||||
|
public static byte asc_to_bcd(byte asc) { |
||||||
|
byte bcd; |
||||||
|
if (asc >= 48 && asc <= 57) { |
||||||
|
bcd = (byte)(asc - 48); |
||||||
|
} else if (asc >= 65 && asc <= 70) { |
||||||
|
bcd = (byte)(asc - 65 + 10); |
||||||
|
} else if (asc >= 97 && asc <= 102) { |
||||||
|
bcd = (byte)(asc - 97 + 10); |
||||||
|
} else { |
||||||
|
bcd = (byte)(asc - 48); |
||||||
|
} |
||||||
|
|
||||||
|
return bcd; |
||||||
|
} |
||||||
|
|
||||||
|
public static String bcd2Str(byte[] bytes) { |
||||||
|
char[] temp = new char[bytes.length * 2]; |
||||||
|
|
||||||
|
for(int i = 0; i < bytes.length; ++i) { |
||||||
|
char val = (char)((bytes[i] & 240) >> 4 & 15); |
||||||
|
temp[i * 2] = (char)(val > '\t' ? val + 65 - 10 : val + 48); |
||||||
|
val = (char)(bytes[i] & 15); |
||||||
|
temp[i * 2 + 1] = (char)(val > '\t' ? val + 65 - 10 : val + 48); |
||||||
|
} |
||||||
|
|
||||||
|
return new String(temp); |
||||||
|
} |
||||||
|
|
||||||
|
public static String[] splitString(String string, int len) { |
||||||
|
int x = string.length() / len; |
||||||
|
int y = string.length() % len; |
||||||
|
int z = 0; |
||||||
|
if (y != 0) { |
||||||
|
z = 1; |
||||||
|
} |
||||||
|
|
||||||
|
String[] strings = new String[x + z]; |
||||||
|
String str = ""; |
||||||
|
|
||||||
|
for(int i = 0; i < x + z; ++i) { |
||||||
|
if (i == x + z - 1 && y != 0) { |
||||||
|
str = string.substring(i * len, i * len + y); |
||||||
|
} else { |
||||||
|
str = string.substring(i * len, i * len + len); |
||||||
|
} |
||||||
|
|
||||||
|
strings[i] = str; |
||||||
|
} |
||||||
|
|
||||||
|
return strings; |
||||||
|
} |
||||||
|
|
||||||
|
public static byte[][] splitArray(byte[] data, int len) { |
||||||
|
int x = data.length / len; |
||||||
|
int y = data.length % len; |
||||||
|
int z = 0; |
||||||
|
if (y != 0) { |
||||||
|
z = 1; |
||||||
|
} |
||||||
|
|
||||||
|
byte[][] arrays = new byte[x + z][]; |
||||||
|
|
||||||
|
for(int i = 0; i < x + z; ++i) { |
||||||
|
byte[] arr = new byte[len]; |
||||||
|
if (i == x + z - 1 && y != 0) { |
||||||
|
System.arraycopy(data, i * len, arr, 0, y); |
||||||
|
} else { |
||||||
|
System.arraycopy(data, i * len, arr, 0, len); |
||||||
|
} |
||||||
|
|
||||||
|
arrays[i] = arr; |
||||||
|
} |
||||||
|
|
||||||
|
return arrays; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,16 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<parent> |
||||||
|
<artifactId>hzinfo-ris-pxhd-service-api</artifactId> |
||||||
|
<groupId>org.springblade</groupId> |
||||||
|
<version>4.5.0.RELEASE</version> |
||||||
|
</parent> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
|
||||||
|
<artifactId>pxhd-hzinfo-inspect-api</artifactId> |
||||||
|
<name>${project.artifactId}</name> |
||||||
|
<packaging>jar</packaging> |
||||||
|
|
||||||
|
</project> |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
package org.springblade.hzinfo_inspect; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: py |
||||||
|
*/ |
||||||
|
public class Constants { |
||||||
|
public final static String APP_NAME = "hzinfo-inspect"; |
||||||
|
} |
||||||
@ -0,0 +1,29 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.gather.entity; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
@Data |
||||||
|
public class InspectReportEntity implements Serializable { |
||||||
|
private static final long serialVersionUID = -3296006758328565445L; |
||||||
|
|
||||||
|
@ApiModelProperty("人员ID") |
||||||
|
private Long userId; |
||||||
|
|
||||||
|
@ApiModelProperty("姓名") |
||||||
|
private String userName; |
||||||
|
|
||||||
|
@ApiModelProperty("完成任务情况") |
||||||
|
private String completeSituation; |
||||||
|
|
||||||
|
@ApiModelProperty("未完成任务情况") |
||||||
|
private String incompleteSituation; |
||||||
|
|
||||||
|
@ApiModelProperty("工时") |
||||||
|
private Integer hours; |
||||||
|
|
||||||
|
@ApiModelProperty("发现问题数量") |
||||||
|
private Integer findProblemCount; |
||||||
|
} |
||||||
@ -0,0 +1,164 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.gather.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
import org.springblade.core.mp.support.QueryField; |
||||||
|
import org.springblade.core.mp.support.SqlCondition; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
import java.time.format.DateTimeFormatter; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 实体类 |
||||||
|
* |
||||||
|
* @author Chill |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("hz_st_hi_task_gather") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
@ApiModel(value = "TaskGather对象", description = "巡检任务统计数据集合对象,集控站使用") |
||||||
|
public class TaskGatherEntity extends BaseEntity { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
|
||||||
|
@QueryField(condition = SqlCondition.EQUAL) |
||||||
|
@ApiModelProperty("租户ID") |
||||||
|
private String tenantId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 用户id |
||||||
|
*/ |
||||||
|
@QueryField(condition = SqlCondition.EQUAL) |
||||||
|
@ApiModelProperty(value = "用户id") |
||||||
|
private Long userId; |
||||||
|
/** |
||||||
|
* 用户名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "用户名称") |
||||||
|
private String userName; |
||||||
|
/** |
||||||
|
* 路径id |
||||||
|
*/ |
||||||
|
@QueryField(condition = SqlCondition.EQUAL) |
||||||
|
@ApiModelProperty(value = "路径id") |
||||||
|
private Long routeId; |
||||||
|
/** |
||||||
|
* |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "路径名称") |
||||||
|
private String routeName; |
||||||
|
/** |
||||||
|
* 问题数 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "问题数") |
||||||
|
private Long problemNum; |
||||||
|
/** |
||||||
|
* 计划ID |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划ID") |
||||||
|
private Long planId; |
||||||
|
/** |
||||||
|
* 计划模式 0 人员 1岗位 2机构 3自由模式 4 自由人模式 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划模式 0 人员 1岗位 2机构 3自由模式 4 自由人模式") |
||||||
|
private String type; |
||||||
|
/** |
||||||
|
* 计划名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划名称") |
||||||
|
private String planName; |
||||||
|
/** |
||||||
|
* 任务批次号 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "任务批次号") |
||||||
|
private String batchNumber; |
||||||
|
/** |
||||||
|
* 计划周期 0: 从不 1:每天 2:每月 3:每季度 5:每年 4:每周 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划周期 0: 从不 1:每天 2:每月 3:每季度 5:每年 4:每周") |
||||||
|
private String cycle; |
||||||
|
/** |
||||||
|
* 派发方式:0 抢占模式 1 并发模式 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "派发方式:0 抢占模式 1 并发模式") |
||||||
|
private String method; |
||||||
|
/** |
||||||
|
* 任务计划开始时间 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "任务计划开始时间") |
||||||
|
private LocalDateTime planStartTime; |
||||||
|
/** |
||||||
|
* 任务计划结束时间 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "任务计划结束时间") |
||||||
|
private LocalDateTime planEndTime; |
||||||
|
/** |
||||||
|
* 任务实际开始时间 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "任务实际开始时间") |
||||||
|
private LocalDateTime startTime; |
||||||
|
/** |
||||||
|
* 任务实际结束时间 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "任务实际结束时间") |
||||||
|
private LocalDateTime endTime; |
||||||
|
/** |
||||||
|
* 巡检报备 0 未报备 1已报备 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "巡检报备 0 未报备 1已报备") |
||||||
|
private String keepOnRecord; |
||||||
|
/** |
||||||
|
* 巡检类型标识: 0普通巡检,1,视频自动巡检,2机器人巡检 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "巡检类型标识: 0普通巡检,1,视频自动巡检,2机器人巡检") |
||||||
|
private String autoVideo; |
||||||
|
/** |
||||||
|
* 临时任务的巡检任务内容 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "临时任务的巡检任务内容") |
||||||
|
private String taskContent; |
||||||
|
/** |
||||||
|
* 计划类型,common常规任务,temporary临时任务 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划类型,common常规任务,temporary临时任务") |
||||||
|
private String planType; |
||||||
|
/** |
||||||
|
* 任务开始前 是否发送提醒短信 标识 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "任务开始前 是否发送提醒短信 标识") |
||||||
|
private Boolean startRemindFlag; |
||||||
|
/** |
||||||
|
* 任务结束前 是否发送提醒短信 标识 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "任务结束前 是否发送提醒短信 标识") |
||||||
|
private Boolean endRemindFlag; |
||||||
|
/** |
||||||
|
* 开始前提醒时间 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "开始前提醒时间") |
||||||
|
private LocalDateTime startRemindTime; |
||||||
|
/** |
||||||
|
* 结束前提醒时间 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "结束前提醒时间") |
||||||
|
private LocalDateTime endRemindTime; |
||||||
|
|
||||||
|
public String getStrPlanStartTime(){ |
||||||
|
DateTimeFormatter dfShort = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
||||||
|
return dfShort.format(getPlanStartTime()); |
||||||
|
} |
||||||
|
|
||||||
|
public Long getProblemNum() { |
||||||
|
if(problemNum == null){ |
||||||
|
return 0L; |
||||||
|
} |
||||||
|
return problemNum; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,38 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.gather.feign; |
||||||
|
|
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.hzinfo_inspect.Constants; |
||||||
|
import org.springblade.hzinfo_inspect.gather.entity.TaskGatherEntity; |
||||||
|
import org.springblade.hzinfo_inspect.gather.vo.TaskGatherReportVO; |
||||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
@FeignClient( |
||||||
|
value = Constants.APP_NAME |
||||||
|
) |
||||||
|
public interface IInspectGatherClient { |
||||||
|
|
||||||
|
String API_PREFIX = "/feign/gather"; |
||||||
|
String LIST_GATHER_TASK_BY_DISPOSER = API_PREFIX + "/listGatherTaskByDisposer"; |
||||||
|
String LIST_TASK_GATHER_REPORT = API_PREFIX + "/listTaskGatherReport"; |
||||||
|
String LIST_BY_TIME_AND_PERSON = API_PREFIX + "/listByTimeAndPerson"; |
||||||
|
String INSPECT_CONCLUSION = API_PREFIX + "/getInspectConclusion"; |
||||||
|
|
||||||
|
@GetMapping(LIST_GATHER_TASK_BY_DISPOSER) |
||||||
|
R<List<TaskGatherEntity>> listGatherTaskByDisposer(@RequestParam("disposer") String disposer); |
||||||
|
|
||||||
|
@PostMapping(LIST_TASK_GATHER_REPORT) |
||||||
|
List<TaskGatherReportVO> listTaskGatherReport(@RequestBody Map<String, Object> params); |
||||||
|
|
||||||
|
@PostMapping(LIST_BY_TIME_AND_PERSON) |
||||||
|
List<TaskGatherEntity> listByTimeAndPerson(@RequestBody Map<String, Object> params); |
||||||
|
|
||||||
|
@PostMapping(INSPECT_CONCLUSION) |
||||||
|
List<Map<String, Object>> getInspectConclusion(@RequestBody Map<String, Object> params); |
||||||
|
} |
||||||
@ -0,0 +1,30 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.gather.vo; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
@Data |
||||||
|
public class TaskGatherReportVO implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 8220246531084664333L; |
||||||
|
|
||||||
|
@ApiModelProperty("人员ID") |
||||||
|
private Long userId; |
||||||
|
|
||||||
|
@ApiModelProperty("姓名") |
||||||
|
private String userName; |
||||||
|
|
||||||
|
@ApiModelProperty("完成任务情况") |
||||||
|
private String completeSituation; |
||||||
|
|
||||||
|
@ApiModelProperty("未完成任务情况") |
||||||
|
private String incompleteSituation; |
||||||
|
|
||||||
|
@ApiModelProperty("工时") |
||||||
|
private Long hours; |
||||||
|
|
||||||
|
@ApiModelProperty("发现问题数量") |
||||||
|
private Long findProblemCount; |
||||||
|
} |
||||||
@ -0,0 +1,182 @@ |
|||||||
|
/** |
||||||
|
* |
||||||
|
*/ |
||||||
|
package org.springblade.hzinfo_inspect.plan; |
||||||
|
|
||||||
|
import lombok.Getter; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author ninglong |
||||||
|
* |
||||||
|
*/ |
||||||
|
public interface PlanContants { |
||||||
|
|
||||||
|
String INSPECT_TYPE = "inspectType";//字典表巡检类型
|
||||||
|
|
||||||
|
/**计划状态字典key**/ |
||||||
|
String PLAN_STATUS = "planStatus"; |
||||||
|
|
||||||
|
public enum PlanTypeEnum{ |
||||||
|
/** |
||||||
|
* 计划人员模式 |
||||||
|
*/ |
||||||
|
USER_TYPE("0"), |
||||||
|
/** |
||||||
|
* 计划岗位模式 |
||||||
|
*/ |
||||||
|
POSITION_TYPE("1"), |
||||||
|
/** |
||||||
|
* 计划机构模式 |
||||||
|
*/ |
||||||
|
ORG_TYPE("2"), |
||||||
|
/** |
||||||
|
* 计划自由模式 |
||||||
|
*/ |
||||||
|
FREE_TYPE("3"), |
||||||
|
/** |
||||||
|
* 计划班次模式 |
||||||
|
*/ |
||||||
|
CLASS_TYPE("4"); |
||||||
|
@Getter |
||||||
|
private String type; |
||||||
|
private PlanTypeEnum(String type){ |
||||||
|
this.type = type; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 0:待审核-->1:已审核-->2:派发中-->3:暂停-->4:结束-->5审核不通过-->6待提交 |
||||||
|
*/ |
||||||
|
public enum PlanStatusEnum{ |
||||||
|
/** |
||||||
|
* 待审核 |
||||||
|
*/ |
||||||
|
PLAN_AUTH("0"), |
||||||
|
/** |
||||||
|
* 已审核 |
||||||
|
*/ |
||||||
|
CHECK_STATUS("1"), |
||||||
|
/** |
||||||
|
* 派发中 |
||||||
|
*/ |
||||||
|
UNDERWAY_STATUS("2"), |
||||||
|
/** |
||||||
|
* 暂停 |
||||||
|
*/ |
||||||
|
PAUSE_STATUS("3"), |
||||||
|
/** |
||||||
|
* 结束 |
||||||
|
*/ |
||||||
|
FINISH_STATUS("4"), |
||||||
|
/** |
||||||
|
* 审核不通过 |
||||||
|
*/ |
||||||
|
AUTH_STOP("5"), |
||||||
|
/** |
||||||
|
* 待提交 |
||||||
|
*/ |
||||||
|
PLAN_SUBMIT("6"); |
||||||
|
|
||||||
|
@Getter |
||||||
|
private String status; |
||||||
|
private PlanStatusEnum(String status){ |
||||||
|
this.status = status; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public enum PlanCycleEnum { |
||||||
|
/** |
||||||
|
* 计划周期每次 |
||||||
|
*/ |
||||||
|
NEVER_CYCLE("0"), |
||||||
|
/** |
||||||
|
* 计划周期每天 |
||||||
|
*/ |
||||||
|
EVERYDAY_CYCLE("1"), |
||||||
|
/** |
||||||
|
* 计划周期每月 |
||||||
|
*/ |
||||||
|
EVERYMONTH_CYCLE("2"), |
||||||
|
/** |
||||||
|
* 计划周期每季度 |
||||||
|
*/ |
||||||
|
EVERYQUARTER_CYCLE("3"), |
||||||
|
/** |
||||||
|
* 计划周期每周 |
||||||
|
*/ |
||||||
|
EVERYWEEK_CYCLE("5"), |
||||||
|
/** |
||||||
|
* 计划周期每周 |
||||||
|
*/ |
||||||
|
EVERYYEAR_CYCLE("4"); |
||||||
|
@Getter |
||||||
|
private String cycle; |
||||||
|
private PlanCycleEnum(String cycle){ |
||||||
|
this.cycle = cycle; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 派发方式:0 抢占模式 1 并发模式 |
||||||
|
*/ |
||||||
|
@Getter |
||||||
|
public enum PlanMethodEnum{ |
||||||
|
SEIZE("0"),CONCURRENT("1"); |
||||||
|
private String method; |
||||||
|
private PlanMethodEnum(String method){ |
||||||
|
this.method = method; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 计划类型,common常规任务,temporary临时任务 |
||||||
|
*/ |
||||||
|
@Getter |
||||||
|
enum PlanContentTypeEnum{ |
||||||
|
COMMON("common"),TEMP("temporary"); |
||||||
|
private String desc; |
||||||
|
private PlanContentTypeEnum(String desc){ |
||||||
|
this.desc = desc; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 巡检类型, 0普通巡检,1视频自动巡检,2机器人巡检 |
||||||
|
*/ |
||||||
|
@Getter |
||||||
|
enum InspectTypeEnum{ |
||||||
|
/** |
||||||
|
* 0普通巡检 |
||||||
|
*/ |
||||||
|
COMMON("0"), |
||||||
|
/** |
||||||
|
* 1视频自动巡检 |
||||||
|
*/ |
||||||
|
VIDEO("1"), |
||||||
|
/** |
||||||
|
* 2机器人巡检 |
||||||
|
*/ |
||||||
|
ROBOT("2"), |
||||||
|
//防汛巡检
|
||||||
|
FLOOD("3"), |
||||||
|
//特殊巡检
|
||||||
|
SPECIAL("4"); |
||||||
|
|
||||||
|
private String val; |
||||||
|
InspectTypeEnum(String val){ |
||||||
|
this.val = val; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 是否立即生产任务 1-是 0-否 |
||||||
|
*/ |
||||||
|
@Getter |
||||||
|
enum GenTaskImmediateEnum{ |
||||||
|
YES(1),NO(0); |
||||||
|
private int flag; |
||||||
|
GenTaskImmediateEnum(int flag){ |
||||||
|
this.flag = flag; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,197 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.plan.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import lombok.ToString; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||||
|
|
||||||
|
import java.time.LocalDate; |
||||||
|
import java.time.LocalDateTime; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 实体类 |
||||||
|
* |
||||||
|
* @author Chill |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("hz_st_re_plan") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
@ApiModel(value = "巡检计划", description = "巡检计划") |
||||||
|
@ToString |
||||||
|
public class PlanEntity extends BaseEntity { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 765388503678954943L; |
||||||
|
|
||||||
|
/** |
||||||
|
* 计划编码 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划编码") |
||||||
|
private String code; |
||||||
|
/** |
||||||
|
* 计划名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划名称") |
||||||
|
private String name; |
||||||
|
/** |
||||||
|
* 计划开始时间 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划开始时间") |
||||||
|
@DateTimeFormat( |
||||||
|
pattern = "yyyy-MM-dd" |
||||||
|
) |
||||||
|
@JsonFormat( |
||||||
|
pattern = "yyyy-MM-dd" |
||||||
|
) |
||||||
|
private LocalDate startTime; |
||||||
|
/** |
||||||
|
* 计划结束时间 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划结束时间") |
||||||
|
@DateTimeFormat( |
||||||
|
pattern = "yyyy-MM-dd" |
||||||
|
) |
||||||
|
@JsonFormat( |
||||||
|
pattern = "yyyy-MM-dd" |
||||||
|
) |
||||||
|
private LocalDate endTime; |
||||||
|
/** |
||||||
|
* 计划模式 0 人员 1岗位 2机构 3自由模式 4 自由人模式 5 临时任务 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划模式 0 人员 1岗位 2机构 3自由模式 4 班次模式 5 临时任务") |
||||||
|
private String type; |
||||||
|
/** |
||||||
|
* 派发方式:0 抢占模式 1 并发模式 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "派发方式:0 抢占模式 1 并发模式") |
||||||
|
private String method; |
||||||
|
/** |
||||||
|
* 计划周期 0: 从不 1:每天 2:每月 3:每季度 4:每年 5:每周 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划周期 0: 每次 1:每天 2:每月 3:每季度 4:每年 5:每周") |
||||||
|
private String cycle; |
||||||
|
/** |
||||||
|
* 审批人 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "审批人") |
||||||
|
private Long approver; |
||||||
|
/** |
||||||
|
* 审批时间 |
||||||
|
*/ |
||||||
|
@DateTimeFormat( |
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss" |
||||||
|
) |
||||||
|
@JsonFormat( |
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss" |
||||||
|
) |
||||||
|
@ApiModelProperty(value = "审批时间 ") |
||||||
|
private LocalDateTime approveTime; |
||||||
|
/** |
||||||
|
* 计划来源 1巡检 2点检 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划来源 1巡检 2点检") |
||||||
|
private String fromSource; |
||||||
|
|
||||||
|
/** |
||||||
|
* 是否立即生产任务 1-是 0-否 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "是否立即生产任务 1-是 0-否") |
||||||
|
private Integer taskFlg; |
||||||
|
|
||||||
|
/** |
||||||
|
* 执行时间-开始(HH:mm:ss) |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "执行时间-开始(HH:mm:ss)") |
||||||
|
@TableField(exist = false) |
||||||
|
private String execStartTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 执行时间-结束(HH:mm:ss) |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "执行时间-结束(HH:mm:ss)") |
||||||
|
@TableField(exist = false) |
||||||
|
private String execEndTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 执行结束时间是否是第二天,只针对巡检周期为“每天”的任务 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "执行结束时间是否是第二天") |
||||||
|
@TableField(exist = false) |
||||||
|
private Boolean isNextDay; |
||||||
|
|
||||||
|
/** |
||||||
|
* 巡检路线数据 |
||||||
|
* [{"sort":1,"objectId":"225","objectName":"人员考勤","templateId":"2235","templateName":"人员考勤"},{"sort":2,"objectId":"191","objectName":"厂房","templateId":"2235","templateName":"人员考勤"}] |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "巡检路线数据 : [{\"sort\":1,\"objectId\":\"225\",\"objectName\":\"人员考勤\",\"templateId\":\"2235\",\"templateName\":\"人员考勤\"},{\"sort\":2,\"objectId\":\"191\",\"objectName\":\"厂房\",\"templateId\":\"2235\",\"templateName\":\"人员考勤\"}]" ) |
||||||
|
private String routeData; |
||||||
|
/** |
||||||
|
* 巡检路线ID字段 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "巡检路线ID字段") |
||||||
|
private Long routeId; |
||||||
|
/** |
||||||
|
* 路线名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "路线名称") |
||||||
|
private String routeName; |
||||||
|
/** |
||||||
|
* 开始前提醒(分钟) |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "开始前提醒(分钟)") |
||||||
|
private Integer startRemind; |
||||||
|
/** |
||||||
|
* 结束前提醒(分钟) |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "结束前提醒(分钟)") |
||||||
|
private Integer endRemind; |
||||||
|
/** |
||||||
|
* 一天任务次数 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "一天任务次数") |
||||||
|
private Integer taskTimesADay; |
||||||
|
/** |
||||||
|
* 任务执行时间json数据 |
||||||
|
* json格式:execStartTime表示开始时间,execEndTime表示结束时间 |
||||||
|
* [{"execStartTime":"08:00:00","execEndTime":"20:40:00","isNextDay":true,"classId":1417678653371785217},{"execStartTime":"08:00:00","execEndTime":"20:40:00"}] |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "任务执行时间json数据,json格式:[{\"execStartTime\":\"08:00:00\",\"execEndTime\":\"20:40:00\"},{\"execStartTime\":\"08:00:00\",\"execEndTime\":\"20:40:00\"}]") |
||||||
|
private String execTimeJson; |
||||||
|
/** |
||||||
|
* 开始任务时AI检测项,来自数据字段表: beginCheckType, 多个检测项直接通过 " ^ "隔开 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "开始任务时AI检测项,来自数据字段表: beginCheckType, 多个检测项直接通过 ^ 隔开") |
||||||
|
private String aiCheckItems; |
||||||
|
|
||||||
|
/** |
||||||
|
* 巡检类型标识: 0普通巡检,1视频自动巡检,2机器人巡检 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "巡检类型标识: 0普通巡检,1视频自动巡检,2机器人巡检") |
||||||
|
private String autoVideo; |
||||||
|
|
||||||
|
/** |
||||||
|
* 计划类型,common常规任务,temporary临时任务 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划类型,common常规任务,temporary临时任务 ") |
||||||
|
private String planType; |
||||||
|
|
||||||
|
/** |
||||||
|
* 临时任务的巡检任务内容 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "临时任务的巡检任务内容") |
||||||
|
private String taskContent; |
||||||
|
|
||||||
|
/** |
||||||
|
* 值班id |
||||||
|
*/ |
||||||
|
@TableField(exist=false) |
||||||
|
@ApiModelProperty(value = "值班id") |
||||||
|
private Long dutyId; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,34 @@ |
|||||||
|
/** |
||||||
|
* |
||||||
|
*/ |
||||||
|
package org.springblade.hzinfo_inspect.plan.entity; |
||||||
|
|
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
|
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.Builder; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import lombok.NoArgsConstructor; |
||||||
|
|
||||||
|
/** |
||||||
|
* |
||||||
|
* 巡检计划对象模板 |
||||||
|
* @author ninglong |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("hz_st_re_plan_object_template") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
@AllArgsConstructor |
||||||
|
@NoArgsConstructor |
||||||
|
@Builder |
||||||
|
public class PlanObjectTemplateEntity extends BaseEntity { |
||||||
|
|
||||||
|
private static final long serialVersionUID = -2081929783559311856L; |
||||||
|
|
||||||
|
private Long planId; |
||||||
|
private Long objectId; |
||||||
|
private Long templateId; |
||||||
|
} |
||||||
@ -0,0 +1,37 @@ |
|||||||
|
/** |
||||||
|
* |
||||||
|
*/ |
||||||
|
package org.springblade.hzinfo_inspect.plan.entity; |
||||||
|
|
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.Builder; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import lombok.NoArgsConstructor; |
||||||
|
|
||||||
|
/** |
||||||
|
* 巡检计划机构 |
||||||
|
* @author ninglong |
||||||
|
*/ |
||||||
|
@AllArgsConstructor |
||||||
|
@NoArgsConstructor |
||||||
|
@Builder |
||||||
|
@Data |
||||||
|
@ApiModel(value="巡检计划机构") |
||||||
|
@TableName("hz_st_re_plan_org") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class PlanOrgEntity extends BaseEntity { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 696388503830864943L; |
||||||
|
|
||||||
|
@ApiModelProperty(value="计划id") |
||||||
|
private Long planId; |
||||||
|
@ApiModelProperty(value="机构id") |
||||||
|
private Long orgId; |
||||||
|
} |
||||||
@ -0,0 +1,37 @@ |
|||||||
|
/** |
||||||
|
* |
||||||
|
*/ |
||||||
|
package org.springblade.hzinfo_inspect.plan.entity; |
||||||
|
|
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.Builder; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import lombok.NoArgsConstructor; |
||||||
|
|
||||||
|
/** |
||||||
|
* 巡检计划岗位 |
||||||
|
* @author ninglong |
||||||
|
*/ |
||||||
|
@AllArgsConstructor |
||||||
|
@NoArgsConstructor |
||||||
|
@Builder |
||||||
|
@Data |
||||||
|
@ApiModel(value="巡检计划岗位") |
||||||
|
@TableName("hz_st_re_plan_position") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class PlanPositionEntity extends BaseEntity { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 696388503830864943L; |
||||||
|
|
||||||
|
@ApiModelProperty(value="计划id") |
||||||
|
private Long planId; |
||||||
|
@ApiModelProperty(value="用户id") |
||||||
|
private Long positionId; |
||||||
|
} |
||||||
@ -0,0 +1,37 @@ |
|||||||
|
/** |
||||||
|
* |
||||||
|
*/ |
||||||
|
package org.springblade.hzinfo_inspect.plan.entity; |
||||||
|
|
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.Builder; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import lombok.NoArgsConstructor; |
||||||
|
|
||||||
|
/** |
||||||
|
* 巡检计划用户 |
||||||
|
* @author ninglong |
||||||
|
*/ |
||||||
|
@AllArgsConstructor |
||||||
|
@NoArgsConstructor |
||||||
|
@Builder |
||||||
|
@Data |
||||||
|
@ApiModel(value="巡检计划用户") |
||||||
|
@TableName("hz_st_re_plan_user") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class PlanUserEntity extends BaseEntity { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 696388503830864943L; |
||||||
|
|
||||||
|
@ApiModelProperty(value="计划id") |
||||||
|
private Long planId; |
||||||
|
@ApiModelProperty(value="用户id") |
||||||
|
private Long userId; |
||||||
|
} |
||||||
@ -0,0 +1,43 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.plan.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 实体类 |
||||||
|
* @author py |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("hz_st_re_route") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
@ApiModel(value = "Route对象", description = "巡检路径") |
||||||
|
public class RouteEntity extends BaseEntity { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 643218503830864943L; |
||||||
|
|
||||||
|
/** |
||||||
|
* 路线名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "路线名称") |
||||||
|
private String routeName; |
||||||
|
/** |
||||||
|
* 路线数据 |
||||||
|
* json list |
||||||
|
* 格式: |
||||||
|
* [{"sort":1,"objectId":"225","objectName":"人员考勤","templateId":"2235","templateName":"人员考勤"},{"sort":2,"objectId":"191","objectName":"厂房","templateId":"2235","templateName":"人员考勤"}] |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "路线数据: [{\"sort\":1,\"objectId\":\"225\",\"objectName\":\"人员考勤\",\"templateId\":\"2235\",\"templateName\":\"人员考勤\"},{\"sort\":2,\"objectId\":\"191\",\"objectName\":\"厂房\",\"templateId\":\"2235\",\"templateName\":\"人员考勤\"}]") |
||||||
|
private String routeData; |
||||||
|
|
||||||
|
/** |
||||||
|
* 巡检类型标识 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = " 巡检类型标识 0普通巡检,1视频自动巡检,2机器人巡检") |
||||||
|
private String supportAutoVideo; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,27 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.plan.feign; |
||||||
|
|
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.hzinfo_inspect.Constants; |
||||||
|
import org.springblade.hzinfo_inspect.plan.vo.PlanVO; |
||||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@FeignClient( |
||||||
|
value = Constants.APP_NAME |
||||||
|
) |
||||||
|
public interface IInspectPlanClient { |
||||||
|
String API_PREFIX = "/feign/plan"; |
||||||
|
String ADD_AND_CHECK_PLAN = API_PREFIX + "/addPlanAndChecked"; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 新增巡检计划 并审核、生成任务 |
||||||
|
* @param plan |
||||||
|
* @return 返回taskId list |
||||||
|
*/ |
||||||
|
@PostMapping(ADD_AND_CHECK_PLAN) |
||||||
|
R<List<Long>> addPlanAndChecked(@RequestBody PlanVO plan); |
||||||
|
} |
||||||
@ -0,0 +1,89 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.plan.vo; |
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
import org.springblade.core.mp.support.QueryField; |
||||||
|
import org.springblade.core.mp.support.SqlCondition; |
||||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.time.LocalDate; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author ninglong |
||||||
|
* @create 2020-08-26 8:25 |
||||||
|
*/ |
||||||
|
@Getter |
||||||
|
@Setter |
||||||
|
@ApiModel(value = "计划列表查询对象") |
||||||
|
public class PlanListQueryVO implements Serializable { |
||||||
|
private static final long serialVersionUID = -7257795401205244042L; |
||||||
|
|
||||||
|
/** |
||||||
|
* 计划编码 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划编码") |
||||||
|
@QueryField(condition = SqlCondition.LIKE) |
||||||
|
private String code; |
||||||
|
/** |
||||||
|
* 计划名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划名称") |
||||||
|
@QueryField(condition = SqlCondition.LIKE) |
||||||
|
private String name; |
||||||
|
/** |
||||||
|
* 计划开始时间 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划开始时间") |
||||||
|
@DateTimeFormat( |
||||||
|
pattern = "yyyy-MM-dd" |
||||||
|
) |
||||||
|
@JsonFormat( |
||||||
|
pattern = "yyyy-MM-dd" |
||||||
|
) |
||||||
|
private LocalDate startTime; |
||||||
|
/** |
||||||
|
* 计划结束时间 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划结束时间") |
||||||
|
@DateTimeFormat( |
||||||
|
pattern = "yyyy-MM-dd" |
||||||
|
) |
||||||
|
@JsonFormat( |
||||||
|
pattern = "yyyy-MM-dd" |
||||||
|
) |
||||||
|
private LocalDate endTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 巡检类型标识: 0普通巡检,1视频自动巡检,2机器人巡检 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "巡检类型标识: 0普通巡检,1视频自动巡检,2机器人巡检") |
||||||
|
@QueryField(condition = SqlCondition.EQUAL) |
||||||
|
private String autoVideo; |
||||||
|
|
||||||
|
/** |
||||||
|
* 计划模式 0 人员 1岗位 2机构 3自由模式 4 自由人模式 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划模式 0 人员 1岗位 2机构 3自由模式 4 自由人模式") |
||||||
|
@QueryField(condition = SqlCondition.EQUAL) |
||||||
|
private String type; |
||||||
|
/** |
||||||
|
* 派发方式:0 抢占模式 1 并发模式 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "派发方式:0 抢占模式 1 并发模式") |
||||||
|
@QueryField(condition = SqlCondition.EQUAL) |
||||||
|
private String method; |
||||||
|
/** |
||||||
|
* 计划周期 0: 从不 1:每天 2:每月 3:每季度 4:每年 5:每周 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划周期 0: 每次 1:每天 2:每月 3:每季度 4:每年 5:每周") |
||||||
|
@QueryField(condition = SqlCondition.EQUAL) |
||||||
|
private String cycle; |
||||||
|
|
||||||
|
@ApiModelProperty("业务状态 0:待审核-->1:已审核-->2:派发中-->3:暂停-->4:结束-->5审核不通过-->6待提交") |
||||||
|
@QueryField(condition = SqlCondition.EQUAL) |
||||||
|
private Integer status; |
||||||
|
} |
||||||
@ -0,0 +1,38 @@ |
|||||||
|
/** |
||||||
|
* |
||||||
|
*/ |
||||||
|
package org.springblade.hzinfo_inspect.plan.vo; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.Builder; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.NoArgsConstructor; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
* 巡检计划对象模板vo |
||||||
|
* @author ninglong |
||||||
|
*/ |
||||||
|
@AllArgsConstructor |
||||||
|
@NoArgsConstructor |
||||||
|
@Builder |
||||||
|
@Data |
||||||
|
@ApiModel(value="巡检计划对象模板") |
||||||
|
public class PlanObjectTemplateVO implements Serializable{ |
||||||
|
|
||||||
|
private static final long serialVersionUID = 696388503830864943L; |
||||||
|
|
||||||
|
@ApiModelProperty(value="巡检计划对象模板id") |
||||||
|
private Long id; |
||||||
|
@ApiModelProperty(value="对象id") |
||||||
|
private Long objectId; |
||||||
|
@ApiModelProperty(value="对象名称") |
||||||
|
private String objectName; |
||||||
|
@ApiModelProperty(value="模板id") |
||||||
|
private Long templateId; |
||||||
|
@ApiModelProperty(value="模板名称") |
||||||
|
private String templateName; |
||||||
|
} |
||||||
@ -0,0 +1,60 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.plan.vo; |
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.*; |
||||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.time.LocalDateTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 巡检计划任务对象 |
||||||
|
* @author ninglong |
||||||
|
* @create 2020-08-21 10:26 |
||||||
|
*/ |
||||||
|
@Getter |
||||||
|
@Setter |
||||||
|
@Builder |
||||||
|
@AllArgsConstructor |
||||||
|
@NoArgsConstructor |
||||||
|
@ApiModel(value = "巡检计划任务对象") |
||||||
|
public class PlanTaskListVO implements Serializable { |
||||||
|
/** |
||||||
|
* 任务id |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "任务id") |
||||||
|
private Long taskId; |
||||||
|
/** |
||||||
|
* 任务批次号 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "任务批次号") |
||||||
|
private String batchNumber; |
||||||
|
|
||||||
|
/** |
||||||
|
* 任务计划开始时间 |
||||||
|
*/ |
||||||
|
@DateTimeFormat( |
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss" |
||||||
|
) |
||||||
|
@JsonFormat( |
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss" |
||||||
|
) |
||||||
|
@ApiModelProperty(value = "任务计划开始时间") |
||||||
|
private LocalDateTime planStartTime; |
||||||
|
/** |
||||||
|
* 任务计划结束时间 |
||||||
|
*/ |
||||||
|
@DateTimeFormat( |
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss" |
||||||
|
) |
||||||
|
@JsonFormat( |
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss" |
||||||
|
) |
||||||
|
@ApiModelProperty(value = "任务计划结束时间") |
||||||
|
private LocalDateTime planEndTime; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "任务状态") |
||||||
|
private Integer status; |
||||||
|
} |
||||||
@ -0,0 +1,187 @@ |
|||||||
|
/** |
||||||
|
* |
||||||
|
*/ |
||||||
|
package org.springblade.hzinfo_inspect.plan.vo; |
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import com.google.common.collect.Lists; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
import javax.validation.constraints.Size; |
||||||
|
import java.io.Serializable; |
||||||
|
import java.time.LocalDate; |
||||||
|
import java.time.LocalDateTime; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* 巡检计划vo |
||||||
|
* @author ninglong |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@ApiModel(value="巡检计划vo") |
||||||
|
public class PlanVO extends BaseEntity implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = -2714872219464298746L; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "计划id") |
||||||
|
private Long id; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "0:待审核-->1:已审核-->2:派发中-->3:暂停-->4:结束-->5审核不通过-->6待提交") |
||||||
|
private Integer status; |
||||||
|
/** |
||||||
|
* 计划编码 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划编码") |
||||||
|
private String code; |
||||||
|
/** |
||||||
|
* 计划名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划名称,长度必须为1到128") |
||||||
|
@Size(min=1,max = 128,message ="计划名称长度必须为1到128") |
||||||
|
private String name; |
||||||
|
/* |
||||||
|
@ApiModelProperty(value="班次id") |
||||||
|
private Long classId; |
||||||
|
|
||||||
|
*//**
|
||||||
|
* 值班班次名称 |
||||||
|
*//*
|
||||||
|
@ApiModelProperty(value = "值班班次名称") |
||||||
|
private String className;*/ |
||||||
|
|
||||||
|
/** |
||||||
|
* 计划开始时间 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划开始时间") |
||||||
|
@JsonFormat(pattern="yyyy-MM-dd") |
||||||
|
private LocalDate startTime; |
||||||
|
/** |
||||||
|
* 计划结束时间 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划结束时间") |
||||||
|
@JsonFormat(pattern="yyyy-MM-dd") |
||||||
|
private LocalDate endTime; |
||||||
|
/** |
||||||
|
* 计划模式 0 人员 1岗位 2机构 3自由模式 4 自由人模式 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划模式 0 人员 1岗位 2机构 3自由模式 4 班次") |
||||||
|
private String type; |
||||||
|
/** |
||||||
|
* 派发方式:0 抢占模式 1 并发模式 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "派发方式:0 抢占模式 1 并发模式") |
||||||
|
private String method; |
||||||
|
/** |
||||||
|
* 计划周期 0: 从不 1:每天 2:每月 3:每季度 4:每年 5:每周 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划周期 0: 每次 1:每天 2:每月 3:每季度 4:每年 5:每周") |
||||||
|
private String cycle; |
||||||
|
/** |
||||||
|
* 审批人 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "审批人") |
||||||
|
private Long approver; |
||||||
|
/** |
||||||
|
* 审批时间 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "审批时间 ") |
||||||
|
private LocalDateTime approveTime; |
||||||
|
/** |
||||||
|
* 计划来源 1巡检 2点检 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划来源 1巡检 2点检",hidden = true) |
||||||
|
private String fromSource; |
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "巡检计划对象模板id") |
||||||
|
private List<PlanObjectTemplateVO> planObjectTemplates = Lists.newArrayList(); |
||||||
|
|
||||||
|
@ApiModelProperty(value = "任务") |
||||||
|
private List<PlanTaskListVO> tasks = Lists.newArrayList(); |
||||||
|
|
||||||
|
@ApiModelProperty(value = "巡检计划模式人员id") |
||||||
|
private List<Long> planUsers = Lists.newArrayList(); |
||||||
|
@ApiModelProperty(value = "巡检计划模式人员名称") |
||||||
|
private List<String> planUserNames = Lists.newArrayList(); |
||||||
|
@ApiModelProperty(value = "巡检计划模式岗位id") |
||||||
|
private List<Long> planPosts = Lists.newArrayList(); |
||||||
|
@ApiModelProperty(value = "巡检计划模式岗位名称") |
||||||
|
private List<String> planPostNames = Lists.newArrayList(); |
||||||
|
@ApiModelProperty(value = "巡检计划模式机构id") |
||||||
|
private List<Long> planOrgs = Lists.newArrayList(); |
||||||
|
@ApiModelProperty(value = "巡检计划模式机构名称") |
||||||
|
private List<String> planOrgNames = Lists.newArrayList(); |
||||||
|
|
||||||
|
/** hzims add begin **/ |
||||||
|
|
||||||
|
/** |
||||||
|
* 计划类型,common常规任务,temporary临时任务 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划类型,common常规任务,temporary临时任务 ") |
||||||
|
private String planType; |
||||||
|
|
||||||
|
/** |
||||||
|
* 临时任务的巡检任务内容 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "临时任务的巡检任务内容") |
||||||
|
private String taskContent; |
||||||
|
|
||||||
|
/** |
||||||
|
* 是否立即生产任务 1-是 0-否 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "是否立即生产任务 1-是 0-否") |
||||||
|
private Integer taskFlg; |
||||||
|
|
||||||
|
/** |
||||||
|
* 巡检路线数据 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "巡检路线数据") |
||||||
|
private String routeData; |
||||||
|
/** |
||||||
|
* 巡检路线ID字段 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "巡检路线ID字段") |
||||||
|
private Long routeId; |
||||||
|
/** |
||||||
|
* 路线名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "路线名称") |
||||||
|
private String routeName; |
||||||
|
/** |
||||||
|
* 开始前提醒(分钟) |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "开始前提醒(分钟)") |
||||||
|
private Integer startRemind; |
||||||
|
/** |
||||||
|
* 结束前提醒(分钟) |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "结束前提醒(分钟)") |
||||||
|
private Integer endRemind; |
||||||
|
/** |
||||||
|
* 一天任务次数 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "一天任务次数") |
||||||
|
private Integer taskTimesADay; |
||||||
|
/** |
||||||
|
* 任务执行时间json数据 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "任务执行时间json数据") |
||||||
|
private String execTimeJson; |
||||||
|
/** |
||||||
|
* 开始任务时AI检测项,来自数据字段表: beginCheckType, 多个检测项直接通过 " ^ "隔开 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "开始任务时AI检测项,来自数据字段表: beginCheckType, 多个检测项直接通过 ^ 隔开") |
||||||
|
private String aiCheckItems; |
||||||
|
|
||||||
|
/** |
||||||
|
* 是否视频自动巡检 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "是否视频自动巡检") |
||||||
|
private String autoVideo; |
||||||
|
|
||||||
|
/** hzims add end **/ |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,23 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.plan.vo; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.math.BigDecimal; |
||||||
|
|
||||||
|
/** |
||||||
|
* 巡检路径内容 |
||||||
|
* "sort":1,"objectId":"225","objectName":"人员考勤","templateId":"2235","templateName":"人员考勤"} |
||||||
|
* @Author: py |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
public class RoutObject implements Serializable { |
||||||
|
private Integer sort; |
||||||
|
private Long objectId; |
||||||
|
private String objectName; |
||||||
|
private Long templateId; |
||||||
|
private String templateName; |
||||||
|
private BigDecimal lng; |
||||||
|
private BigDecimal lat; |
||||||
|
} |
||||||
|
|
||||||
@ -0,0 +1,19 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.plan.vo; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.hzinfo_inspect.plan.entity.RouteEntity; |
||||||
|
|
||||||
|
/** |
||||||
|
* 模型VO |
||||||
|
* |
||||||
|
* @author py |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class RouteVO extends RouteEntity { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 765388503830864943L; |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,21 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.report.feign; |
||||||
|
|
||||||
|
import org.springblade.hzinfo_inspect.Constants; |
||||||
|
import org.springblade.hzinfo_inspect.report.vo.AlarmRoutReportVO; |
||||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
@FeignClient( |
||||||
|
value = Constants.APP_NAME |
||||||
|
) |
||||||
|
public interface IInspectReportClient { |
||||||
|
String API_PREFIX = "/feign/report"; |
||||||
|
String GET_ALARAM_REPORT = API_PREFIX + "/getAlarmReport"; |
||||||
|
|
||||||
|
@PostMapping(GET_ALARAM_REPORT) |
||||||
|
Map<Long, AlarmRoutReportVO> getAlarmReport(@RequestParam("depts") List<Long> depts, @RequestParam("date") String date); |
||||||
|
} |
||||||
@ -0,0 +1,9 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.report.vo; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
@Data |
||||||
|
public class AlarmRoutReportVO { |
||||||
|
private Long overNum ; // 过检次数
|
||||||
|
private Long missingNum; // 漏检次数
|
||||||
|
} |
||||||
@ -0,0 +1,11 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.report.vo; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
import org.springblade.hzinfo_inspect.gather.entity.TaskGatherEntity; |
||||||
|
|
||||||
|
@Data |
||||||
|
public class AlarmTaskGatherReportVO extends TaskGatherEntity { |
||||||
|
|
||||||
|
private Long dept; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,14 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.safeproduct.constants; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author xiashandong |
||||||
|
* @created 2021/5/27 10:09 |
||||||
|
**/ |
||||||
|
public interface DictConstants { |
||||||
|
/**危险源应用类型key**/ |
||||||
|
String SAFE_DANGER_SOURCE_APPLY_TYPE = "safe_danger_source_apply_type"; |
||||||
|
/**危险源类型**/ |
||||||
|
String DANGER_TYPE = "dangerType"; |
||||||
|
/**危险等级**/ |
||||||
|
String RISK_LEVEL = "riskLevel"; |
||||||
|
} |
||||||
@ -0,0 +1,11 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.safeproduct.constants; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author hx |
||||||
|
*/ |
||||||
|
public interface RoleConstant { |
||||||
|
/**站长**/ |
||||||
|
String STATION_AGENT = "stationAgent"; |
||||||
|
/**安全评审**/ |
||||||
|
String SAFE_REVIEWER = "safetyReviewer"; |
||||||
|
} |
||||||
@ -0,0 +1,72 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.safeproduct.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||||
|
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* @author xiashandong |
||||||
|
* @created 2020/9/1 15:19 |
||||||
|
**/ |
||||||
|
@Data |
||||||
|
@TableName("hzims_safe_danger_source") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
@ApiModel(value = "危险源对象", description = "") |
||||||
|
public class DangerSourceEntity extends BaseEntity { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
private String tenantId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 危险源类型 1=作业活动 2=设备 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "危险源类型 1=作业活动 2=设备") |
||||||
|
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||||
|
private Integer type; |
||||||
|
/** |
||||||
|
* 设备ID |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "设备ID") |
||||||
|
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||||
|
private Long eqId; |
||||||
|
/** |
||||||
|
* 危险源名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "危险源名称") |
||||||
|
private String name; |
||||||
|
/** |
||||||
|
* 危险因素 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "危险因素") |
||||||
|
private String dangerEle; |
||||||
|
|
||||||
|
/** |
||||||
|
* 应用类型 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "应用类型") |
||||||
|
private String applyType; |
||||||
|
/** |
||||||
|
* 可能导致的事故 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "可能导致的事故") |
||||||
|
private String cause; |
||||||
|
/** |
||||||
|
* 措施 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "措施") |
||||||
|
private String measures; |
||||||
|
/** |
||||||
|
* 风险等级 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "风险等级 10=稍有危险 20=一般危险 30=显著危险 40=高度危险") |
||||||
|
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||||
|
private Integer level; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,65 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.safeproduct.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||||
|
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* @author xiashandong |
||||||
|
* @created 2020/9/1 15:23 |
||||||
|
**/ |
||||||
|
@Data |
||||||
|
@TableName("hzims_safe_danger_source_level_record") |
||||||
|
@ApiModel(value = "危险源等级变更记录对象", description = "") |
||||||
|
public class DangerSourceLevelRecordEntity implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
/** |
||||||
|
* 危险源ID |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "危险源ID") |
||||||
|
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||||
|
private Long sourceId; |
||||||
|
/** |
||||||
|
* 原等级 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "原等级") |
||||||
|
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||||
|
private Integer orgiLevel; |
||||||
|
/** |
||||||
|
* 新等级 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "新等级") |
||||||
|
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||||
|
private Integer newLevel; |
||||||
|
/** |
||||||
|
* 评级类型 0=降级 1=升级 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "评级类型 0=降级 1=升级") |
||||||
|
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||||
|
private Integer type; |
||||||
|
/** |
||||||
|
* 工作流ID |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "工作流ID") |
||||||
|
private String flowId; |
||||||
|
/** |
||||||
|
* 变更时间 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "变更时间") |
||||||
|
private Date updateTime; |
||||||
|
/** |
||||||
|
* 备注 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "备注") |
||||||
|
private String remark; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,56 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.safeproduct.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||||
|
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 实体类 |
||||||
|
* |
||||||
|
* @author Chill |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("hzims_safe_danger_source_position") |
||||||
|
@ApiModel(value = "危险源位置对象", description = "") |
||||||
|
public class DangerSourcePositionEntity implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
/** |
||||||
|
* 危险源ID |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "危险源ID", hidden = true) |
||||||
|
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||||
|
private Long sourceId; |
||||||
|
/** |
||||||
|
* 平面图顶部距离 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "平面图顶部距离") |
||||||
|
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||||
|
private Double paddingTop; |
||||||
|
/** |
||||||
|
* 平面图左边距 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "平面图左边距") |
||||||
|
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||||
|
private Double paddingLeft; |
||||||
|
/** |
||||||
|
* 经度 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "经度") |
||||||
|
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||||
|
private Double lgtd; |
||||||
|
/** |
||||||
|
* 纬度 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "纬度") |
||||||
|
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||||
|
private Double lttd; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,34 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.safeproduct.feign; |
||||||
|
|
||||||
|
import org.springblade.hzinfo_inspect.Constants; |
||||||
|
import org.springblade.hzinfo_inspect.safeproduct.entity.DangerSourceEntity; |
||||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@FeignClient( |
||||||
|
value = Constants.APP_NAME |
||||||
|
) |
||||||
|
public interface IDangerSourceClient { |
||||||
|
String API_PREFIX = "/feign/dangerSource"; |
||||||
|
String DETAILS = API_PREFIX + "/details"; |
||||||
|
String LIST_BY_DEPT_ID = API_PREFIX + "/listByDeptId"; |
||||||
|
|
||||||
|
/** |
||||||
|
* 根据ID集合查询详情集,并按照传入的ids排序 |
||||||
|
* |
||||||
|
* @author xiashandong |
||||||
|
**/ |
||||||
|
@GetMapping(DETAILS) |
||||||
|
List<DangerSourceEntity> details(@RequestParam("ids") String[] ids); |
||||||
|
|
||||||
|
/** |
||||||
|
* 根据条件查询危险源 |
||||||
|
* |
||||||
|
* @author xiashandong |
||||||
|
**/ |
||||||
|
@GetMapping(LIST_BY_DEPT_ID) |
||||||
|
List<DangerSourceEntity> listByDeptId(@RequestParam("deptId") String deptId); |
||||||
|
} |
||||||
@ -0,0 +1,170 @@ |
|||||||
|
/** |
||||||
|
* |
||||||
|
*/ |
||||||
|
package org.springblade.hzinfo_inspect.task; |
||||||
|
|
||||||
|
import lombok.Getter; |
||||||
|
|
||||||
|
import java.util.HashSet; |
||||||
|
import java.util.Set; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author ninglong |
||||||
|
* |
||||||
|
*/ |
||||||
|
public interface TaskContants { |
||||||
|
/** |
||||||
|
* 处理同时开启几个任务的 |
||||||
|
*/ |
||||||
|
String OPEN_MULTIPLE_TASK = "hzims.tasks.flag"; |
||||||
|
/** |
||||||
|
* 流程key |
||||||
|
*/ |
||||||
|
final String PROGROM_FLOWABLE_KEY = "inspectProgram"; |
||||||
|
|
||||||
|
/** |
||||||
|
* 巡检任务类型字典key |
||||||
|
*/ |
||||||
|
String INSPECT_TASK_TYPE = "inspectType"; |
||||||
|
|
||||||
|
/** |
||||||
|
* 流程key |
||||||
|
*/ |
||||||
|
final String TASK_USER = "problemUser"; |
||||||
|
|
||||||
|
/** |
||||||
|
* 0未开始 1进行中 2暂停 3已完成 4未完成 |
||||||
|
* @author ninglong |
||||||
|
* |
||||||
|
*/ |
||||||
|
public enum TaskStatusEnum{ |
||||||
|
/** |
||||||
|
* 任务状态未开始常量值 |
||||||
|
*/ |
||||||
|
INIT_STATUS("0"), |
||||||
|
/** |
||||||
|
* 任务状态进行中常量值 |
||||||
|
*/ |
||||||
|
UNDERWAY_STATUS("1"), |
||||||
|
/** |
||||||
|
* 任务状态暂停常量值 |
||||||
|
*/ |
||||||
|
PAUSE_STATUS("2"), |
||||||
|
/** |
||||||
|
* 任务状态已完成常量值 |
||||||
|
*/ |
||||||
|
FINISH_STATUS("3"), |
||||||
|
/** |
||||||
|
* 任务状态未完成常量值 |
||||||
|
*/ |
||||||
|
UNFINISH_STATUS("4"); |
||||||
|
@Getter |
||||||
|
private String status; |
||||||
|
private TaskStatusEnum(String status){ |
||||||
|
this.status = status; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 领用状态 0:未领用 1:已领用 |
||||||
|
* @author ninglong |
||||||
|
*/ |
||||||
|
public enum ClaimStatusEnum{ |
||||||
|
/** |
||||||
|
* 0:未领用 |
||||||
|
*/ |
||||||
|
UN_COLLECT("0"), |
||||||
|
/** |
||||||
|
* 1:已领用 |
||||||
|
*/ |
||||||
|
COLLECT("1"); |
||||||
|
@Getter |
||||||
|
private String status; |
||||||
|
private ClaimStatusEnum(String status){ |
||||||
|
this.status = status; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 报备模式 0 任务报备 1 人员报备 |
||||||
|
* @author ninglong |
||||||
|
*/ |
||||||
|
public enum TaskRecordTypeEnum{ |
||||||
|
task("0"),people("1"); |
||||||
|
@Getter |
||||||
|
private String type; |
||||||
|
private TaskRecordTypeEnum(String type){ |
||||||
|
this.type = type; |
||||||
|
} |
||||||
|
} |
||||||
|
/** |
||||||
|
* 巡检备案 0 未备案 1已备案 |
||||||
|
* @author ninglong |
||||||
|
*/ |
||||||
|
public enum keepOnRecordEnum{ |
||||||
|
no("0"),yes("1"); |
||||||
|
@Getter |
||||||
|
private String type; |
||||||
|
private keepOnRecordEnum(String type){ |
||||||
|
this.type = type; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 是否问题 0:否 1 是 默认0 |
||||||
|
* @author ninglong |
||||||
|
*/ |
||||||
|
public enum ProblemEnum{ |
||||||
|
no("0"),yes("1"); |
||||||
|
@Getter |
||||||
|
private String type; |
||||||
|
private ProblemEnum(String type){ |
||||||
|
this.type = type; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 完成标识 0 不可用 1 可用 |
||||||
|
* @author ninglong |
||||||
|
* |
||||||
|
*/ |
||||||
|
public enum AvailableEnum{ |
||||||
|
no("0"),yes("1"); |
||||||
|
@Getter |
||||||
|
private String type; |
||||||
|
private AvailableEnum(String type){ |
||||||
|
this.type = type; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 当前状态 0 不可用 1 可用 |
||||||
|
* @author py |
||||||
|
* |
||||||
|
*/ |
||||||
|
public enum CurrentStatusEnum{ |
||||||
|
normal("1"), abnormal("0") ; |
||||||
|
@Getter |
||||||
|
private String type; |
||||||
|
private CurrentStatusEnum(String type){ |
||||||
|
this.type = type; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
enum StatusEnum{ |
||||||
|
/** |
||||||
|
* 状态未完成 |
||||||
|
*/ |
||||||
|
INIT_STATUS(0), |
||||||
|
/** |
||||||
|
* 任务状态已完成 |
||||||
|
*/ |
||||||
|
FINISH_STATUS(1); |
||||||
|
@Getter |
||||||
|
private Integer status; |
||||||
|
private StatusEnum(Integer status){ |
||||||
|
this.status = status; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,169 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.task.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import io.swagger.annotations.ApiModel; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 实体类 |
||||||
|
* @author Chill |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("hz_st_ex_task") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
@ApiModel(value = "巡检任务对象", description = "巡检任务") |
||||||
|
public class TaskEntity extends BaseEntity { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
/** |
||||||
|
* 计划ID |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划ID") |
||||||
|
private Long planId; |
||||||
|
/** |
||||||
|
* 计划模式 0 人员 1岗位 2机构 3自由模式 4 自由人模式 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划模式 0 人员 1岗位 2机构 3自由模式 4 自由人模式") |
||||||
|
private String type; |
||||||
|
/** |
||||||
|
* 计划名称 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划名称") |
||||||
|
private String planName; |
||||||
|
/** |
||||||
|
* 任务批次号 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "任务批次号") |
||||||
|
private String batchNumber; |
||||||
|
/** |
||||||
|
* 任务计划开始时间 |
||||||
|
*/ |
||||||
|
@DateTimeFormat( |
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss" |
||||||
|
) |
||||||
|
@JsonFormat( |
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss" |
||||||
|
) |
||||||
|
@ApiModelProperty(value = "任务计划开始时间") |
||||||
|
private LocalDateTime planStartTime; |
||||||
|
/** |
||||||
|
* 任务计划结束时间 |
||||||
|
*/ |
||||||
|
@DateTimeFormat( |
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss" |
||||||
|
) |
||||||
|
@JsonFormat( |
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss" |
||||||
|
) |
||||||
|
@ApiModelProperty(value = "任务计划结束时间") |
||||||
|
private LocalDateTime planEndTime; |
||||||
|
/** |
||||||
|
* 任务实际开始时间 |
||||||
|
*/ |
||||||
|
@DateTimeFormat( |
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss" |
||||||
|
) |
||||||
|
@JsonFormat( |
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss" |
||||||
|
) |
||||||
|
@ApiModelProperty(value = "任务实际开始时间") |
||||||
|
private LocalDateTime startTime; |
||||||
|
/** |
||||||
|
* 任务实际结束时间 |
||||||
|
*/ |
||||||
|
@DateTimeFormat( |
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss" |
||||||
|
) |
||||||
|
@JsonFormat( |
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss" |
||||||
|
) |
||||||
|
@ApiModelProperty(value = "任务实际结束时间") |
||||||
|
private LocalDateTime endTime; |
||||||
|
/** |
||||||
|
* 巡检备案 0 未备案 1已备案 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "任务报备 0 未报备 1已报备") |
||||||
|
private String keepOnRecord; |
||||||
|
|
||||||
|
/** |
||||||
|
* 计划周期 0: 从不 1:每天 2:每月 3:每季度 4:每年 5:每周 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "计划周期 0: 从不 1:每天 2:每月 3:每季度 4:每年 5:每周") |
||||||
|
private String cycle; |
||||||
|
|
||||||
|
@ApiModelProperty(value = "任务模式:0抢占,1并发") |
||||||
|
private String method; |
||||||
|
|
||||||
|
@TableField(exist=false) |
||||||
|
@ApiModelProperty(value = "任务执行人") |
||||||
|
private String userName; |
||||||
|
|
||||||
|
@TableField(exist=false) |
||||||
|
@ApiModelProperty(value = "任务执行人id") |
||||||
|
private Long userId; |
||||||
|
|
||||||
|
@TableField(exist=false) |
||||||
|
@ApiModelProperty(value = "任务执行人手机号码") |
||||||
|
private String userPhone; |
||||||
|
|
||||||
|
@TableField(exist=false) |
||||||
|
@ApiModelProperty(value = "巡检路线的点") |
||||||
|
private List<String> point; |
||||||
|
|
||||||
|
/** |
||||||
|
* 巡检类型标识: 0普通巡检,1视频自动巡检,2机器人巡检 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "巡检类型标识: 0普通巡检,1视频自动巡检,2机器人巡检 3防汛巡检 4特殊巡检") |
||||||
|
private String autoVideo; |
||||||
|
|
||||||
|
/** |
||||||
|
* hld |
||||||
|
*/ |
||||||
|
|
||||||
|
@ApiModelProperty(value = "计划类型") |
||||||
|
private String planType; |
||||||
|
|
||||||
|
/** |
||||||
|
* 任务开始前 是否发送提醒短信 标识 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "任务开始前 是否发送提醒短信 标识") |
||||||
|
private Boolean startRemindFlag ; |
||||||
|
/** |
||||||
|
* 任务结束前 是否发送提醒短信 标识 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "任务结束前 是否发送提醒短信 标识") |
||||||
|
private Boolean endRemindFlag ; |
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "计划、任务增加开始前提醒时间") |
||||||
|
private LocalDateTime startRemindTime; |
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "计划、任务增加结束前提醒时间") |
||||||
|
private LocalDateTime endRemindTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 临时任务的巡检任务内容 |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "临时任务的巡检任务内容") |
||||||
|
private String taskContent; |
||||||
|
|
||||||
|
/** |
||||||
|
* 值班id |
||||||
|
*/ |
||||||
|
@ApiModelProperty(value = "值班id") |
||||||
|
private Long dutyId; |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,30 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.task.feign; |
||||||
|
|
||||||
|
import org.springblade.hzinfo_inspect.Constants; |
||||||
|
import org.springblade.hzinfo_inspect.task.entity.TaskEntity; |
||||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@FeignClient( |
||||||
|
value = Constants.APP_NAME |
||||||
|
) |
||||||
|
public interface IInspectTaskClient { |
||||||
|
String API_PREFIX = "/feign/inspect/task"; |
||||||
|
String QUERY_BY_PLAN_START_TIME = API_PREFIX + "/queryByPlanStartTime"; |
||||||
|
String QUERY_BY_PLAN_START_TIME_AND_DEPT = API_PREFIX + "/queryByPlanStartTimeAndDept"; |
||||||
|
|
||||||
|
/** |
||||||
|
* 根据创建时间查询巡检任务列表 |
||||||
|
**/ |
||||||
|
@GetMapping(QUERY_BY_PLAN_START_TIME) |
||||||
|
List<TaskEntity> queryByPlanStartTime(@RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate); |
||||||
|
|
||||||
|
/** |
||||||
|
* 根据创建时间及创建部门查询巡检任务列表 |
||||||
|
**/ |
||||||
|
@GetMapping(QUERY_BY_PLAN_START_TIME_AND_DEPT) |
||||||
|
List<TaskEntity> queryByPlanStartTimeAndDept(@RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate, @RequestParam("depts") List<Long> depts); |
||||||
|
} |
||||||
@ -0,0 +1,52 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.task.feign; |
||||||
|
|
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.hzinfo_inspect.Constants; |
||||||
|
import org.springblade.hzinfo_inspect.task.entity.TaskEntity; |
||||||
|
import org.springblade.hzinfo_inspect.task.vo.DutyInspectTaskVO; |
||||||
|
import org.springblade.hzinfo_inspect.task.vo.TaskReportVO; |
||||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
@FeignClient( |
||||||
|
value = Constants.APP_NAME |
||||||
|
) |
||||||
|
public interface IInspectTaskReportClient { |
||||||
|
String API_PREFIX = "real/time/task"; |
||||||
|
String TO_RECEIVE = API_PREFIX + "/toReceives"; |
||||||
|
String EXECUTROY = API_PREFIX + "/executorys"; |
||||||
|
String EXECUTED = API_PREFIX + "/executeds"; |
||||||
|
String DAY_ALL = API_PREFIX + "/dayAll"; |
||||||
|
String CLASS_ALL = API_PREFIX + "/classAll"; |
||||||
|
String INSPECT_TASK_REPORT = API_PREFIX + "/getInspectTaskReport"; |
||||||
|
String INSPECT_TASK_CONCLUSION = API_PREFIX + "/getReportConClusion"; |
||||||
|
String GET_DUTY_INSPEC_TTASK = API_PREFIX + "/getDutyInspectTask"; |
||||||
|
|
||||||
|
@PostMapping(TO_RECEIVE) |
||||||
|
List<TaskEntity> toReceives(); |
||||||
|
|
||||||
|
@PostMapping(EXECUTROY) |
||||||
|
List<TaskEntity> executorys(); |
||||||
|
|
||||||
|
@PostMapping(EXECUTED) |
||||||
|
List<TaskEntity> executeds(); |
||||||
|
|
||||||
|
@PostMapping(DAY_ALL) |
||||||
|
List<TaskEntity> dayAll(); |
||||||
|
|
||||||
|
@PostMapping(CLASS_ALL) |
||||||
|
List<TaskEntity> classAll(@RequestBody Map<String, Object> params); |
||||||
|
|
||||||
|
@PostMapping(INSPECT_TASK_REPORT) |
||||||
|
List<TaskReportVO> getInspectTaskReport(@RequestBody Map<String, Object> params); |
||||||
|
|
||||||
|
@PostMapping(INSPECT_TASK_CONCLUSION) |
||||||
|
Map<String,Object> getReportConclusion(@RequestBody Map<String, Object> params); |
||||||
|
|
||||||
|
@PostMapping(GET_DUTY_INSPEC_TTASK) |
||||||
|
R<DutyInspectTaskVO> getDutyInspectTask(@RequestBody Map<String, Object> params); |
||||||
|
} |
||||||
@ -0,0 +1,16 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.task.vo; |
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
|
||||||
|
@Data |
||||||
|
@EqualsAndHashCode |
||||||
|
public class DutyInspectTaskVO { |
||||||
|
|
||||||
|
@ApiModelProperty("巡检任务总数") |
||||||
|
private Integer inspectTaskSum; |
||||||
|
|
||||||
|
@ApiModelProperty("巡检任务完成数") |
||||||
|
private Integer inspectTaskFinish; |
||||||
|
} |
||||||
@ -0,0 +1,35 @@ |
|||||||
|
package org.springblade.hzinfo_inspect.task.vo; |
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||||
|
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author hx |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@EqualsAndHashCode |
||||||
|
public class TaskReportVO { |
||||||
|
private static final long serialVersionUID = 8220246531084664333L; |
||||||
|
|
||||||
|
@ApiModelProperty("人员ID") |
||||||
|
private Long userId; |
||||||
|
|
||||||
|
@ApiModelProperty("姓名") |
||||||
|
private String userName; |
||||||
|
|
||||||
|
@ApiModelProperty("完成任务情况") |
||||||
|
private String completeSituation; |
||||||
|
|
||||||
|
@ApiModelProperty("未完成任务情况") |
||||||
|
private String incompleteSituation; |
||||||
|
|
||||||
|
@ApiModelProperty("工时") |
||||||
|
private Long hours; |
||||||
|
|
||||||
|
@ApiModelProperty("发现问题数量") |
||||||
|
@JsonSerialize(nullsUsing = NullSerializer.class) |
||||||
|
private Long findProblemCount; |
||||||
|
} |
||||||
@ -0,0 +1,16 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<parent> |
||||||
|
<artifactId>hzinfo-ris-pxhd-service-api</artifactId> |
||||||
|
<groupId>org.springblade</groupId> |
||||||
|
<version>4.5.0.RELEASE</version> |
||||||
|
</parent> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
|
||||||
|
<artifactId>hzinfo-ris-pxhd-common-service-api</artifactId> |
||||||
|
<name>${project.artifactId}</name> |
||||||
|
<packaging>jar</packaging> |
||||||
|
|
||||||
|
</project> |
||||||
@ -0,0 +1,35 @@ |
|||||||
|
package org.springblade.ris_common.entity; |
||||||
|
|
||||||
|
public enum QueryDateTypeEnum { |
||||||
|
//时
|
||||||
|
HOUR("hour"), |
||||||
|
//日
|
||||||
|
DAY("day"), |
||||||
|
//月
|
||||||
|
MONTH("month"), |
||||||
|
//年
|
||||||
|
YEAR("year"); |
||||||
|
|
||||||
|
private String queryDateType; |
||||||
|
|
||||||
|
QueryDateTypeEnum(String queryDateType) { |
||||||
|
this.queryDateType = queryDateType; |
||||||
|
} |
||||||
|
|
||||||
|
public static QueryDateTypeEnum getInstance(String queryDateType) { |
||||||
|
for (QueryDateTypeEnum queryTypeEnum : QueryDateTypeEnum.values()) { |
||||||
|
if (queryTypeEnum.getQueryDateType().equals(queryDateType)) { |
||||||
|
return queryTypeEnum; |
||||||
|
} |
||||||
|
} |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
public String getQueryDateType() { |
||||||
|
return queryDateType; |
||||||
|
} |
||||||
|
|
||||||
|
public void setQueryDateType(String queryDateType) { |
||||||
|
this.queryDateType = queryDateType; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,272 @@ |
|||||||
|
package org.springblade.ris_common.entity; |
||||||
|
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||||
|
import org.springblade.ris_common.util.ReportDateUtil; |
||||||
|
|
||||||
|
import java.text.SimpleDateFormat; |
||||||
|
import java.util.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* 提供出去的报表 |
||||||
|
* 提供基础业务数据以及统计数据 |
||||||
|
* |
||||||
|
* @Author: liugang |
||||||
|
* @Date: 2019/7/8 15:03 |
||||||
|
*/ |
||||||
|
public class Report { |
||||||
|
|
||||||
|
/** |
||||||
|
* (唯一标识key,标题名称value), |
||||||
|
*/ |
||||||
|
private List<Map<String, String>> title; |
||||||
|
|
||||||
|
/** |
||||||
|
* 报表基础数据 |
||||||
|
*/ |
||||||
|
private List<ReportUnit> data; |
||||||
|
|
||||||
|
/** |
||||||
|
* 附加报表统计数据 |
||||||
|
*/ |
||||||
|
private List<ReportUnit> standardData; |
||||||
|
|
||||||
|
/** |
||||||
|
* 初始化基础报表数据 |
||||||
|
* 把数据全部置为初始状态("-") |
||||||
|
* |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
public void initBaseReport(int size, Date begin, Date end, QueryDateTypeEnum dtEnum) { |
||||||
|
data = new ArrayList<>(); |
||||||
|
Calendar cal = Calendar.getInstance(); |
||||||
|
cal.setTime(begin); |
||||||
|
SimpleDateFormat sdf = ReportDateUtil.getSimpleDateFormatByType(dtEnum); |
||||||
|
int step = ReportDateUtil.getCalendarType(dtEnum); |
||||||
|
Date temp = cal.getTime(); |
||||||
|
while (temp.before(end)) { |
||||||
|
String key = sdf.format(temp); |
||||||
|
ReportUnit unit = new ReportUnit(); |
||||||
|
unit.init(key, size); |
||||||
|
data.add(unit); |
||||||
|
cal.set(step, cal.get(step) + 1); |
||||||
|
temp = cal.getTime(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public void initBaseReportMonth(int day,int month){ |
||||||
|
data = new ArrayList<>(); |
||||||
|
for(int i=1;i<=day;i++){ |
||||||
|
String key=i> 9 ? ""+i:"0"+i; |
||||||
|
ReportUnit unit = new ReportUnit(); |
||||||
|
unit.init(key, month); |
||||||
|
data.add(unit); |
||||||
|
} |
||||||
|
ReportUnit unit = new ReportUnit(); |
||||||
|
unit.init("max", month); |
||||||
|
data.add(unit); |
||||||
|
|
||||||
|
unit = new ReportUnit(); |
||||||
|
unit.init("maxDate", month); |
||||||
|
data.add(unit); |
||||||
|
|
||||||
|
unit = new ReportUnit(); |
||||||
|
unit.init("min", month); |
||||||
|
data.add(unit); |
||||||
|
|
||||||
|
unit = new ReportUnit(); |
||||||
|
unit.init("minDate", month); |
||||||
|
data.add(unit); |
||||||
|
|
||||||
|
unit = new ReportUnit(); |
||||||
|
unit.init("avg", month); |
||||||
|
data.add(unit); |
||||||
|
} |
||||||
|
|
||||||
|
public void initBaseReportMaxMin(int size, Date begin, Date end, QueryDateTypeEnum dtEnum) { |
||||||
|
initBaseReport(size, begin, end, dtEnum); |
||||||
|
ReportUnit unit = new ReportUnit(); |
||||||
|
unit.init("max", size); |
||||||
|
data.add(unit); |
||||||
|
|
||||||
|
unit = new ReportUnit(); |
||||||
|
unit.init("maxDate", size); |
||||||
|
data.add(unit); |
||||||
|
|
||||||
|
unit = new ReportUnit(); |
||||||
|
unit.init("min", size); |
||||||
|
data.add(unit); |
||||||
|
|
||||||
|
unit = new ReportUnit(); |
||||||
|
unit.init("minDate", size); |
||||||
|
data.add(unit); |
||||||
|
|
||||||
|
unit = new ReportUnit(); |
||||||
|
unit.init("avg", size); |
||||||
|
data.add(unit); |
||||||
|
|
||||||
|
unit = new ReportUnit(); |
||||||
|
unit.init("range", size);//极差
|
||||||
|
data.add(unit); |
||||||
|
} |
||||||
|
|
||||||
|
public void initBaseReportHistory(int size){ |
||||||
|
data = new ArrayList<>(); |
||||||
|
ReportUnit unit = new ReportUnit(); |
||||||
|
unit.init("max", size); |
||||||
|
data.add(unit); |
||||||
|
|
||||||
|
unit = new ReportUnit(); |
||||||
|
unit.init("maxDate", size); |
||||||
|
data.add(unit); |
||||||
|
|
||||||
|
unit = new ReportUnit(); |
||||||
|
unit.init("min", size); |
||||||
|
data.add(unit); |
||||||
|
|
||||||
|
unit = new ReportUnit(); |
||||||
|
unit.init("minDate", size); |
||||||
|
data.add(unit); |
||||||
|
|
||||||
|
unit = new ReportUnit(); |
||||||
|
unit.init("avg", size); |
||||||
|
data.add(unit); |
||||||
|
|
||||||
|
unit = new ReportUnit(); |
||||||
|
unit.init("range", size);//极差
|
||||||
|
data.add(unit); |
||||||
|
} |
||||||
|
|
||||||
|
public void initCompareBaseReport(int size, Date begin, Date end, QueryDateTypeEnum dtEnum) { |
||||||
|
data = new ArrayList<>(); |
||||||
|
Calendar cal = Calendar.getInstance(); |
||||||
|
cal.setTime(begin); |
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("MM-dd"); |
||||||
|
int step = ReportDateUtil.getCalendarType(dtEnum); |
||||||
|
Date temp = cal.getTime(); |
||||||
|
while (temp.before(end)) { |
||||||
|
String key = sdf.format(temp); |
||||||
|
ReportUnit unit = new ReportUnit(); |
||||||
|
unit.init(key, size); |
||||||
|
data.add(unit); |
||||||
|
cal.set(step, cal.get(step) + 1); |
||||||
|
temp = cal.getTime(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public void initBaseRingReport(int size, Date begin, Date end, QueryDateTypeEnum dtEnum){ |
||||||
|
data = new ArrayList<>(); |
||||||
|
Calendar cal = Calendar.getInstance(); |
||||||
|
cal.setTime(begin); |
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH"); |
||||||
|
int step = ReportDateUtil.getCalendarType(dtEnum); |
||||||
|
Date temp = cal.getTime(); |
||||||
|
while (temp.before(end)) { |
||||||
|
String key = sdf.format(temp); |
||||||
|
ReportUnit unit = new ReportUnit(); |
||||||
|
unit.init(key, size); |
||||||
|
data.add(unit); |
||||||
|
cal.set(step, cal.get(step) + 1); |
||||||
|
temp = cal.getTime(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public void initRingBaseReport(int size, Date begin, Date end, QueryDateTypeEnum dtEnum) { |
||||||
|
data = new ArrayList<>(); |
||||||
|
Calendar cal = Calendar.getInstance(); |
||||||
|
cal.setTime(begin); |
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("MM-dd"); |
||||||
|
int step = ReportDateUtil.getCalendarType(dtEnum); |
||||||
|
Date temp = cal.getTime(); |
||||||
|
while (temp.before(end)) { |
||||||
|
String key = sdf.format(temp); |
||||||
|
ReportUnit unit = new ReportUnit(); |
||||||
|
unit.init(key, size); |
||||||
|
data.add(unit); |
||||||
|
cal.set(step, cal.get(step) + 1); |
||||||
|
temp = cal.getTime(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 初始化统计数据 |
||||||
|
* |
||||||
|
* @param size 大小 |
||||||
|
* @param keys 统计数据类型 |
||||||
|
*/ |
||||||
|
public void initStandardReport(int size, String[] keys) { |
||||||
|
standardData = new ArrayList<>(); |
||||||
|
for (String key : keys) { |
||||||
|
standardData.add(initSingleStandard(key, size)); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
private ReportUnit initSingleStandard(String key, int size) { |
||||||
|
ReportUnit unit = new ReportUnit(); |
||||||
|
unit.setKey(key); |
||||||
|
unit.setDataList(new ArrayList<>()); |
||||||
|
for (int i = 0; i < size; i++) { |
||||||
|
unit.getDataList().add("-"); |
||||||
|
} |
||||||
|
return unit; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 修改唯一标识标定的数据对象(基础数据) |
||||||
|
* |
||||||
|
* @param key 唯一标识 |
||||||
|
* @param index 修改的数据索引 |
||||||
|
* @param value 修改的值 |
||||||
|
*/ |
||||||
|
public void setBaseCell(String key, int index, String value) { |
||||||
|
for (ReportUnit unit : data) { |
||||||
|
if (unit.getKey().equals(key)) { |
||||||
|
unit.getDataList().set(index, value); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 修改唯一标识标定的数据对象(标准数据) |
||||||
|
* |
||||||
|
* @param key 唯一标识 |
||||||
|
* @param index 修改的数据索引 |
||||||
|
* @param value 修改的值 |
||||||
|
*/ |
||||||
|
public void setStandardCell(String key, int index, String value) { |
||||||
|
for (ReportUnit unit : standardData) { |
||||||
|
if (unit.getKey().equals(key)) { |
||||||
|
unit.getDataList().set(index, value); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public List<Map<String, String>> getTitle() { |
||||||
|
return title; |
||||||
|
} |
||||||
|
|
||||||
|
public void setTitle(List<Map<String, String>> title) { |
||||||
|
this.title = title; |
||||||
|
} |
||||||
|
|
||||||
|
public List<ReportUnit> getData() { |
||||||
|
return data; |
||||||
|
} |
||||||
|
|
||||||
|
public void setData(List<ReportUnit> data) { |
||||||
|
this.data = data; |
||||||
|
} |
||||||
|
|
||||||
|
public List<ReportUnit> getStandardData() { |
||||||
|
return standardData; |
||||||
|
} |
||||||
|
|
||||||
|
public void setStandardData(List<ReportUnit> standardData) { |
||||||
|
this.standardData = standardData; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String toString() { |
||||||
|
return ToStringBuilder.reflectionToString(this); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
@ -0,0 +1,107 @@ |
|||||||
|
package org.springblade.ris_common.entity; |
||||||
|
|
||||||
|
/** |
||||||
|
* 封装一个key,value键值对象 |
||||||
|
* 可能是数据库返回查询数据 |
||||||
|
* 也可能是使用的对象由于数据需要置为- |
||||||
|
* 所以采用String存储处理 |
||||||
|
* |
||||||
|
* @Author: liugang |
||||||
|
* @Date: 2019/7/8 16:02 |
||||||
|
*/ |
||||||
|
public class ReportData { |
||||||
|
|
||||||
|
private String keyStr; |
||||||
|
|
||||||
|
private String keyDate; |
||||||
|
|
||||||
|
private String val; |
||||||
|
//测站 或 属性
|
||||||
|
private String stcd; |
||||||
|
//属性名
|
||||||
|
private String name; |
||||||
|
|
||||||
|
private Double value; |
||||||
|
|
||||||
|
private int month=-1; |
||||||
|
|
||||||
|
private String day; |
||||||
|
|
||||||
|
public String getDay() { |
||||||
|
return day; |
||||||
|
} |
||||||
|
|
||||||
|
public void setDay(String day) { |
||||||
|
this.day = day; |
||||||
|
} |
||||||
|
|
||||||
|
public int getMonth() { |
||||||
|
return month; |
||||||
|
} |
||||||
|
|
||||||
|
public void setMonth(int month) { |
||||||
|
this.month = month; |
||||||
|
} |
||||||
|
|
||||||
|
public String getName() { |
||||||
|
return name; |
||||||
|
} |
||||||
|
|
||||||
|
public void setName(String name) { |
||||||
|
this.name = name; |
||||||
|
} |
||||||
|
|
||||||
|
public String getStcd() { |
||||||
|
return stcd; |
||||||
|
} |
||||||
|
|
||||||
|
public void setStcd(String stcd) { |
||||||
|
this.stcd = stcd; |
||||||
|
} |
||||||
|
|
||||||
|
public ReportData() { |
||||||
|
} |
||||||
|
|
||||||
|
public String getKeyDate() { |
||||||
|
return keyDate; |
||||||
|
} |
||||||
|
|
||||||
|
public void setKeyDate(String keyDate) { |
||||||
|
this.keyDate = keyDate; |
||||||
|
} |
||||||
|
|
||||||
|
public ReportData(String keyStr, String val) { |
||||||
|
this.keyStr = keyStr; |
||||||
|
this.val = val; |
||||||
|
} |
||||||
|
|
||||||
|
public String getKeyStr() { |
||||||
|
return keyStr; |
||||||
|
} |
||||||
|
|
||||||
|
public void setKeyStr(String keyStr) { |
||||||
|
this.keyStr = keyStr; |
||||||
|
} |
||||||
|
|
||||||
|
public String getVal() { |
||||||
|
return val; |
||||||
|
} |
||||||
|
|
||||||
|
public void setVal(String val) { |
||||||
|
this.val = val; |
||||||
|
} |
||||||
|
|
||||||
|
public Double getValue() { |
||||||
|
if(val!=null) { |
||||||
|
if(val.indexOf("-")==-1) { |
||||||
|
return Double.valueOf(val); |
||||||
|
} |
||||||
|
} |
||||||
|
return 0.0; |
||||||
|
} |
||||||
|
|
||||||
|
public void setValue(Double value) { |
||||||
|
this.value = value; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
@ -0,0 +1,34 @@ |
|||||||
|
package org.springblade.ris_common.entity; |
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
public class ReportUnit { |
||||||
|
private String key; |
||||||
|
|
||||||
|
private List<String> dataList; |
||||||
|
|
||||||
|
public void init(String key, int size) { |
||||||
|
this.key = key; |
||||||
|
dataList = new ArrayList<>(); |
||||||
|
for (int i = 0; i < size; i++) { |
||||||
|
dataList.add("-"); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public String getKey() { |
||||||
|
return key; |
||||||
|
} |
||||||
|
|
||||||
|
public void setKey(String key) { |
||||||
|
this.key = key; |
||||||
|
} |
||||||
|
|
||||||
|
public List<String> getDataList() { |
||||||
|
return dataList; |
||||||
|
} |
||||||
|
|
||||||
|
public void setDataList(List<String> dataList) { |
||||||
|
this.dataList = dataList; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,174 @@ |
|||||||
|
package org.springblade.ris_common.entity; |
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Objects; |
||||||
|
|
||||||
|
public class StandardData { |
||||||
|
public static final String STANDARD_AVG = "平均值"; |
||||||
|
public static final String STANDARD_MAX = "最大值"; |
||||||
|
public static final String STANDARD_MAX_DATE = "最大值出现的时间"; |
||||||
|
public static final String STANDARD_MIN = "最小值"; |
||||||
|
public static final String STANDARD_MIN_DATE = "最小值出现的时间"; |
||||||
|
public static final String STANDARD_AMPLITUDE = "最大变幅"; |
||||||
|
public static final String STANDARD_SUM = "总量"; |
||||||
|
|
||||||
|
/** |
||||||
|
* 平均值 |
||||||
|
*/ |
||||||
|
private String dataAvg; |
||||||
|
/** |
||||||
|
* 最大值 |
||||||
|
*/ |
||||||
|
private String dataMax; |
||||||
|
/** |
||||||
|
* 最大值时间 |
||||||
|
*/ |
||||||
|
private String dataMaxDate; |
||||||
|
/** |
||||||
|
* 最小值 |
||||||
|
*/ |
||||||
|
private String dataMin; |
||||||
|
/** |
||||||
|
* 最小值出现时间 |
||||||
|
*/ |
||||||
|
private String dataMinDate; |
||||||
|
/** |
||||||
|
* 最大变幅 |
||||||
|
*/ |
||||||
|
private String amplitude; |
||||||
|
/** |
||||||
|
* 总量 |
||||||
|
*/ |
||||||
|
private String dataSum; |
||||||
|
|
||||||
|
/** |
||||||
|
* 比较并处理最大值和最大值日期 |
||||||
|
* |
||||||
|
* @param value 被比较值 |
||||||
|
* @param date 日期 |
||||||
|
*/ |
||||||
|
public void compareDealMax(String value, String date) { |
||||||
|
if (Objects.isNull(dataMax)) { |
||||||
|
dataMax = value; |
||||||
|
dataMaxDate = date; |
||||||
|
} else { |
||||||
|
if (Double.valueOf(dataMax) < Double.valueOf(value)) { |
||||||
|
dataMax = value; |
||||||
|
dataMaxDate = date; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 比较并处理最小值和最小值日期 |
||||||
|
* |
||||||
|
* @param value 被比较值 |
||||||
|
* @param date 日期 |
||||||
|
*/ |
||||||
|
public void compareDealMin(String value, String date) { |
||||||
|
if (Objects.isNull(dataMin)) { |
||||||
|
dataMin = value; |
||||||
|
dataMinDate = date; |
||||||
|
} else { |
||||||
|
if (Double.valueOf(value) < Double.valueOf(dataMin)) { |
||||||
|
dataMin = value; |
||||||
|
dataMinDate = date; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 默认计算总和,如有其他逻辑请继承后改写 |
||||||
|
* |
||||||
|
* @param value |
||||||
|
*/ |
||||||
|
public void countSum(String value) { |
||||||
|
if (Objects.isNull(dataSum)) { |
||||||
|
dataSum = value; |
||||||
|
} else { |
||||||
|
dataSum = new BigDecimal(value).add(new BigDecimal(dataSum)).toString(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 处理空数据,如果数据为空则置- |
||||||
|
*/ |
||||||
|
public void dealNullData() { |
||||||
|
if (StringUtils.isEmpty(dataAvg)) { |
||||||
|
dataAvg = "-"; |
||||||
|
} |
||||||
|
if (StringUtils.isEmpty(dataMax)) { |
||||||
|
dataMax = "-"; |
||||||
|
} |
||||||
|
if (StringUtils.isEmpty(dataMaxDate)) { |
||||||
|
dataMaxDate = "-"; |
||||||
|
} |
||||||
|
if (StringUtils.isEmpty(dataMin)) { |
||||||
|
dataMin = "-"; |
||||||
|
} |
||||||
|
if (StringUtils.isEmpty(dataMinDate)) { |
||||||
|
dataMinDate = "-"; |
||||||
|
} |
||||||
|
if (StringUtils.isEmpty(dataSum)) { |
||||||
|
dataSum = "-"; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public String getDataAvg() { |
||||||
|
return dataAvg; |
||||||
|
} |
||||||
|
|
||||||
|
public void setDataAvg(String dataAvg) { |
||||||
|
this.dataAvg = dataAvg; |
||||||
|
} |
||||||
|
|
||||||
|
public String getDataMax() { |
||||||
|
return dataMax; |
||||||
|
} |
||||||
|
|
||||||
|
public void setDataMax(String dataMax) { |
||||||
|
this.dataMax = dataMax; |
||||||
|
} |
||||||
|
|
||||||
|
public String getDataMaxDate() { |
||||||
|
return dataMaxDate; |
||||||
|
} |
||||||
|
|
||||||
|
public void setDataMaxDate(String dataMaxDate) { |
||||||
|
this.dataMaxDate = dataMaxDate; |
||||||
|
} |
||||||
|
|
||||||
|
public String getDataMin() { |
||||||
|
return dataMin; |
||||||
|
} |
||||||
|
|
||||||
|
public void setDataMin(String dataMin) { |
||||||
|
this.dataMin = dataMin; |
||||||
|
} |
||||||
|
|
||||||
|
public String getDataMinDate() { |
||||||
|
return dataMinDate; |
||||||
|
} |
||||||
|
|
||||||
|
public void setDataMinDate(String dataMinDate) { |
||||||
|
this.dataMinDate = dataMinDate; |
||||||
|
} |
||||||
|
|
||||||
|
public String getAmplitude() { |
||||||
|
return amplitude; |
||||||
|
} |
||||||
|
|
||||||
|
public void setAmplitude(String amplitude) { |
||||||
|
this.amplitude = amplitude; |
||||||
|
} |
||||||
|
|
||||||
|
public String getDataSum() { |
||||||
|
return dataSum; |
||||||
|
} |
||||||
|
|
||||||
|
public void setDataSum(String dataSum) { |
||||||
|
this.dataSum = dataSum; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,177 @@ |
|||||||
|
package org.springblade.ris_common.entity; |
||||||
|
|
||||||
|
|
||||||
|
import org.springblade.ris_common.util.ReportDateUtil; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.List; |
||||||
|
import java.util.Objects; |
||||||
|
|
||||||
|
public class YearReport { |
||||||
|
private static final int MAX_DAY = 31; |
||||||
|
|
||||||
|
private int year; |
||||||
|
private String stcd; |
||||||
|
|
||||||
|
/** |
||||||
|
* 一个List<String>代表1个月 |
||||||
|
* 1个List<String>有31个Double对象代表每一天 |
||||||
|
* 如果没有数据或者天不存在就用-表示 |
||||||
|
*/ |
||||||
|
private List<List<String>> dayList; |
||||||
|
|
||||||
|
/** |
||||||
|
* 一个key代表统计数据类型,value代表每个月统计数据值 |
||||||
|
* 例如<最大值,12个月的数据> |
||||||
|
* 最大值,最小值,平均值等等组成一个List |
||||||
|
*/ |
||||||
|
private List<ReportUnit> monthList; |
||||||
|
|
||||||
|
/** |
||||||
|
* 全年统计数据 |
||||||
|
*/ |
||||||
|
private List<ReportData> yearList; |
||||||
|
|
||||||
|
public void init(String stcd, Integer year) { |
||||||
|
this.year = year; |
||||||
|
this.stcd = stcd; |
||||||
|
initDayList(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 依据年份初始化年度报表,每个月的每天都加上- |
||||||
|
* 目前不存在的年份也加上了- |
||||||
|
* 如果有需求,则只把有日期的天上加上- |
||||||
|
*/ |
||||||
|
public void initDayList() { |
||||||
|
dayList = new ArrayList<>(); |
||||||
|
for (int month = 0; month <= ReportDateUtil.MAX_MONTH; month++) { |
||||||
|
dayList.add(new ArrayList<>()); |
||||||
|
for (int day = 0; day < MAX_DAY; day++) { |
||||||
|
dayList.get(month).add("-"); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 初始化月份统计数据 |
||||||
|
* |
||||||
|
* @param keys 最大值,最小值,平均值等 |
||||||
|
*/ |
||||||
|
public void initMonthList(String[] keys) { |
||||||
|
monthList = new ArrayList<>(); |
||||||
|
for (String key : keys) { |
||||||
|
ReportUnit reportUnit = new ReportUnit(); |
||||||
|
reportUnit.setKey(key); |
||||||
|
List<String> list = new ArrayList<>(); |
||||||
|
for (int month = 0; month <= ReportDateUtil.MAX_MONTH; month++) { |
||||||
|
list.add("-"); |
||||||
|
} |
||||||
|
reportUnit.setDataList(list); |
||||||
|
monthList.add(reportUnit); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取某类型每个月的数据 |
||||||
|
* |
||||||
|
* @param key |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
public ReportUnit getMonthKeyList(String key) { |
||||||
|
for (ReportUnit reportUnit : monthList) { |
||||||
|
if (reportUnit.getKey().equals(key)) { |
||||||
|
return reportUnit; |
||||||
|
} |
||||||
|
} |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 提供出去的设置每天数据 |
||||||
|
* |
||||||
|
* @param month 0-11月 |
||||||
|
* @param day 1-31日 |
||||||
|
* @param value 值 |
||||||
|
*/ |
||||||
|
public void setDayValue(int month, int day, String value) { |
||||||
|
dayList.get(month).set(day - 1, value); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 提供出去的设置每月的统计数据 |
||||||
|
* |
||||||
|
* @param key 类型(最大值,最小值等) |
||||||
|
* @param month 0-11月 |
||||||
|
* @param value 值 |
||||||
|
*/ |
||||||
|
public void setMonthValue(String key, int month, String value) { |
||||||
|
for (ReportUnit reportUnit : monthList) { |
||||||
|
if (reportUnit.getKey().equals(key)) { |
||||||
|
reportUnit.getDataList().set(month, value); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 针对数据进行求和计算 |
||||||
|
* |
||||||
|
* @param list |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
public String sum(List<String> list) { |
||||||
|
String temp = null; |
||||||
|
for (String data : list) { |
||||||
|
if ("-".equals(data) || Double.valueOf(data) <= 0) { |
||||||
|
continue; |
||||||
|
} |
||||||
|
if (Objects.isNull(temp)) { |
||||||
|
temp = data; |
||||||
|
} else { |
||||||
|
temp = new BigDecimal(temp).add(new BigDecimal(data)).toString(); |
||||||
|
} |
||||||
|
} |
||||||
|
return temp; |
||||||
|
} |
||||||
|
|
||||||
|
public int getYear() { |
||||||
|
return year; |
||||||
|
} |
||||||
|
|
||||||
|
public void setYear(int year) { |
||||||
|
this.year = year; |
||||||
|
} |
||||||
|
|
||||||
|
public String getStcd() { |
||||||
|
return stcd; |
||||||
|
} |
||||||
|
|
||||||
|
public void setStcd(String stcd) { |
||||||
|
this.stcd = stcd; |
||||||
|
} |
||||||
|
|
||||||
|
public List<List<String>> getDayList() { |
||||||
|
return dayList; |
||||||
|
} |
||||||
|
|
||||||
|
public void setDayList(List<List<String>> dayList) { |
||||||
|
this.dayList = dayList; |
||||||
|
} |
||||||
|
|
||||||
|
public List<ReportUnit> getMonthList() { |
||||||
|
return monthList; |
||||||
|
} |
||||||
|
|
||||||
|
public void setMonthList(List<ReportUnit> monthList) { |
||||||
|
this.monthList = monthList; |
||||||
|
} |
||||||
|
|
||||||
|
public List<ReportData> getYearList() { |
||||||
|
return yearList; |
||||||
|
} |
||||||
|
|
||||||
|
public void setYearList(List<ReportData> yearList) { |
||||||
|
this.yearList = yearList; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,147 @@ |
|||||||
|
package org.springblade.ris_common.util; |
||||||
|
|
||||||
|
import org.springblade.ris_common.entity.QueryDateTypeEnum; |
||||||
|
import org.springblade.ris_common.entity.ReportData; |
||||||
|
|
||||||
|
import java.text.SimpleDateFormat; |
||||||
|
import java.util.*; |
||||||
|
|
||||||
|
public class CommonUtil { |
||||||
|
/** |
||||||
|
* 检查查询类型是否符合 |
||||||
|
* |
||||||
|
* @param type |
||||||
|
*/ |
||||||
|
public static QueryDateTypeEnum checkType(String type) { |
||||||
|
QueryDateTypeEnum dtEnum = QueryDateTypeEnum.getInstance(type); |
||||||
|
if (Objects.isNull(dtEnum)) { |
||||||
|
return null; |
||||||
|
} |
||||||
|
return dtEnum; |
||||||
|
} |
||||||
|
|
||||||
|
public static Date getHistoryDate(Date now,int year){ |
||||||
|
Calendar calendar = Calendar.getInstance(); //创建Calendar 的实例
|
||||||
|
calendar.setTime(now); |
||||||
|
calendar.add(Calendar.YEAR, -year);//当前时间减去一年,即一年前的时间
|
||||||
|
return calendar.getTime(); |
||||||
|
} |
||||||
|
|
||||||
|
public static String getLastDayOfMonth(String yearMonth) |
||||||
|
{ |
||||||
|
String[] arr=yearMonth.split("-"); |
||||||
|
Calendar cal = Calendar.getInstance(); |
||||||
|
//设置年份
|
||||||
|
int year=Integer.valueOf(arr[0]); |
||||||
|
cal.set(Calendar.YEAR,year); |
||||||
|
//设置月份
|
||||||
|
int month=Integer.valueOf(arr[1]); |
||||||
|
cal.set(Calendar.MONTH, month-1); |
||||||
|
//获取某月最大天数
|
||||||
|
int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH); |
||||||
|
//设置日历中月份的最大天数
|
||||||
|
cal.set(Calendar.DAY_OF_MONTH, lastDay); |
||||||
|
//格式化日期
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
||||||
|
String lastDayOfMonth = sdf.format(cal.getTime()); |
||||||
|
|
||||||
|
return lastDayOfMonth; |
||||||
|
} |
||||||
|
|
||||||
|
public static int getYearGap(Date start,Date end){ |
||||||
|
Calendar calStartTime = Calendar.getInstance(); //获取日历实例
|
||||||
|
Calendar calEndTime = Calendar.getInstance(); |
||||||
|
calStartTime.setTime(start); |
||||||
|
calEndTime.setTime(end); |
||||||
|
return calEndTime.get(Calendar.YEAR) - calStartTime.get(Calendar.YEAR); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public static Map<String, Date> getStartEnd(String beginSpt, String endSpt){ |
||||||
|
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
||||||
|
Date begin = null; |
||||||
|
Date end = null; |
||||||
|
try { |
||||||
|
begin = sdf.parse(beginSpt); |
||||||
|
end = sdf.parse(endSpt); |
||||||
|
} catch (Exception e) { |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
Map<String,Date> res=new HashMap<>(); |
||||||
|
res.put("begin",begin); |
||||||
|
res.put("end",end); |
||||||
|
return res; |
||||||
|
} |
||||||
|
|
||||||
|
public static String getKey(String str) { |
||||||
|
String[] arr=str.split(" "); |
||||||
|
String arr0=arr[0]; |
||||||
|
String[] keys=arr0.split("-"); |
||||||
|
String key=keys[1]+"-"+keys[2]; |
||||||
|
return key; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public static List<ReportData> getReportDataBySignage(List<ReportData> timeDataList, String signage){ |
||||||
|
List<ReportData> list=new ArrayList<>(); |
||||||
|
for(ReportData data:timeDataList){ |
||||||
|
if(signage.equals(data.getStcd())){ |
||||||
|
list.add(data); |
||||||
|
} |
||||||
|
} |
||||||
|
return list; |
||||||
|
} |
||||||
|
|
||||||
|
public static int getMonth(String key) { |
||||||
|
String[] keys = key.split("-"); |
||||||
|
String month = keys[1]; |
||||||
|
return Integer.valueOf(month); |
||||||
|
} |
||||||
|
|
||||||
|
public static String getDay(String key) { |
||||||
|
String[] keys = key.split("-"); |
||||||
|
String dayHour = keys[2]; |
||||||
|
String[] dayHourArr=dayHour.split(" "); |
||||||
|
return dayHourArr[0]; |
||||||
|
} |
||||||
|
|
||||||
|
public static int getHour(String key) { |
||||||
|
String[] keys = key.split(" "); |
||||||
|
String dayHour = keys[1]; |
||||||
|
String[] dayHourArr=dayHour.split(":"); |
||||||
|
return Integer.valueOf(dayHourArr[0]); |
||||||
|
} |
||||||
|
|
||||||
|
//0-> s(秒) 1->、m(分)、2->h(小时)3->、d(天)4->、w(周)5->、n(自然月)、6->y(自然年)
|
||||||
|
public static String getKeyBySaveTimeType(String key,Integer saveTimeType){ |
||||||
|
if(saveTimeType.intValue() == 2){//小时
|
||||||
|
int index=key.indexOf(":"); |
||||||
|
if(index>0) { |
||||||
|
String tmp = key.substring(0, index); |
||||||
|
return tmp; |
||||||
|
} |
||||||
|
} |
||||||
|
if(saveTimeType.intValue() == 3){//天
|
||||||
|
String[] arr=key.split(" "); |
||||||
|
return arr[0]; |
||||||
|
} |
||||||
|
if(saveTimeType.intValue() == 5){//月
|
||||||
|
int index=key.lastIndexOf("-"); |
||||||
|
if(index>0) { |
||||||
|
String tmp = key.substring(0, index); |
||||||
|
return tmp; |
||||||
|
} |
||||||
|
} |
||||||
|
if(saveTimeType.intValue() == 6){//年
|
||||||
|
int index = key.indexOf("-"); |
||||||
|
if(index>0) { |
||||||
|
String tmp = key.substring(0, index); |
||||||
|
return tmp; |
||||||
|
} |
||||||
|
} |
||||||
|
return key; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,116 @@ |
|||||||
|
package org.springblade.ris_common.util; |
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils; |
||||||
|
import org.springblade.ris_common.entity.QueryDateTypeEnum; |
||||||
|
|
||||||
|
import java.text.SimpleDateFormat; |
||||||
|
import java.util.Calendar; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
public class ReportDateUtil { |
||||||
|
public static final int MAX_MONTH = 11; |
||||||
|
|
||||||
|
public static int getDateDiff(Date begin, Date end, int step) { |
||||||
|
//初始化差距
|
||||||
|
int diff = 0; |
||||||
|
Calendar cal = Calendar.getInstance(); |
||||||
|
cal.setTime(begin); |
||||||
|
Date temp = cal.getTime(); |
||||||
|
while (temp.before(end)) { |
||||||
|
diff++; |
||||||
|
cal.set(step, cal.get(step) + 1); |
||||||
|
temp = cal.getTime(); |
||||||
|
} |
||||||
|
return diff; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取日期 |
||||||
|
* |
||||||
|
* @param year 年 |
||||||
|
* @param month 月(0-11) |
||||||
|
* @param day 日(1-31) |
||||||
|
* @param hour 时 |
||||||
|
* @param minute 分 |
||||||
|
* @param second 秒 |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
public static Date getDate(int year, int month, int day, int hour, int minute, int second) { |
||||||
|
Calendar calendar = Calendar.getInstance(); |
||||||
|
calendar.set(Calendar.YEAR, year); |
||||||
|
calendar.set(Calendar.MONTH, month); |
||||||
|
calendar.set(Calendar.DAY_OF_MONTH, day); |
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, hour); |
||||||
|
calendar.set(Calendar.MINUTE, minute); |
||||||
|
calendar.set(Calendar.SECOND, second); |
||||||
|
calendar.set(Calendar.MILLISECOND, 0); |
||||||
|
Date date = calendar.getTime(); |
||||||
|
return date; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取下一个日期(下一年,下一月,下一日等) |
||||||
|
* |
||||||
|
* @param curDate |
||||||
|
* @param field |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
public static Date getNextDate(Date curDate, int field) { |
||||||
|
Calendar calendar = Calendar.getInstance(); |
||||||
|
calendar.setTime(curDate); |
||||||
|
calendar.set(field, calendar.get(field) + 1); |
||||||
|
return calendar.getTime(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 依据查询类型获取时间格式类型 |
||||||
|
* |
||||||
|
* @param dtEnum |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
public static SimpleDateFormat getSimpleDateFormatByType(QueryDateTypeEnum dtEnum) { |
||||||
|
switch (dtEnum) { |
||||||
|
case HOUR: |
||||||
|
return new SimpleDateFormat("yyyy-MM-dd HH"); |
||||||
|
case DAY: |
||||||
|
return new SimpleDateFormat("yyyy-MM-dd"); |
||||||
|
case MONTH: |
||||||
|
return new SimpleDateFormat("yyyy-MM"); |
||||||
|
case YEAR: |
||||||
|
return new SimpleDateFormat("yyyy"); |
||||||
|
default: |
||||||
|
return new SimpleDateFormat("yyyy-MM-dd"); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 依据查询类型获取日历类型 |
||||||
|
* |
||||||
|
* @param dtEnum |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
public static int getCalendarType(QueryDateTypeEnum dtEnum) { |
||||||
|
switch (dtEnum) { |
||||||
|
case HOUR: |
||||||
|
return Calendar.HOUR_OF_DAY; |
||||||
|
case DAY: |
||||||
|
return Calendar.DAY_OF_MONTH; |
||||||
|
case MONTH: |
||||||
|
return Calendar.MONTH; |
||||||
|
case YEAR: |
||||||
|
return Calendar.YEAR; |
||||||
|
default: |
||||||
|
return Calendar.DAY_OF_MONTH; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/*** |
||||||
|
* 年月日时分秒 转年月日 |
||||||
|
*/ |
||||||
|
public static String getYMDStr(String ymd) { |
||||||
|
if(StringUtils.isNotEmpty(ymd)){ |
||||||
|
return ymd.substring(0,11); |
||||||
|
} |
||||||
|
return ""; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,16 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<parent> |
||||||
|
<artifactId>hzinfo-ris-pxhd-service-api</artifactId> |
||||||
|
<groupId>org.springblade</groupId> |
||||||
|
<version>4.5.0.RELEASE</version> |
||||||
|
</parent> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
|
||||||
|
<artifactId>pxhd-messaging-center-service-api</artifactId> |
||||||
|
|
||||||
|
<name>${project.artifactId}</name> |
||||||
|
<packaging>jar</packaging> |
||||||
|
</project> |
||||||
@ -0,0 +1,12 @@ |
|||||||
|
package org.springblade.messaging_center.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import lombok.Data; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
@TableName("hz_send_message_group") |
||||||
|
@Data |
||||||
|
public class HzMessageGroup extends BaseEntity { |
||||||
|
private String groupName; |
||||||
|
private String personIds; |
||||||
|
} |
||||||
@ -0,0 +1,11 @@ |
|||||||
|
package org.springblade.messaging_center.entity; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
@Data |
||||||
|
public class HzMessageRelation implements Serializable { |
||||||
|
private Long id; |
||||||
|
private Long ruleId; |
||||||
|
} |
||||||
@ -0,0 +1,31 @@ |
|||||||
|
package org.springblade.messaging_center.entity; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
@Data |
||||||
|
public class MessageInfo implements Serializable { |
||||||
|
private Long id; |
||||||
|
//标题
|
||||||
|
private String title; |
||||||
|
//发送人id
|
||||||
|
private Long sendUserId; |
||||||
|
//接收人id
|
||||||
|
private Long receiveUserId; |
||||||
|
//内容
|
||||||
|
private String content; |
||||||
|
//发送时间
|
||||||
|
private Date sendTime; |
||||||
|
//确认时间
|
||||||
|
private Date okTime; |
||||||
|
//消息类型 1通知消息 2处理消息
|
||||||
|
private int msgType; |
||||||
|
//消息状态 0未读 1已读/已确认/未处理 2已处理
|
||||||
|
private int status; |
||||||
|
//消息等级 1紧急 2重要 3一般 4不重要
|
||||||
|
private int msgLevel; |
||||||
|
//模板id
|
||||||
|
private Long templateId; |
||||||
|
} |
||||||
@ -0,0 +1,41 @@ |
|||||||
|
package org.springblade.messaging_center.entity; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.math.BigDecimal; |
||||||
|
|
||||||
|
@Data |
||||||
|
public class MessageRule implements Serializable { |
||||||
|
//规则id
|
||||||
|
private Long id; |
||||||
|
//字段code
|
||||||
|
private String code; |
||||||
|
//字段名称
|
||||||
|
private String name; |
||||||
|
//单位
|
||||||
|
private String unit; |
||||||
|
//数据来源 1 redis(hz3000) 2数据平台 3数据库 4日期数据 5常量
|
||||||
|
private String dataSource; |
||||||
|
//取值方式 max min avg common
|
||||||
|
private String queryType; |
||||||
|
//取值信息
|
||||||
|
//1 遥测id+站点id+type "{\"ycId\":\"1\",\"stationId\":\"0\",\"type\":\"1\"}"
|
||||||
|
//2 deviceCode+属性code
|
||||||
|
//3 数据库+表+字段
|
||||||
|
private String valueInfo; |
||||||
|
//周期类型 S M H D
|
||||||
|
private String periodType; |
||||||
|
//时间间隔
|
||||||
|
private int dtGap; |
||||||
|
//判定规则 大于gt 小于lt eq等于 gq大于等于 lq小于等于
|
||||||
|
private String compareRule; |
||||||
|
//判定值
|
||||||
|
private BigDecimal compareValue; |
||||||
|
//判定后的消息 为空则不加入模板消息中 不为空则替换到模板消息中
|
||||||
|
private String compareMsg; |
||||||
|
//数据格式化
|
||||||
|
private String format; |
||||||
|
//租户
|
||||||
|
private String tenantId; |
||||||
|
} |
||||||
@ -0,0 +1,48 @@ |
|||||||
|
package org.springblade.messaging_center.entity; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
@Data |
||||||
|
public class MessageTemplate implements Serializable { |
||||||
|
//模板id
|
||||||
|
private Long id; |
||||||
|
//模板标题
|
||||||
|
private String title; |
||||||
|
//消息模板
|
||||||
|
//系统级格式 {sk}上游水位{rz}下游水位{blrz}
|
||||||
|
//用户级格式 XX水库上游水位XXm下游水位XXm
|
||||||
|
private String content; |
||||||
|
//定时规则
|
||||||
|
private String cron; |
||||||
|
//模板状态(0暂停、1启用)
|
||||||
|
private Integer status; |
||||||
|
//人员来源 1人员 2部门 3角色 4自定义组
|
||||||
|
private Integer personType; |
||||||
|
//租户id
|
||||||
|
private String tenantId; |
||||||
|
//对应人员来源id
|
||||||
|
private String personTypeIds; |
||||||
|
//类型(系统system/用户user)
|
||||||
|
private String type; |
||||||
|
//操作规则 (确认/创建任务规则) 1确认 2处理
|
||||||
|
private Integer operate; |
||||||
|
|
||||||
|
//用于统计和分析的字段
|
||||||
|
//模板类型(message 消息类 warn告警类)
|
||||||
|
private String templateType; |
||||||
|
/** |
||||||
|
* 模板类型细分 |
||||||
|
* message day每日汛情 |
||||||
|
* warn level 水位告警 |
||||||
|
* warn flow流量告警 |
||||||
|
* warn rain雨量告警 |
||||||
|
* warn moisture墒情告警 |
||||||
|
* warn soe soe告警 |
||||||
|
*/ |
||||||
|
private String templateTypeSeg; |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,13 @@ |
|||||||
|
package org.springblade.messaging_center.entity; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
|
||||||
|
@Data |
||||||
|
public class SendMsgInfo { |
||||||
|
private Long id;//模板id
|
||||||
|
private String title; |
||||||
|
private String content; |
||||||
|
private ArrayList<String> tags; |
||||||
|
} |
||||||
@ -0,0 +1,39 @@ |
|||||||
|
package org.springblade.messaging_center.enums; |
||||||
|
|
||||||
|
public enum CompareRuleEnum { |
||||||
|
GT("gt","大于"), |
||||||
|
LT("lt","小于"), |
||||||
|
GQ("gq","大于等于"), |
||||||
|
LQ("lq","小于等于"); |
||||||
|
private String type; |
||||||
|
private String name; |
||||||
|
CompareRuleEnum(String type,String name){ |
||||||
|
this.type = type; |
||||||
|
this.name = name; |
||||||
|
} |
||||||
|
|
||||||
|
public static String getNameByType(String type){ |
||||||
|
for(CompareRuleEnum compareRuleEnum:CompareRuleEnum.values()){ |
||||||
|
if(compareRuleEnum.getType().equals(type)){ |
||||||
|
return compareRuleEnum.getName(); |
||||||
|
} |
||||||
|
} |
||||||
|
return "通知消息"; |
||||||
|
} |
||||||
|
|
||||||
|
public String getType() { |
||||||
|
return type; |
||||||
|
} |
||||||
|
|
||||||
|
public void setType(String type) { |
||||||
|
this.type = type; |
||||||
|
} |
||||||
|
|
||||||
|
public String getName() { |
||||||
|
return name; |
||||||
|
} |
||||||
|
|
||||||
|
public void setName(String name) { |
||||||
|
this.name = name; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,39 @@ |
|||||||
|
package org.springblade.messaging_center.enums; |
||||||
|
|
||||||
|
public enum MsgLevelEnum { |
||||||
|
ONE(1,"紧急"), |
||||||
|
TWO(2,"重要"), |
||||||
|
THREE(3,"一般"), |
||||||
|
FOUR(4,"不重要"); |
||||||
|
private int type; |
||||||
|
private String name; |
||||||
|
MsgLevelEnum(int type,String name){ |
||||||
|
this.type = type; |
||||||
|
this.name = name; |
||||||
|
} |
||||||
|
|
||||||
|
public static String getNameByType(int type){ |
||||||
|
for(MsgLevelEnum msgLevelEnum:MsgLevelEnum.values()){ |
||||||
|
if(msgLevelEnum.getType() == type){ |
||||||
|
return msgLevelEnum.getName(); |
||||||
|
} |
||||||
|
} |
||||||
|
return "不重要"; |
||||||
|
} |
||||||
|
|
||||||
|
public int getType() { |
||||||
|
return type; |
||||||
|
} |
||||||
|
|
||||||
|
public void setType(int type) { |
||||||
|
this.type = type; |
||||||
|
} |
||||||
|
|
||||||
|
public String getName() { |
||||||
|
return name; |
||||||
|
} |
||||||
|
|
||||||
|
public void setName(String name) { |
||||||
|
this.name = name; |
||||||
|
} |
||||||
|
} |
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue