1.污区图
2.过程监督-终端 代码提交
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
package com.njcn.process.pojo.dto.excel;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.device.pq.pojo.constant.DeviceValidMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* <功能描述>
|
||||
*
|
||||
* @author wr
|
||||
* @createTime: 2023-02-27
|
||||
*/
|
||||
@Data
|
||||
public class TerminalExcel implements Serializable {
|
||||
|
||||
|
||||
@Excel(name = "终端编号",width = 15)
|
||||
@NotBlank(message = "终端编号不为空")
|
||||
@Pattern(regexp = "^[A-Za-z0-9]{1,32}$", message = "终端编号违规长度不能超过32位(数字 、 字母)")
|
||||
private String id;
|
||||
|
||||
@Excel(name = "终端名称",width = 15)
|
||||
@NotBlank(message = "终端名称不为空")
|
||||
@Pattern(regexp = PatternRegex.DEPT_NAME_REGEX, message = DeviceValidMessage.PROJECT_NAME_RULE)
|
||||
private String name;
|
||||
|
||||
@Excel(name = "组织机构名称",width = 15)
|
||||
@NotBlank(message = "组织机构名称不为空")
|
||||
private String orgName;
|
||||
|
||||
@Excel(name = "生产厂家",width = 15)
|
||||
@NotBlank(message = "生产厂家不为空")
|
||||
private String manufacture;
|
||||
|
||||
@Excel(name = "安装位置")
|
||||
@NotBlank(message = "安装位置不为空")
|
||||
private String installPlace;
|
||||
|
||||
@Excel(name = "送检单位")
|
||||
@NotBlank(message = "送检单位不为空")
|
||||
private String inspectionName;
|
||||
|
||||
@Excel(name = "检测时间",format = "yyyy-MM-dd", width = 15)
|
||||
@NotNull(message = "检测时间不为空")
|
||||
private LocalDate inspectionTime;
|
||||
|
||||
// @Excel(name = "检测结果")
|
||||
// @NotBlank(message = "检测结果不为空")
|
||||
// private String testResults;
|
||||
//
|
||||
// @Excel(name = "下次检测时间",format = "yyyy-MM-dd", width = 15)
|
||||
// @NotNull(message = "下次检测时间不为空")
|
||||
// private LocalDate nextInspectionTime;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class TerminalExcelMsg extends TerminalExcel implements Serializable {
|
||||
@Excel(name = "错误信息描述", width = 30)
|
||||
private String msg;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.njcn.process.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* <功能描述>
|
||||
*
|
||||
* @author wr
|
||||
* @createTime: 2023-02-27
|
||||
*/
|
||||
@Data
|
||||
public class TerminalParam {
|
||||
|
||||
|
||||
@ApiModelProperty("开始时间")
|
||||
@Pattern(regexp = PatternRegex.TIME_FORMAT, message = "时间格式错误")
|
||||
private String startTime;
|
||||
|
||||
@ApiModelProperty("结束时间")
|
||||
@Pattern(regexp = PatternRegex.TIME_FORMAT, message = "时间格式错误")
|
||||
private String endTime;
|
||||
|
||||
@ApiModelProperty("单位id")
|
||||
private String id;
|
||||
|
||||
@Data
|
||||
public static class TerminalPageParam extends TerminalParam{
|
||||
|
||||
@ApiModelProperty(value = "页码")
|
||||
private Integer PageNum;
|
||||
|
||||
@ApiModelProperty(value = "条数")
|
||||
private Integer PageSize;
|
||||
|
||||
@ApiModelProperty(value = "是否周期检测列表")
|
||||
private Integer type;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class TerminalCycleParam {
|
||||
|
||||
@ApiModelProperty("单位id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "检测结果")
|
||||
private String testResults;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class TerminalUpdateParam {
|
||||
@ApiModelProperty(value = "终端编号")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "终端名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "组织机构名称")
|
||||
private String orgName;
|
||||
|
||||
@ApiModelProperty(value = "组织机构ID(外键)")
|
||||
private String orgId;
|
||||
|
||||
@ApiModelProperty(value = "生产厂家")
|
||||
private String manufacture;
|
||||
|
||||
@ApiModelProperty(value = "安装位置")
|
||||
private String installPlace;
|
||||
|
||||
@ApiModelProperty(value = "送检单位")
|
||||
private String inspectionName;
|
||||
|
||||
@ApiModelProperty(value = "检测结果")
|
||||
private String testResults;
|
||||
|
||||
@ApiModelProperty(value = "检测时间")
|
||||
private LocalDate inspectionTime;
|
||||
|
||||
@ApiModelProperty(value = "下次检测时间")
|
||||
private LocalDate nextInspectionTime;
|
||||
|
||||
@ApiModelProperty(value = "检测报告")
|
||||
private String inspectionReport;
|
||||
|
||||
@ApiModelProperty(value = "原始数据报告")
|
||||
private String originalReport;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.njcn.process.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import java.time.LocalDate;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2023-02-27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("pms_terminal_detection")
|
||||
@ApiModel(value="PmsTerminalDetection对象", description="")
|
||||
public class PmsTerminalDetection implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "终端编号")
|
||||
@TableId(value = "Id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "终端名称")
|
||||
@TableField("Name")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "组织机构名称")
|
||||
@TableField("Org_Name")
|
||||
private String orgName;
|
||||
|
||||
@ApiModelProperty(value = "组织机构ID(外键)")
|
||||
@TableField("Org_No")
|
||||
private String orgNo;
|
||||
|
||||
@ApiModelProperty(value = "生产厂家(字典)")
|
||||
@TableField("Manufacture")
|
||||
private String manufacture;
|
||||
|
||||
@ApiModelProperty(value = "安装位置")
|
||||
private String installPlace;
|
||||
|
||||
@ApiModelProperty(value = "送检单位")
|
||||
@TableField("inspection_Name")
|
||||
private String inspectionName;
|
||||
|
||||
@ApiModelProperty(value = "检测结果(0:未开展 1:已开展)")
|
||||
private Integer testResults;
|
||||
|
||||
@ApiModelProperty(value = "检测时间")
|
||||
@TableField("inspection_Time")
|
||||
private LocalDate inspectionTime;
|
||||
|
||||
@ApiModelProperty(value = "下次检测时间")
|
||||
@TableField("next_inspection_Time")
|
||||
private LocalDate nextInspectionTime;
|
||||
|
||||
@ApiModelProperty(value = "检测报告")
|
||||
@TableField("inspection_Report")
|
||||
private String inspectionReport;
|
||||
|
||||
@ApiModelProperty(value = "原始数据报告")
|
||||
@TableField("original_Report")
|
||||
private String originalReport;
|
||||
|
||||
@ApiModelProperty(value = "数据状态:0-删除;1-正常; ")
|
||||
@TableField("Status")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "创建用户")
|
||||
@TableField("Create_By")
|
||||
private String createBy;
|
||||
|
||||
@ApiModelProperty(value = "更新用户")
|
||||
@TableField("Update_By")
|
||||
private String updateBy;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.njcn.process.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* <功能描述>
|
||||
*
|
||||
* @author wr
|
||||
* @createTime: 2023-02-27
|
||||
*/
|
||||
@Data
|
||||
public class TerminalVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "终端编号")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "终端名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "组织机构名称")
|
||||
private String orgName;
|
||||
|
||||
@ApiModelProperty(value = "组织机构编号")
|
||||
private String orgNO;
|
||||
|
||||
@ApiModelProperty(value = "生产厂家")
|
||||
private String manufacture;
|
||||
|
||||
@ApiModelProperty(value = "安装位置")
|
||||
private String installPlace;
|
||||
|
||||
@ApiModelProperty(value = "送检单位")
|
||||
private String inspectionName;
|
||||
|
||||
@ApiModelProperty(value = "检测结果")
|
||||
private String testResults;
|
||||
|
||||
@ApiModelProperty(value = "检测时间")
|
||||
private LocalDate inspectionTime;
|
||||
|
||||
@ApiModelProperty(value = "下次检测时间")
|
||||
private LocalDate nextInspectionTime;
|
||||
|
||||
@ApiModelProperty(value = "检测报告")
|
||||
private String inspectionReport;
|
||||
|
||||
@ApiModelProperty(value = "原始数据报告")
|
||||
private String originalReport;
|
||||
|
||||
@Data
|
||||
public static class TerminalStatistics implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "单位id")
|
||||
private String orgNo;
|
||||
|
||||
@ApiModelProperty(value = "单位名称")
|
||||
private String orgName;
|
||||
|
||||
@ApiModelProperty(value = "统计数量")
|
||||
private Integer count;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
package com.njcn.process.utils;
|
||||
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelForEachParams;
|
||||
import cn.afterturn.easypoi.excel.export.styler.IExcelExportStyler;
|
||||
import org.apache.poi.hssf.util.HSSFColor;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/7/4
|
||||
*/
|
||||
public class ExcelStyleUtil implements IExcelExportStyler {
|
||||
// 数据行类型
|
||||
private static final String DATA_STYLES = "dataStyles";
|
||||
// 标题类型
|
||||
private static final String TITLE_STYLES = "titleStyles";
|
||||
//头样式
|
||||
private static final String HEADER_STYLES = "headerStyles";
|
||||
|
||||
//数据行样式
|
||||
private CellStyle styles;
|
||||
// 标题样式
|
||||
private CellStyle titleStyle;
|
||||
|
||||
// 标题样式
|
||||
private CellStyle headerStyle;
|
||||
|
||||
public ExcelStyleUtil(Workbook workbook) {
|
||||
this.init(workbook);
|
||||
}
|
||||
|
||||
private void init(Workbook workbook) {
|
||||
this.styles = initStyles(workbook);
|
||||
this.titleStyle = initTitleStyle(workbook);
|
||||
this.headerStyle = initTitleStyle(workbook);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public CellStyle getHeaderStyle(short headerColor) {
|
||||
return headerStyle;
|
||||
}
|
||||
|
||||
/**
|
||||
* 标题样式
|
||||
*/
|
||||
@Override
|
||||
public CellStyle getTitleStyle(short i) {
|
||||
return titleStyle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CellStyle getStyles(boolean parity, ExcelExportEntity entity) {
|
||||
return styles;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取样式方法
|
||||
*
|
||||
* @param dataRow 数据行
|
||||
* @param obj 对象
|
||||
* @param data 数据
|
||||
*/
|
||||
@Override
|
||||
public CellStyle getStyles(Cell cell, int dataRow, ExcelExportEntity entity, Object obj, Object data) {
|
||||
return getStyles(true, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CellStyle getTemplateStyles(boolean isSingle, ExcelForEachParams excelForEachParams) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化--标题行样式
|
||||
* @param workbook
|
||||
* @return
|
||||
*/
|
||||
private CellStyle initTitleStyle(Workbook workbook) {
|
||||
return buildCellStyle(workbook,TITLE_STYLES);
|
||||
}
|
||||
|
||||
/**
|
||||
* 头样式
|
||||
* @author cdf
|
||||
* @date 2022/7/4
|
||||
*/
|
||||
private CellStyle initHeaderStyle(Workbook workbook) {
|
||||
return buildCellStyle(workbook,HEADER_STYLES);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化--数据行样式
|
||||
* @param workbook
|
||||
* @return
|
||||
*/
|
||||
private CellStyle initStyles(Workbook workbook) {
|
||||
return buildCellStyle(workbook,DATA_STYLES);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置单元格样式
|
||||
* @param workbook
|
||||
* @param type 类型 用来区分是数据行样式还是标题样式
|
||||
* @return
|
||||
*/
|
||||
private CellStyle buildCellStyle(Workbook workbook,String type) {
|
||||
CellStyle style = workbook.createCellStyle();
|
||||
// 字体样式
|
||||
Font font = workbook.createFont();
|
||||
if(TITLE_STYLES.equals(type)){
|
||||
font.setFontHeightInPoints((short)12);
|
||||
font.setBold(true);
|
||||
// 设置水平对齐的样式为居中对齐;
|
||||
style.setAlignment(HorizontalAlignment.CENTER);
|
||||
}
|
||||
if(HEADER_STYLES.equals(type)){
|
||||
font.setFontHeightInPoints((short)12);
|
||||
font.setBold(true);
|
||||
// 设置水平对齐的样式为居中对齐;
|
||||
style.setAlignment(HorizontalAlignment.LEFT);
|
||||
}
|
||||
if(DATA_STYLES.equals(type)){
|
||||
font.setFontHeightInPoints((short)10);
|
||||
// 设置水平对齐的样式为居中对齐;
|
||||
style.setAlignment(HorizontalAlignment.CENTER);
|
||||
}
|
||||
font.setFontName("Courier New");
|
||||
style.setFont(font);
|
||||
// 设置底边框
|
||||
style.setBorderBottom(BorderStyle.THIN);
|
||||
// 设置左边框
|
||||
style.setBorderLeft(BorderStyle.THIN);
|
||||
// 设置右边框;
|
||||
style.setBorderRight(BorderStyle.THIN);
|
||||
// 设置顶边框;
|
||||
style.setBorderTop(BorderStyle.THIN);
|
||||
// 设置底边颜色
|
||||
style.setBottomBorderColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex());
|
||||
// 设置左边框颜色;
|
||||
style.setLeftBorderColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex());
|
||||
// 设置右边框颜色;
|
||||
style.setRightBorderColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex());
|
||||
// 设置顶边框颜色;
|
||||
style.setTopBorderColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex());
|
||||
// 设置自动换行;
|
||||
style.setWrapText(false);
|
||||
|
||||
|
||||
// 设置垂直对齐的样式为居中对齐;
|
||||
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
return style;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user