Merge branch 'master' into gaea
This commit is contained in:
commit
667c657f5d
|
@ -16,4 +16,8 @@ public class Message implements Serializable {
|
|||
public static final String IMAGE_PATH_IS_NOT_EXIST = "图像地址不存在";
|
||||
public static final String IMAGE_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 TURBINE_ID_IS_NOT_EXIST = "机组id不存在";
|
||||
public static final String PART_ID_IS_NOT_EXIST = "部件id不存在";
|
||||
public static final String IMAGE_SOURCE_I_NOT_EXIST_OR_ILLEGAL = "部件id不存在";
|
||||
}
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
package com.dite.znpt.converts;
|
||||
|
||||
import com.dite.znpt.domain.entity.DefectEntity;
|
||||
import com.dite.znpt.domain.entity.ImageCollectEntity;
|
||||
import com.dite.znpt.domain.entity.ImageEntity;
|
||||
import com.dite.znpt.domain.vo.DefectReq;
|
||||
import com.dite.znpt.domain.vo.DefectResp;
|
||||
import com.dite.znpt.domain.vo.ImageCollectReq;
|
||||
import com.dite.znpt.domain.vo.ImageReq;
|
||||
import com.dite.znpt.domain.entity.*;
|
||||
import com.dite.znpt.domain.vo.*;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.NullValuePropertyMappingStrategy;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
@ -24,9 +19,23 @@ public interface Converts {
|
|||
|
||||
List<ImageEntity> toImageEntity(List<ImageReq> list);
|
||||
|
||||
List<ImageSimpleReq> toImageSimpleReq(List<OutWorkDefectReq> list);
|
||||
|
||||
ImageCollectEntity toImageCollectEntity(ImageCollectReq req);
|
||||
|
||||
DefectEntity toDefectEntity(DefectReq req);
|
||||
|
||||
DefectResp toDefectResp(DefectEntity entity);
|
||||
|
||||
ProjectResp toProjectResp(ProjectEntity entity);
|
||||
|
||||
ProjectEntity toProjectEntity(ProjectReq req);
|
||||
|
||||
TurbineEntity toTurbineEntity(TurbineReq req);
|
||||
|
||||
TurbineResp toTurbineResp(TurbineEntity entity);
|
||||
|
||||
PartEntity toPartEntity(PartReq req);
|
||||
|
||||
PartResp toPartResp(PartEntity entity);
|
||||
}
|
||||
|
|
|
@ -32,10 +32,6 @@ public class ImageCollectEntity extends AuditableEntity implements Serializable
|
|||
@TableId(value = "collect_id", type = IdType.ASSIGN_UUID)
|
||||
private String collectId;
|
||||
|
||||
@ApiModelProperty("部件id")
|
||||
@TableField("part_id")
|
||||
private String partId;
|
||||
|
||||
@ApiModelProperty("拍摄时间-起")
|
||||
@TableField("shooting_time_begin")
|
||||
private LocalDateTime shootingTimeBegin;
|
||||
|
|
|
@ -33,6 +33,10 @@ public class ImageEntity extends AuditableEntity implements Serializable {
|
|||
@TableId(value = "image_id", type = IdType.ASSIGN_UUID)
|
||||
private String imageId;
|
||||
|
||||
@ApiModelProperty("部件id")
|
||||
@TableField("part_id")
|
||||
private String partId;
|
||||
|
||||
@ApiModelProperty("图像采集id")
|
||||
@TableField("collect_id")
|
||||
private String collectId;
|
||||
|
|
|
@ -28,11 +28,6 @@ public class PartEntity extends AuditableEntity implements Serializable {
|
|||
@TableId(value = "part_id", type = IdType.ASSIGN_UUID)
|
||||
private String partId;
|
||||
|
||||
@ExcelProperty("项目id")
|
||||
@ApiModelProperty("项目id")
|
||||
@TableField("project_id")
|
||||
private String projectId;
|
||||
|
||||
@ExcelProperty("机组id")
|
||||
@ApiModelProperty("机组id")
|
||||
@TableField("turbine_id")
|
||||
|
@ -48,8 +43,8 @@ public class PartEntity extends AuditableEntity implements Serializable {
|
|||
@TableField("part_code")
|
||||
private String partCode;
|
||||
|
||||
@ExcelProperty("类型,字典part_type")
|
||||
@ApiModelProperty("类型,字典part_type")
|
||||
@ExcelProperty("类型,枚举PartTypeEnum")
|
||||
@ApiModelProperty("类型,枚举PartTypeEnum")
|
||||
@TableField("part_type")
|
||||
private String partType;
|
||||
|
||||
|
@ -60,12 +55,12 @@ public class PartEntity extends AuditableEntity implements Serializable {
|
|||
|
||||
@ExcelProperty("厂商")
|
||||
@ApiModelProperty("厂商")
|
||||
@TableField("manufacturer")
|
||||
private String manufacturer;
|
||||
@TableField("part_manufacturer")
|
||||
private String partManufacturer;
|
||||
|
||||
@ExcelProperty("型号")
|
||||
@ApiModelProperty("型号")
|
||||
@TableField("model")
|
||||
private String model;
|
||||
@TableField("part_model")
|
||||
private String partModel;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@ import com.alibaba.excel.annotation.ExcelProperty;
|
|||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("personnel")
|
||||
@ApiModel(value="PersonnelEntity对象", description="人员信息表")
|
||||
public class PersonnelEntity extends AuditableEntity implements Serializable {
|
||||
@TableName("person")
|
||||
@ApiModel(value="PersonEntity对象", description="人员信息表")
|
||||
public class PersonEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -62273861742734411L;
|
||||
|
|
@ -83,12 +83,12 @@ public class ProjectEntity extends AuditableEntity implements Serializable {
|
|||
private String turbineModel;
|
||||
|
||||
@ApiModelProperty("施工人员")
|
||||
@TableField("construction_personnel")
|
||||
private String constructionPersonnel;
|
||||
@TableField("construction_person")
|
||||
private String constructionPerson;
|
||||
|
||||
@ApiModelProperty("施工人员id")
|
||||
@TableField("construction_personnel_id")
|
||||
private String constructionPersonnelId;
|
||||
@TableField("construction_person_id")
|
||||
private String constructionPersonId;
|
||||
|
||||
@ApiModelProperty("安全员id")
|
||||
@TableField("auditor_id")
|
||||
|
|
|
@ -38,6 +38,11 @@ public class TurbineEntity extends AuditableEntity implements Serializable {
|
|||
@TableField("turbine_name")
|
||||
private String turbineName;
|
||||
|
||||
@ExcelProperty("机组编码")
|
||||
@ApiModelProperty("机组编码")
|
||||
@TableField("turbine_code")
|
||||
private String turbineCode;
|
||||
|
||||
@ExcelProperty("机组描述")
|
||||
@ApiModelProperty("机组描述")
|
||||
@TableField("turbine_desc")
|
||||
|
@ -45,17 +50,17 @@ public class TurbineEntity extends AuditableEntity implements Serializable {
|
|||
|
||||
@ExcelProperty("机组厂商")
|
||||
@ApiModelProperty("机组厂商")
|
||||
@TableField("manufacturer")
|
||||
private String manufacturer;
|
||||
@TableField("turbine_manufacturer")
|
||||
private String turbineManufacturer;
|
||||
|
||||
@ExcelProperty("机组型号")
|
||||
@ApiModelProperty("机组型号")
|
||||
@TableField("model")
|
||||
private String model;
|
||||
@TableField("turbine_model")
|
||||
private String turbineModel;
|
||||
|
||||
@ApiModelProperty("封面图")
|
||||
@TableField("cover_url")
|
||||
private String coverUrl;
|
||||
@TableField("turbine_cover_url")
|
||||
private String turbineCoverUrl;
|
||||
|
||||
@ApiModelProperty("状态:0待施工,1施工中,2已完工,3已审核,4已验收")
|
||||
@TableField("status")
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
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: gaoxiong
|
||||
* @Date: 2025/5/11 22:29
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("图像简要信息请求实体")
|
||||
public class ImageSimpleReq implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 4813411833253078204L;
|
||||
|
||||
@ApiModelProperty(name = "部件id", required = true)
|
||||
private String partId;
|
||||
|
||||
@ApiModelProperty(name = "图像来源,枚举:ImageSourceEnum", required = true)
|
||||
private String imageSource;
|
||||
|
||||
@ApiModelProperty(name = "图像路径", required = true)
|
||||
private String imagePath;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
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: gaoxiong
|
||||
* @Date: 2025/5/11 21:20
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("外部工作上报缺陷请求实体")
|
||||
public class OutWorkDefectReq extends DefectReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -9109852601298547208L;
|
||||
|
||||
@ApiModelProperty(name = "图像路径", required = true)
|
||||
private String imagePath;
|
||||
|
||||
@ApiModelProperty(name = "部件id", required = true)
|
||||
private String partId;
|
||||
}
|
|
@ -12,7 +12,7 @@ import lombok.Data;
|
|||
* @Description: 请求实体
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("列表请求实体")
|
||||
@ApiModel("部件列表请求实体")
|
||||
public class PartListReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 118135700439578757L;
|
||||
|
@ -20,32 +20,20 @@ public class PartListReq implements Serializable {
|
|||
@ApiModelProperty("查询关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("Id")
|
||||
private String partId;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
@ApiModelProperty(name = "项目id", required = true)
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("机组id")
|
||||
@ApiModelProperty(name = "机组id", required = true)
|
||||
private String turbineId;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String partName;
|
||||
|
||||
@ApiModelProperty("编号")
|
||||
private String partCode;
|
||||
|
||||
@ApiModelProperty("类型,字典part_type")
|
||||
@ApiModelProperty("类型,枚举PartTypeEnum")
|
||||
private String partType;
|
||||
|
||||
@ApiModelProperty("描述")
|
||||
private String partDesc;
|
||||
|
||||
@ApiModelProperty("厂商")
|
||||
private String manufacturer;
|
||||
private String partManufacturer;
|
||||
|
||||
@ApiModelProperty("型号")
|
||||
private String model;
|
||||
private String partModel;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
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: gaoxiong
|
||||
* @Date: 2025/5/7 21:50
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("部件列表响应实体")
|
||||
public class PartListResp implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -8081226536055269084L;
|
||||
|
||||
@ApiModelProperty("部件id")
|
||||
private String partId;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("机组id")
|
||||
private String turbineId;
|
||||
|
||||
@ApiModelProperty("机组名称")
|
||||
private String turbineName;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String partName;
|
||||
|
||||
@ApiModelProperty("编号")
|
||||
private String partCode;
|
||||
|
||||
@ApiModelProperty("类型,枚举PartTypeEnum")
|
||||
private String partType;
|
||||
|
||||
@ApiModelProperty("类型,枚举PartTypeEnum")
|
||||
private String partTypeLabel;
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
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: gaoxiong
|
||||
* @Date: 2025/5/7 21:51
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("部件请求实体")
|
||||
public class PartReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -585044340118904985L;
|
||||
|
||||
@ApiModelProperty("机组id")
|
||||
private String turbineId;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String partName;
|
||||
|
||||
@ApiModelProperty("编号")
|
||||
private String partCode;
|
||||
|
||||
@ApiModelProperty("类型,枚举PartTypeEnum")
|
||||
private String partType;
|
||||
|
||||
@ApiModelProperty("描述")
|
||||
private String partDesc;
|
||||
|
||||
@ApiModelProperty("厂商")
|
||||
private String PartManufacturer;
|
||||
|
||||
@ApiModelProperty("型号")
|
||||
private String PartModel;
|
||||
}
|
|
@ -1,9 +1,11 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.dite.znpt.domain.entity.PartEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
|
@ -11,8 +13,46 @@ import com.dite.znpt.domain.entity.PartEntity;
|
|||
* @Description: 响应实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("响应实体")
|
||||
public class PartResp extends PartEntity {
|
||||
@ApiModel("部件响应实体")
|
||||
public class PartResp implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -4457194361289992312L;
|
||||
|
||||
@ApiModelProperty("部件id")
|
||||
private String partId;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("机组")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("机组id")
|
||||
private String turbineId;
|
||||
|
||||
@ApiModelProperty("机组名称")
|
||||
private String turbineName;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String partName;
|
||||
|
||||
@ApiModelProperty("编号")
|
||||
private String partCode;
|
||||
|
||||
@ApiModelProperty("类型,枚举PartTypeEnum")
|
||||
private String partType;
|
||||
|
||||
@ApiModelProperty("类型描述")
|
||||
private String partTypeLabel;
|
||||
|
||||
@ApiModelProperty("描述")
|
||||
private String partDesc;
|
||||
|
||||
@ApiModelProperty("厂商")
|
||||
private String partManufacturer;
|
||||
|
||||
@ApiModelProperty("型号")
|
||||
private String partModel;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import lombok.Data;
|
|||
*/
|
||||
@Data
|
||||
@ApiModel("人员信息列表请求实体")
|
||||
public class PersonnelListReq implements Serializable {
|
||||
public class PersonListReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -10363935468256543L;
|
||||
|
|
@ -3,7 +3,7 @@ package com.dite.znpt.domain.vo;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.dite.znpt.domain.entity.PersonnelEntity;
|
||||
import com.dite.znpt.domain.entity.PersonEntity;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
|
@ -13,6 +13,6 @@ import com.dite.znpt.domain.entity.PersonnelEntity;
|
|||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("人员信息响应实体")
|
||||
public class PersonnelResp extends PersonnelEntity {
|
||||
public class PersonResp extends PersonEntity {
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
@ -19,9 +20,6 @@ public class ProjectListReq implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = -74121355744234753L;
|
||||
|
||||
@ApiModelProperty("查询关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
|
@ -37,11 +35,13 @@ public class ProjectListReq implements Serializable {
|
|||
@ApiModelProperty("项目状态,枚举:ProjectStatusEnum")
|
||||
private String status;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty("创建日期-起")
|
||||
private LocalDate createDateBegin;
|
||||
private String createDateBegin;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty("创建日期-讫")
|
||||
private LocalDate createDateEnd;
|
||||
private String createDateEnd;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
@ -19,15 +20,18 @@ public class ProjectReq implements Serializable {
|
|||
@Serial
|
||||
private static final long serialVersionUID = 740685592879189406L;
|
||||
|
||||
@ExcelProperty("项目名称")
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("项目封面")
|
||||
private String coverUrl;
|
||||
|
||||
@ExcelProperty("风场名称")
|
||||
@ApiModelProperty("风场名称")
|
||||
private String farmName;
|
||||
|
||||
@ExcelProperty("风场地址")
|
||||
@ApiModelProperty("风场地址")
|
||||
private String farmAddress;
|
||||
|
||||
|
@ -49,17 +53,19 @@ public class ProjectReq implements Serializable {
|
|||
@ApiModelProperty("检查单位联系电话")
|
||||
private String inspectionPhone;
|
||||
|
||||
@ExcelProperty("项目规模")
|
||||
@ApiModelProperty("项目规模")
|
||||
private String scale;
|
||||
|
||||
@ExcelProperty("风机型号")
|
||||
@ApiModelProperty("风机型号")
|
||||
private String turbineModel;
|
||||
|
||||
@ApiModelProperty("施工人员")
|
||||
private String constructionPersonnel;
|
||||
|
||||
@ApiModelProperty("施工人员id")
|
||||
private String constructionPersonnelId;
|
||||
private String constructionPersonId;
|
||||
|
||||
@ApiModelProperty("施工人员")
|
||||
private String constructionPersonName;
|
||||
|
||||
@ApiModelProperty("安全员id")
|
||||
private String auditorId;
|
||||
|
@ -89,7 +95,7 @@ public class ProjectReq implements Serializable {
|
|||
private String discloseContent;
|
||||
|
||||
@ApiModelProperty("状态:0待施工,1施工中,2已完工,3已审核,4已验收")
|
||||
private Integer status;
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("项目工作类型 可能有多项,逗号分隔")
|
||||
private String workType;
|
||||
|
|
|
@ -26,7 +26,23 @@ public class ProjectResp extends ProjectReq implements Serializable {
|
|||
@Serial
|
||||
private static final long serialVersionUID = -1883901559600186726L;
|
||||
|
||||
@ExcelProperty("项目id")
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("安全员")
|
||||
private String auditorName;
|
||||
|
||||
@ApiModelProperty("质量员")
|
||||
private String qualityOfficerName;
|
||||
|
||||
@ApiModelProperty("项目经理")
|
||||
private String projectManagerName;
|
||||
|
||||
@ApiModelProperty("施工组长")
|
||||
private String constructionTeamLeaderName;
|
||||
|
||||
@ApiModelProperty("状态:0待施工,1施工中,2已完工,3已审核,4已验收")
|
||||
private String statusLabel;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
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;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/5/7 22:17
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("机组明细响应实体")
|
||||
public class TurbineInfoResp extends TurbineResp implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 5493448541358665068L;
|
||||
|
||||
@ApiModelProperty("部件信息")
|
||||
private List<PartResp> partRespList;
|
||||
}
|
|
@ -12,31 +12,25 @@ import lombok.Data;
|
|||
* @Description: 机组-项目关联请求实体
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("机组-项目关联列表请求实体")
|
||||
@ApiModel("机组列表请求实体")
|
||||
public class TurbineListReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 141552424945497346L;
|
||||
|
||||
@ApiModelProperty("查询关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("机组-项目关联Id")
|
||||
private String turbineId;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
@ApiModelProperty(name = "项目id", required = true)
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("机组名称")
|
||||
private String turbineName;
|
||||
@ApiModelProperty("查询关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("机组描述")
|
||||
private String turbineDesc;
|
||||
|
||||
@ApiModelProperty("机组厂商")
|
||||
private String manufacturer;
|
||||
private String turbineManufacturer;
|
||||
|
||||
@ApiModelProperty("机组型号")
|
||||
private String model;
|
||||
private String turbineModel;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.dite.znpt.domain.entity.PartEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.dite.znpt.domain.entity.TurbineEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
* @Description: 机组-项目关联响应实体
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("机组列表响应实体")
|
||||
public class TurbineListResp implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 8391079826638511248L;
|
||||
|
||||
@ApiModelProperty("机组号")
|
||||
private String turbineId;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("机组名称")
|
||||
private String turbineName;
|
||||
|
||||
@ApiModelProperty("机组编码")
|
||||
private String turbineCode;
|
||||
|
||||
@ApiModelProperty("机组描述")
|
||||
private String turbineDesc;
|
||||
|
||||
@ApiModelProperty("机组厂商")
|
||||
private String turbineManufacturer;
|
||||
|
||||
@ApiModelProperty("机组型号")
|
||||
private String turbineModel;
|
||||
|
||||
@ApiModelProperty("封面图")
|
||||
private String turbineCoverUrl;
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/5/7 21:44
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("机组请求实体")
|
||||
public class TurbineReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 115092978850852080L;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("机组名称")
|
||||
private String turbineName;
|
||||
|
||||
@ApiModelProperty("机组编码")
|
||||
private String turbineCode;
|
||||
|
||||
@ApiModelProperty("机组描述")
|
||||
private String turbineDesc;
|
||||
|
||||
@ApiModelProperty("机组厂商")
|
||||
private String turbineManufacturer;
|
||||
|
||||
@ApiModelProperty("机组型号")
|
||||
private String turbineModel;
|
||||
|
||||
@ApiModelProperty("封面图")
|
||||
private String turbineCoverUrl;
|
||||
|
||||
}
|
|
@ -1,61 +1,48 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.dite.znpt.domain.entity.PartEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.dite.znpt.domain.entity.TurbineEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
* @Description: 机组-项目关联响应实体
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/5/7 21:44
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("机组-项目关联响应实体")
|
||||
public class TurbineResp extends TurbineEntity {
|
||||
@ApiModel("机组响应实体")
|
||||
public class TurbineResp implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -1403719853347580858L;
|
||||
|
||||
@ApiModelProperty("部件")
|
||||
private List<PartEntity> partsList;
|
||||
@ApiModelProperty("机组号")
|
||||
private String turbineId;
|
||||
|
||||
@ApiModelProperty("内部工作状态, -1不存在,0未开始、1开始施工、2已提交报告、3审核通过")
|
||||
private String antiThunderWorkStatus;
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("外部工作状态, -1不存在,0未开始、1开始施工、2已提交报告、3审核通过")
|
||||
private String inWorkStatus;
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("防雷工作状态, -1不存在,0未开始、1开始施工、2已提交报告、3审核通过")
|
||||
private String outWorkStatus;
|
||||
@ApiModelProperty("机组名称")
|
||||
private String turbineName;
|
||||
|
||||
@ApiModelProperty("数据报告工作状态, -1不存在,0未开始、1开始施工、2已提交报告、3审核通过")
|
||||
private String summaryWorkStatus;
|
||||
@ApiModelProperty("机组编码")
|
||||
private String turbineCode;
|
||||
|
||||
@ApiModelProperty("内部工作安全员审核状态, -1不存在,0未审核、1审核通过")
|
||||
private String antiThunderWorkSafetyStatus;
|
||||
@ApiModelProperty("机组描述")
|
||||
private String turbineDesc;
|
||||
|
||||
@ApiModelProperty("外部工作安全员审核状态, -1不存在,0未审核、1审核通过")
|
||||
private String inWorkSafetyStatus;
|
||||
@ApiModelProperty("机组厂商")
|
||||
private String turbineManufacturer;
|
||||
|
||||
@ApiModelProperty("防雷工作安全员审核状态, -1不存在,0未审核、1审核通过")
|
||||
private String outWorkSafetyStatus;
|
||||
@ApiModelProperty("机组型号")
|
||||
private String turbineModel;
|
||||
|
||||
@ApiModelProperty("内部工作质量员审核状态, -1不存在,0未审核、1审核通过")
|
||||
private String antiThunderWorkQualityStatus;
|
||||
@ApiModelProperty("封面图")
|
||||
private String turbineCoverUrl;
|
||||
|
||||
@ApiModelProperty("外部工作质量员审核状态, -1不存在,0未审核、1审核通过")
|
||||
private String inWorkQualityStatus;
|
||||
|
||||
@ApiModelProperty("防雷工作质量员审核状态, -1不存在,0未审核、1审核通过")
|
||||
private String outWorkQualityStatus;
|
||||
|
||||
@ApiModelProperty("防雷是否不合格,1不合格,0合格")
|
||||
private Boolean lightningUnqualified;
|
||||
|
||||
@ApiModelProperty("来源, app,backend后台,不传参默认后台")
|
||||
private String source;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,8 @@ import java.util.List;
|
|||
@Getter
|
||||
public enum DefectSourceEnum {
|
||||
AI("AI", "智能识别"),
|
||||
MANUAL("MANUAL", "人工标注");
|
||||
MANUAL("MANUAL", "人工标注"),
|
||||
OUT_WORK("MANUAL", "外部工作");
|
||||
|
||||
private final String code;
|
||||
private final String desc;
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
package com.dite.znpt.enums;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/5/11 23:35
|
||||
* @Description:
|
||||
*/
|
||||
@Getter
|
||||
public enum ImageSourceEnum {
|
||||
COLLECT("collect", "图像采集", Boolean.TRUE),
|
||||
OUT_WORK("out-work", "外部工作", Boolean.TRUE),
|
||||
LIGHTNING_PROTECTING_WORK("lightning-protection-work", "防雷工作", Boolean.FALSE);
|
||||
|
||||
private final String code;
|
||||
private final String desc;
|
||||
private final boolean isDefectImage;
|
||||
|
||||
ImageSourceEnum(String code, String desc, boolean isDefectImage){
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
this.isDefectImage = isDefectImage;
|
||||
}
|
||||
|
||||
public static ImageSourceEnum getByCode(String code){
|
||||
for (ImageSourceEnum e : ImageSourceEnum.values() ) {
|
||||
if(e.code.equals(code)){
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getDescByCode(String code){
|
||||
ImageSourceEnum e = getByCode(code);
|
||||
return null == e ? null : e.desc;
|
||||
}
|
||||
|
||||
public static List<JSONObject> list(Boolean isDefectImage){
|
||||
List<JSONObject> list = new ArrayList<>(ImageSourceEnum.values().length);
|
||||
for (ImageSourceEnum e : ImageSourceEnum.values() ) {
|
||||
if(isDefectImage.equals(e.isDefectImage)){
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set(e.code, e.desc);
|
||||
list.add(jsonObject);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.dite.znpt.enums;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/5/7 21:22
|
||||
* @Description:
|
||||
*/
|
||||
@Getter
|
||||
public enum PartTypeEnum {
|
||||
CABIN("CABIN", "机舱"),
|
||||
VANE_1("VANE-1", "叶片1"),
|
||||
VANE_2("VANE-2", "叶片2"),
|
||||
VANE_3("VANE-3", "叶片3"),
|
||||
TOWER("TOWER", "塔筒");
|
||||
|
||||
private final String code;
|
||||
private final String desc;
|
||||
|
||||
PartTypeEnum(String code, String desc){
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static PartTypeEnum getByCode(String code){
|
||||
for (PartTypeEnum e : PartTypeEnum.values() ) {
|
||||
if(e.code.equals(code)){
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getDescByCode(String code){
|
||||
PartTypeEnum e = getByCode(code);
|
||||
return null == e ? null : e.desc;
|
||||
}
|
||||
|
||||
public static List<JSONObject> listAll(){
|
||||
List<JSONObject> list = new ArrayList<>(PartTypeEnum.values().length);
|
||||
for (PartTypeEnum e : PartTypeEnum.values() ) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set(e.code, e.desc);
|
||||
list.add(jsonObject);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ package com.dite.znpt.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.PartEntity;
|
||||
import com.dite.znpt.domain.vo.PartListReq;
|
||||
import com.dite.znpt.domain.vo.PartListResp;
|
||||
import com.dite.znpt.domain.vo.PartResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
@ -14,6 +15,6 @@ import java.util.List;
|
|||
* @Description: 表数据库访问层
|
||||
*/
|
||||
public interface PartMapper extends BaseMapper<PartEntity> {
|
||||
List<PartResp> queryBySelective(PartListReq partReq);
|
||||
List<PartListResp> queryBySelective(PartListReq partReq);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.PersonnelEntity;
|
||||
import com.dite.znpt.domain.vo.PersonnelListReq;
|
||||
import com.dite.znpt.domain.vo.PersonnelResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.dite.znpt.domain.entity.PersonEntity;
|
||||
import com.dite.znpt.domain.vo.PersonListReq;
|
||||
import com.dite.znpt.domain.vo.PersonResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -13,7 +12,7 @@ import java.util.List;
|
|||
* @date 2025/04/11 23:17
|
||||
* @Description: 人员信息表数据库访问层
|
||||
*/
|
||||
public interface PersonnelMapper extends BaseMapper<PersonnelEntity> {
|
||||
List<PersonnelResp> queryBySelective(PersonnelListReq personnelReq);
|
||||
public interface PersonnelMapper extends BaseMapper<PersonEntity> {
|
||||
List<PersonResp> queryBySelective(PersonListReq personnelReq);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.dite.znpt.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.ProjectEntity;
|
||||
import com.dite.znpt.domain.vo.ProjectListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectListResp;
|
||||
import com.dite.znpt.domain.vo.ProjectResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
@ -14,6 +15,6 @@ import java.util.List;
|
|||
* @Description: 项目信息表数据库访问层
|
||||
*/
|
||||
public interface ProjectMapper extends BaseMapper<ProjectEntity> {
|
||||
List<ProjectResp> queryBySelective(ProjectListReq projectReq);
|
||||
List<ProjectListResp> queryBySelective(ProjectListReq projectReq);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@ package com.dite.znpt.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.TurbineEntity;
|
||||
import com.dite.znpt.domain.vo.TurbineInfoResp;
|
||||
import com.dite.znpt.domain.vo.TurbineListReq;
|
||||
import com.dite.znpt.domain.vo.TurbineResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.dite.znpt.domain.vo.TurbineListResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -14,6 +14,8 @@ import java.util.List;
|
|||
* @Description: 机组-项目关联表数据库访问层
|
||||
*/
|
||||
public interface TurbineMapper extends BaseMapper<TurbineEntity> {
|
||||
List<TurbineResp> queryBySelective(TurbineListReq turbineReq);
|
||||
List<TurbineListResp> queryBySelective(TurbineListReq turbineReq);
|
||||
List<TurbineInfoResp> listTurbineInfo(TurbineListReq turbineReq);
|
||||
TurbineInfoResp getTurbineInfo(String turbineId);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.dite.znpt.domain.entity.DefectEntity;
|
|||
import com.dite.znpt.domain.vo.DefectListReq;
|
||||
import com.dite.znpt.domain.vo.DefectReq;
|
||||
import com.dite.znpt.domain.vo.DefectResp;
|
||||
import com.dite.znpt.domain.vo.OutWorkDefectReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -47,6 +48,15 @@ public interface DefectService extends IService<DefectEntity> {
|
|||
**/
|
||||
void save(String imageId, DefectReq req);
|
||||
|
||||
/**
|
||||
* 功能描述:新增外部工作缺陷记录
|
||||
*
|
||||
* @param list
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
List<DefectEntity> saveOutWorkDefect(List<OutWorkDefectReq> list);
|
||||
|
||||
/**
|
||||
* 功能描述:更新缺陷记录
|
||||
*
|
||||
|
|
|
@ -10,5 +10,5 @@ import com.dite.znpt.domain.vo.ImageCollectReq;
|
|||
* @Description:
|
||||
*/
|
||||
public interface ImageCollectService extends IService<ImageCollectEntity> {
|
||||
void save(String departId, ImageCollectReq req);
|
||||
void save(String partId, ImageCollectReq req);
|
||||
}
|
||||
|
|
|
@ -2,12 +2,10 @@ package com.dite.znpt.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.ImageEntity;
|
||||
import com.dite.znpt.domain.vo.ImageListReq;
|
||||
import com.dite.znpt.domain.vo.ImageListResp;
|
||||
import com.dite.znpt.domain.vo.ImageReq;
|
||||
import com.dite.znpt.domain.vo.ImageResp;
|
||||
import com.dite.znpt.domain.vo.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -21,9 +19,13 @@ public interface ImageService extends IService<ImageEntity> {
|
|||
|
||||
List<ImageListResp> page(ImageListReq req);
|
||||
|
||||
List<ImageEntity> batchSaveByImageSimpleReq(List<ImageSimpleReq> list);
|
||||
|
||||
ImageResp detail(String imageId);
|
||||
|
||||
List<ImageReq> batchUpload(String departId, MultipartFile[] files);
|
||||
List<ImageReq> batchUploadDefectImage(String partId, String imageSource, MultipartFile[] files);
|
||||
|
||||
String uploadCommonImage(String imageSource, MultipartFile file) throws IOException;
|
||||
|
||||
void delete(String imageId);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.dite.znpt.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.PartEntity;
|
||||
import com.dite.znpt.domain.vo.PartListReq;
|
||||
import com.dite.znpt.domain.vo.PartListResp;
|
||||
import com.dite.znpt.domain.vo.PartReq;
|
||||
import com.dite.znpt.domain.vo.PartResp;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -15,14 +17,24 @@ import java.util.List;
|
|||
public interface PartService extends IService<PartEntity> {
|
||||
|
||||
/**
|
||||
* 功能描述:查询列表
|
||||
* 功能描述:分页查询列表
|
||||
*
|
||||
* @param partReq
|
||||
* @return {@link List }<{@link PartEntity }>
|
||||
* @return {@link List }<{@link PartListResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
List<PartResp> selectList(PartListReq partReq);
|
||||
List<PartListResp> page(PartListReq partReq);
|
||||
|
||||
/**
|
||||
* 功能描述:查询列表
|
||||
*
|
||||
* @param partReq
|
||||
* @return {@link List }<{@link PartListResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
List<PartListResp> list(PartListReq partReq);
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条
|
||||
|
@ -32,25 +44,25 @@ public interface PartService extends IService<PartEntity> {
|
|||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
PartResp selectById(String partId);
|
||||
PartResp detail(String partId);
|
||||
|
||||
/**
|
||||
* 功能描述:新增
|
||||
*
|
||||
* @param part
|
||||
* @param req
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
void saveData(PartEntity part);
|
||||
void save(PartReq req);
|
||||
|
||||
/**
|
||||
* 功能描述:更新
|
||||
*
|
||||
* @param part
|
||||
* @param req
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
void updateData(PartEntity part);
|
||||
void update(String partId, PartReq req);
|
||||
|
||||
/**
|
||||
* 功能描述:删除
|
||||
|
@ -60,5 +72,15 @@ public interface PartService extends IService<PartEntity> {
|
|||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
void deleteById(String partId);
|
||||
|
||||
/**
|
||||
* 功能描述:删除
|
||||
*
|
||||
* @param turbineIds 机组id
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
void deleteByTurbineIds(List<String> turbineIds);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.PersonnelEntity;
|
||||
import com.dite.znpt.domain.vo.PersonnelListReq;
|
||||
import com.dite.znpt.domain.vo.PersonnelResp;
|
||||
import com.dite.znpt.domain.entity.PersonEntity;
|
||||
import com.dite.znpt.domain.vo.PersonListReq;
|
||||
import com.dite.znpt.domain.vo.PersonResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -12,27 +12,27 @@ import java.util.List;
|
|||
* @date 2025/04/11 23:17
|
||||
* @Description: 人员信息表服务接口
|
||||
*/
|
||||
public interface PersonnelService extends IService<PersonnelEntity> {
|
||||
public interface PersonService extends IService<PersonEntity> {
|
||||
|
||||
/**
|
||||
* 功能描述:查询人员信息列表
|
||||
*
|
||||
* @param personnelReq 人员信息
|
||||
* @return {@link List }<{@link PersonnelEntity }>
|
||||
* @return {@link List }<{@link PersonEntity }>
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
List<PersonnelResp> selectList(PersonnelListReq personnelReq);
|
||||
List<PersonResp> selectList(PersonListReq personnelReq);
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条人员信息
|
||||
*
|
||||
* @param personId 人员信息Id
|
||||
* @return {@link PersonnelResp }
|
||||
* @return {@link PersonResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
PersonnelResp selectById(String personId);
|
||||
PersonResp selectById(String personId);
|
||||
|
||||
/**
|
||||
* 功能描述:新增人员信息
|
||||
|
@ -41,7 +41,7 @@ public interface PersonnelService extends IService<PersonnelEntity> {
|
|||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
void saveData(PersonnelEntity personnel);
|
||||
void saveData(PersonEntity personnel);
|
||||
|
||||
/**
|
||||
* 功能描述:更新人员信息
|
||||
|
@ -50,7 +50,7 @@ public interface PersonnelService extends IService<PersonnelEntity> {
|
|||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
void updateData(PersonnelEntity personnel);
|
||||
void updateData(PersonEntity personnel);
|
||||
|
||||
/**
|
||||
* 功能描述:删除人员信息
|
|
@ -2,8 +2,7 @@ package com.dite.znpt.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.TurbineEntity;
|
||||
import com.dite.znpt.domain.vo.TurbineListReq;
|
||||
import com.dite.znpt.domain.vo.TurbineResp;
|
||||
import com.dite.znpt.domain.vo.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -15,50 +14,90 @@ import java.util.List;
|
|||
public interface TurbineService extends IService<TurbineEntity> {
|
||||
|
||||
/**
|
||||
* 功能描述:查询机组-项目关联列表
|
||||
* 功能描述:分页查询机组列表
|
||||
*
|
||||
* @param turbineReq 机组-项目关联
|
||||
* @return {@link List }<{@link TurbineEntity }>
|
||||
* @param req
|
||||
* @return {@link List }<{@link TurbineListResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
List<TurbineResp> selectList(TurbineListReq turbineReq);
|
||||
List<TurbineListResp> page(TurbineListReq req);
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条机组-项目关联
|
||||
* 功能描述:查询机组列表
|
||||
*
|
||||
* @param turbineId 机组-项目关联Id
|
||||
* @param req
|
||||
* @return {@link List }<{@link TurbineListResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
List<TurbineListResp> list(TurbineListReq req);
|
||||
|
||||
/**
|
||||
* 功能描述:查询机组明细列表
|
||||
*
|
||||
* @param req
|
||||
* @return {@link List }<{@link TurbineInfoResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
List<TurbineInfoResp> listInfo(TurbineListReq req);
|
||||
|
||||
/**
|
||||
* 功能描述:查询指定机组详情
|
||||
*
|
||||
* @param turbineId 机组Id
|
||||
* @return {@link TurbineResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
TurbineResp selectById(String turbineId);
|
||||
TurbineResp detail(String turbineId);
|
||||
|
||||
/**
|
||||
* 功能描述:新增机组-项目关联
|
||||
* 功能描述:查询指定机组明细内信息
|
||||
*
|
||||
* @param turbine 机组-项目关联
|
||||
* @param turbineId 机组Id
|
||||
* @return {@link TurbineListResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
void saveData(TurbineEntity turbine);
|
||||
TurbineInfoResp info(String turbineId);
|
||||
|
||||
/**
|
||||
* 功能描述:更新机组-项目关联
|
||||
* 功能描述:新增机组
|
||||
*
|
||||
* @param turbine 机组-项目关联
|
||||
* @param req
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
void updateData(TurbineEntity turbine);
|
||||
void save(TurbineReq req);
|
||||
|
||||
/**
|
||||
* 功能描述:删除机组-项目关联
|
||||
* 功能描述:更新机组
|
||||
*
|
||||
* @param turbineId 机组-项目关联Id
|
||||
* @param turbineId
|
||||
* @param req
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
void update(String turbineId, TurbineReq req);
|
||||
|
||||
/**
|
||||
* 功能描述:删除机组
|
||||
*
|
||||
* @param turbineId 机组Id
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
void deleteById(String turbineId);
|
||||
|
||||
/**
|
||||
* 功能描述:删除机组
|
||||
*
|
||||
* @param projectId 项目id
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
void deleteByProjectId(String projectId);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.DefectEntity;
|
||||
import com.dite.znpt.domain.vo.DefectListReq;
|
||||
import com.dite.znpt.domain.vo.DefectReq;
|
||||
import com.dite.znpt.domain.vo.DefectResp;
|
||||
import com.dite.znpt.domain.entity.ImageEntity;
|
||||
import com.dite.znpt.domain.vo.*;
|
||||
import com.dite.znpt.enums.DefectSourceEnum;
|
||||
import com.dite.znpt.enums.DefectTypeEnum;
|
||||
import com.dite.znpt.enums.RepairStatusEnum;
|
||||
|
@ -15,13 +15,16 @@ import com.dite.znpt.service.DefectService;
|
|||
import com.dite.znpt.mapper.DefectMapper;
|
||||
import com.dite.znpt.service.ImageService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
|
@ -87,9 +90,35 @@ public class DefectServiceImpl extends ServiceImpl<DefectMapper, DefectEntity> i
|
|||
throw new ServiceException(Message.IMAGE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
DefectEntity defectEntity = Converts.INSTANCE.toDefectEntity(req);
|
||||
defectEntity.setImageId(imageId);
|
||||
this.save(defectEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:新增外部工作缺陷记录
|
||||
*
|
||||
* @param list
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Override
|
||||
public List<DefectEntity> saveOutWorkDefect(List<OutWorkDefectReq> list) {
|
||||
List<ImageSimpleReq> imageSimpleReqList = Converts.INSTANCE.toImageSimpleReq(list);
|
||||
List<ImageEntity> imageEntityList = imageService.batchSaveByImageSimpleReq(imageSimpleReqList);
|
||||
Map<String, ImageEntity> imageMap = imageEntityList.stream().collect(Collectors.toMap(k->k.getPartId().concat(StrUtil.COLON).concat(k.getImagePath()), Function.identity()));
|
||||
List<DefectEntity> defectEntityList = new ArrayList<>();
|
||||
list.stream().forEach(req -> {
|
||||
String key = req.getPartId().concat(StrUtil.COLON).concat(req.getImagePath());
|
||||
if(imageMap.containsKey(key)){
|
||||
DefectEntity defectEntity = Converts.INSTANCE.toDefectEntity(req);
|
||||
defectEntity.setImageId(imageMap.get(key).getImageId());
|
||||
defectEntityList.add(defectEntity);
|
||||
}
|
||||
});
|
||||
this.saveBatch(defectEntityList);
|
||||
return defectEntityList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:更新缺陷记录
|
||||
*
|
||||
|
|
|
@ -9,10 +9,12 @@ import com.dite.znpt.converts.Converts;
|
|||
import com.dite.znpt.domain.entity.ImageCollectEntity;
|
||||
import com.dite.znpt.domain.entity.ImageEntity;
|
||||
import com.dite.znpt.domain.vo.ImageCollectReq;
|
||||
import com.dite.znpt.enums.ImageSourceEnum;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.mapper.ImageCollectMapper;
|
||||
import com.dite.znpt.service.ImageCollectService;
|
||||
import com.dite.znpt.service.ImageService;
|
||||
import com.dite.znpt.service.PartService;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -35,26 +37,32 @@ public class ImageCollectServiceImpl extends ServiceImpl<ImageCollectMapper, Ima
|
|||
@Resource
|
||||
private ImageService imageService;
|
||||
|
||||
@Resource
|
||||
private PartService partService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void save(String partId, ImageCollectReq req) {
|
||||
if(null == partService.getById(partId)){
|
||||
throw new ServiceException(Message.PART_ID_IS_NOT_EXIST);
|
||||
}
|
||||
if(CollUtil.isEmpty(req.getImageList())){
|
||||
throw new ServiceException(Message.IMAGE_IS_EMPTY);
|
||||
}
|
||||
ImageCollectEntity imageCollect = Converts.INSTANCE.toImageCollectEntity(req);
|
||||
imageCollect.setPartId(partId);
|
||||
this.save(imageCollect);
|
||||
List<ImageEntity> imageList = Converts.INSTANCE.toImageEntity(req.getImageList());
|
||||
String path_prefix = permPath.concat(StrUtil.BACKSLASH).concat(partId).concat(StrUtil.BACKSLASH);
|
||||
String path_prefix = permPath.concat(StrUtil.BACKSLASH).concat(ImageSourceEnum.COLLECT.getCode()).concat(StrUtil.BACKSLASH).concat(partId).concat(StrUtil.BACKSLASH);
|
||||
imageList.stream().forEach(image -> {
|
||||
image.setPartId(partId);
|
||||
image.setCollectId(imageCollect.getCollectId());
|
||||
String path = path_prefix + image.getImageName();
|
||||
File file = new File(image.getImagePath());
|
||||
if (file.exists()) {
|
||||
byte[] bytes = FileUtil.readBytes(file);
|
||||
FileUtil.writeBytes(bytes, path);
|
||||
FileUtil.del(file);
|
||||
image.setImagePath(path);
|
||||
FileUtil.del(file);
|
||||
}else {
|
||||
imageList.remove(image);
|
||||
}
|
||||
|
|
|
@ -8,19 +8,17 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.constant.Message;
|
||||
import com.dite.znpt.domain.entity.ImageEntity;
|
||||
import com.dite.znpt.domain.vo.ImageListReq;
|
||||
import com.dite.znpt.domain.vo.ImageListResp;
|
||||
import com.dite.znpt.domain.vo.ImageReq;
|
||||
import com.dite.znpt.domain.vo.ImageResp;
|
||||
import com.dite.znpt.enums.ImageTypeEnum;
|
||||
import com.dite.znpt.enums.ShootingMethodEnum;
|
||||
import com.dite.znpt.enums.WeatherEnum;
|
||||
import com.dite.znpt.domain.entity.PartEntity;
|
||||
import com.dite.znpt.domain.vo.*;
|
||||
import com.dite.znpt.enums.*;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.mapper.ImageMapper;
|
||||
import com.dite.znpt.service.ImageCollectService;
|
||||
import com.dite.znpt.service.ImageService;
|
||||
import com.dite.znpt.service.PartService;
|
||||
import com.dite.znpt.util.EXIFUtil;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import lombok.Getter;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -28,14 +26,19 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
|
@ -48,9 +51,14 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
|||
@Resource
|
||||
private ImageCollectService imageCollectService;
|
||||
|
||||
@Resource
|
||||
private PartService partService;
|
||||
|
||||
@Value("${upload.temp-path}")
|
||||
private String tempPath;
|
||||
|
||||
@Value("${upload.perm-path}")
|
||||
private String permPath;
|
||||
@Override
|
||||
public List<ImageListResp> list(ImageListReq req) {
|
||||
List<ImageListResp> partList= this.baseMapper.queryImageList(req);
|
||||
|
@ -68,22 +76,54 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
|||
return this.list(req);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ImageEntity> batchSaveByImageSimpleReq(List<ImageSimpleReq> list){
|
||||
List<ImageEntity> imageList = new ArrayList<>();
|
||||
List<String> partIds = list.stream().map(ImageSimpleReq::getPartId).collect(Collectors.toList());
|
||||
Map<String, PartEntity> partIdMap= partService.listByIds(partIds).stream().collect(Collectors.toMap(PartEntity::getPartId, Function.identity()));
|
||||
list.stream().forEach(req -> {
|
||||
if(partIdMap.containsKey(req.getPartId())){
|
||||
String path_prefix = permPath.concat(StrUtil.BACKSLASH).concat(req.getImageSource()).concat(StrUtil.BACKSLASH).concat(req.getPartId()).concat(StrUtil.BACKSLASH);
|
||||
String temp_path_prefix = tempPath.concat(StrUtil.BACKSLASH).concat(req.getImageSource()).concat(StrUtil.BACKSLASH).concat(req.getPartId()).concat(StrUtil.BACKSLASH);
|
||||
File file = new File(req.getImagePath());
|
||||
if(file.exists() && req.getImagePath().contains(temp_path_prefix)){
|
||||
ImageEntity entity = new ImageEntity();
|
||||
entity.setPartId(req.getPartId());
|
||||
String path = path_prefix + StrUtil.removePrefix(req.getImagePath(), temp_path_prefix);
|
||||
byte[] bytes = FileUtil.readBytes(file);
|
||||
FileUtil.writeBytes(bytes, path);
|
||||
FileUtil.del(file);
|
||||
entity.setImagePath(path);
|
||||
imageList.add(entity);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.saveBatch(imageList);
|
||||
return imageList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageResp detail(String imageId) {
|
||||
ImageResp imageResp = this.baseMapper.detail(imageId);
|
||||
if(null != imageResp && null != imageResp.getImageCollectInfo()){
|
||||
imageResp.getImageCollectInfo().setWeatherLabel(WeatherEnum.getDescByCode(imageResp.getImageCollectInfo().getWeather()));
|
||||
imageResp.getImageCollectInfo().setShootingMethodLabel(ShootingMethodEnum.getDescByCode(imageResp.getImageCollectInfo().getShootingMethodLabel()));
|
||||
}
|
||||
|
||||
return imageResp;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public List<ImageReq> batchUpload(String departId, MultipartFile[] files) {
|
||||
public List<ImageReq> batchUploadDefectImage(String partId, String imageSource, MultipartFile[] files) {
|
||||
if(null == partService.getById(partId)){
|
||||
throw new ServiceException(Message.PART_ID_IS_NOT_EXIST);
|
||||
}
|
||||
if(null == files || files.length == 0){
|
||||
throw new ServiceException(Message.IMAGE_IS_EMPTY);
|
||||
}
|
||||
List<ImageReq> list = new ArrayList<>(files.length);
|
||||
String path_prefix = tempPath.concat(StrUtil.BACKSLASH).concat(departId).concat(StrUtil.BACKSLASH);
|
||||
String path_prefix = tempPath.concat(StrUtil.BACKSLASH).concat(imageSource).concat(StrUtil.BACKSLASH).concat(partId).concat(StrUtil.BACKSLASH);
|
||||
for (MultipartFile file : files) {
|
||||
if (!file.isEmpty()) {
|
||||
try {
|
||||
|
@ -98,6 +138,22 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
|||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String uploadCommonImage(String imageSource, MultipartFile file) throws IOException {
|
||||
if(null == file){
|
||||
throw new ServiceException(Message.IMAGE_IS_EMPTY);
|
||||
}
|
||||
ImageSourceEnum imageSourceEnum = ImageSourceEnum.getByCode(imageSource);
|
||||
if(null == imageSourceEnum || imageSourceEnum.isDefectImage()){
|
||||
throw new ServiceException(Message.IMAGE_SOURCE_I_NOT_EXIST_OR_ILLEGAL);
|
||||
}
|
||||
String dateStr = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
String path_prefix = permPath.concat(StrUtil.BACKSLASH).concat(imageSource).concat(StrUtil.BACKSLASH).concat(dateStr).concat(StrUtil.BACKSLASH);
|
||||
String path = path_prefix + file.getOriginalFilename();
|
||||
FileUtil.writeBytes(file.getBytes(),path);
|
||||
return path;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void delete(String imageId) {
|
||||
|
|
|
@ -1,16 +1,29 @@
|
|||
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.dite.znpt.constant.Message;
|
||||
import com.dite.znpt.converts.Converts;
|
||||
import com.dite.znpt.domain.entity.PartEntity;
|
||||
import com.dite.znpt.domain.entity.ProjectEntity;
|
||||
import com.dite.znpt.domain.entity.TurbineEntity;
|
||||
import com.dite.znpt.domain.vo.PartListReq;
|
||||
import com.dite.znpt.domain.vo.PartListResp;
|
||||
import com.dite.znpt.domain.vo.PartReq;
|
||||
import com.dite.znpt.domain.vo.PartResp;
|
||||
import com.dite.znpt.service.PartService;
|
||||
import com.dite.znpt.enums.PartTypeEnum;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.mapper.PartMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.service.PartService;
|
||||
import com.dite.znpt.service.ProjectService;
|
||||
import com.dite.znpt.service.TurbineService;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -22,22 +35,42 @@ import java.util.List;
|
|||
@RequiredArgsConstructor
|
||||
public class PartServiceImpl extends ServiceImpl<PartMapper, PartEntity> implements PartService {
|
||||
|
||||
@Resource
|
||||
private ProjectService projectService;
|
||||
|
||||
@Resource
|
||||
private TurbineService turbineService;
|
||||
|
||||
/**
|
||||
* 功能描述:查询列表
|
||||
* 功能描述:分页查询列表
|
||||
*
|
||||
* @param partReq 信息
|
||||
* @return {@link List }<{@link PartResp }>
|
||||
* @param req 信息
|
||||
* @return {@link List }<{@link PartListResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Override
|
||||
public List<PartResp> selectList(PartListReq partReq) {
|
||||
public List<PartListResp> page(PartListReq req) {
|
||||
PageUtil.startPage();
|
||||
List<PartResp> partList= this.baseMapper.queryBySelective(partReq);
|
||||
partList.forEach(resp -> {
|
||||
return this.list(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:查询列表
|
||||
*
|
||||
* @param req 信息
|
||||
* @return {@link List }<{@link PartListResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Override
|
||||
public List<PartListResp> list(PartListReq req) {
|
||||
PageUtil.startPage();
|
||||
List<PartListResp> list= this.baseMapper.queryBySelective(req);
|
||||
list.forEach(resp -> {
|
||||
resp.setPartTypeLabel(PartTypeEnum.getDescByCode(resp.getPartType()));
|
||||
});
|
||||
return partList;
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -49,38 +82,55 @@ public class PartServiceImpl extends ServiceImpl<PartMapper, PartEntity> impleme
|
|||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Override
|
||||
public PartResp selectById(String partId) {
|
||||
PartListReq partReq = new PartListReq();
|
||||
partReq.setPartId(partId);
|
||||
|
||||
List<PartResp> list = selectList(partReq);
|
||||
return list.isEmpty() ? CollUtil.getFirst(list) : new PartResp();
|
||||
public PartResp detail(String partId) {
|
||||
PartEntity entity = this.baseMapper.selectById(partId);
|
||||
PartResp resp = Converts.INSTANCE.toPartResp(entity);
|
||||
if(StrUtil.isNotEmpty(resp.getTurbineId())){
|
||||
TurbineEntity turbine = turbineService.getById(resp.getTurbineId());
|
||||
if(null != turbine){
|
||||
resp.setTurbineId(turbine.getTurbineName());
|
||||
if(StrUtil.isNotEmpty(turbine.getProjectId())){
|
||||
ProjectEntity project = projectService.getById(turbine.getProjectId());
|
||||
if(null != project){
|
||||
resp.setProjectName(project.getProjectName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return resp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:新增
|
||||
*
|
||||
* @param part
|
||||
* @param req
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void saveData(PartEntity part) {
|
||||
// todo 校验
|
||||
save(part);
|
||||
public void save(PartReq req) {
|
||||
PartEntity entity = Converts.INSTANCE.toPartEntity(req);
|
||||
this.save(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:更新
|
||||
*
|
||||
* @param part
|
||||
* @param partId
|
||||
* @param req
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void updateData(PartEntity part) {
|
||||
// todo 校验
|
||||
updateById(part);
|
||||
public void update(String partId, PartReq req) {
|
||||
if(null == this.baseMapper.selectById(partId)){
|
||||
throw new ServiceException(Message.PART_ID_IS_NOT_EXIST);
|
||||
}
|
||||
PartEntity entity = Converts.INSTANCE.toPartEntity(req);
|
||||
entity.setPartId(partId);
|
||||
this.updateById(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -90,10 +140,25 @@ public class PartServiceImpl extends ServiceImpl<PartMapper, PartEntity> impleme
|
|||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void deleteById(String partId) {
|
||||
// todo 校验
|
||||
removeById(partId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:删除
|
||||
*
|
||||
* @param turbineIds 机组id
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void deleteByTurbineIds(List<String> turbineIds) {
|
||||
this.baseMapper.delete(Wrappers.<PartEntity>lambdaQuery().in(PartEntity::getTurbineId, turbineIds));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.domain.entity.PersonnelEntity;
|
||||
import com.dite.znpt.domain.vo.PersonnelListReq;
|
||||
import com.dite.znpt.domain.vo.PersonnelResp;
|
||||
import com.dite.znpt.service.PersonnelService;
|
||||
import com.dite.znpt.domain.entity.PersonEntity;
|
||||
import com.dite.znpt.domain.vo.PersonListReq;
|
||||
import com.dite.znpt.domain.vo.PersonResp;
|
||||
import com.dite.znpt.service.PersonService;
|
||||
import com.dite.znpt.mapper.PersonnelMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
|
@ -20,20 +20,20 @@ import java.util.List;
|
|||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class PersonnelServiceImpl extends ServiceImpl<PersonnelMapper, PersonnelEntity> implements PersonnelService {
|
||||
public class PersonServiceImpl extends ServiceImpl<PersonnelMapper, PersonEntity> implements PersonService {
|
||||
|
||||
/**
|
||||
* 功能描述:查询人员信息列表
|
||||
*
|
||||
* @param personnelReq 人员信息信息
|
||||
* @return {@link List }<{@link PersonnelResp }>
|
||||
* @return {@link List }<{@link PersonResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Override
|
||||
public List<PersonnelResp> selectList(PersonnelListReq personnelReq) {
|
||||
public List<PersonResp> selectList(PersonListReq personnelReq) {
|
||||
PageUtil.startPage();
|
||||
List<PersonnelResp> personnelList= this.baseMapper.queryBySelective(personnelReq);
|
||||
List<PersonResp> personnelList= this.baseMapper.queryBySelective(personnelReq);
|
||||
personnelList.forEach(resp -> {
|
||||
|
||||
});
|
||||
|
@ -44,17 +44,17 @@ public class PersonnelServiceImpl extends ServiceImpl<PersonnelMapper, Personnel
|
|||
* 功能描述:查询单条人员信息
|
||||
*
|
||||
* @param personId 人员信息Id
|
||||
* @return {@link PersonnelResp }
|
||||
* @return {@link PersonResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Override
|
||||
public PersonnelResp selectById(String personId) {
|
||||
PersonnelListReq personnelReq = new PersonnelListReq();
|
||||
public PersonResp selectById(String personId) {
|
||||
PersonListReq personnelReq = new PersonListReq();
|
||||
personnelReq.setPersonId(personId);
|
||||
|
||||
List<PersonnelResp> list = selectList(personnelReq);
|
||||
return list.isEmpty() ? CollUtil.getFirst(list) : new PersonnelResp();
|
||||
List<PersonResp> list = selectList(personnelReq);
|
||||
return list.isEmpty() ? CollUtil.getFirst(list) : new PersonResp();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,7 +65,7 @@ public class PersonnelServiceImpl extends ServiceImpl<PersonnelMapper, Personnel
|
|||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Override
|
||||
public void saveData(PersonnelEntity personnel) {
|
||||
public void saveData(PersonEntity personnel) {
|
||||
// todo 校验
|
||||
save(personnel);
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ public class PersonnelServiceImpl extends ServiceImpl<PersonnelMapper, Personnel
|
|||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Override
|
||||
public void updateData(PersonnelEntity personnel) {
|
||||
public void updateData(PersonEntity personnel) {
|
||||
// todo 校验
|
||||
updateById(personnel);
|
||||
}
|
|
@ -1,20 +1,33 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.PersonEntity;
|
||||
import com.dite.znpt.domain.entity.ProjectEntity;
|
||||
import com.dite.znpt.domain.vo.ProjectListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectListResp;
|
||||
import com.dite.znpt.domain.vo.ProjectReq;
|
||||
import com.dite.znpt.domain.vo.ProjectResp;
|
||||
import com.dite.znpt.enums.ProjectStatusEnum;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.service.PersonService;
|
||||
import com.dite.znpt.service.ProjectService;
|
||||
import com.dite.znpt.mapper.ProjectMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
|
@ -25,31 +38,29 @@ import java.util.List;
|
|||
@RequiredArgsConstructor
|
||||
public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectEntity> implements ProjectService {
|
||||
|
||||
@Resource
|
||||
private PersonService personService;
|
||||
/**
|
||||
* 功能描述:查询项目信息列表
|
||||
*
|
||||
* @param projectReq 项目信息信息
|
||||
* @param req 项目信息信息
|
||||
* @return {@link List }<{@link ProjectResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Override
|
||||
public List<ProjectListResp> page(ProjectListReq projectReq) {
|
||||
public List<ProjectListResp> page(ProjectListReq req) {
|
||||
PageUtil.startPage();
|
||||
List<ProjectResp> projectList= this.baseMapper.queryBySelective(projectReq);
|
||||
projectList.forEach(resp -> {
|
||||
|
||||
});
|
||||
return null;
|
||||
return this.list(req);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectListResp> list(ProjectListReq projectReq) {
|
||||
List<ProjectResp> projectList= this.baseMapper.queryBySelective(projectReq);
|
||||
projectList.forEach(resp -> {
|
||||
|
||||
public List<ProjectListResp> list(ProjectListReq req) {
|
||||
List<ProjectListResp> list= this.baseMapper.queryBySelective(req);
|
||||
list.forEach(resp -> {
|
||||
resp.setStatusLabel(ProjectStatusEnum.getDescByCode(resp.getStatus()));
|
||||
});
|
||||
return null;
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -62,8 +73,35 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectEntity
|
|||
**/
|
||||
@Override
|
||||
public ProjectResp detail(String projectId) {
|
||||
|
||||
return null;
|
||||
ProjectEntity entity = this.baseMapper.selectById(projectId);
|
||||
if(entity == null){
|
||||
throw new ServiceException(Message.PROJECT_ID_IS_NOT_EXIST);
|
||||
}
|
||||
ProjectResp resp = Converts.INSTANCE.toProjectResp(entity);
|
||||
resp.setStatusLabel(ProjectStatusEnum.getDescByCode(resp.getStatus()));
|
||||
List<String> personIds = new ArrayList<>();
|
||||
if(StrUtil.isNotEmpty(resp.getAuditorId())){
|
||||
personIds.add(resp.getAuditorId());
|
||||
}
|
||||
if(StrUtil.isNotEmpty(resp.getQualityOfficerId())){
|
||||
personIds.add(resp.getQualityOfficerId());
|
||||
}
|
||||
if(StrUtil.isNotEmpty(resp.getConstructionTeamLeaderId())){
|
||||
personIds.add(resp.getConstructionTeamLeaderId());
|
||||
}
|
||||
if(StrUtil.isNotEmpty(resp.getProjectManagerId())){
|
||||
personIds.add(resp.getProjectManagerId());
|
||||
}
|
||||
if(CollUtil.isNotEmpty(personIds)){
|
||||
Map<String, PersonEntity> personIdMap = personService.listByIds(personIds).stream().collect(Collectors.toMap(k->k.getPersonId(), Function.identity()));
|
||||
if(CollUtil.isNotEmpty(personIdMap)){
|
||||
resp.setAuditorName(personIdMap.containsKey(resp.getAuditorId()) ? personIdMap.get(resp.getAuditorId()).getName() : null);
|
||||
resp.setProjectManagerName(personIdMap.containsKey(resp.getProjectManagerId()) ? personIdMap.get(resp.getProjectManagerId()).getName() : null);
|
||||
resp.setConstructionTeamLeaderName(personIdMap.containsKey(resp.getConstructionTeamLeaderId()) ? personIdMap.get(resp.getConstructionTeamLeaderId()).getName() : null);
|
||||
resp.setQualityOfficerName(personIdMap.containsKey(resp.getQualityOfficerId()) ? personIdMap.get(resp.getQualityOfficerId()).getName() : null);
|
||||
}
|
||||
}
|
||||
return resp;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,8 +114,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectEntity
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void save(ProjectReq req) {
|
||||
// todo 校验
|
||||
|
||||
ProjectEntity entity = Converts.INSTANCE.toProjectEntity(req);
|
||||
this.save(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -91,8 +129,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectEntity
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void update(String projectId, ProjectReq req) {
|
||||
// todo 校验
|
||||
|
||||
if(null == this.baseMapper.selectById(projectId)){
|
||||
throw new ServiceException(Message.PROJECT_ID_IS_NOT_EXIST);
|
||||
}
|
||||
ProjectEntity entity = Converts.INSTANCE.toProjectEntity(req);
|
||||
entity.setProjectId(projectId);
|
||||
this.updateById(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -105,7 +147,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectEntity
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void deleteById(String projectId) {
|
||||
// todo 校验
|
||||
removeById(projectId);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,17 +1,27 @@
|
|||
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.dite.znpt.constant.Message;
|
||||
import com.dite.znpt.converts.Converts;
|
||||
import com.dite.znpt.domain.entity.ProjectEntity;
|
||||
import com.dite.znpt.domain.entity.TurbineEntity;
|
||||
import com.dite.znpt.domain.vo.TurbineListReq;
|
||||
import com.dite.znpt.domain.vo.TurbineResp;
|
||||
import com.dite.znpt.service.TurbineService;
|
||||
import com.dite.znpt.domain.vo.*;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.mapper.TurbineMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.service.PartService;
|
||||
import com.dite.znpt.service.ProjectService;
|
||||
import com.dite.znpt.service.TurbineService;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
|
@ -22,78 +32,147 @@ import java.util.List;
|
|||
@RequiredArgsConstructor
|
||||
public class TurbineServiceImpl extends ServiceImpl<TurbineMapper, TurbineEntity> implements TurbineService {
|
||||
|
||||
@Resource
|
||||
private ProjectService projectService;
|
||||
|
||||
@Resource
|
||||
private PartService partService;
|
||||
|
||||
/**
|
||||
* 功能描述:查询机组-项目关联列表
|
||||
* 功能描述:分页查询机组列表
|
||||
*
|
||||
* @param turbineReq 机组-项目关联信息
|
||||
* @return {@link List }<{@link TurbineResp }>
|
||||
* @param req
|
||||
* @return {@link List }<{@link TurbineListResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Override
|
||||
public List<TurbineResp> selectList(TurbineListReq turbineReq) {
|
||||
public List<TurbineListResp> page(TurbineListReq req) {
|
||||
PageUtil.startPage();
|
||||
List<TurbineResp> turbineList= this.baseMapper.queryBySelective(turbineReq);
|
||||
turbineList.forEach(resp -> {
|
||||
|
||||
});
|
||||
return turbineList;
|
||||
return this.list(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条机组-项目关联
|
||||
* 功能描述:查询机组列表
|
||||
*
|
||||
* @param turbineId 机组-项目关联Id
|
||||
* @param req
|
||||
* @return {@link List }<{@link TurbineEntity }>
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Override
|
||||
public List<TurbineListResp> list(TurbineListReq req) {
|
||||
List<TurbineListResp> list= this.baseMapper.queryBySelective(req);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:查询机组明细列表
|
||||
*
|
||||
* @param req
|
||||
* @return {@link List }<{@link TurbineInfoResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Override
|
||||
public List<TurbineInfoResp> listInfo(TurbineListReq req) {
|
||||
List<TurbineInfoResp> list= this.baseMapper.listTurbineInfo(req);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条机组
|
||||
*
|
||||
* @param turbineId 机组Id
|
||||
* @return {@link TurbineResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Override
|
||||
public TurbineResp selectById(String turbineId) {
|
||||
TurbineListReq turbineReq = new TurbineListReq();
|
||||
turbineReq.setTurbineId(turbineId);
|
||||
|
||||
List<TurbineResp> list = selectList(turbineReq);
|
||||
return list.isEmpty() ? CollUtil.getFirst(list) : new TurbineResp();
|
||||
public TurbineResp detail(String turbineId) {
|
||||
TurbineEntity entity = this.baseMapper.selectById(turbineId);
|
||||
TurbineResp resp = Converts.INSTANCE.toTurbineResp(entity);
|
||||
if(null != resp && StrUtil.isNotEmpty(resp.getProjectId())){
|
||||
ProjectEntity project = projectService.getById(resp.getProjectId());
|
||||
resp.setProjectName(project.getProjectName());
|
||||
}
|
||||
return resp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:新增机组-项目关联
|
||||
* 功能描述:查询指定机组明细内信息
|
||||
*
|
||||
* @param turbine 机组-项目关联
|
||||
* @param turbineId 机组Id
|
||||
* @return {@link TurbineListResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Override
|
||||
public void saveData(TurbineEntity turbine) {
|
||||
// todo 校验
|
||||
save(turbine);
|
||||
public TurbineInfoResp info(String turbineId) {
|
||||
return this.baseMapper.getTurbineInfo(turbineId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:更新机组-项目关联
|
||||
* 功能描述:新增机组
|
||||
*
|
||||
* @param turbine 机组-项目关联
|
||||
* @param req
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void updateData(TurbineEntity turbine) {
|
||||
// todo 校验
|
||||
updateById(turbine);
|
||||
public void save(TurbineReq req) {
|
||||
TurbineEntity entity = Converts.INSTANCE.toTurbineEntity(req);
|
||||
this.save(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:删除机组-项目关联
|
||||
* 功能描述:更新机组
|
||||
*
|
||||
* @param turbineId
|
||||
* @param req
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void update(String turbineId, TurbineReq req) {
|
||||
if(null == this.baseMapper.selectById(turbineId)){
|
||||
throw new ServiceException(Message.TURBINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
TurbineEntity entity = Converts.INSTANCE.toTurbineEntity(req);
|
||||
entity.setTurbineId(turbineId);
|
||||
this.updateById(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:删除机组
|
||||
*
|
||||
* @param turbineId 机组-项目关联Id
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void deleteById(String turbineId) {
|
||||
// todo 校验
|
||||
removeById(turbineId);
|
||||
partService.deleteByTurbineIds(Arrays.asList(turbineId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:删除机组
|
||||
*
|
||||
* @param projectId 项目id
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
**/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void deleteByProjectId(String projectId) {
|
||||
List<TurbineEntity> turbineList = this.baseMapper.selectList(Wrappers.<TurbineEntity>lambdaQuery().eq(TurbineEntity::getProjectId, projectId));
|
||||
List<String> turbineIds = turbineList.stream().map(TurbineEntity::getTurbineId).collect(Collectors.toList());
|
||||
this.baseMapper.deleteByIds(turbineIds);
|
||||
partService.deleteByTurbineIds(turbineIds);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
|
||||
<select id="queryImageList" resultType="com.dite.znpt.domain.vo.ImageListResp">
|
||||
SELECT
|
||||
i.image_id, i.image_name, ic.part_id, p.part_name, i.image_resolution, i.focal_distance, i.shooting_time, i.camera_manufacturer,
|
||||
i.image_id, i.image_name, i.part_id, p.part_name, i.image_resolution, i.focal_distance, i.shooting_time, i.camera_manufacturer,
|
||||
i.camera_model, i.GPS, ic.weather, ic.humidness, CONCAT(ic.temperature_min, '℃', '~',temperature_max, '℃') AS temperature, ic.wind_level,
|
||||
ic.shooting_method, ic.shooting_distance,ic.collector_name, i.image_type
|
||||
FROM image i
|
||||
LEFT JOIN image_collect ic ON i.collect_id = ic.collect_id
|
||||
LEFT JOIN part p ON ic.part_id = p.part_id
|
||||
LEFT JOIN part p ON i.part_id = p.part_id
|
||||
<where>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND i.image_name LIKE concat('%', #{keyword}, '%')
|
||||
|
|
|
@ -2,46 +2,31 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.dite.znpt.mapper.PartMapper">
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
a.part_id, a.project_id, a.turbine_id, a.part_name,
|
||||
a.part_code, a.part_type, a.part_desc, a.manufacturer,
|
||||
a.model
|
||||
</sql>
|
||||
|
||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.PartResp">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from part a
|
||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.PartListResp">
|
||||
SELECT
|
||||
pa.part_id, t.project_id, pr.project_name, t.turbine_id, t.turbine_name, pa.part_name, pa.part_code, pa.part_type, pa.part_desc
|
||||
FROM part pa
|
||||
LEFT JOIN turbine t ON pa.turbine_id = t.turbine_id
|
||||
LEFT JOIN project pr ON t.project_id = pr.project_id
|
||||
<where>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
# and (a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%') or a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%'))
|
||||
</if>
|
||||
<if test="partId != null and partId != ''">
|
||||
and a.part_id like concat ('%', #{partId}, '%')
|
||||
# and (pa.part_name like concat('%', #{keyword,jdbcType=VARCHAR}, '%') or pa.part_code like concat('%', #{keyword,jdbcType=VARCHAR}, '%'))
|
||||
</if>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
and a.project_id like concat ('%', #{projectId}, '%')
|
||||
and t.project_id = #{projectId}
|
||||
</if>
|
||||
<if test="turbineId != null and turbineId != ''">
|
||||
and a.turbine_id like concat ('%', #{turbineId}, '%')
|
||||
</if>
|
||||
<if test="partName != null and partName != ''">
|
||||
and a.part_name like concat ('%', #{partName}, '%')
|
||||
</if>
|
||||
<if test="partCode != null and partCode != ''">
|
||||
and a.part_code like concat ('%', #{partCode}, '%')
|
||||
and t.turbine_id = #{turbineId}
|
||||
</if>
|
||||
<if test="partType != null and partType != ''">
|
||||
and a.part_type like concat ('%', #{partType}, '%')
|
||||
and a.part_type = #{partType}
|
||||
</if>
|
||||
<if test="partDesc != null and partDesc != ''">
|
||||
and a.part_desc like concat ('%', #{partDesc}, '%')
|
||||
<if test="partManufacturer != null and partManufacturer != ''">
|
||||
and a.part_manufacturer like concat ('%', #{partManufacturer}, '%')
|
||||
</if>
|
||||
<if test="manufacturer != null and manufacturer != ''">
|
||||
and a.manufacturer like concat ('%', #{manufacturer}, '%')
|
||||
</if>
|
||||
<if test="model != null and model != ''">
|
||||
and a.model like concat ('%', #{model}, '%')
|
||||
<if test="partModel != null and partModel != ''">
|
||||
and a.part_model like concat ('%', #{partModel}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
a.password, a.status
|
||||
</sql>
|
||||
|
||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.PersonnelResp">
|
||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.PersonResp">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from personnel a
|
||||
|
|
|
@ -2,42 +2,32 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.dite.znpt.mapper.ProjectMapper">
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
a.project_id, a.project_name, a.farm_name, a.farm_address,
|
||||
a.method_id, a.scale, a.turbine_model, a.status
|
||||
</sql>
|
||||
|
||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.ProjectResp">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from project a
|
||||
|
||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.ProjectListResp">
|
||||
SELECT
|
||||
prj.project_id, prj.project_name, prj.farm_name, prj.status, prj.cover_url, prj.farm_address, prj.client, prj.client_contact, prj.client_phone, prj.inspection_unit,
|
||||
prj.inspection_contact, prj.inspection_phone, prj.scale, prj.turbine_model, prj.project_manager_id, pm.name AS project_manager_name, prj.construction_person_id, prj.construction_person_name , prj.create_time
|
||||
FROM project prj
|
||||
LEFT JOIN person pm ON pm.person_id = prj.project_manager_id
|
||||
<where>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
# and (a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%') or a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%'))
|
||||
</if>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
and a.project_id like concat ('%', #{projectId}, '%')
|
||||
</if>
|
||||
<if test="projectName != null and projectName != ''">
|
||||
and a.project_name like concat ('%', #{projectName}, '%')
|
||||
AND prj.project_name LIKE concat ('%', #{projectName}, '%')
|
||||
</if>
|
||||
<if test="farmName != null and farmName != ''">
|
||||
and a.farm_name like concat ('%', #{farmName}, '%')
|
||||
AND prj.farm_name LIKE concat ('%', #{farmName}, '%')
|
||||
</if>
|
||||
<if test="farmAddress != null and farmAddress != ''">
|
||||
and a.farm_address like concat ('%', #{farmAddress}, '%')
|
||||
AND prj.farm_address LIKE concat ('%', #{farmAddress}, '%')
|
||||
</if>
|
||||
<if test="methodId != null and methodId != ''">
|
||||
and a.method_id like concat ('%', #{methodId}, '%')
|
||||
</if>
|
||||
<if test="scale != null and scale != ''">
|
||||
and a.scale like concat ('%', #{scale}, '%')
|
||||
</if>
|
||||
<if test="turbineModel != null and turbineModel != ''">
|
||||
and a.turbine_model like concat ('%', #{turbineModel}, '%')
|
||||
<if test="client != null and client != ''">
|
||||
AND prj.client LIKE concat ('%', #{client}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
and a.status like concat ('%', #{status}, '%')
|
||||
AND prj.status = #{status}
|
||||
</if>
|
||||
<if test="createDateBegin != null and createDateBegin !='' and createDateEnd != null and createDateEnd != '' ">
|
||||
AND prj.create_time BETWEEN #{createDateBegin} AND #{createDateEnd}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
|
|
@ -2,38 +2,89 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.dite.znpt.mapper.TurbineMapper">
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
a.turbine_id, a.project_id, a.turbine_name, a.turbine_desc,
|
||||
a.manufacturer, a.model
|
||||
</sql>
|
||||
|
||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.TurbineResp">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from turbine a
|
||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.TurbineListResp">
|
||||
SELECT
|
||||
t.turbine_id, t.project_id, p.project_name, t.turbine_name, t.turbine_code, t.turbine_desc, t.turbine_manufacturer, t.turbine_model, t.turbine_cover_url
|
||||
FROM turbine t
|
||||
LEFT JOIN project p ON t.project_id = p.project_id
|
||||
<where>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
# and (a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%') or a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%'))
|
||||
</if>
|
||||
<if test="turbineId != null and turbineId != ''">
|
||||
and a.turbine_id like concat ('%', #{turbineId}, '%')
|
||||
and (t.turbine_name like concat('%', #{keyword,jdbcType=VARCHAR}, '%') or t.turbine_code like concat('%', #{keyword,jdbcType=VARCHAR}, '%'))
|
||||
</if>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
and a.project_id like concat ('%', #{projectId}, '%')
|
||||
</if>
|
||||
<if test="turbineName != null and turbineName != ''">
|
||||
and a.turbine_name like concat ('%', #{turbineName}, '%')
|
||||
and t.project_id = #{projectId}
|
||||
</if>
|
||||
<if test="turbineDesc != null and turbineDesc != ''">
|
||||
and a.turbine_desc like concat ('%', #{turbineDesc}, '%')
|
||||
and t.turbine_desc like concat ('%', #{turbineDesc}, '%')
|
||||
</if>
|
||||
<if test="manufacturer != null and manufacturer != ''">
|
||||
and a.manufacturer like concat ('%', #{manufacturer}, '%')
|
||||
and t.turbine_manufacturer like concat ('%', #{manufacturer}, '%')
|
||||
</if>
|
||||
<if test="model != null and model != ''">
|
||||
and a.model like concat ('%', #{model}, '%')
|
||||
and t.turbine_model like concat ('%', #{model}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<resultMap id="turbineInfoMap" type="com.dite.znpt.domain.vo.TurbineInfoResp">
|
||||
<id property="turbineId" column="turbine_id"></id>
|
||||
<result property="projectId" column="project_id"></result>
|
||||
<result property="projectName" column="project_name"></result>
|
||||
<result property="turbineName" column="turbine_name"></result>
|
||||
<result property="turbineCode" column="turbine_code"></result>
|
||||
<result property="turbineDesc" column="turbine_desc"></result>
|
||||
<result property="turbineManufacturer" column="turbine_manufacturer"></result>
|
||||
<result property="turbineModel" column="turbine_model"></result>
|
||||
<result property="turbineCoverUrl" column="turbine_coverUrl"></result>
|
||||
<collection property="partRespList" ofType="com.dite.znpt.domain.vo.PartResp">
|
||||
<id property="partId" column="part_id"></id>
|
||||
<result property="projectId" column="project_id"></result>
|
||||
<result property="projectName" column="project_name"></result>
|
||||
<result property="turbineId" column="turbine_id"></result>
|
||||
<result property="turbineName" column="turbine_name"></result>
|
||||
<result property="partName" column="part_name"></result>
|
||||
<result property="partCode" column="part_code"></result>
|
||||
<result property="partType" column="part_type"></result>
|
||||
<result property="partDesc" column="part_desc"></result>
|
||||
<result property="partManufacturer" column="part_manufacturer"></result>
|
||||
<result property="partModel" column="part_model"></result>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<select id="listTurbineInfo" resultMap="turbineInfoMap">
|
||||
SELECT
|
||||
t.turbine_id, t.project_id, pr.project_name, t.turbine_name, t.turbine_code, t.turbine_desc, t.turbine_manufacturer, t.turbine_model, t.turbine_cover_url,
|
||||
pa.part_id, pa.part_name, pa.part_code, pa.part_type, pa.part_desc, pa.part_manufacturer, pa.part_model
|
||||
FROM turbine t
|
||||
LEFT JOIN project pr ON t.project_id = pr.project_id
|
||||
LEFT JOIN part pa ON t.turbine_id = pa.turbine_id
|
||||
<where>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
and (t.turbine_name like concat('%', #{keyword,jdbcType=VARCHAR}, '%') or t.turbine_code like concat('%', #{keyword,jdbcType=VARCHAR}, '%'))
|
||||
</if>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
and t.project_id = #{projectId}
|
||||
</if>
|
||||
<if test="turbineDesc != null and turbineDesc != ''">
|
||||
and t.turbine_desc like concat ('%', #{turbineDesc}, '%')
|
||||
</if>
|
||||
<if test="turbineManufacturer != null and turbineManufacturer != ''">
|
||||
and t.turbine_manufacturer like concat ('%', #{manufacturer}, '%')
|
||||
</if>
|
||||
<if test="turbineModel != null and turbineModel != ''">
|
||||
and t.turbine_model like concat ('%', #{model}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getTurbineInfo" resultMap="turbineInfoMap">
|
||||
SELECT
|
||||
t.turbine_id, t.project_id, pr.project_name, t.turbine_name, t.turbine_code, t.turbine_desc, t.turbine_manufacturer, t.turbine_model, t.turbine_cover_url,
|
||||
pa.part_id, pa.part_name, pa.part_code, pa.part_type, pa.part_desc, pa.part_manufacturer, pa.part_model
|
||||
FROM turbine t
|
||||
LEFT JOIN project pr ON t.project_id = pr.project_id
|
||||
LEFT JOIN part pa ON t.turbine_id = pa.turbine_id
|
||||
WHERE t.turbine_id = #{turbineId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
@ -2,12 +2,14 @@ package com.dite.znpt.web.controller;
|
|||
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.enums.*;
|
||||
import com.dite.znpt.service.ImageService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
|
@ -19,6 +21,9 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
@RequestMapping("/common")
|
||||
public class CommonController {
|
||||
|
||||
@Resource
|
||||
private ImageService imageService;
|
||||
|
||||
@ApiOperation(value = "查询缺陷级别", httpMethod = "GET")
|
||||
@GetMapping("/list/defect-level")
|
||||
public Result listDefectLevel(){
|
||||
|
@ -76,4 +81,14 @@ public class CommonController {
|
|||
public Result listWeather(){
|
||||
return Result.ok(WeatherEnum.listAll());
|
||||
}
|
||||
@ApiOperation(value = "查询通用图片来源", httpMethod = "GET")
|
||||
@GetMapping("/list/common-image-source")
|
||||
public Result listCommonImageSource(){
|
||||
return Result.ok(ImageSourceEnum.list(Boolean.FALSE));
|
||||
}
|
||||
@ApiOperation(value = "上传图片", httpMethod = "POST")
|
||||
@PostMapping("/upload-image/{imageSource}")
|
||||
public Result uploadImage(@PathVariable String imageSource, MultipartFile file) throws IOException {
|
||||
return Result.ok(imageService.uploadCommonImage(imageSource, file));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,13 +33,13 @@ public class DefectController {
|
|||
|
||||
@ApiOperation(value = "分页查询缺陷记录列表", httpMethod = "GET")
|
||||
@GetMapping("/page")
|
||||
public PageResult<DefectResp> page(@RequestBody DefectListReq req) {
|
||||
public PageResult<DefectResp> page(DefectListReq req) {
|
||||
return PageResult.ok(defectService.page(req));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询缺陷记录列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result<List<DefectResp>> list(@RequestBody DefectListReq req) {
|
||||
public Result<List<DefectResp>> list(DefectListReq req) {
|
||||
return Result.ok(defectService.list(req));
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ package com.dite.znpt.web.controller;
|
|||
import com.dite.znpt.domain.PageResult;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.vo.*;
|
||||
import com.dite.znpt.enums.ImageSourceEnum;
|
||||
import com.dite.znpt.service.ImageCollectService;
|
||||
import com.dite.znpt.service.ImageService;
|
||||
import io.swagger.annotations.Api;
|
||||
|
@ -32,13 +33,13 @@ public class ImageController {
|
|||
|
||||
@ApiOperation(value = "分页查询图像列表", httpMethod = "GET")
|
||||
@GetMapping("/page")
|
||||
public PageResult<ImageListResp> page(@RequestBody ImageListReq req) {
|
||||
public PageResult<ImageListResp> page(ImageListReq req) {
|
||||
return PageResult.ok(imageService.page(req));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询图像列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result<List<ImageListResp>> list(@RequestBody ImageListReq req){
|
||||
public Result<List<ImageListResp>> list(ImageListReq req){
|
||||
return Result.ok(imageService.list(req));
|
||||
}
|
||||
|
||||
|
@ -49,15 +50,22 @@ public class ImageController {
|
|||
}
|
||||
|
||||
@ApiOperation(value = "批量上传图像", httpMethod = "POST")
|
||||
@PostMapping("/upload-batch/{departId}")
|
||||
public Result<List<ImageReq>> uploadBatch(@PathVariable String departId, @RequestParam("files") MultipartFile[] files) {
|
||||
return Result.ok(imageService.batchUpload(departId, files));
|
||||
@PostMapping("/upload-batch/{partId}")
|
||||
public Result<List<ImageReq>> uploadBatch(@PathVariable String partId, @RequestParam("files") MultipartFile[] files) {
|
||||
return Result.ok(imageService.batchUploadDefectImage(partId, ImageSourceEnum.COLLECT.getCode(), files));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "外部工作上传图像", httpMethod = "POST")
|
||||
@PostMapping("/out-work/upload/{partId}")
|
||||
public Result<String> uploadOutWork( @PathVariable String partId, @RequestParam("file") MultipartFile file) {
|
||||
MultipartFile[] files = {file};
|
||||
return Result.ok(imageService.batchUploadDefectImage(partId, ImageSourceEnum.OUT_WORK.getCode(), files).get(0).getImagePath());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "设置信息", httpMethod = "POST")
|
||||
@PostMapping("/setting-info/{departId}")
|
||||
public Result save(@PathVariable String departId, @RequestBody ImageCollectReq req) {
|
||||
imageCollectService.save(departId, req);
|
||||
@PostMapping("/setting-info/{partId}")
|
||||
public Result save(@PathVariable String partId, @RequestBody ImageCollectReq req) {
|
||||
imageCollectService.save(partId, req);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.dite.znpt.web.controller;
|
|||
|
||||
import com.dite.znpt.domain.Constants;
|
||||
import com.dite.znpt.domain.vo.PartListReq;
|
||||
import com.dite.znpt.domain.vo.PartListResp;
|
||||
import com.dite.znpt.domain.vo.PartReq;
|
||||
import com.dite.znpt.domain.vo.PartResp;
|
||||
import com.dite.znpt.domain.entity.PartEntity;
|
||||
import com.dite.znpt.service.PartService;
|
||||
|
@ -30,29 +32,35 @@ public class PartController {
|
|||
@Resource
|
||||
private PartService partService;
|
||||
|
||||
@ApiOperation(value = "获取列表", httpMethod = "GET")
|
||||
@ApiOperation(value = "分页获取部件列表", httpMethod = "GET")
|
||||
@GetMapping("/page")
|
||||
public PageResult<PartListResp> page(PartListReq partReq) {
|
||||
return PageResult.ok(partService.page(partReq));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取部件列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public PageResult<PartResp> list(PartListReq partReq) {
|
||||
return PageResult.ok(partService.selectList(partReq));
|
||||
public Result<List<PartListResp>> list(PartListReq partReq) {
|
||||
return Result.ok(partService.list(partReq));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据Id获取详细信息", httpMethod = "GET")
|
||||
@GetMapping("/{partId}")
|
||||
public Result<PartResp> getInfo(@PathVariable String partId) {
|
||||
return Result.ok(partService.selectById(partId));
|
||||
@GetMapping("/detail/{partId}")
|
||||
public Result<PartResp> detail(@PathVariable String partId) {
|
||||
return Result.ok(partService.detail(partId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增", httpMethod = "POST")
|
||||
@PostMapping
|
||||
public Result<Object> add(@RequestBody PartEntity part) {
|
||||
partService.saveData(part);
|
||||
public Result<Object> add(@RequestBody PartReq req) {
|
||||
partService.save(req);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改", httpMethod = "PUT")
|
||||
@PutMapping
|
||||
public Result<Object> edit(@RequestBody PartEntity part) {
|
||||
partService.updateData(part);
|
||||
@PutMapping("/{partId}")
|
||||
public Result<Object> edit(@PathVariable String partId, @RequestBody PartReq req) {
|
||||
partService.update(partId, req);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
@ -63,14 +71,14 @@ public class PartController {
|
|||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导出", httpMethod = "GET")
|
||||
@ApiOperation(value = "导出部件-需求待明确", httpMethod = "GET")
|
||||
@GetMapping("/export")
|
||||
@ResponseExcel(name = "")
|
||||
public List<PartResp> export(PartListReq partReq) {
|
||||
return partService.selectList(partReq);
|
||||
@ResponseExcel(name = "部件")
|
||||
public List<PartListResp> export(PartListReq partReq) {
|
||||
return partService.list(partReq);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导入", httpMethod = "POST")
|
||||
@ApiOperation(value = "导入部件-需求待明确", httpMethod = "POST")
|
||||
@PostMapping("/import")
|
||||
public Result<Object> importData(@RequestExcel List<PartEntity> dataList, BindingResult bindingResult) {
|
||||
// JSR 303 校验通用校验获取失败的数据
|
||||
|
|
|
@ -2,10 +2,10 @@ package com.dite.znpt.web.controller;
|
|||
|
||||
|
||||
import com.dite.znpt.domain.Constants;
|
||||
import com.dite.znpt.domain.vo.PersonnelListReq;
|
||||
import com.dite.znpt.domain.vo.PersonnelResp;
|
||||
import com.dite.znpt.domain.entity.PersonnelEntity;
|
||||
import com.dite.znpt.service.PersonnelService;
|
||||
import com.dite.znpt.domain.vo.PersonListReq;
|
||||
import com.dite.znpt.domain.vo.PersonResp;
|
||||
import com.dite.znpt.domain.entity.PersonEntity;
|
||||
import com.dite.znpt.service.PersonService;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.PageResult;
|
||||
import com.pig4cloud.plugin.excel.annotation.RequestExcel;
|
||||
|
@ -25,54 +25,54 @@ import java.util.List;
|
|||
*/
|
||||
@Api(tags = "人员信息")
|
||||
@RestController
|
||||
@RequestMapping("/personnel")
|
||||
public class PersonnelController {
|
||||
@RequestMapping("/person")
|
||||
public class PersonController {
|
||||
@Resource
|
||||
private PersonnelService personnelService;
|
||||
private PersonService personService;
|
||||
|
||||
@ApiOperation(value = "获取人员信息列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public PageResult<PersonnelResp> list(PersonnelListReq personnelReq) {
|
||||
return PageResult.ok(personnelService.selectList(personnelReq));
|
||||
public PageResult<PersonResp> list(PersonListReq personnelReq) {
|
||||
return PageResult.ok(personService.selectList(personnelReq));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据人员信息Id获取详细信息", httpMethod = "GET")
|
||||
@GetMapping("/{personId}")
|
||||
public Result<PersonnelResp> getInfo(@PathVariable String personId) {
|
||||
return Result.ok(personnelService.selectById(personId));
|
||||
public Result<PersonResp> getInfo(@PathVariable String personId) {
|
||||
return Result.ok(personService.selectById(personId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增人员信息", httpMethod = "POST")
|
||||
@PostMapping
|
||||
public Result<Object> add(@RequestBody PersonnelEntity personnel) {
|
||||
personnelService.saveData(personnel);
|
||||
public Result<Object> add(@RequestBody PersonEntity personnel) {
|
||||
personService.saveData(personnel);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改人员信息", httpMethod = "PUT")
|
||||
@PutMapping
|
||||
public Result<Object> edit(@RequestBody PersonnelEntity personnel) {
|
||||
personnelService.updateData(personnel);
|
||||
public Result<Object> edit(@RequestBody PersonEntity personnel) {
|
||||
personService.updateData(personnel);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除人员信息", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{personId}")
|
||||
public Result<Object> remove(@PathVariable String personId) {
|
||||
personnelService.deleteById(personId);
|
||||
personService.deleteById(personId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导出人员信息", httpMethod = "GET")
|
||||
@GetMapping("/export")
|
||||
@ResponseExcel(name = "人员信息")
|
||||
public List<PersonnelResp> export(PersonnelListReq personnelReq) {
|
||||
return personnelService.selectList(personnelReq);
|
||||
public List<PersonResp> export(PersonListReq personnelReq) {
|
||||
return personService.selectList(personnelReq);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导入人员信息", httpMethod = "POST")
|
||||
@PostMapping("/import")
|
||||
public Result<Object> importData(@RequestExcel List<PersonnelEntity> dataList, BindingResult bindingResult) {
|
||||
public Result<Object> importData(@RequestExcel List<PersonEntity> dataList, BindingResult bindingResult) {
|
||||
// JSR 303 校验通用校验获取失败的数据
|
||||
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
|
||||
if (errorMessageList != null && !errorMessageList.isEmpty()) {
|
|
@ -32,12 +32,18 @@ public class ProjectController {
|
|||
@Resource
|
||||
private ProjectService projectService;
|
||||
|
||||
@ApiOperation(value = "获取项目信息列表", httpMethod = "GET")
|
||||
@ApiOperation(value = "分页查询项目信息列表", httpMethod = "GET")
|
||||
@GetMapping("/page")
|
||||
public PageResult<ProjectListResp> page(@RequestBody ProjectListReq req) {
|
||||
public PageResult<ProjectListResp> page(ProjectListReq req) {
|
||||
return PageResult.ok(projectService.page(req));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询项目信息列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result<List<ProjectListResp>> list(ProjectListReq req) {
|
||||
return Result.ok(projectService.list(req));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询项目信息详细信息", httpMethod = "GET")
|
||||
@GetMapping("/detail/{projectId}")
|
||||
public Result<ProjectResp> detail(@PathVariable String projectId) {
|
||||
|
@ -65,14 +71,14 @@ public class ProjectController {
|
|||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导出项目信息", httpMethod = "GET")
|
||||
@ApiOperation(value = "导出项目信息-需求待明确", httpMethod = "GET")
|
||||
@GetMapping("/export")
|
||||
@ResponseExcel(name = "项目信息")
|
||||
public List<ProjectResp> export(ProjectListReq req) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导入项目信息", httpMethod = "POST")
|
||||
@ApiOperation(value = "导入项目信息-需求待明确", httpMethod = "POST")
|
||||
@PostMapping("/import")
|
||||
public Result<Object> importData(@RequestExcel List<ProjectEntity> dataList, BindingResult bindingResult) {
|
||||
// JSR 303 校验通用校验获取失败的数据
|
||||
|
|
|
@ -2,10 +2,8 @@ package com.dite.znpt.web.controller;
|
|||
|
||||
|
||||
import com.dite.znpt.domain.Constants;
|
||||
import com.dite.znpt.domain.vo.TurbineListReq;
|
||||
import com.dite.znpt.domain.vo.TurbineResp;
|
||||
import com.dite.znpt.domain.vo.*;
|
||||
import com.dite.znpt.domain.entity.TurbineEntity;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.service.TurbineService;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.PageResult;
|
||||
|
@ -18,61 +16,78 @@ import org.springframework.validation.BindingResult;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/11 23:17
|
||||
*/
|
||||
@Api(tags = "机组-项目关联")
|
||||
@Api(tags = "机组信息")
|
||||
@RestController
|
||||
@RequestMapping("/turbine")
|
||||
public class TurbineController {
|
||||
@Resource
|
||||
private TurbineService turbineService;
|
||||
|
||||
@ApiOperation(value = "获取机组-项目关联列表", httpMethod = "GET")
|
||||
@GetMapping({"/list", "/getByProjectId"})
|
||||
public PageResult<TurbineResp> list(TurbineListReq turbineReq) {
|
||||
return PageResult.ok(turbineService.selectList(turbineReq));
|
||||
@ApiOperation(value = "分页查询机组列表", httpMethod = "GET")
|
||||
@GetMapping("/page")
|
||||
public PageResult<TurbineListResp> page(TurbineListReq req) {
|
||||
return PageResult.ok(turbineService.page(req));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据机组-项目关联Id获取详细信息", httpMethod = "GET")
|
||||
@GetMapping("/{turbineCode}")
|
||||
public Result<TurbineResp> getInfo(@PathVariable String turbineCode) {
|
||||
return Result.ok(turbineService.selectById(turbineCode));
|
||||
@ApiOperation(value = "查询机组列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result<List<TurbineListResp>> list(TurbineListReq req) {
|
||||
return Result.ok(turbineService.list(req));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增机组-项目关联", httpMethod = "POST")
|
||||
@ApiOperation(value = "查询机组明细列表", httpMethod = "GET")
|
||||
@GetMapping("/list/info")
|
||||
public Result<List<TurbineInfoResp>> listInfo( TurbineListReq req) {
|
||||
return Result.ok(turbineService.listInfo(req));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取指定机组详情", httpMethod = "GET")
|
||||
@GetMapping("/detail/{turbineId}")
|
||||
public Result<TurbineResp> detail(@PathVariable String turbineId) {
|
||||
return Result.ok(turbineService.detail(turbineId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取指定机组明细详情", httpMethod = "GET")
|
||||
@GetMapping("/info/{turbineId}")
|
||||
public Result<TurbineInfoResp> info(@PathVariable String turbineId) {
|
||||
return Result.ok(turbineService.info(turbineId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增机组", httpMethod = "POST")
|
||||
@PostMapping
|
||||
public Result<Object> add(@RequestBody TurbineEntity turbine) {
|
||||
turbineService.saveData(turbine);
|
||||
public Result<Object> add(@RequestBody TurbineReq req) {
|
||||
turbineService.save(req);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改机组-项目关联", httpMethod = "PUT")
|
||||
@PutMapping
|
||||
public Result<Object> edit(@RequestBody TurbineEntity turbine) {
|
||||
turbineService.updateData(turbine);
|
||||
@ApiOperation(value = "修改机组", httpMethod = "PUT")
|
||||
@PutMapping("/{turbineId}")
|
||||
public Result edit(@PathVariable String turbineId, @RequestBody TurbineReq req) {
|
||||
turbineService.update(turbineId, req);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除机组-项目关联", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{turbineCode}")
|
||||
public Result<Object> remove(@PathVariable String turbineCode) {
|
||||
turbineService.deleteById(turbineCode);
|
||||
@ApiOperation(value = "删除机组", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{turbineId}")
|
||||
public Result<Object> remove(@PathVariable String turbineId) {
|
||||
turbineService.deleteById(turbineId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导出机组-项目关联", httpMethod = "GET")
|
||||
@ApiOperation(value = "导出机组-需求待明确", httpMethod = "GET")
|
||||
@GetMapping("/export")
|
||||
@ResponseExcel(name = "机组-项目关联")
|
||||
public List<TurbineResp> export(TurbineListReq turbineReq) {
|
||||
return turbineService.selectList(turbineReq);
|
||||
@ResponseExcel(name = "机组")
|
||||
public List<TurbineListResp> export(TurbineListReq turbineReq) {
|
||||
return turbineService.list(turbineReq);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导入机组-项目关联", httpMethod = "POST")
|
||||
@ApiOperation(value = "导入机组-需求待明确", httpMethod = "POST")
|
||||
@PostMapping("/import")
|
||||
public Result<Object> importData(@RequestExcel List<TurbineEntity> dataList, BindingResult bindingResult) {
|
||||
// JSR 303 校验通用校验获取失败的数据
|
||||
|
|
|
@ -84,7 +84,7 @@ spring:
|
|||
|
||||
sip-config:
|
||||
name: 信令服务
|
||||
ip: 192.168.0.207
|
||||
ip: 192.168.0.112
|
||||
port: 1074
|
||||
charset: gb2312
|
||||
domain: 3402000000
|
||||
|
@ -100,7 +100,7 @@ zlm-config:
|
|||
# 公网ip
|
||||
publicHost:
|
||||
# 接口ip
|
||||
apiHost: 192.168.0.207
|
||||
apiHost: 192.168.0.112
|
||||
# 接口端口
|
||||
apiPort: 8080
|
||||
# 密钥
|
||||
|
@ -108,7 +108,7 @@ zlm-config:
|
|||
# 流id前缀
|
||||
streamPrefix:
|
||||
# rtp ip
|
||||
rtpHost: 192.168.0.207
|
||||
rtpHost: 192.168.0.112
|
||||
# rtp 端口
|
||||
rtpPort: 8080
|
||||
# 动态端口起始值
|
||||
|
@ -117,6 +117,6 @@ zlm-config:
|
|||
dynamicPortEnd: 30185
|
||||
|
||||
upload:
|
||||
temp-path: F:\Upload\Temp
|
||||
perm-path: F:\Upload\Perm
|
||||
temp-path: F:\Upload\Image\Temp
|
||||
perm-path: F:\Upload\Image
|
||||
|
||||
|
|
Loading…
Reference in New Issue