生成报告-todo
This commit is contained in:
parent
817791b6e1
commit
c8cf7169ca
|
@ -20,7 +20,9 @@ public class Message implements Serializable {
|
||||||
public static final String IMAGE_SOURCE_IS_NOT_EXIST = "图像类型不存在";
|
public static final String IMAGE_SOURCE_IS_NOT_EXIST = "图像类型不存在";
|
||||||
public static final String DEFECT_ID_IS_NOT_EXIST = "缺陷id不存在";
|
public static final String DEFECT_ID_IS_NOT_EXIST = "缺陷id不存在";
|
||||||
public static final String PROJECT_ID_IS_NOT_EXIST = "项目id不存在";
|
public static final String PROJECT_ID_IS_NOT_EXIST = "项目id不存在";
|
||||||
|
public static final String PROJECT_STATUS_IS_NOT_COMPLETED = "项目[{}]的状态不是已完工";
|
||||||
public static final String TURBINE_ID_IS_NOT_EXIST = "机组id不存在";
|
public static final String TURBINE_ID_IS_NOT_EXIST = "机组id不存在";
|
||||||
|
public static final String TURBINE_STATUS_IS_NOT_COMPLETED = "机组[{}]的状态不是已完工";
|
||||||
public static final String PART_ID_IS_NOT_EXIST = "部件id不存在";
|
public static final String PART_ID_IS_NOT_EXIST = "部件id不存在";
|
||||||
public static final String USER_ID_NOT_EXIST = "用户id不存在";
|
public static final String USER_ID_NOT_EXIST = "用户id不存在";
|
||||||
public static final String USER_ID_NOT_EXIST_OR_ILLEGAL = "用户id不存在或者不合法";
|
public static final String USER_ID_NOT_EXIST_OR_ILLEGAL = "用户id不存在或者不合法";
|
||||||
|
@ -67,4 +69,5 @@ public class Message implements Serializable {
|
||||||
public static final String SUGGESTION_ID_IS_NOT_EXIST = "维修建议id不存在";
|
public static final String SUGGESTION_ID_IS_NOT_EXIST = "维修建议id不存在";
|
||||||
public static final String SUGGESTION_LEVEL_TYPE_FORBID_REPEAT = "存在缺陷级别为[{}]缺陷类型为[{}]的维修建议";
|
public static final String SUGGESTION_LEVEL_TYPE_FORBID_REPEAT = "存在缺陷级别为[{}]缺陷类型为[{}]的维修建议";
|
||||||
public static final String CHECK_SCHEME_ID_IS_NOT_EXIST = "检查方案id不存在";
|
public static final String CHECK_SCHEME_ID_IS_NOT_EXIST = "检查方案id不存在";
|
||||||
|
public static final String INSPECTION_REPORT_ID_IS_NOT_EXIST = "检查报告id不存在";
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,5 +108,7 @@ public interface Converts {
|
||||||
CheckSchemeResp toCheckSchemeResp(CheckSchemeEntity entity);
|
CheckSchemeResp toCheckSchemeResp(CheckSchemeEntity entity);
|
||||||
|
|
||||||
CheckSchemeEntity toCheckSchemeEntity(CheckSchemeReq req);
|
CheckSchemeEntity toCheckSchemeEntity(CheckSchemeReq req);
|
||||||
|
|
||||||
|
InspectionReportEntity toInspectionReportEntity(InspectionReportReq req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,6 @@ public class CheckSchemeEntity extends AuditableEntity implements Serializable {
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
@ApiModelProperty("删除标志(0代表存在 1代表删除)")
|
@ApiModelProperty("删除标志(0代表存在 1代表删除)")
|
||||||
@TableField("delFlag")
|
@TableField("del_flag")
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,6 @@ import lombok.EqualsAndHashCode;
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Bear.G
|
* @author Bear.G
|
||||||
|
@ -78,7 +77,7 @@ public class InspectionReportEntity extends AuditableEntity implements Serializa
|
||||||
|
|
||||||
@ApiModelProperty("报告编制时间")
|
@ApiModelProperty("报告编制时间")
|
||||||
@TableField("report_write_time")
|
@TableField("report_write_time")
|
||||||
private LocalDateTime reportWriteTime;
|
private LocalDate reportWriteTime;
|
||||||
|
|
||||||
@ApiModelProperty("报告复核人员id")
|
@ApiModelProperty("报告复核人员id")
|
||||||
@TableField("report_reviewer")
|
@TableField("report_reviewer")
|
||||||
|
@ -86,7 +85,7 @@ public class InspectionReportEntity extends AuditableEntity implements Serializa
|
||||||
|
|
||||||
@ApiModelProperty("报告复核时间")
|
@ApiModelProperty("报告复核时间")
|
||||||
@TableField("report_review_time")
|
@TableField("report_review_time")
|
||||||
private LocalDateTime reportReviewTime;
|
private LocalDate reportReviewTime;
|
||||||
|
|
||||||
@ApiModelProperty("报告审核人员id")
|
@ApiModelProperty("报告审核人员id")
|
||||||
@TableField("report_auditor")
|
@TableField("report_auditor")
|
||||||
|
@ -94,5 +93,5 @@ public class InspectionReportEntity extends AuditableEntity implements Serializa
|
||||||
|
|
||||||
@ApiModelProperty("报告审核时间")
|
@ApiModelProperty("报告审核时间")
|
||||||
@TableField("report_audit_time")
|
@TableField("report_audit_time")
|
||||||
private LocalDateTime reportAuditTime;
|
private LocalDate reportAuditTime;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: gaoxiong
|
||||||
|
* @Date: 2025/7/9 23:35
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("检查方案列表查询请求实体")
|
||||||
|
public class CheckSchemeListReq implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1345082408495150993L;
|
||||||
|
|
||||||
|
@ApiModelProperty("检查方式,枚举CheckMethodEnum")
|
||||||
|
private List<String> checkMethod;
|
||||||
|
}
|
|
@ -44,7 +44,6 @@ public class CheckSchemeReq implements Serializable {
|
||||||
@ApiModelProperty("检查方式,枚举CheckMethodEnum")
|
@ApiModelProperty("检查方式,枚举CheckMethodEnum")
|
||||||
private String checkMethod;
|
private String checkMethod;
|
||||||
|
|
||||||
@NotBlank(message = "备注不能为空")
|
|
||||||
@Size(max = 500, message = "备注不能超过500个字")
|
@Size(max = 500, message = "备注不能超过500个字")
|
||||||
@ApiModelProperty("备注")
|
@ApiModelProperty("备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.dite.znpt.domain.vo;
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -38,6 +39,7 @@ public class InspectionReportCoverInfo implements Serializable {
|
||||||
@ApiModelProperty("报告编制人员")
|
@ApiModelProperty("报告编制人员")
|
||||||
private String reportWriterName;
|
private String reportWriterName;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@ApiModelProperty("报告编制时间")
|
@ApiModelProperty("报告编制时间")
|
||||||
private LocalDateTime reportWriteTime;
|
private LocalDateTime reportWriteTime;
|
||||||
|
|
||||||
|
@ -47,6 +49,7 @@ public class InspectionReportCoverInfo implements Serializable {
|
||||||
@ApiModelProperty("报告复核人员")
|
@ApiModelProperty("报告复核人员")
|
||||||
private String reportReviewerName;
|
private String reportReviewerName;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@ApiModelProperty("报告复核时间")
|
@ApiModelProperty("报告复核时间")
|
||||||
private LocalDateTime reportReviewTime;
|
private LocalDateTime reportReviewTime;
|
||||||
|
|
||||||
|
@ -56,6 +59,7 @@ public class InspectionReportCoverInfo implements Serializable {
|
||||||
@ApiModelProperty("报告审核人员")
|
@ApiModelProperty("报告审核人员")
|
||||||
private String reportAuditName;
|
private String reportAuditName;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@ApiModelProperty("报告审核时间")
|
@ApiModelProperty("报告审核时间")
|
||||||
private LocalDateTime reportAuditTime;
|
private LocalDateTime reportAuditTime;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Bear.G
|
||||||
|
* @date 2025/7/14/周一 15:32
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("检查报告列表请求实体")
|
||||||
|
public class InspectionReportListReq implements Serializable {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = -8122588121700840604L;
|
||||||
|
|
||||||
|
@ApiModelProperty("主标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty("副标题")
|
||||||
|
private String subTile;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目id")
|
||||||
|
private String projectId;
|
||||||
|
|
||||||
|
@ApiModelProperty("机组id")
|
||||||
|
private String turbineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("风场名字")
|
||||||
|
private String farmName;
|
||||||
|
|
||||||
|
@ApiModelProperty("委托单位")
|
||||||
|
private String client;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,59 @@
|
||||||
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Bear.G
|
||||||
|
* @date 2025/7/14/周一 15:32
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("检查报告列表响应实体")
|
||||||
|
public class InspectionReportListResp implements Serializable {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = -7652873535955803183L;
|
||||||
|
|
||||||
|
@ApiModelProperty("报告id")
|
||||||
|
private String reportId;
|
||||||
|
|
||||||
|
@ApiModelProperty("主标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty("副标题")
|
||||||
|
private String subTitle;
|
||||||
|
|
||||||
|
@ApiModelProperty("报告编制人员")
|
||||||
|
private String reportWriterName;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@ApiModelProperty("报告编制时间")
|
||||||
|
private LocalDateTime reportWriteTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目id")
|
||||||
|
private String projectId;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目名称")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@ApiModelProperty("风场名字")
|
||||||
|
private String farmName;
|
||||||
|
|
||||||
|
@ApiModelProperty("委托单位")
|
||||||
|
private String client;
|
||||||
|
|
||||||
|
@ApiModelProperty("机组id")
|
||||||
|
private String turbineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("机组名称")
|
||||||
|
private String turbineName;
|
||||||
|
|
||||||
|
@ApiModelProperty("机组编码")
|
||||||
|
private String turbineCode;
|
||||||
|
}
|
|
@ -1,17 +1,16 @@
|
||||||
package com.dite.znpt.domain.vo;
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: gaoxiong
|
* @Author: gaoxiong
|
||||||
|
@ -24,55 +23,68 @@ public class InspectionReportReq implements Serializable {
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 4937399975205847660L;
|
private static final long serialVersionUID = 4937399975205847660L;
|
||||||
|
|
||||||
@ApiModelProperty("报告id")
|
@NotBlank(message = "主标题不能为空")
|
||||||
private String reportId;
|
@Size(max = 50, message = "主标题长度不能超过50")
|
||||||
|
|
||||||
@ApiModelProperty("主标题")
|
@ApiModelProperty("主标题")
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
|
@NotBlank(message = "副标题不能为空")
|
||||||
|
@Size(max = 50, message = "副标题长度不能超过50")
|
||||||
@ApiModelProperty("副标题")
|
@ApiModelProperty("副标题")
|
||||||
private String subTitle;
|
private String subTitle;
|
||||||
|
|
||||||
@ApiModelProperty("封面")
|
@ApiModelProperty("封面")
|
||||||
private String coverImage;
|
private String coverImage;
|
||||||
|
|
||||||
|
@NotBlank(message = "项目id不能为空")
|
||||||
@ApiModelProperty("项目id")
|
@ApiModelProperty("项目id")
|
||||||
private String projectId;
|
private String projectId;
|
||||||
|
|
||||||
|
@NotBlank(message = "机组id不能为空")
|
||||||
@ApiModelProperty("机组id")
|
@ApiModelProperty("机组id")
|
||||||
private String turbineId;
|
private String turbineId;
|
||||||
|
|
||||||
|
@NotNull(message = "检查日期不能为空")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@ApiModelProperty("检查日期")
|
@ApiModelProperty("检查日期")
|
||||||
private LocalDate checkDate;
|
private LocalDate checkDate;
|
||||||
|
|
||||||
@ApiModelProperty("检查位置")
|
@NotBlank(message = "检查内容不能为空")
|
||||||
private String checkPosition;
|
|
||||||
|
|
||||||
@ApiModelProperty("检查内容")
|
@ApiModelProperty("检查内容")
|
||||||
private String checkContent;
|
private String checkContent;
|
||||||
|
|
||||||
@ApiModelProperty("检查方式,多个方式英文逗号分隔")
|
@NotBlank(message = "检查内容不能为空")
|
||||||
|
@ApiModelProperty("检查方式,多个方式英文逗号分隔,枚举:CheckMethodEnum")
|
||||||
private String checkMethod;
|
private String checkMethod;
|
||||||
|
|
||||||
|
@NotBlank(message = "检查人员不能为空")
|
||||||
@ApiModelProperty("检查人员id,多个人员英文逗号分隔")
|
@ApiModelProperty("检查人员id,多个人员英文逗号分隔")
|
||||||
private String checkUserId;
|
private String checkUserId;
|
||||||
|
|
||||||
|
@NotBlank(message = "报告编制人员不能为空")
|
||||||
@ApiModelProperty("报告编制人员id")
|
@ApiModelProperty("报告编制人员id")
|
||||||
private String reportWriter;
|
private String reportWriter;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@NotNull(message = "报告编制时间不能为空")
|
||||||
@ApiModelProperty("报告编制时间")
|
@ApiModelProperty("报告编制时间")
|
||||||
private LocalDateTime reportWriteTime;
|
private LocalDate reportWriteTime;
|
||||||
|
|
||||||
|
@NotBlank(message = "报告复核人员不能为空")
|
||||||
@ApiModelProperty("报告复核人员id")
|
@ApiModelProperty("报告复核人员id")
|
||||||
private String reportReviewer;
|
private String reportReviewer;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@NotNull(message = "报告复核时间不能为空")
|
||||||
@ApiModelProperty("报告复核时间")
|
@ApiModelProperty("报告复核时间")
|
||||||
private LocalDateTime reportReviewTime;
|
private LocalDate reportReviewTime;
|
||||||
|
|
||||||
|
@NotBlank(message = "报告审核人员不能为空")
|
||||||
@ApiModelProperty("报告审核人员id")
|
@ApiModelProperty("报告审核人员id")
|
||||||
private String reportAuditor;
|
private String reportAuditor;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@NotNull(message = "报告审核时间不能为空")
|
||||||
@ApiModelProperty("报告审核时间")
|
@ApiModelProperty("报告审核时间")
|
||||||
private LocalDateTime reportAuditTime;
|
private LocalDate reportAuditTime;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ public class TurbineResp implements Serializable {
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = -1403719853347580858L;
|
private static final long serialVersionUID = -1403719853347580858L;
|
||||||
|
|
||||||
@ApiModelProperty("机组号")
|
@ApiModelProperty("机组id")
|
||||||
private String turbineId;
|
private String turbineId;
|
||||||
|
|
||||||
@ApiModelProperty("项目id")
|
@ApiModelProperty("项目id")
|
||||||
|
|
|
@ -2,6 +2,12 @@ package com.dite.znpt.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.dite.znpt.domain.entity.InspectionReportEntity;
|
import com.dite.znpt.domain.entity.InspectionReportEntity;
|
||||||
|
import com.dite.znpt.domain.vo.InspectionReportListReq;
|
||||||
|
import com.dite.znpt.domain.vo.InspectionReportListResp;
|
||||||
|
import com.dite.znpt.domain.vo.InspectionReportResp;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Bear.G
|
* @author Bear.G
|
||||||
|
@ -9,4 +15,7 @@ import com.dite.znpt.domain.entity.InspectionReportEntity;
|
||||||
* @description
|
* @description
|
||||||
*/
|
*/
|
||||||
public interface InspectionReportMapper extends BaseMapper<InspectionReportEntity> {
|
public interface InspectionReportMapper extends BaseMapper<InspectionReportEntity> {
|
||||||
|
|
||||||
|
List<InspectionReportListResp> listInspectionReportListResp(@Param("req") InspectionReportListReq req);
|
||||||
|
InspectionReportResp getInspectionReportResp(@Param("reportId") String reportId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,8 @@ import java.util.List;
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
public interface CheckSchemeService extends IService<CheckSchemeEntity> {
|
public interface CheckSchemeService extends IService<CheckSchemeEntity> {
|
||||||
List<CheckSchemeResp> page(String checkMethod);
|
List<CheckSchemeResp> page(List<String> checkMethods);
|
||||||
List<CheckSchemeResp> list(String checkMethod);
|
List<CheckSchemeResp> list(List<String> checkMethods);
|
||||||
CheckSchemeResp detail(String checkSchemeId);
|
CheckSchemeResp detail(String checkSchemeId);
|
||||||
void save(CheckSchemeReq req);
|
void save(CheckSchemeReq req);
|
||||||
void update(String checkSchemeId, CheckSchemeReq req);
|
void update(String checkSchemeId, CheckSchemeReq req);
|
||||||
|
|
|
@ -2,6 +2,12 @@ package com.dite.znpt.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.dite.znpt.domain.entity.InspectionReportEntity;
|
import com.dite.znpt.domain.entity.InspectionReportEntity;
|
||||||
|
import com.dite.znpt.domain.vo.InspectionReportListReq;
|
||||||
|
import com.dite.znpt.domain.vo.InspectionReportListResp;
|
||||||
|
import com.dite.znpt.domain.vo.InspectionReportReq;
|
||||||
|
import com.dite.znpt.domain.vo.InspectionReportResp;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Bear.G
|
* @author Bear.G
|
||||||
|
@ -9,4 +15,9 @@ import com.dite.znpt.domain.entity.InspectionReportEntity;
|
||||||
* @description
|
* @description
|
||||||
*/
|
*/
|
||||||
public interface InspectionReportService extends IService<InspectionReportEntity> {
|
public interface InspectionReportService extends IService<InspectionReportEntity> {
|
||||||
|
List<InspectionReportListResp> page(InspectionReportListReq req);
|
||||||
|
List<InspectionReportListResp> list(InspectionReportListReq req);
|
||||||
|
InspectionReportResp detail(String reportId);
|
||||||
|
void save(InspectionReportReq req);
|
||||||
|
void update(String reportId, InspectionReportReq req);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,14 +28,16 @@ import java.util.List;
|
||||||
public class CheckSchemeServiceImpl extends ServiceImpl<CheckSchemeMapper, CheckSchemeEntity> implements CheckSchemeService {
|
public class CheckSchemeServiceImpl extends ServiceImpl<CheckSchemeMapper, CheckSchemeEntity> implements CheckSchemeService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CheckSchemeResp> page(String checkMethod) {
|
public List<CheckSchemeResp> page(List<String> checkMethods) {
|
||||||
PageUtil.startPage();
|
PageUtil.startPage();
|
||||||
return this.list(checkMethod);
|
return this.list(checkMethods);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CheckSchemeResp> list(String checkMethod) {
|
public List<CheckSchemeResp> list(List<String> checkMethods) {
|
||||||
List<CheckSchemeResp> result = Converts.INSTANCE.toCheckSchemeResp(this.list(Wrappers.lambdaQuery(CheckSchemeEntity.class).eq(StrUtil.isNotBlank(checkMethod), CheckSchemeEntity::getCheckMethod, checkMethod)));
|
List<CheckSchemeResp> result = Converts.INSTANCE.toCheckSchemeResp(
|
||||||
|
this.list(Wrappers.lambdaQuery(CheckSchemeEntity.class).in(null != checkMethods && !checkMethods.isEmpty(), CheckSchemeEntity::getCheckMethod, checkMethods))
|
||||||
|
);
|
||||||
result.forEach(resp -> {
|
result.forEach(resp -> {
|
||||||
resp.setCheckMethodLabel(CheckMethodEnum.getDescByCode(resp.getCheckMethod()));
|
resp.setCheckMethodLabel(CheckMethodEnum.getDescByCode(resp.getCheckMethod()));
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,12 +1,29 @@
|
||||||
package com.dite.znpt.service.impl;
|
package com.dite.znpt.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.dite.znpt.constant.Message;
|
||||||
|
import com.dite.znpt.converts.Converts;
|
||||||
import com.dite.znpt.domain.entity.InspectionReportEntity;
|
import com.dite.znpt.domain.entity.InspectionReportEntity;
|
||||||
|
import com.dite.znpt.domain.entity.ProjectEntity;
|
||||||
|
import com.dite.znpt.domain.entity.TurbineEntity;
|
||||||
|
import com.dite.znpt.domain.vo.InspectionReportListReq;
|
||||||
|
import com.dite.znpt.domain.vo.InspectionReportListResp;
|
||||||
|
import com.dite.znpt.domain.vo.InspectionReportReq;
|
||||||
|
import com.dite.znpt.domain.vo.InspectionReportResp;
|
||||||
|
import com.dite.znpt.enums.ProjectStatusEnum;
|
||||||
|
import com.dite.znpt.exception.ServiceException;
|
||||||
import com.dite.znpt.mapper.InspectionReportMapper;
|
import com.dite.znpt.mapper.InspectionReportMapper;
|
||||||
|
import com.dite.znpt.service.InspectionReportService;
|
||||||
|
import com.dite.znpt.service.ProjectService;
|
||||||
|
import com.dite.znpt.service.TurbineService;
|
||||||
|
import com.dite.znpt.util.PageUtil;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.io.Serial;
|
import javax.annotation.Resource;
|
||||||
import java.io.Serializable;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Bear.G
|
* @author Bear.G
|
||||||
|
@ -14,7 +31,62 @@ import java.io.Serializable;
|
||||||
* @description
|
* @description
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class InspectionReportServiceImpl extends ServiceImpl<InspectionReportMapper, InspectionReportEntity> implements Serializable {
|
public class InspectionReportServiceImpl extends ServiceImpl<InspectionReportMapper, InspectionReportEntity> implements InspectionReportService {
|
||||||
@Serial
|
|
||||||
private static final long serialVersionUID = 1460849450000057636L;
|
@Resource
|
||||||
|
private ProjectService projectService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TurbineService turbineService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<InspectionReportListResp> page(InspectionReportListReq req) {
|
||||||
|
PageUtil.startPage();
|
||||||
|
return this.list(req);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<InspectionReportListResp> list(InspectionReportListReq req) {
|
||||||
|
return this.baseMapper.listInspectionReportListResp(req);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public InspectionReportResp detail(String reportId) {
|
||||||
|
return this.baseMapper.getInspectionReportResp(reportId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public void save(InspectionReportReq req) {
|
||||||
|
this.save(validation(req));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public void update(String reportId, InspectionReportReq req) {
|
||||||
|
if(this.getById(reportId) == null){
|
||||||
|
throw new ServiceException(Message.INSPECTION_REPORT_ID_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
InspectionReportEntity entity = validation(req);
|
||||||
|
entity.setReportId(reportId);
|
||||||
|
this.updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
private InspectionReportEntity validation(InspectionReportReq req){
|
||||||
|
ProjectEntity project = projectService.getById(req.getProjectId());
|
||||||
|
if(null == project){
|
||||||
|
throw new ServiceException(Message.PROJECT_ID_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
if(ProjectStatusEnum.COMPLETED.getCode() != project.getStatus()){
|
||||||
|
throw new ServiceException(StrUtil.format(Message.PROJECT_STATUS_IS_NOT_COMPLETED, project.getProjectName()));
|
||||||
|
}
|
||||||
|
TurbineEntity turbine = turbineService.getById(req.getTurbineId());
|
||||||
|
if(null == turbine){
|
||||||
|
throw new ServiceException(Message.TURBINE_ID_IS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
if(ProjectStatusEnum.COMPLETED.getCode() != turbine.getStatus()){
|
||||||
|
throw new ServiceException(StrUtil.format(Message.TURBINE_STATUS_IS_NOT_COMPLETED, turbine.getTurbineName()));
|
||||||
|
}
|
||||||
|
return Converts.INSTANCE.toInspectionReportEntity(req);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.dite.znpt.mapper.InspectionReportMapper">
|
<mapper namespace="com.dite.znpt.mapper.InspectionReportMapper">
|
||||||
|
|
||||||
|
<select id="listInspectionReportListResp" resultType="com.dite.znpt.domain.vo.InspectionReportListResp">
|
||||||
|
|
||||||
|
</select>
|
||||||
|
<select id="getInspectionReportResp" resultType="com.dite.znpt.domain.vo.InspectionReportResp">
|
||||||
|
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -27,14 +27,14 @@ public class CheckSchemeController {
|
||||||
|
|
||||||
@ApiOperation(value = "分页查询检查方案信息", httpMethod = "GET")
|
@ApiOperation(value = "分页查询检查方案信息", httpMethod = "GET")
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
public PageResult<CheckSchemeResp> page(@RequestParam(required = false) String checkMethod){
|
public PageResult<CheckSchemeResp> page(@RequestParam(required = false) List<String> checkMethods){
|
||||||
return PageResult.ok(checkSchemeService.page(checkMethod));
|
return PageResult.ok(checkSchemeService.page(checkMethods));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询检查方案信息列表", httpMethod = "GET")
|
@ApiOperation(value = "查询检查方案信息列表", httpMethod = "GET")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Result<List<CheckSchemeResp>> list(@RequestParam(required = false) String checkMethod){
|
public Result<List<CheckSchemeResp>> list(@RequestParam(required = false) List<String> checkMethods){
|
||||||
return Result.ok(checkSchemeService.list(checkMethod));
|
return Result.ok(checkSchemeService.list(checkMethods));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询检查方案详情", httpMethod = "GET")
|
@ApiOperation(value = "查询检查方案详情", httpMethod = "GET")
|
||||||
|
|
|
@ -1,8 +1,19 @@
|
||||||
package com.dite.znpt.web.controller;
|
package com.dite.znpt.web.controller;
|
||||||
|
|
||||||
|
import com.dite.znpt.domain.PageResult;
|
||||||
|
import com.dite.znpt.domain.Result;
|
||||||
|
import com.dite.znpt.domain.vo.InspectionReportListReq;
|
||||||
|
import com.dite.znpt.domain.vo.InspectionReportListResp;
|
||||||
|
import com.dite.znpt.domain.vo.InspectionReportReq;
|
||||||
|
import com.dite.znpt.domain.vo.InspectionReportResp;
|
||||||
|
import com.dite.znpt.service.InspectionReportService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Bear.G
|
* @author Bear.G
|
||||||
|
@ -13,4 +24,40 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/inspection-report")
|
@RequestMapping("/inspection-report")
|
||||||
public class InspectionReportController {
|
public class InspectionReportController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private InspectionReportService inspectionReportService;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "分页查询检查报告列表", httpMethod = "GET")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public PageResult<InspectionReportListResp> page(InspectionReportListReq req) {
|
||||||
|
return PageResult.ok(inspectionReportService.page(req));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询检查报告列表", httpMethod = "GET")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public Result<List<InspectionReportListResp>> list(InspectionReportListReq req) {
|
||||||
|
return Result.ok(inspectionReportService.list(req));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询检查报告详情", httpMethod = "GET")
|
||||||
|
@GetMapping("/detail/{reportId}")
|
||||||
|
public Result<InspectionReportResp> detail(@PathVariable String reportId) {
|
||||||
|
return Result.ok(inspectionReportService.detail(reportId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增检查报告", httpMethod = "POST")
|
||||||
|
@PostMapping
|
||||||
|
public Result<?> add(@Validated @RequestBody InspectionReportReq req) {
|
||||||
|
inspectionReportService.save(req);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改检查报告", httpMethod = "PUT")
|
||||||
|
@PostMapping("/{reportId}")
|
||||||
|
public Result<?> edit(@PathVariable String reportId, @Validated @RequestBody InspectionReportReq req) {
|
||||||
|
inspectionReportService.update(reportId, req);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue