Merge branch 'jgq' into master
This commit is contained in:
commit
d4883a7fb2
|
@ -10,11 +10,27 @@ import java.time.LocalDateTime;
|
|||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
public class CustomLocalDateTimeDeserializer extends JsonDeserializer<LocalDateTime> {
|
||||
private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
private static final DateTimeFormatter FORMATTER1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
private static final DateTimeFormatter FORMATTER2 = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm");
|
||||
|
||||
@Override
|
||||
public LocalDateTime deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
|
||||
String date = p.getText();
|
||||
return LocalDateTimeUtil.parse(date, FORMATTER);
|
||||
if (date == null || date.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
// 尝试第一种格式 yyyy-MM-dd HH:mm:ss
|
||||
return LocalDateTimeUtil.parse(date, FORMATTER1);
|
||||
} catch (Exception e1) {
|
||||
try {
|
||||
// 尝试第二种格式 yyyy/MM/dd HH:mm
|
||||
return LocalDateTimeUtil.parse(date, FORMATTER2);
|
||||
} catch (Exception e2) {
|
||||
// 如果都失败,尝试自动解析
|
||||
return LocalDateTimeUtil.parse(date);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public class Schedule {
|
|||
List<ImageEntity> list = imageService.lambdaQuery().eq(ImageEntity::getPreTreatment, "0")
|
||||
.isNotNull(ImageEntity::getPartId)
|
||||
.isNotNull(ImageEntity::getProjectId).list();
|
||||
List<String> partIds = list.stream().map(ImageEntity::getPartId).toList();
|
||||
List<String> partIds = list.stream().map(ImageEntity::getPartId).collect(Collectors.toList());
|
||||
Map<String, PartResp> partRespMap = partService.listInfos(partIds).stream().collect(Collectors.toMap(PartResp::getPartId, Function.identity()));
|
||||
// 预处理
|
||||
List<ImageEntity> successList = new ArrayList<>();
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
package com.dite.znpt.converts;
|
||||
|
||||
import com.dite.znpt.domain.entity.EquipmentEntity;
|
||||
import com.dite.znpt.domain.vo.EquipmentReq;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.NullValuePropertyMappingStrategy;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 设备信息转换器
|
||||
* @author Bear.G
|
||||
* @date 2025/1/1
|
||||
*/
|
||||
@Mapper(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
|
||||
public interface EquipmentConverts {
|
||||
EquipmentConverts INSTANCE = Mappers.getMapper(EquipmentConverts.class);
|
||||
|
||||
/**
|
||||
* 将EquipmentReq转换为EquipmentEntity
|
||||
* @param req 设备请求对象
|
||||
* @return 设备实体对象
|
||||
*/
|
||||
EquipmentEntity toEquipmentEntity(EquipmentReq req);
|
||||
}
|
|
@ -9,6 +9,8 @@ import lombok.EqualsAndHashCode;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
|
@ -27,6 +29,9 @@ public class EquipmentEntity extends AuditableEntity implements Serializable {
|
|||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String equipmentId;
|
||||
|
||||
@ApiModelProperty("资产编号")
|
||||
private String assetCode;
|
||||
|
||||
@ApiModelProperty("设备名称")
|
||||
private String equipmentName;
|
||||
|
||||
|
@ -45,6 +50,138 @@ public class EquipmentEntity extends AuditableEntity implements Serializable {
|
|||
@ApiModelProperty("设备序列号")
|
||||
private String equipmentSn;
|
||||
|
||||
@ApiModelProperty("品牌")
|
||||
private String brand;
|
||||
|
||||
@ApiModelProperty("配置规格/参数")
|
||||
private String specification;
|
||||
|
||||
@ApiModelProperty("位置状态")
|
||||
private String locationStatus;
|
||||
|
||||
@ApiModelProperty("设备当前物理位置")
|
||||
private String physicalLocation;
|
||||
|
||||
@ApiModelProperty("负责人")
|
||||
private String responsiblePerson;
|
||||
|
||||
@ApiModelProperty("健康状态")
|
||||
private String healthStatus;
|
||||
|
||||
@ApiModelProperty("采购时间")
|
||||
private LocalDateTime purchaseTime;
|
||||
|
||||
@ApiModelProperty("入库时间")
|
||||
private LocalDateTime inStockTime;
|
||||
|
||||
@ApiModelProperty("启用时间")
|
||||
private LocalDateTime activationTime;
|
||||
|
||||
@ApiModelProperty("预计报废时间")
|
||||
private LocalDateTime expectedScrapTime;
|
||||
|
||||
@ApiModelProperty("实际报废时间")
|
||||
private LocalDateTime actualScrapTime;
|
||||
|
||||
@ApiModelProperty("状态变更时间")
|
||||
private LocalDateTime statusChangeTime;
|
||||
|
||||
@ApiModelProperty("采购订单")
|
||||
private String purchaseOrder;
|
||||
|
||||
@ApiModelProperty("供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
@ApiModelProperty("采购价格")
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
@ApiModelProperty("当前净值")
|
||||
private BigDecimal currentNetValue;
|
||||
|
||||
@ApiModelProperty("折旧方法")
|
||||
private String depreciationMethod;
|
||||
|
||||
@ApiModelProperty("折旧年限")
|
||||
private Integer depreciationYears;
|
||||
|
||||
@ApiModelProperty("残值")
|
||||
private BigDecimal salvageValue;
|
||||
|
||||
@ApiModelProperty("保修截止日期")
|
||||
private LocalDateTime warrantyExpireDate;
|
||||
|
||||
@ApiModelProperty("上次维护日期")
|
||||
private LocalDateTime lastMaintenanceDate;
|
||||
|
||||
@ApiModelProperty("下次维护日期")
|
||||
private LocalDateTime nextMaintenanceDate;
|
||||
|
||||
@ApiModelProperty("维护人员")
|
||||
private String maintenancePerson;
|
||||
|
||||
@ApiModelProperty("库存条码")
|
||||
private String inventoryBarcode;
|
||||
|
||||
@ApiModelProperty("资产备注")
|
||||
private String assetRemark;
|
||||
|
||||
@ApiModelProperty("使用部门/人")
|
||||
private String usingDepartment;
|
||||
|
||||
@ApiModelProperty("领用时间")
|
||||
private LocalDateTime borrowingTime;
|
||||
|
||||
@ApiModelProperty("归还时间")
|
||||
private LocalDateTime returnTime;
|
||||
|
||||
@ApiModelProperty("出库时间")
|
||||
private LocalDateTime outStockTime;
|
||||
|
||||
@ApiModelProperty("总使用时间")
|
||||
private String totalUsageTime;
|
||||
|
||||
@ApiModelProperty("折旧率")
|
||||
private BigDecimal depreciationRate;
|
||||
|
||||
@ApiModelProperty("折旧方法说明")
|
||||
private String depreciationMethodDesc;
|
||||
|
||||
@ApiModelProperty("发票")
|
||||
private String invoice;
|
||||
|
||||
@ApiModelProperty("发票状态")
|
||||
private String invoiceStatus;
|
||||
|
||||
@ApiModelProperty("附件")
|
||||
private String attachments;
|
||||
|
||||
@ApiModelProperty("照片")
|
||||
private String photos;
|
||||
|
||||
@ApiModelProperty("条码")
|
||||
private String barcode;
|
||||
|
||||
@ApiModelProperty("导入人")
|
||||
private String importer;
|
||||
|
||||
@ApiModelProperty("盘库时间/状态1")
|
||||
private String inventoryTimeStatus1;
|
||||
|
||||
@ApiModelProperty("盘库时间/状态2")
|
||||
private String inventoryTimeStatus2;
|
||||
|
||||
@ApiModelProperty("盘库时间/状态3")
|
||||
private String inventoryTimeStatus3;
|
||||
|
||||
@ApiModelProperty("盘点时间/状态1")
|
||||
private String inventoryCheckTimeStatus1;
|
||||
|
||||
@ApiModelProperty("盘点时间/状态2")
|
||||
private String inventoryCheckTimeStatus2;
|
||||
|
||||
@ApiModelProperty("盘点时间/状态3")
|
||||
private String inventoryCheckTimeStatus3;
|
||||
|
||||
@ApiModelProperty("当前使用记录id")
|
||||
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||
private String useRecordId;
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
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.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训证书表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("training_certificate")
|
||||
@ApiModel(value="TrainingCertificateEntity对象", description="培训证书表")
|
||||
public class TrainingCertificateEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ExcelProperty("证书ID")
|
||||
@ApiModelProperty("证书ID")
|
||||
@TableId(value = "certificate_id", type = IdType.ASSIGN_UUID)
|
||||
private String certificateId;
|
||||
|
||||
@ExcelProperty("培训记录ID")
|
||||
@ApiModelProperty("培训记录ID")
|
||||
@TableField("record_id")
|
||||
private String recordId;
|
||||
|
||||
@ExcelProperty("证书编号")
|
||||
@ApiModelProperty("证书编号")
|
||||
@TableField("certificate_code")
|
||||
private String certificateCode;
|
||||
|
||||
@ExcelProperty("证书名称")
|
||||
@ApiModelProperty("证书名称")
|
||||
@TableField("certificate_name")
|
||||
private String certificateName;
|
||||
|
||||
@ExcelProperty("发证日期")
|
||||
@ApiModelProperty("发证日期")
|
||||
@TableField("issue_date")
|
||||
private LocalDate issueDate;
|
||||
|
||||
@ExcelProperty("有效期至")
|
||||
@ApiModelProperty("有效期至")
|
||||
@TableField("valid_until")
|
||||
private LocalDate validUntil;
|
||||
|
||||
@ExcelProperty("证书文件路径")
|
||||
@ApiModelProperty("证书文件路径")
|
||||
@TableField("certificate_path")
|
||||
private String certificatePath;
|
||||
|
||||
@ExcelProperty("状态")
|
||||
@ApiModelProperty("状态:VALID-有效,EXPIRED-已过期,REVOKED-已撤销")
|
||||
@TableField("status")
|
||||
private String status;
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
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.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训互动记录表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("training_interaction")
|
||||
@ApiModel(value="TrainingInteractionEntity对象", description="培训互动记录表")
|
||||
public class TrainingInteractionEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ExcelProperty("互动记录ID")
|
||||
@ApiModelProperty("互动记录ID")
|
||||
@TableId(value = "interaction_id", type = IdType.ASSIGN_UUID)
|
||||
private String interactionId;
|
||||
|
||||
@ExcelProperty("培训计划ID")
|
||||
@ApiModelProperty("培训计划ID")
|
||||
@TableField("plan_id")
|
||||
private String planId;
|
||||
|
||||
@ExcelProperty("用户ID")
|
||||
@ApiModelProperty("用户ID")
|
||||
@TableField("user_id")
|
||||
private String userId;
|
||||
|
||||
@ExcelProperty("用户姓名")
|
||||
@ApiModelProperty("用户姓名")
|
||||
@TableField("user_name")
|
||||
private String userName;
|
||||
|
||||
@ExcelProperty("互动类型")
|
||||
@ApiModelProperty("互动类型:QUESTION-提问,ANSWER-回答,COMMENT-评论,LIKE-点赞")
|
||||
@TableField("interaction_type")
|
||||
private String interactionType;
|
||||
|
||||
@ExcelProperty("互动内容")
|
||||
@ApiModelProperty("互动内容")
|
||||
@TableField("content")
|
||||
private String content;
|
||||
|
||||
@ExcelProperty("父级互动ID")
|
||||
@ApiModelProperty("父级互动ID(用于回复)")
|
||||
@TableField("parent_id")
|
||||
private String parentId;
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
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.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训材料表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("training_material")
|
||||
@ApiModel(value="TrainingMaterialEntity对象", description="培训材料表")
|
||||
public class TrainingMaterialEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ExcelProperty("培训材料ID")
|
||||
@ApiModelProperty("培训材料ID")
|
||||
@TableId(value = "material_id", type = IdType.ASSIGN_UUID)
|
||||
private String materialId;
|
||||
|
||||
@ExcelProperty("培训计划ID")
|
||||
@ApiModelProperty("培训计划ID")
|
||||
@TableField("plan_id")
|
||||
private String planId;
|
||||
|
||||
@ExcelProperty("材料名称")
|
||||
@ApiModelProperty("材料名称")
|
||||
@TableField("material_name")
|
||||
private String materialName;
|
||||
|
||||
@ExcelProperty("材料类型")
|
||||
@ApiModelProperty("材料类型:DOCUMENT-文档,VIDEO-视频,AUDIO-音频,IMAGE-图片")
|
||||
@TableField("material_type")
|
||||
private String materialType;
|
||||
|
||||
@ExcelProperty("材料路径")
|
||||
@ApiModelProperty("材料路径")
|
||||
@TableField("material_path")
|
||||
private String materialPath;
|
||||
|
||||
@ExcelProperty("材料大小")
|
||||
@ApiModelProperty("材料大小(字节)")
|
||||
@TableField("material_size")
|
||||
private Long materialSize;
|
||||
|
||||
@ExcelProperty("材料描述")
|
||||
@ApiModelProperty("材料描述")
|
||||
@TableField("description")
|
||||
private String description;
|
||||
|
||||
@ExcelProperty("排序")
|
||||
@ApiModelProperty("排序")
|
||||
@TableField("sort_order")
|
||||
private Integer sortOrder;
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
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.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训计划表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("training_plan")
|
||||
@ApiModel(value="TrainingPlanEntity对象", description="培训计划表")
|
||||
public class TrainingPlanEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ExcelProperty("培训计划ID")
|
||||
@ApiModelProperty("培训计划ID")
|
||||
@TableId(value = "plan_id", type = IdType.ASSIGN_UUID)
|
||||
private String planId;
|
||||
|
||||
@ExcelProperty("培训计划名称")
|
||||
@ApiModelProperty("培训计划名称")
|
||||
@TableField("plan_name")
|
||||
private String planName;
|
||||
|
||||
@ExcelProperty("培训类型")
|
||||
@ApiModelProperty("培训类型:SAFETY-安全教育,SKILL-技能培训,CULTURE-企业文化")
|
||||
@TableField("training_type")
|
||||
private String trainingType;
|
||||
|
||||
@ExcelProperty("培训级别")
|
||||
@ApiModelProperty("培训级别:SITE-现场级,DEPARTMENT-部门级,COMPANY-公司级")
|
||||
@TableField("training_level")
|
||||
private String trainingLevel;
|
||||
|
||||
@ExcelProperty("培训内容")
|
||||
@ApiModelProperty("培训内容")
|
||||
@TableField("training_content")
|
||||
private String trainingContent;
|
||||
|
||||
@ExcelProperty("培训讲师")
|
||||
@ApiModelProperty("培训讲师")
|
||||
@TableField("trainer")
|
||||
private String trainer;
|
||||
|
||||
@ExcelProperty("培训地点")
|
||||
@ApiModelProperty("培训地点")
|
||||
@TableField("training_location")
|
||||
private String trainingLocation;
|
||||
|
||||
@ExcelProperty("培训开始时间")
|
||||
@ApiModelProperty("培训开始时间")
|
||||
@TableField("start_time")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@ExcelProperty("培训结束时间")
|
||||
@ApiModelProperty("培训结束时间")
|
||||
@TableField("end_time")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@ExcelProperty("培训状态")
|
||||
@ApiModelProperty("培训状态:DRAFT-草稿,PUBLISHED-已发布,IN_PROGRESS-进行中,COMPLETED-已完成,CANCELLED-已取消")
|
||||
@TableField("status")
|
||||
private String status;
|
||||
|
||||
@ExcelProperty("最大参训人数")
|
||||
@ApiModelProperty("最大参训人数")
|
||||
@TableField("max_participants")
|
||||
private Integer maxParticipants;
|
||||
|
||||
@ExcelProperty("培训要求")
|
||||
@ApiModelProperty("培训要求")
|
||||
@TableField("requirements")
|
||||
private String requirements;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
@ApiModelProperty("备注")
|
||||
@TableField("remark")
|
||||
private String remark;
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
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.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训记录表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("training_record")
|
||||
@ApiModel(value="TrainingRecordEntity对象", description="培训记录表")
|
||||
public class TrainingRecordEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ExcelProperty("培训记录ID")
|
||||
@ApiModelProperty("培训记录ID")
|
||||
@TableId(value = "record_id", type = IdType.ASSIGN_UUID)
|
||||
private String recordId;
|
||||
|
||||
@ExcelProperty("培训计划ID")
|
||||
@ApiModelProperty("培训计划ID")
|
||||
@TableField("plan_id")
|
||||
private String planId;
|
||||
|
||||
@ExcelProperty("参训人员ID")
|
||||
@ApiModelProperty("参训人员ID")
|
||||
@TableField("user_id")
|
||||
private String userId;
|
||||
|
||||
@ExcelProperty("参训人员姓名")
|
||||
@ApiModelProperty("参训人员姓名")
|
||||
@TableField("user_name")
|
||||
private String userName;
|
||||
|
||||
@ExcelProperty("部门ID")
|
||||
@ApiModelProperty("部门ID")
|
||||
@TableField("dept_id")
|
||||
private String deptId;
|
||||
|
||||
@ExcelProperty("部门名称")
|
||||
@ApiModelProperty("部门名称")
|
||||
@TableField("dept_name")
|
||||
private String deptName;
|
||||
|
||||
@ExcelProperty("出勤状态")
|
||||
@ApiModelProperty("出勤状态:PENDING-待确认,PRESENT-出席,ABSENT-缺席,LATE-迟到")
|
||||
@TableField("attendance_status")
|
||||
private String attendanceStatus;
|
||||
|
||||
@ExcelProperty("签到时间")
|
||||
@ApiModelProperty("签到时间")
|
||||
@TableField("sign_in_time")
|
||||
private LocalDateTime signInTime;
|
||||
|
||||
@ExcelProperty("签退时间")
|
||||
@ApiModelProperty("签退时间")
|
||||
@TableField("sign_out_time")
|
||||
private LocalDateTime signOutTime;
|
||||
|
||||
@ExcelProperty("培训成绩")
|
||||
@ApiModelProperty("培训成绩")
|
||||
@TableField("score")
|
||||
private BigDecimal score;
|
||||
|
||||
@ExcelProperty("培训反馈")
|
||||
@ApiModelProperty("培训反馈")
|
||||
@TableField("feedback")
|
||||
private String feedback;
|
||||
|
||||
@ExcelProperty("证书ID")
|
||||
@ApiModelProperty("证书ID")
|
||||
@TableField("certificate_id")
|
||||
private String certificateId;
|
||||
}
|
|
@ -6,6 +6,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
|
@ -26,4 +27,130 @@ public class EquipmentListReq implements Serializable {
|
|||
|
||||
@ApiModelProperty("设备状态,0-空闲中,1-使用,3-保养中,4-维修中,5-已报废")
|
||||
private String equipmentStatus;
|
||||
|
||||
@ApiModelProperty("设备序列号")
|
||||
private String equipmentSn;
|
||||
|
||||
@ApiModelProperty("资产编号")
|
||||
private String assetCode;
|
||||
|
||||
@ApiModelProperty("品牌")
|
||||
private String brand;
|
||||
|
||||
@ApiModelProperty("位置状态")
|
||||
private String locationStatus;
|
||||
|
||||
@ApiModelProperty("健康状态")
|
||||
private String healthStatus;
|
||||
|
||||
@ApiModelProperty("负责人")
|
||||
private String responsiblePerson;
|
||||
|
||||
@ApiModelProperty("使用状态,0-空闲中,1-使用中")
|
||||
private String useStatus;
|
||||
|
||||
@ApiModelProperty("项目ID")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("用户ID")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty("设备型号")
|
||||
private String equipmentModel;
|
||||
|
||||
@ApiModelProperty("配置规格/参数")
|
||||
private String specification;
|
||||
|
||||
@ApiModelProperty("设备当前物理位置")
|
||||
private String physicalLocation;
|
||||
|
||||
@ApiModelProperty("供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
@ApiModelProperty("维护人员")
|
||||
private String maintenancePerson;
|
||||
|
||||
@ApiModelProperty("库存条码")
|
||||
private String inventoryBarcode;
|
||||
|
||||
@ApiModelProperty("资产备注")
|
||||
private String assetRemark;
|
||||
|
||||
@ApiModelProperty("使用部门/人")
|
||||
private String usingDepartment;
|
||||
|
||||
@ApiModelProperty("发票")
|
||||
private String invoice;
|
||||
|
||||
@ApiModelProperty("条码")
|
||||
private String barcode;
|
||||
|
||||
@ApiModelProperty("导入人")
|
||||
private String importer;
|
||||
|
||||
@ApiModelProperty("采购时间开始")
|
||||
private LocalDateTime purchaseTimeStart;
|
||||
|
||||
@ApiModelProperty("采购时间结束")
|
||||
private LocalDateTime purchaseTimeEnd;
|
||||
|
||||
@ApiModelProperty("入库时间开始")
|
||||
private LocalDateTime inStockTimeStart;
|
||||
|
||||
@ApiModelProperty("入库时间结束")
|
||||
private LocalDateTime inStockTimeEnd;
|
||||
|
||||
@ApiModelProperty("启用时间开始")
|
||||
private LocalDateTime activationTimeStart;
|
||||
|
||||
@ApiModelProperty("启用时间结束")
|
||||
private LocalDateTime activationTimeEnd;
|
||||
|
||||
@ApiModelProperty("预计报废时间开始")
|
||||
private LocalDateTime expectedScrapTimeStart;
|
||||
|
||||
@ApiModelProperty("预计报废时间结束")
|
||||
private LocalDateTime expectedScrapTimeEnd;
|
||||
|
||||
@ApiModelProperty("保修截止日期开始")
|
||||
private LocalDateTime warrantyExpireDateStart;
|
||||
|
||||
@ApiModelProperty("保修截止日期结束")
|
||||
private LocalDateTime warrantyExpireDateEnd;
|
||||
|
||||
@ApiModelProperty("上次维护日期开始")
|
||||
private LocalDateTime lastMaintenanceDateStart;
|
||||
|
||||
@ApiModelProperty("上次维护日期结束")
|
||||
private LocalDateTime lastMaintenanceDateEnd;
|
||||
|
||||
@ApiModelProperty("下次维护日期开始")
|
||||
private LocalDateTime nextMaintenanceDateStart;
|
||||
|
||||
@ApiModelProperty("下次维护日期结束")
|
||||
private LocalDateTime nextMaintenanceDateEnd;
|
||||
|
||||
@ApiModelProperty("创建时间开始")
|
||||
private LocalDateTime createTimeStart;
|
||||
|
||||
@ApiModelProperty("创建时间结束")
|
||||
private LocalDateTime createTimeEnd;
|
||||
|
||||
@ApiModelProperty("更新时间开始")
|
||||
private LocalDateTime updateTimeStart;
|
||||
|
||||
@ApiModelProperty("更新时间结束")
|
||||
private LocalDateTime updateTimeEnd;
|
||||
|
||||
@ApiModelProperty("当前页码")
|
||||
private Integer page = 1;
|
||||
|
||||
@ApiModelProperty("每页大小")
|
||||
private Integer pageSize = 10;
|
||||
|
||||
@ApiModelProperty("排序字段")
|
||||
private String orderBy;
|
||||
|
||||
@ApiModelProperty("排序方向")
|
||||
private String orderDirection = "desc";
|
||||
}
|
||||
|
|
|
@ -8,6 +8,8 @@ import javax.validation.constraints.NotBlank;
|
|||
import javax.validation.constraints.Size;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
|
@ -22,7 +24,7 @@ public class EquipmentReq implements Serializable {
|
|||
|
||||
@ApiModelProperty("设备名称")
|
||||
@NotBlank(message = "设备名称不能为空")
|
||||
@Size(max = 100, message = "设备名称长度不能超过100个字")
|
||||
@Size(max = 200, message = "设备名称长度不能超过200个字")
|
||||
private String equipmentName;
|
||||
|
||||
@ApiModelProperty("设备类型, 枚举:EquipmentTypeEnum")
|
||||
|
@ -31,11 +33,177 @@ public class EquipmentReq implements Serializable {
|
|||
|
||||
@ApiModelProperty("设备型号")
|
||||
@NotBlank(message = "设备型号不能为空")
|
||||
@Size(max = 50, message = "设备型号长度不能超过50个字")
|
||||
@Size(max = 200, message = "设备型号长度不能超过200个字")
|
||||
private String equipmentModel;
|
||||
|
||||
@ApiModelProperty("设备SN")
|
||||
@NotBlank(message = "设备SN不能为空")
|
||||
@Size(max = 50, message = "设备SN长度不能超过50个字")
|
||||
@Size(max = 100, message = "设备SN长度不能超过100个字")
|
||||
private String equipmentSn;
|
||||
|
||||
@ApiModelProperty("资产编号")
|
||||
@Size(max = 50, message = "资产编号长度不能超过50个字")
|
||||
private String assetCode;
|
||||
|
||||
@ApiModelProperty("品牌")
|
||||
@Size(max = 100, message = "品牌长度不能超过100个字")
|
||||
private String brand;
|
||||
|
||||
@ApiModelProperty("配置规格/参数")
|
||||
@Size(max = 500, message = "配置规格长度不能超过500个字")
|
||||
private String specification;
|
||||
|
||||
@ApiModelProperty("设备状态,枚举:EquipmentStatusEnum")
|
||||
private String equipmentStatus;
|
||||
|
||||
@ApiModelProperty("使用状态,0-空闲中,1-使用中")
|
||||
private String useStatus;
|
||||
|
||||
@ApiModelProperty("位置状态")
|
||||
private String locationStatus;
|
||||
|
||||
@ApiModelProperty("设备当前物理位置")
|
||||
@Size(max = 200, message = "物理位置长度不能超过200个字")
|
||||
private String physicalLocation;
|
||||
|
||||
@ApiModelProperty("负责人")
|
||||
@Size(max = 100, message = "负责人长度不能超过100个字")
|
||||
private String responsiblePerson;
|
||||
|
||||
@ApiModelProperty("健康状态")
|
||||
private String healthStatus;
|
||||
|
||||
@ApiModelProperty("采购时间")
|
||||
private LocalDateTime purchaseTime;
|
||||
|
||||
@ApiModelProperty("入库时间")
|
||||
private LocalDateTime inStockTime;
|
||||
|
||||
@ApiModelProperty("启用时间")
|
||||
private LocalDateTime activationTime;
|
||||
|
||||
@ApiModelProperty("预计报废时间")
|
||||
private LocalDateTime expectedScrapTime;
|
||||
|
||||
@ApiModelProperty("实际报废时间")
|
||||
private LocalDateTime actualScrapTime;
|
||||
|
||||
@ApiModelProperty("状态变更时间")
|
||||
private LocalDateTime statusChangeTime;
|
||||
|
||||
@ApiModelProperty("采购订单")
|
||||
@Size(max = 100, message = "采购订单长度不能超过100个字")
|
||||
private String purchaseOrder;
|
||||
|
||||
@ApiModelProperty("供应商名称")
|
||||
@Size(max = 200, message = "供应商名称长度不能超过200个字")
|
||||
private String supplierName;
|
||||
|
||||
@ApiModelProperty("采购价格")
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
@ApiModelProperty("当前净值")
|
||||
private BigDecimal currentNetValue;
|
||||
|
||||
@ApiModelProperty("折旧方法")
|
||||
private String depreciationMethod;
|
||||
|
||||
@ApiModelProperty("折旧年限")
|
||||
private Integer depreciationYears;
|
||||
|
||||
@ApiModelProperty("残值")
|
||||
private BigDecimal salvageValue;
|
||||
|
||||
@ApiModelProperty("保修截止日期")
|
||||
private LocalDateTime warrantyExpireDate;
|
||||
|
||||
@ApiModelProperty("上次维护日期")
|
||||
private LocalDateTime lastMaintenanceDate;
|
||||
|
||||
@ApiModelProperty("下次维护日期")
|
||||
private LocalDateTime nextMaintenanceDate;
|
||||
|
||||
@ApiModelProperty("维护人员")
|
||||
@Size(max = 100, message = "维护人员长度不能超过100个字")
|
||||
private String maintenancePerson;
|
||||
|
||||
@ApiModelProperty("库存条码")
|
||||
@Size(max = 100, message = "库存条码长度不能超过100个字")
|
||||
private String inventoryBarcode;
|
||||
|
||||
@ApiModelProperty("资产备注")
|
||||
@Size(max = 1000, message = "资产备注长度不能超过1000个字")
|
||||
private String assetRemark;
|
||||
|
||||
@ApiModelProperty("使用部门/人")
|
||||
@Size(max = 200, message = "使用部门/人长度不能超过200个字")
|
||||
private String usingDepartment;
|
||||
|
||||
@ApiModelProperty("领用时间")
|
||||
private LocalDateTime borrowingTime;
|
||||
|
||||
@ApiModelProperty("归还时间")
|
||||
private LocalDateTime returnTime;
|
||||
|
||||
@ApiModelProperty("出库时间")
|
||||
private LocalDateTime outStockTime;
|
||||
|
||||
@ApiModelProperty("总使用时间")
|
||||
@Size(max = 100, message = "总使用时间长度不能超过100个字")
|
||||
private String totalUsageTime;
|
||||
|
||||
@ApiModelProperty("折旧率")
|
||||
private BigDecimal depreciationRate;
|
||||
|
||||
@ApiModelProperty("折旧方法说明")
|
||||
@Size(max = 500, message = "折旧方法说明长度不能超过500个字")
|
||||
private String depreciationMethodDesc;
|
||||
|
||||
@ApiModelProperty("发票")
|
||||
@Size(max = 100, message = "发票长度不能超过100个字")
|
||||
private String invoice;
|
||||
|
||||
@ApiModelProperty("发票状态")
|
||||
@Size(max = 50, message = "发票状态长度不能超过50个字")
|
||||
private String invoiceStatus;
|
||||
|
||||
@ApiModelProperty("附件")
|
||||
@Size(max = 500, message = "附件长度不能超过500个字")
|
||||
private String attachments;
|
||||
|
||||
@ApiModelProperty("照片")
|
||||
@Size(max = 500, message = "照片长度不能超过500个字")
|
||||
private String photos;
|
||||
|
||||
@ApiModelProperty("条码")
|
||||
@Size(max = 100, message = "条码长度不能超过100个字")
|
||||
private String barcode;
|
||||
|
||||
@ApiModelProperty("导入人")
|
||||
@Size(max = 100, message = "导入人长度不能超过100个字")
|
||||
private String importer;
|
||||
|
||||
@ApiModelProperty("盘库时间/状态1")
|
||||
@Size(max = 100, message = "盘库时间/状态1长度不能超过100个字")
|
||||
private String inventoryTimeStatus1;
|
||||
|
||||
@ApiModelProperty("盘库时间/状态2")
|
||||
@Size(max = 100, message = "盘库时间/状态2长度不能超过100个字")
|
||||
private String inventoryTimeStatus2;
|
||||
|
||||
@ApiModelProperty("盘库时间/状态3")
|
||||
@Size(max = 100, message = "盘库时间/状态3长度不能超过100个字")
|
||||
private String inventoryTimeStatus3;
|
||||
|
||||
@ApiModelProperty("盘点时间/状态1")
|
||||
@Size(max = 100, message = "盘点时间/状态1长度不能超过100个字")
|
||||
private String inventoryCheckTimeStatus1;
|
||||
|
||||
@ApiModelProperty("盘点时间/状态2")
|
||||
@Size(max = 100, message = "盘点时间/状态2长度不能超过100个字")
|
||||
private String inventoryCheckTimeStatus2;
|
||||
|
||||
@ApiModelProperty("盘点时间/状态3")
|
||||
@Size(max = 100, message = "盘点时间/状态3长度不能超过100个字")
|
||||
private String inventoryCheckTimeStatus3;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
|
@ -21,6 +23,9 @@ public class EquipmentResp implements Serializable {
|
|||
@ApiModelProperty("设备ID")
|
||||
private String equipmentId;
|
||||
|
||||
@ApiModelProperty("资产编号")
|
||||
private String assetCode;
|
||||
|
||||
@ApiModelProperty("设备名称")
|
||||
private String equipmentName;
|
||||
|
||||
|
@ -36,6 +41,12 @@ public class EquipmentResp implements Serializable {
|
|||
@ApiModelProperty("设备SN")
|
||||
private String equipmentSn;
|
||||
|
||||
@ApiModelProperty("品牌")
|
||||
private String brand;
|
||||
|
||||
@ApiModelProperty("配置规格/参数")
|
||||
private String specification;
|
||||
|
||||
@ApiModelProperty("设备状态, 枚举:EquipmentStatusEnum")
|
||||
private String equipmentStatus;
|
||||
|
||||
|
@ -45,6 +56,138 @@ public class EquipmentResp implements Serializable {
|
|||
@ApiModelProperty("设备使用状态,0-空闲中,1-使用中")
|
||||
private String useStatus;
|
||||
|
||||
@ApiModelProperty("位置状态")
|
||||
private String locationStatus;
|
||||
|
||||
@ApiModelProperty("位置状态描述")
|
||||
private String locationStatusLabel;
|
||||
|
||||
@ApiModelProperty("设备当前物理位置")
|
||||
private String physicalLocation;
|
||||
|
||||
@ApiModelProperty("负责人")
|
||||
private String responsiblePerson;
|
||||
|
||||
@ApiModelProperty("健康状态")
|
||||
private String healthStatus;
|
||||
|
||||
@ApiModelProperty("健康状态描述")
|
||||
private String healthStatusLabel;
|
||||
|
||||
@ApiModelProperty("采购时间")
|
||||
private LocalDateTime purchaseTime;
|
||||
|
||||
@ApiModelProperty("入库时间")
|
||||
private LocalDateTime inStockTime;
|
||||
|
||||
@ApiModelProperty("启用时间")
|
||||
private LocalDateTime activationTime;
|
||||
|
||||
@ApiModelProperty("预计报废时间")
|
||||
private LocalDateTime expectedScrapTime;
|
||||
|
||||
@ApiModelProperty("实际报废时间")
|
||||
private LocalDateTime actualScrapTime;
|
||||
|
||||
@ApiModelProperty("状态变更时间")
|
||||
private LocalDateTime statusChangeTime;
|
||||
|
||||
@ApiModelProperty("采购订单")
|
||||
private String purchaseOrder;
|
||||
|
||||
@ApiModelProperty("供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
@ApiModelProperty("采购价格")
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
@ApiModelProperty("当前净值")
|
||||
private BigDecimal currentNetValue;
|
||||
|
||||
@ApiModelProperty("折旧方法")
|
||||
private String depreciationMethod;
|
||||
|
||||
@ApiModelProperty("折旧年限")
|
||||
private Integer depreciationYears;
|
||||
|
||||
@ApiModelProperty("残值")
|
||||
private BigDecimal salvageValue;
|
||||
|
||||
@ApiModelProperty("保修截止日期")
|
||||
private LocalDateTime warrantyExpireDate;
|
||||
|
||||
@ApiModelProperty("上次维护日期")
|
||||
private LocalDateTime lastMaintenanceDate;
|
||||
|
||||
@ApiModelProperty("下次维护日期")
|
||||
private LocalDateTime nextMaintenanceDate;
|
||||
|
||||
@ApiModelProperty("维护人员")
|
||||
private String maintenancePerson;
|
||||
|
||||
@ApiModelProperty("库存条码")
|
||||
private String inventoryBarcode;
|
||||
|
||||
@ApiModelProperty("资产备注")
|
||||
private String assetRemark;
|
||||
|
||||
@ApiModelProperty("使用部门/人")
|
||||
private String usingDepartment;
|
||||
|
||||
@ApiModelProperty("领用时间")
|
||||
private LocalDateTime borrowingTime;
|
||||
|
||||
@ApiModelProperty("归还时间")
|
||||
private LocalDateTime returnTime;
|
||||
|
||||
@ApiModelProperty("出库时间")
|
||||
private LocalDateTime outStockTime;
|
||||
|
||||
@ApiModelProperty("总使用时间")
|
||||
private String totalUsageTime;
|
||||
|
||||
@ApiModelProperty("折旧率")
|
||||
private BigDecimal depreciationRate;
|
||||
|
||||
@ApiModelProperty("折旧方法说明")
|
||||
private String depreciationMethodDesc;
|
||||
|
||||
@ApiModelProperty("发票")
|
||||
private String invoice;
|
||||
|
||||
@ApiModelProperty("发票状态")
|
||||
private String invoiceStatus;
|
||||
|
||||
@ApiModelProperty("附件")
|
||||
private String attachments;
|
||||
|
||||
@ApiModelProperty("照片")
|
||||
private String photos;
|
||||
|
||||
@ApiModelProperty("条码")
|
||||
private String barcode;
|
||||
|
||||
@ApiModelProperty("导入人")
|
||||
private String importer;
|
||||
|
||||
@ApiModelProperty("盘库时间/状态1")
|
||||
private String inventoryTimeStatus1;
|
||||
|
||||
@ApiModelProperty("盘库时间/状态2")
|
||||
private String inventoryTimeStatus2;
|
||||
|
||||
@ApiModelProperty("盘库时间/状态3")
|
||||
private String inventoryTimeStatus3;
|
||||
|
||||
@ApiModelProperty("盘点时间/状态1")
|
||||
private String inventoryCheckTimeStatus1;
|
||||
|
||||
@ApiModelProperty("盘点时间/状态2")
|
||||
private String inventoryCheckTimeStatus2;
|
||||
|
||||
@ApiModelProperty("盘点时间/状态3")
|
||||
private String inventoryCheckTimeStatus3;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
|
@ -56,4 +199,10 @@ public class EquipmentResp implements Serializable {
|
|||
|
||||
@ApiModelProperty("使用人")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训材料响应VO
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value="TrainingMaterialResp对象", description="培训材料响应")
|
||||
public class TrainingMaterialResp {
|
||||
|
||||
@ApiModelProperty("培训材料ID")
|
||||
private String materialId;
|
||||
|
||||
@ApiModelProperty("材料名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("材料类型")
|
||||
private String materialType;
|
||||
|
||||
@ApiModelProperty("材料路径")
|
||||
private String materialPath;
|
||||
|
||||
@ApiModelProperty("材料大小")
|
||||
private Long materialSize;
|
||||
|
||||
@ApiModelProperty("材料描述")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
private Integer sortOrder;
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训计划列表请求VO
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value="TrainingPlanListReq对象", description="培训计划列表请求")
|
||||
public class TrainingPlanListReq {
|
||||
|
||||
@ApiModelProperty("培训计划名称")
|
||||
private String planName;
|
||||
|
||||
@ApiModelProperty("培训类型")
|
||||
private String trainingType;
|
||||
|
||||
@ApiModelProperty("培训级别")
|
||||
private String trainingLevel;
|
||||
|
||||
@ApiModelProperty("培训状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("培训讲师")
|
||||
private String trainer;
|
||||
|
||||
@ApiModelProperty("开始时间")
|
||||
private String startTime;
|
||||
|
||||
@ApiModelProperty("结束时间")
|
||||
private String endTime;
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训计划列表响应VO
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value="TrainingPlanListResp对象", description="培训计划列表响应")
|
||||
public class TrainingPlanListResp {
|
||||
|
||||
@ApiModelProperty("培训计划ID")
|
||||
private String planId;
|
||||
|
||||
@ApiModelProperty("培训计划名称")
|
||||
private String planName;
|
||||
|
||||
@ApiModelProperty("培训类型")
|
||||
private String trainingType;
|
||||
|
||||
@ApiModelProperty("培训级别")
|
||||
private String trainingLevel;
|
||||
|
||||
@ApiModelProperty("培训内容")
|
||||
private String trainingContent;
|
||||
|
||||
@ApiModelProperty("培训讲师")
|
||||
private String trainer;
|
||||
|
||||
@ApiModelProperty("培训地点")
|
||||
private String trainingLocation;
|
||||
|
||||
@ApiModelProperty("培训开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@ApiModelProperty("培训结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@ApiModelProperty("培训状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("最大参训人数")
|
||||
private Integer maxParticipants;
|
||||
|
||||
@ApiModelProperty("当前参训人数")
|
||||
private Integer currentParticipants;
|
||||
|
||||
@ApiModelProperty("培训要求")
|
||||
private String requirements;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private String createBy;
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训计划请求VO
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value="TrainingPlanReq对象", description="培训计划请求")
|
||||
public class TrainingPlanReq {
|
||||
|
||||
@ApiModelProperty("培训计划名称")
|
||||
@NotBlank(message = "培训计划名称不能为空")
|
||||
private String planName;
|
||||
|
||||
@ApiModelProperty("培训类型")
|
||||
@NotBlank(message = "培训类型不能为空")
|
||||
private String trainingType;
|
||||
|
||||
@ApiModelProperty("培训级别")
|
||||
@NotBlank(message = "培训级别不能为空")
|
||||
private String trainingLevel;
|
||||
|
||||
@ApiModelProperty("培训内容")
|
||||
private String trainingContent;
|
||||
|
||||
@ApiModelProperty("培训讲师")
|
||||
private String trainer;
|
||||
|
||||
@ApiModelProperty("培训地点")
|
||||
private String trainingLocation;
|
||||
|
||||
@ApiModelProperty("培训开始时间")
|
||||
@NotNull(message = "培训开始时间不能为空")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@ApiModelProperty("培训结束时间")
|
||||
@NotNull(message = "培训结束时间不能为空")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@ApiModelProperty("培训状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("最大参训人数")
|
||||
private Integer maxParticipants;
|
||||
|
||||
@ApiModelProperty("培训要求")
|
||||
private String requirements;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训计划响应VO
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value="TrainingPlanResp对象", description="培训计划响应")
|
||||
public class TrainingPlanResp {
|
||||
|
||||
@ApiModelProperty("培训计划ID")
|
||||
private String planId;
|
||||
|
||||
@ApiModelProperty("培训计划名称")
|
||||
private String planName;
|
||||
|
||||
@ApiModelProperty("培训类型")
|
||||
private String trainingType;
|
||||
|
||||
@ApiModelProperty("培训级别")
|
||||
private String trainingLevel;
|
||||
|
||||
@ApiModelProperty("培训内容")
|
||||
private String trainingContent;
|
||||
|
||||
@ApiModelProperty("培训讲师")
|
||||
private String trainer;
|
||||
|
||||
@ApiModelProperty("培训地点")
|
||||
private String trainingLocation;
|
||||
|
||||
@ApiModelProperty("培训开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@ApiModelProperty("培训结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@ApiModelProperty("培训状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("最大参训人数")
|
||||
private Integer maxParticipants;
|
||||
|
||||
@ApiModelProperty("当前参训人数")
|
||||
private Integer currentParticipants;
|
||||
|
||||
@ApiModelProperty("培训要求")
|
||||
private String requirements;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private String createBy;
|
||||
|
||||
@ApiModelProperty("培训材料列表")
|
||||
private List<TrainingMaterialResp> materials;
|
||||
|
||||
@ApiModelProperty("培训记录列表")
|
||||
private List<TrainingRecordResp> records;
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训记录响应VO
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value="TrainingRecordResp对象", description="培训记录响应")
|
||||
public class TrainingRecordResp {
|
||||
|
||||
@ApiModelProperty("培训记录ID")
|
||||
private String recordId;
|
||||
|
||||
@ApiModelProperty("参训人员ID")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty("参训人员姓名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("部门ID")
|
||||
private String deptId;
|
||||
|
||||
@ApiModelProperty("部门名称")
|
||||
private String deptName;
|
||||
|
||||
@ApiModelProperty("出勤状态")
|
||||
private String attendanceStatus;
|
||||
|
||||
@ApiModelProperty("签到时间")
|
||||
private LocalDateTime signInTime;
|
||||
|
||||
@ApiModelProperty("签退时间")
|
||||
private LocalDateTime signOutTime;
|
||||
|
||||
@ApiModelProperty("培训成绩")
|
||||
private BigDecimal score;
|
||||
|
||||
@ApiModelProperty("培训反馈")
|
||||
private String feedback;
|
||||
|
||||
@ApiModelProperty("证书ID")
|
||||
private String certificateId;
|
||||
}
|
|
@ -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 Bear.G
|
||||
* @date 2025/7/31/周四 15:30
|
||||
* @description 设备健康状态枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum HealthStatusEnum {
|
||||
EXCELLENT("excellent", "优秀"),
|
||||
GOOD("good", "良好"),
|
||||
NORMAL("normal", "一般"),
|
||||
POOR("poor", "较差"),
|
||||
BAD("bad", "差");
|
||||
|
||||
private final String code;
|
||||
private final String desc;
|
||||
|
||||
HealthStatusEnum(String code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static HealthStatusEnum getByCode(String code) {
|
||||
for (HealthStatusEnum e : HealthStatusEnum.values()) {
|
||||
if (e.code.equals(code)) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getDescByCode(String code) {
|
||||
HealthStatusEnum e = getByCode(code);
|
||||
return null == e ? null : e.desc;
|
||||
}
|
||||
|
||||
public static List<JSONObject> listAll() {
|
||||
List<JSONObject> list = new ArrayList<>(HealthStatusEnum.values().length);
|
||||
for (HealthStatusEnum e : HealthStatusEnum.values()) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set(e.code, e.desc);
|
||||
list.add(jsonObject);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
|
@ -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 Bear.G
|
||||
* @date 2025/7/31/周四 15:30
|
||||
* @description 设备位置状态枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum LocationStatusEnum {
|
||||
IN_STOCK("in_stock", "库存中"),
|
||||
ALLOCATED("allocated", "已分配"),
|
||||
REPAIR("repair", "维修中"),
|
||||
SCRAP("scrap", "待报废"),
|
||||
SCRAPPED("scrapped", "已报废"),
|
||||
BORROWED("borrowed", "外借中"),
|
||||
LOST("lost", "丢失");
|
||||
|
||||
private final String code;
|
||||
private final String desc;
|
||||
|
||||
LocationStatusEnum(String code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static LocationStatusEnum getByCode(String code) {
|
||||
for (LocationStatusEnum e : LocationStatusEnum.values()) {
|
||||
if (e.code.equals(code)) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getDescByCode(String code) {
|
||||
LocationStatusEnum e = getByCode(code);
|
||||
return null == e ? null : e.desc;
|
||||
}
|
||||
|
||||
public static List<JSONObject> listAll() {
|
||||
List<JSONObject> list = new ArrayList<>(LocationStatusEnum.values().length);
|
||||
for (LocationStatusEnum e : LocationStatusEnum.values()) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set(e.code, e.desc);
|
||||
list.add(jsonObject);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
|
@ -2,20 +2,14 @@ package com.dite.znpt.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.EquipmentEntity;
|
||||
import com.dite.znpt.domain.vo.EquipmentListReq;
|
||||
import com.dite.znpt.domain.vo.EquipmentResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
* @date 2025/7/23/周三 17:38
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface EquipmentMapper extends BaseMapper<EquipmentEntity> {
|
||||
|
||||
List<EquipmentResp> selectEquipmentResp(@Param("req") EquipmentListReq req);
|
||||
|
||||
EquipmentResp getEquipmentRespByEquipmentId(@Param("equipmentId") String equipmentId);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.TrainingCertificateEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训证书表Mapper接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface TrainingCertificateMapper extends BaseMapper<TrainingCertificateEntity> {
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.TrainingInteractionEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训互动记录表Mapper接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface TrainingInteractionMapper extends BaseMapper<TrainingInteractionEntity> {
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.TrainingMaterialEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训材料表Mapper接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface TrainingMaterialMapper extends BaseMapper<TrainingMaterialEntity> {
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.TrainingPlanEntity;
|
||||
import com.dite.znpt.domain.vo.TrainingPlanListReq;
|
||||
import com.dite.znpt.domain.vo.TrainingPlanListResp;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训计划表Mapper接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface TrainingPlanMapper extends BaseMapper<TrainingPlanEntity> {
|
||||
|
||||
/**
|
||||
* 查询培训计划列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 培训计划列表
|
||||
*/
|
||||
List<TrainingPlanListResp> listTrainingPlanListResp(@Param("req") TrainingPlanListReq req);
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.TrainingRecordEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训记录表Mapper接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface TrainingRecordMapper extends BaseMapper<TrainingRecordEntity> {
|
||||
|
||||
}
|
|
@ -1,13 +1,11 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.EquipmentEntity;
|
||||
import com.dite.znpt.domain.vo.EquipmentListReq;
|
||||
import com.dite.znpt.domain.vo.EquipmentReq;
|
||||
import com.dite.znpt.domain.vo.EquipmentResp;
|
||||
import com.dite.znpt.domain.vo.EquipmentUseRecordReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
|
@ -15,8 +13,7 @@ import java.util.List;
|
|||
* @description
|
||||
*/
|
||||
public interface EquipmentService extends IService<EquipmentEntity> {
|
||||
List<EquipmentResp> page(EquipmentListReq req);
|
||||
List<EquipmentResp> list(EquipmentListReq req);
|
||||
IPage<EquipmentResp> page(EquipmentListReq req);
|
||||
EquipmentResp detail(String equipmentId);
|
||||
void save(EquipmentReq req);
|
||||
void update(String equipmentId, EquipmentReq req);
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.TrainingPlanEntity;
|
||||
import com.dite.znpt.domain.vo.TrainingPlanListReq;
|
||||
import com.dite.znpt.domain.vo.TrainingPlanListResp;
|
||||
import com.dite.znpt.domain.vo.TrainingPlanReq;
|
||||
import com.dite.znpt.domain.vo.TrainingPlanResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训计划表服务接口
|
||||
*/
|
||||
public interface TrainingPlanService extends IService<TrainingPlanEntity> {
|
||||
|
||||
/**
|
||||
* 分页查询培训计划列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 培训计划列表
|
||||
*/
|
||||
List<TrainingPlanListResp> page(TrainingPlanListReq req);
|
||||
|
||||
/**
|
||||
* 查询培训计划列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 培训计划列表
|
||||
*/
|
||||
List<TrainingPlanListResp> list(TrainingPlanListReq req);
|
||||
|
||||
/**
|
||||
* 查询培训计划详情
|
||||
*
|
||||
* @param planId 培训计划ID
|
||||
* @return 培训计划详情
|
||||
*/
|
||||
TrainingPlanResp detail(String planId);
|
||||
|
||||
/**
|
||||
* 新增培训计划
|
||||
*
|
||||
* @param req 培训计划信息
|
||||
*/
|
||||
void save(TrainingPlanReq req);
|
||||
|
||||
/**
|
||||
* 更新培训计划
|
||||
*
|
||||
* @param planId 培训计划ID
|
||||
* @param req 培训计划信息
|
||||
*/
|
||||
void update(String planId, TrainingPlanReq req);
|
||||
|
||||
/**
|
||||
* 删除培训计划
|
||||
*
|
||||
* @param planId 培训计划ID
|
||||
*/
|
||||
void deleteById(String planId);
|
||||
|
||||
/**
|
||||
* 发布培训计划
|
||||
*
|
||||
* @param planId 培训计划ID
|
||||
*/
|
||||
void publish(String planId);
|
||||
|
||||
/**
|
||||
* 取消培训计划
|
||||
*
|
||||
* @param planId 培训计划ID
|
||||
*/
|
||||
void cancel(String planId);
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.TrainingRecordEntity;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训记录表服务接口
|
||||
*/
|
||||
public interface TrainingRecordService extends IService<TrainingRecordEntity> {
|
||||
|
||||
}
|
|
@ -1,97 +1,387 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.constant.Message;
|
||||
import com.dite.znpt.converts.Converts;
|
||||
// 移除EquipmentConverts导入,使用手动转换
|
||||
import com.dite.znpt.domain.entity.EquipmentEntity;
|
||||
import com.dite.znpt.domain.entity.EquipmentUseRecordEntity;
|
||||
import com.dite.znpt.domain.vo.EquipmentListReq;
|
||||
import com.dite.znpt.domain.vo.EquipmentReq;
|
||||
import com.dite.znpt.domain.vo.EquipmentResp;
|
||||
import com.dite.znpt.domain.vo.EquipmentUseRecordReq;
|
||||
import com.dite.znpt.enums.EquipmentStatusEnum;
|
||||
import com.dite.znpt.enums.EquipmentTypeEnum;
|
||||
import com.dite.znpt.enums.HealthStatusEnum;
|
||||
import com.dite.znpt.enums.LocationStatusEnum;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.mapper.EquipmentMapper;
|
||||
import com.dite.znpt.service.EquipmentService;
|
||||
import com.dite.znpt.service.EquipmentUseRecordService;
|
||||
import com.dite.znpt.service.ProjectService;
|
||||
import com.dite.znpt.service.UserService;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import com.dite.znpt.constant.Constants;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
* @date 2025/7/23/周三 17:39
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, EquipmentEntity> implements EquipmentService {
|
||||
|
||||
@Resource
|
||||
private EquipmentUseRecordService equipmentUseRecordService;
|
||||
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
@Resource
|
||||
private ProjectService projectService;
|
||||
|
||||
@Override
|
||||
public List<EquipmentResp> page(EquipmentListReq req) {
|
||||
PageUtil.startPage();
|
||||
return this.list(req);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EquipmentResp> list(EquipmentListReq req) {
|
||||
List<EquipmentResp> list = this.baseMapper.selectEquipmentResp(req);
|
||||
list.forEach(resp -> {
|
||||
resp.setEquipmentTypeLabel(EquipmentTypeEnum.getDescByCode(resp.getEquipmentType()));
|
||||
resp.setEquipmentStatusLabel(EquipmentStatusEnum.getDescByCode(resp.getEquipmentStatus()));
|
||||
});
|
||||
return list;
|
||||
public IPage<EquipmentResp> page(EquipmentListReq req) {
|
||||
log.info("开始执行设备分页查询,请求参数: {}", req);
|
||||
|
||||
// 创建分页对象
|
||||
Page<EquipmentEntity> page = new Page<>(req.getPage(), req.getPageSize());
|
||||
|
||||
// 构建查询条件
|
||||
LambdaQueryWrapper<EquipmentEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// 不需要手动添加 del_flag 条件,@TableLogic 注解会自动处理
|
||||
|
||||
// 添加搜索条件并记录日志
|
||||
int conditionCount = 0;
|
||||
|
||||
if (StringUtils.hasText(req.getEquipmentName())) {
|
||||
queryWrapper.like(EquipmentEntity::getEquipmentName, req.getEquipmentName());
|
||||
log.info("添加设备名称查询条件: {}", req.getEquipmentName());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getEquipmentType())) {
|
||||
queryWrapper.eq(EquipmentEntity::getEquipmentType, req.getEquipmentType());
|
||||
log.info("添加设备类型查询条件: {}", req.getEquipmentType());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getEquipmentStatus())) {
|
||||
queryWrapper.eq(EquipmentEntity::getEquipmentStatus, req.getEquipmentStatus());
|
||||
log.info("添加设备状态查询条件: {}", req.getEquipmentStatus());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getEquipmentSn())) {
|
||||
queryWrapper.like(EquipmentEntity::getEquipmentSn, req.getEquipmentSn());
|
||||
log.info("添加设备序列号查询条件: {}", req.getEquipmentSn());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getAssetCode())) {
|
||||
queryWrapper.like(EquipmentEntity::getAssetCode, req.getAssetCode());
|
||||
log.info("添加资产编号查询条件: {}", req.getAssetCode());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getBrand())) {
|
||||
queryWrapper.like(EquipmentEntity::getBrand, req.getBrand());
|
||||
log.info("添加品牌查询条件: {}", req.getBrand());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getLocationStatus())) {
|
||||
queryWrapper.eq(EquipmentEntity::getLocationStatus, req.getLocationStatus());
|
||||
log.info("添加位置状态查询条件: {}", req.getLocationStatus());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getHealthStatus())) {
|
||||
queryWrapper.eq(EquipmentEntity::getHealthStatus, req.getHealthStatus());
|
||||
log.info("添加健康状态查询条件: {}", req.getHealthStatus());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getResponsiblePerson())) {
|
||||
queryWrapper.like(EquipmentEntity::getResponsiblePerson, req.getResponsiblePerson());
|
||||
log.info("添加负责人查询条件: {}", req.getResponsiblePerson());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getUseStatus())) {
|
||||
queryWrapper.eq(EquipmentEntity::getUseStatus, req.getUseStatus());
|
||||
log.info("添加使用状态查询条件: {}", req.getUseStatus());
|
||||
conditionCount++;
|
||||
}
|
||||
|
||||
// 新增查询条件
|
||||
if (StringUtils.hasText(req.getEquipmentModel())) {
|
||||
queryWrapper.like(EquipmentEntity::getEquipmentModel, req.getEquipmentModel());
|
||||
log.info("添加设备型号查询条件: {}", req.getEquipmentModel());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getSpecification())) {
|
||||
queryWrapper.like(EquipmentEntity::getSpecification, req.getSpecification());
|
||||
log.info("添加配置规格查询条件: {}", req.getSpecification());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getPhysicalLocation())) {
|
||||
queryWrapper.like(EquipmentEntity::getPhysicalLocation, req.getPhysicalLocation());
|
||||
log.info("添加物理位置查询条件: {}", req.getPhysicalLocation());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getSupplierName())) {
|
||||
queryWrapper.like(EquipmentEntity::getSupplierName, req.getSupplierName());
|
||||
log.info("添加供应商名称查询条件: {}", req.getSupplierName());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getMaintenancePerson())) {
|
||||
queryWrapper.like(EquipmentEntity::getMaintenancePerson, req.getMaintenancePerson());
|
||||
log.info("添加维护人员查询条件: {}", req.getMaintenancePerson());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getInventoryBarcode())) {
|
||||
queryWrapper.like(EquipmentEntity::getInventoryBarcode, req.getInventoryBarcode());
|
||||
log.info("添加库存条码查询条件: {}", req.getInventoryBarcode());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getAssetRemark())) {
|
||||
queryWrapper.like(EquipmentEntity::getAssetRemark, req.getAssetRemark());
|
||||
log.info("添加资产备注查询条件: {}", req.getAssetRemark());
|
||||
conditionCount++;
|
||||
}
|
||||
|
||||
// 新增字段查询条件
|
||||
if (StringUtils.hasText(req.getUsingDepartment())) {
|
||||
queryWrapper.like(EquipmentEntity::getUsingDepartment, req.getUsingDepartment());
|
||||
log.info("添加使用部门/人查询条件: {}", req.getUsingDepartment());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getInvoice())) {
|
||||
queryWrapper.like(EquipmentEntity::getInvoice, req.getInvoice());
|
||||
log.info("添加发票查询条件: {}", req.getInvoice());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getBarcode())) {
|
||||
queryWrapper.like(EquipmentEntity::getBarcode, req.getBarcode());
|
||||
log.info("添加条码查询条件: {}", req.getBarcode());
|
||||
conditionCount++;
|
||||
}
|
||||
if (StringUtils.hasText(req.getImporter())) {
|
||||
queryWrapper.like(EquipmentEntity::getImporter, req.getImporter());
|
||||
log.info("添加导入人查询条件: {}", req.getImporter());
|
||||
conditionCount++;
|
||||
}
|
||||
|
||||
// 时间范围查询
|
||||
if (req.getPurchaseTimeStart() != null) {
|
||||
queryWrapper.ge(EquipmentEntity::getPurchaseTime, req.getPurchaseTimeStart());
|
||||
log.info("添加采购时间开始查询条件: {}", req.getPurchaseTimeStart());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getPurchaseTimeEnd() != null) {
|
||||
queryWrapper.le(EquipmentEntity::getPurchaseTime, req.getPurchaseTimeEnd());
|
||||
log.info("添加采购时间结束查询条件: {}", req.getPurchaseTimeEnd());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getInStockTimeStart() != null) {
|
||||
queryWrapper.ge(EquipmentEntity::getInStockTime, req.getInStockTimeStart());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getInStockTimeEnd() != null) {
|
||||
queryWrapper.le(EquipmentEntity::getInStockTime, req.getInStockTimeEnd());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getActivationTimeStart() != null) {
|
||||
queryWrapper.ge(EquipmentEntity::getActivationTime, req.getActivationTimeStart());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getActivationTimeEnd() != null) {
|
||||
queryWrapper.le(EquipmentEntity::getActivationTime, req.getActivationTimeEnd());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getExpectedScrapTimeStart() != null) {
|
||||
queryWrapper.ge(EquipmentEntity::getExpectedScrapTime, req.getExpectedScrapTimeStart());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getExpectedScrapTimeEnd() != null) {
|
||||
queryWrapper.le(EquipmentEntity::getExpectedScrapTime, req.getExpectedScrapTimeEnd());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getWarrantyExpireDateStart() != null) {
|
||||
queryWrapper.ge(EquipmentEntity::getWarrantyExpireDate, req.getWarrantyExpireDateStart());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getWarrantyExpireDateEnd() != null) {
|
||||
queryWrapper.le(EquipmentEntity::getWarrantyExpireDate, req.getWarrantyExpireDateEnd());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getLastMaintenanceDateStart() != null) {
|
||||
queryWrapper.ge(EquipmentEntity::getLastMaintenanceDate, req.getLastMaintenanceDateStart());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getLastMaintenanceDateEnd() != null) {
|
||||
queryWrapper.le(EquipmentEntity::getLastMaintenanceDate, req.getLastMaintenanceDateEnd());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getNextMaintenanceDateStart() != null) {
|
||||
queryWrapper.ge(EquipmentEntity::getNextMaintenanceDate, req.getNextMaintenanceDateStart());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getNextMaintenanceDateEnd() != null) {
|
||||
queryWrapper.le(EquipmentEntity::getNextMaintenanceDate, req.getNextMaintenanceDateEnd());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getCreateTimeStart() != null) {
|
||||
queryWrapper.ge(EquipmentEntity::getCreateTime, req.getCreateTimeStart());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getCreateTimeEnd() != null) {
|
||||
queryWrapper.le(EquipmentEntity::getCreateTime, req.getCreateTimeEnd());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getUpdateTimeStart() != null) {
|
||||
queryWrapper.ge(EquipmentEntity::getUpdateTime, req.getUpdateTimeStart());
|
||||
conditionCount++;
|
||||
}
|
||||
if (req.getUpdateTimeEnd() != null) {
|
||||
queryWrapper.le(EquipmentEntity::getUpdateTime, req.getUpdateTimeEnd());
|
||||
conditionCount++;
|
||||
}
|
||||
|
||||
log.info("总共添加了 {} 个查询条件", conditionCount);
|
||||
|
||||
// 排序处理
|
||||
if (StringUtils.hasText(req.getOrderBy())) {
|
||||
String orderBy = req.getOrderBy();
|
||||
String orderDirection = "desc".equalsIgnoreCase(req.getOrderDirection()) ? "desc" : "asc";
|
||||
|
||||
switch (orderBy.toLowerCase()) {
|
||||
case "equipment_name":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getEquipmentName);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getEquipmentName);
|
||||
}
|
||||
break;
|
||||
case "equipment_sn":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getEquipmentSn);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getEquipmentSn);
|
||||
}
|
||||
break;
|
||||
case "asset_code":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getAssetCode);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getAssetCode);
|
||||
}
|
||||
break;
|
||||
case "equipment_type":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getEquipmentType);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getEquipmentType);
|
||||
}
|
||||
break;
|
||||
case "equipment_status":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getEquipmentStatus);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getEquipmentStatus);
|
||||
}
|
||||
break;
|
||||
case "brand":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getBrand);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getBrand);
|
||||
}
|
||||
break;
|
||||
case "responsible_person":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getResponsiblePerson);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getResponsiblePerson);
|
||||
}
|
||||
break;
|
||||
case "purchase_time":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getPurchaseTime);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getPurchaseTime);
|
||||
}
|
||||
break;
|
||||
case "purchase_price":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getPurchasePrice);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getPurchasePrice);
|
||||
}
|
||||
break;
|
||||
case "update_time":
|
||||
if ("desc".equals(orderDirection)) {
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getUpdateTime);
|
||||
} else {
|
||||
queryWrapper.orderByAsc(EquipmentEntity::getUpdateTime);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// 默认按创建时间倒序
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getCreateTime);
|
||||
break;
|
||||
}
|
||||
log.info("添加排序条件: {} {}", orderBy, orderDirection);
|
||||
} else {
|
||||
// 默认按创建时间倒序
|
||||
queryWrapper.orderByDesc(EquipmentEntity::getCreateTime);
|
||||
log.info("使用默认排序: 按创建时间倒序");
|
||||
}
|
||||
|
||||
log.info("执行分页查询,SQL条件: {}", queryWrapper.getTargetSql());
|
||||
|
||||
// 执行分页查询
|
||||
IPage<EquipmentEntity> equipmentPage = this.page(page, queryWrapper);
|
||||
|
||||
log.info("查询完成,总记录数: {}, 当前页记录数: {}", equipmentPage.getTotal(), equipmentPage.getRecords().size());
|
||||
|
||||
// 转换为响应对象
|
||||
List<EquipmentResp> equipmentRespList = equipmentPage.getRecords().stream()
|
||||
.map(this::convertToResp)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 创建响应分页对象
|
||||
Page<EquipmentResp> respPage = new Page<>(equipmentPage.getCurrent(), equipmentPage.getSize(), equipmentPage.getTotal());
|
||||
respPage.setRecords(equipmentRespList);
|
||||
|
||||
return respPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EquipmentResp detail(String equipmentId) {
|
||||
EquipmentResp resp = this.baseMapper.getEquipmentRespByEquipmentId(equipmentId);
|
||||
resp.setEquipmentTypeLabel(EquipmentTypeEnum.getDescByCode(resp.getEquipmentType()));
|
||||
resp.setEquipmentStatusLabel(EquipmentStatusEnum.getDescByCode(resp.getEquipmentStatus()));
|
||||
return resp;
|
||||
EquipmentEntity equipment = this.getById(equipmentId);
|
||||
if (equipment == null) {
|
||||
throw new ServiceException(Message.EQUIPMENT_ID_NOT_EXIST);
|
||||
}
|
||||
return convertToResp(equipment);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void save(EquipmentReq req) {
|
||||
EquipmentEntity entity = Converts.INSTANCE.toEquipmentUseRecordEntity(req);
|
||||
if(null != getByEquipmentSn(entity.getEquipmentSn())){
|
||||
EquipmentEntity entity = convertToEntity(req);
|
||||
if (getByEquipmentSn(entity.getEquipmentSn()) != null) {
|
||||
throw new ServiceException(Message.EQUIPMENT_SN_EXIST);
|
||||
}
|
||||
this.save(entity);
|
||||
}
|
||||
|
||||
private EquipmentEntity getByEquipmentSn(String equipmentSn){
|
||||
return this.getOne(Wrappers.lambdaQuery(EquipmentEntity.class).eq(EquipmentEntity::getEquipmentSn, equipmentSn));
|
||||
private EquipmentEntity getByEquipmentSn(String equipmentSn) {
|
||||
LambdaQueryWrapper<EquipmentEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(EquipmentEntity::getEquipmentSn, equipmentSn);
|
||||
return this.getOne(queryWrapper);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void update(String equipmentId, EquipmentReq req) {
|
||||
EquipmentEntity equipment = this.getById(equipmentId);
|
||||
if(null == equipment){
|
||||
if (equipment == null) {
|
||||
throw new ServiceException(Message.EQUIPMENT_ID_NOT_EXIST);
|
||||
}
|
||||
if(!equipment.getEquipmentSn().equals(req.getEquipmentSn()) && null != getByEquipmentSn(req.getEquipmentSn())){
|
||||
if (!equipment.getEquipmentSn().equals(req.getEquipmentSn()) && getByEquipmentSn(req.getEquipmentSn()) != null) {
|
||||
throw new ServiceException(Message.EQUIPMENT_SN_EXIST);
|
||||
}
|
||||
EquipmentEntity entity = Converts.INSTANCE.toEquipmentUseRecordEntity(req);
|
||||
EquipmentEntity entity = convertToEntity(req);
|
||||
entity.setEquipmentId(equipmentId);
|
||||
this.updateById(entity);
|
||||
}
|
||||
|
@ -99,10 +389,194 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void deleteById(String equipmentId) {
|
||||
log.info("开始删除设备,设备ID: {}", equipmentId);
|
||||
|
||||
// 查询设备信息
|
||||
EquipmentEntity equipment = this.getById(equipmentId);
|
||||
if(null == equipment){
|
||||
if (equipment == null) {
|
||||
log.error("设备不存在,设备ID: {}", equipmentId);
|
||||
throw new ServiceException(Message.EQUIPMENT_ID_NOT_EXIST);
|
||||
}
|
||||
this.removeById(equipmentId);
|
||||
|
||||
// 检查设备是否已被删除
|
||||
if (!Constants.DEL_FLAG_0.equals(equipment.getDelFlag())) {
|
||||
log.error("设备已被删除,设备ID: {}", equipmentId);
|
||||
throw new ServiceException("设备已被删除");
|
||||
}
|
||||
|
||||
// 检查设备使用状态,如果设备正在使用中,不允许删除
|
||||
if ("1".equals(equipment.getUseStatus())) {
|
||||
log.error("设备正在使用中,无法删除,设备ID: {}, 设备名称: {}", equipmentId, equipment.getEquipmentName());
|
||||
throw new ServiceException("设备正在使用中,请先归还设备后再进行删除操作");
|
||||
}
|
||||
|
||||
// 检查设备位置状态,如果设备已分配或外借中,不允许删除
|
||||
if ("allocated".equals(equipment.getLocationStatus()) || "borrowed".equals(equipment.getLocationStatus())) {
|
||||
log.error("设备已分配或外借中,无法删除,设备ID: {}, 设备名称: {}, 位置状态: {}",
|
||||
equipmentId, equipment.getEquipmentName(), equipment.getLocationStatus());
|
||||
throw new ServiceException("设备已分配或外借中,请先归还设备后再进行删除操作");
|
||||
}
|
||||
|
||||
// 检查设备是否在维修中
|
||||
if ("repair".equals(equipment.getLocationStatus()) || "repair".equals(equipment.getEquipmentStatus())) {
|
||||
log.error("设备正在维修中,无法删除,设备ID: {}, 设备名称: {}", equipmentId, equipment.getEquipmentName());
|
||||
throw new ServiceException("设备正在维修中,请等待维修完成后再进行删除操作");
|
||||
}
|
||||
|
||||
// 先更新设备状态为已报废
|
||||
LambdaUpdateWrapper<EquipmentEntity> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(EquipmentEntity::getEquipmentId, equipmentId)
|
||||
.set(EquipmentEntity::getEquipmentStatus, "scrap")
|
||||
.set(EquipmentEntity::getLocationStatus, "scrapped")
|
||||
.set(EquipmentEntity::getActualScrapTime, LocalDateTime.now())
|
||||
.set(EquipmentEntity::getStatusChangeTime, LocalDateTime.now());
|
||||
|
||||
boolean updateResult = this.update(updateWrapper);
|
||||
if (!updateResult) {
|
||||
log.error("设备状态更新失败,设备ID: {}", equipmentId);
|
||||
throw new ServiceException("设备状态更新失败,请稍后重试");
|
||||
}
|
||||
|
||||
// 执行软删除 - 使用 MyBatis-Plus 的逻辑删除方法
|
||||
boolean deleteResult = this.removeById(equipmentId);
|
||||
|
||||
if (deleteResult) {
|
||||
log.info("设备删除成功,设备ID: {}, 设备名称: {}", equipmentId, equipment.getEquipmentName());
|
||||
} else {
|
||||
log.error("设备删除失败,设备ID: {}", equipmentId);
|
||||
throw new ServiceException("设备删除失败,请稍后重试");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将EquipmentReq转换为EquipmentEntity
|
||||
*/
|
||||
private EquipmentEntity convertToEntity(EquipmentReq req) {
|
||||
EquipmentEntity entity = new EquipmentEntity();
|
||||
entity.setAssetCode(req.getAssetCode());
|
||||
entity.setEquipmentName(req.getEquipmentName());
|
||||
entity.setEquipmentModel(req.getEquipmentModel());
|
||||
entity.setEquipmentType(req.getEquipmentType());
|
||||
entity.setEquipmentStatus(req.getEquipmentStatus());
|
||||
entity.setUseStatus(req.getUseStatus());
|
||||
entity.setEquipmentSn(req.getEquipmentSn());
|
||||
entity.setBrand(req.getBrand());
|
||||
entity.setSpecification(req.getSpecification());
|
||||
entity.setLocationStatus(req.getLocationStatus());
|
||||
entity.setPhysicalLocation(req.getPhysicalLocation());
|
||||
entity.setResponsiblePerson(req.getResponsiblePerson());
|
||||
entity.setHealthStatus(req.getHealthStatus());
|
||||
entity.setPurchaseTime(req.getPurchaseTime());
|
||||
entity.setInStockTime(req.getInStockTime());
|
||||
entity.setActivationTime(req.getActivationTime());
|
||||
entity.setExpectedScrapTime(req.getExpectedScrapTime());
|
||||
entity.setActualScrapTime(req.getActualScrapTime());
|
||||
entity.setStatusChangeTime(req.getStatusChangeTime());
|
||||
entity.setPurchaseOrder(req.getPurchaseOrder());
|
||||
entity.setSupplierName(req.getSupplierName());
|
||||
entity.setPurchasePrice(req.getPurchasePrice());
|
||||
entity.setCurrentNetValue(req.getCurrentNetValue());
|
||||
entity.setDepreciationMethod(req.getDepreciationMethod());
|
||||
entity.setDepreciationYears(req.getDepreciationYears());
|
||||
entity.setSalvageValue(req.getSalvageValue());
|
||||
entity.setWarrantyExpireDate(req.getWarrantyExpireDate());
|
||||
entity.setLastMaintenanceDate(req.getLastMaintenanceDate());
|
||||
entity.setNextMaintenanceDate(req.getNextMaintenanceDate());
|
||||
entity.setMaintenancePerson(req.getMaintenancePerson());
|
||||
entity.setInventoryBarcode(req.getInventoryBarcode());
|
||||
entity.setAssetRemark(req.getAssetRemark());
|
||||
|
||||
// 新增字段转换
|
||||
entity.setUsingDepartment(req.getUsingDepartment());
|
||||
entity.setBorrowingTime(req.getBorrowingTime());
|
||||
entity.setReturnTime(req.getReturnTime());
|
||||
entity.setOutStockTime(req.getOutStockTime());
|
||||
entity.setTotalUsageTime(req.getTotalUsageTime());
|
||||
entity.setDepreciationRate(req.getDepreciationRate());
|
||||
entity.setDepreciationMethodDesc(req.getDepreciationMethodDesc());
|
||||
entity.setInvoice(req.getInvoice());
|
||||
entity.setInvoiceStatus(req.getInvoiceStatus());
|
||||
entity.setAttachments(req.getAttachments());
|
||||
entity.setPhotos(req.getPhotos());
|
||||
entity.setBarcode(req.getBarcode());
|
||||
entity.setImporter(req.getImporter());
|
||||
entity.setInventoryTimeStatus1(req.getInventoryTimeStatus1());
|
||||
entity.setInventoryTimeStatus2(req.getInventoryTimeStatus2());
|
||||
entity.setInventoryTimeStatus3(req.getInventoryTimeStatus3());
|
||||
entity.setInventoryCheckTimeStatus1(req.getInventoryCheckTimeStatus1());
|
||||
entity.setInventoryCheckTimeStatus2(req.getInventoryCheckTimeStatus2());
|
||||
entity.setInventoryCheckTimeStatus3(req.getInventoryCheckTimeStatus3());
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换为响应对象
|
||||
*/
|
||||
private EquipmentResp convertToResp(EquipmentEntity entity) {
|
||||
EquipmentResp resp = new EquipmentResp();
|
||||
resp.setEquipmentId(entity.getEquipmentId());
|
||||
resp.setAssetCode(entity.getAssetCode());
|
||||
resp.setEquipmentName(entity.getEquipmentName());
|
||||
resp.setEquipmentType(entity.getEquipmentType());
|
||||
resp.setEquipmentTypeLabel(EquipmentTypeEnum.getDescByCode(entity.getEquipmentType()));
|
||||
resp.setEquipmentModel(entity.getEquipmentModel());
|
||||
resp.setEquipmentSn(entity.getEquipmentSn());
|
||||
resp.setBrand(entity.getBrand());
|
||||
resp.setSpecification(entity.getSpecification());
|
||||
resp.setEquipmentStatus(entity.getEquipmentStatus());
|
||||
resp.setEquipmentStatusLabel(EquipmentStatusEnum.getDescByCode(entity.getEquipmentStatus()));
|
||||
resp.setUseStatus(entity.getUseStatus());
|
||||
resp.setLocationStatus(entity.getLocationStatus());
|
||||
resp.setLocationStatusLabel(LocationStatusEnum.getDescByCode(entity.getLocationStatus()));
|
||||
resp.setPhysicalLocation(entity.getPhysicalLocation());
|
||||
resp.setResponsiblePerson(entity.getResponsiblePerson());
|
||||
resp.setHealthStatus(entity.getHealthStatus());
|
||||
resp.setHealthStatusLabel(HealthStatusEnum.getDescByCode(entity.getHealthStatus()));
|
||||
resp.setPurchaseTime(entity.getPurchaseTime());
|
||||
resp.setInStockTime(entity.getInStockTime());
|
||||
resp.setActivationTime(entity.getActivationTime());
|
||||
resp.setExpectedScrapTime(entity.getExpectedScrapTime());
|
||||
resp.setActualScrapTime(entity.getActualScrapTime());
|
||||
resp.setStatusChangeTime(entity.getStatusChangeTime());
|
||||
resp.setPurchaseOrder(entity.getPurchaseOrder());
|
||||
resp.setSupplierName(entity.getSupplierName());
|
||||
resp.setPurchasePrice(entity.getPurchasePrice());
|
||||
resp.setCurrentNetValue(entity.getCurrentNetValue());
|
||||
resp.setDepreciationMethod(entity.getDepreciationMethod());
|
||||
resp.setDepreciationYears(entity.getDepreciationYears());
|
||||
resp.setSalvageValue(entity.getSalvageValue());
|
||||
resp.setWarrantyExpireDate(entity.getWarrantyExpireDate());
|
||||
resp.setLastMaintenanceDate(entity.getLastMaintenanceDate());
|
||||
resp.setNextMaintenanceDate(entity.getNextMaintenanceDate());
|
||||
resp.setMaintenancePerson(entity.getMaintenancePerson());
|
||||
resp.setInventoryBarcode(entity.getInventoryBarcode());
|
||||
resp.setAssetRemark(entity.getAssetRemark());
|
||||
|
||||
// 新增字段转换
|
||||
resp.setUsingDepartment(entity.getUsingDepartment());
|
||||
resp.setBorrowingTime(entity.getBorrowingTime());
|
||||
resp.setReturnTime(entity.getReturnTime());
|
||||
resp.setOutStockTime(entity.getOutStockTime());
|
||||
resp.setTotalUsageTime(entity.getTotalUsageTime());
|
||||
resp.setDepreciationRate(entity.getDepreciationRate());
|
||||
resp.setDepreciationMethodDesc(entity.getDepreciationMethodDesc());
|
||||
resp.setInvoice(entity.getInvoice());
|
||||
resp.setInvoiceStatus(entity.getInvoiceStatus());
|
||||
resp.setAttachments(entity.getAttachments());
|
||||
resp.setPhotos(entity.getPhotos());
|
||||
resp.setBarcode(entity.getBarcode());
|
||||
resp.setImporter(entity.getImporter());
|
||||
resp.setInventoryTimeStatus1(entity.getInventoryTimeStatus1());
|
||||
resp.setInventoryTimeStatus2(entity.getInventoryTimeStatus2());
|
||||
resp.setInventoryTimeStatus3(entity.getInventoryTimeStatus3());
|
||||
resp.setInventoryCheckTimeStatus1(entity.getInventoryCheckTimeStatus1());
|
||||
resp.setInventoryCheckTimeStatus2(entity.getInventoryCheckTimeStatus2());
|
||||
resp.setInventoryCheckTimeStatus3(entity.getInventoryCheckTimeStatus3());
|
||||
|
||||
resp.setCreateTime(entity.getCreateTime());
|
||||
resp.setUpdateTime(entity.getUpdateTime());
|
||||
|
||||
return resp;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,123 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import com.dite.znpt.domain.entity.TrainingPlanEntity;
|
||||
import com.dite.znpt.domain.vo.TrainingPlanListReq;
|
||||
import com.dite.znpt.domain.vo.TrainingPlanListResp;
|
||||
import com.dite.znpt.domain.vo.TrainingPlanReq;
|
||||
import com.dite.znpt.domain.vo.TrainingPlanResp;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.mapper.TrainingPlanMapper;
|
||||
import com.dite.znpt.service.TrainingPlanService;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训计划表服务实现类
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TrainingPlanServiceImpl extends ServiceImpl<TrainingPlanMapper, TrainingPlanEntity> implements TrainingPlanService {
|
||||
|
||||
@Override
|
||||
public List<TrainingPlanListResp> page(TrainingPlanListReq req) {
|
||||
PageUtil.startPage();
|
||||
return this.list(req);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TrainingPlanListResp> list(TrainingPlanListReq req) {
|
||||
return this.baseMapper.listTrainingPlanListResp(req);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TrainingPlanResp detail(String planId) {
|
||||
TrainingPlanEntity entity = this.baseMapper.selectById(planId);
|
||||
if (entity == null) {
|
||||
throw new ServiceException("培训计划不存在");
|
||||
}
|
||||
return BeanUtil.copyProperties(entity, TrainingPlanResp.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(TrainingPlanReq req) {
|
||||
TrainingPlanEntity entity = BeanUtil.copyProperties(req, TrainingPlanEntity.class);
|
||||
entity.setStatus("DRAFT");
|
||||
entity.setCreateBy(StpUtil.getLoginIdAsString());
|
||||
this.baseMapper.insert(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(String planId, TrainingPlanReq req) {
|
||||
TrainingPlanEntity entity = this.baseMapper.selectById(planId);
|
||||
if (entity == null) {
|
||||
throw new ServiceException("培训计划不存在");
|
||||
}
|
||||
|
||||
BeanUtil.copyProperties(req, entity);
|
||||
entity.setUpdateBy(StpUtil.getLoginIdAsString());
|
||||
this.baseMapper.updateById(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteById(String planId) {
|
||||
TrainingPlanEntity entity = this.baseMapper.selectById(planId);
|
||||
if (entity == null) {
|
||||
throw new ServiceException("培训计划不存在");
|
||||
}
|
||||
|
||||
// 检查是否可以删除
|
||||
if ("PUBLISHED".equals(entity.getStatus()) || "IN_PROGRESS".equals(entity.getStatus())) {
|
||||
throw new ServiceException("已发布或进行中的培训计划不能删除");
|
||||
}
|
||||
|
||||
this.baseMapper.deleteById(planId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void publish(String planId) {
|
||||
TrainingPlanEntity entity = this.baseMapper.selectById(planId);
|
||||
if (entity == null) {
|
||||
throw new ServiceException("培训计划不存在");
|
||||
}
|
||||
|
||||
if (!"DRAFT".equals(entity.getStatus())) {
|
||||
throw new ServiceException("只有草稿状态的培训计划才能发布");
|
||||
}
|
||||
|
||||
entity.setStatus("PUBLISHED");
|
||||
entity.setUpdateBy(StpUtil.getLoginIdAsString());
|
||||
this.baseMapper.updateById(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void cancel(String planId) {
|
||||
TrainingPlanEntity entity = this.baseMapper.selectById(planId);
|
||||
if (entity == null) {
|
||||
throw new ServiceException("培训计划不存在");
|
||||
}
|
||||
|
||||
if ("COMPLETED".equals(entity.getStatus()) || "CANCELLED".equals(entity.getStatus())) {
|
||||
throw new ServiceException("已完成或已取消的培训计划不能取消");
|
||||
}
|
||||
|
||||
entity.setStatus("CANCELLED");
|
||||
entity.setUpdateBy(StpUtil.getLoginIdAsString());
|
||||
this.baseMapper.updateById(entity);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.domain.entity.TrainingRecordEntity;
|
||||
import com.dite.znpt.mapper.TrainingRecordMapper;
|
||||
import com.dite.znpt.service.TrainingRecordService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训记录表服务实现类
|
||||
*/
|
||||
@Service
|
||||
public class TrainingRecordServiceImpl extends ServiceImpl<TrainingRecordMapper, TrainingRecordEntity> implements TrainingRecordService {
|
||||
|
||||
}
|
|
@ -18,6 +18,10 @@ public class PageUtil extends PageHelper {
|
|||
PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable);
|
||||
}
|
||||
|
||||
public static void startPage(Integer pageNum, Integer pageSize) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
}
|
||||
|
||||
public static void clearPage() {
|
||||
PageHelper.clearPage();
|
||||
}
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.dite.znpt.mapper.EquipmentMapper">
|
||||
<select id="selectEquipmentResp" resultType="com.dite.znpt.domain.vo.EquipmentResp">
|
||||
SELECT eq.equipment_id, eq.equipment_name, eq.equipment_type, eq.equipment_model, eq.equipment_sn, eq.equipment_status, eq.use_status,
|
||||
equr.user_id, u.`name`, equr.project_id, p.project_name
|
||||
FROM equipment eq
|
||||
LEFT JOIN equipment_use_record equr ON eq.use_record_id = equr.use_record_id
|
||||
LEFT JOIN project p ON p.project_id = equr.project_id
|
||||
LEFT JOIN user u ON u.user_id = equr.user_id
|
||||
WHERE eq.del_flag = '0'
|
||||
<if test="req.equipmentName != null and req.equipmentName != ''">
|
||||
AND eq.equipment_name LIKE CONCAT('%', #{req.equipmentName}, '%')
|
||||
</if>
|
||||
<if test="req.equipmentType != null and req.equipmentType != ''">
|
||||
AND eq.equipment_type = #{req.equipmentType}
|
||||
</if>
|
||||
<if test="req.equipmentStatus != null and req.equipmentStatus != ''">
|
||||
AND eq.req.equipment_status = #{req.equipmentStatus}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getEquipmentRespByEquipmentId" resultType="com.dite.znpt.domain.vo.EquipmentResp">
|
||||
SELECT eq.equipment_id, eq.equipment_name, eq.equipment_type, eq.equipment_model, eq.equipment_sn, eq.equipment_status, eq.use_status,
|
||||
equr.user_id, u.`name`, equr.project_id, p.project_name
|
||||
FROM equipment eq
|
||||
LEFT JOIN equipment_use_record equr ON eq.use_record_id = equr.use_record_id
|
||||
LEFT JOIN project p ON p.project_id = equr.project_id
|
||||
LEFT JOIN user u ON u.user_id = equr.user_id
|
||||
WHERE eq.equipment_id = #{equipmentId} AND eq.del_flag = '0'
|
||||
</select>
|
||||
</mapper>
|
|
@ -0,0 +1,50 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.dite.znpt.mapper.TrainingPlanMapper">
|
||||
|
||||
<!-- 查询培训计划列表 -->
|
||||
<select id="listTrainingPlanListResp" resultType="com.dite.znpt.domain.vo.TrainingPlanListResp">
|
||||
SELECT
|
||||
tp.plan_id,
|
||||
tp.plan_name,
|
||||
tp.training_type,
|
||||
tp.training_level,
|
||||
tp.training_content,
|
||||
tp.trainer,
|
||||
tp.training_location,
|
||||
tp.start_time,
|
||||
tp.end_time,
|
||||
tp.status,
|
||||
tp.max_participants,
|
||||
tp.requirements,
|
||||
tp.remark,
|
||||
tp.create_time,
|
||||
tp.create_by,
|
||||
(SELECT COUNT(*) FROM training_record tr WHERE tr.plan_id = tp.plan_id AND tr.del_flag = '0') as current_participants
|
||||
FROM training_plan tp
|
||||
WHERE tp.del_flag = '0'
|
||||
<if test="req.planName != null and req.planName != ''">
|
||||
AND tp.plan_name LIKE CONCAT('%', #{req.planName}, '%')
|
||||
</if>
|
||||
<if test="req.trainingType != null and req.trainingType != ''">
|
||||
AND tp.training_type = #{req.trainingType}
|
||||
</if>
|
||||
<if test="req.trainingLevel != null and req.trainingLevel != ''">
|
||||
AND tp.training_level = #{req.trainingLevel}
|
||||
</if>
|
||||
<if test="req.status != null and req.status != ''">
|
||||
AND tp.status = #{req.status}
|
||||
</if>
|
||||
<if test="req.trainer != null and req.trainer != ''">
|
||||
AND tp.trainer LIKE CONCAT('%', #{req.trainer}, '%')
|
||||
</if>
|
||||
<if test="req.startTime != null and req.startTime != ''">
|
||||
AND tp.start_time >= #{req.startTime}
|
||||
</if>
|
||||
<if test="req.endTime != null and req.endTime != ''">
|
||||
AND tp.end_time <= #{req.endTime}
|
||||
</if>
|
||||
ORDER BY tp.create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
459
doc/aesDemo.html
459
doc/aesDemo.html
|
@ -1,459 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>AES加密解密工具</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" rel="stylesheet">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js"></script>
|
||||
<script>
|
||||
tailwind.config = {
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
primary: '#3b82f6',
|
||||
secondary: '#10b981',
|
||||
accent: '#6366f1',
|
||||
dark: '#1e293b',
|
||||
light: '#f8fafc'
|
||||
},
|
||||
fontFamily: {
|
||||
inter: ['Inter', 'system-ui', 'sans-serif'],
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style type="text/tailwindcss">
|
||||
@layer utilities {
|
||||
.content-auto {
|
||||
content-visibility: auto;
|
||||
}
|
||||
.text-shadow {
|
||||
text-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
}
|
||||
.card-shadow {
|
||||
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.transition-custom {
|
||||
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="font-inter bg-gradient-to-br from-light to-blue-50 min-h-screen">
|
||||
<div class="container mx-auto px-4 py-8 max-w-5xl">
|
||||
<!-- 标题区域 -->
|
||||
<header class="mb-12 text-center">
|
||||
<h1 class="text-[clamp(2rem,5vw,3.5rem)] font-bold text-dark mb-3 text-shadow">
|
||||
<i class="fa-solid fa-lock text-primary mr-3"></i>AES加密解密工具
|
||||
</h1>
|
||||
<p class="text-gray-600 text-lg max-w-2xl mx-auto">
|
||||
使用先进的AES加密算法保护您的数据安全,支持多种加密模式和密钥长度
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<!-- 主内容区 -->
|
||||
<main class="grid grid-cols-1 lg:grid-cols-2 gap-8">
|
||||
<!-- 加密区域 -->
|
||||
<section class="bg-white rounded-2xl p-6 card-shadow transition-custom hover:shadow-xl">
|
||||
<h2 class="text-2xl font-bold text-dark mb-6 flex items-center">
|
||||
<i class="fa-solid fa-shield-lock text-primary mr-2"></i>加密
|
||||
</h2>
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label for="plaintext" class="block text-sm font-medium text-gray-700 mb-1">明文</label>
|
||||
<textarea id="plaintext" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-primary/50 focus:border-primary transition-custom resize-none" rows="4" placeholder="请输入要加密的文本..."></textarea>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="encrypt-key" class="block text-sm font-medium text-gray-700 mb-1">密钥</label>
|
||||
<div class="relative">
|
||||
<input type="text" id="encrypt-key" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-primary/50 focus:border-primary transition-custom" placeholder="请输入16/24/32字节密钥..." value="1234567890123456">
|
||||
<button type="button" id="generate-key" class="absolute right-2 top-1/2 -translate-y-1/2 text-primary hover:text-primary/80 transition-custom">
|
||||
<i class="fa-solid fa-refresh"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">加密选项</label>
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label for="encrypt-mode" class="block text-xs text-gray-500 mb-1">加密模式</label>
|
||||
<select id="encrypt-mode" class="w-full px-3 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-primary/50 focus:border-primary transition-custom">
|
||||
<option value="ECB">ECB</option>
|
||||
<option value="CBC">CBC</option>
|
||||
<option value="CFB">CFB</option>
|
||||
<option value="OFB">OFB</option>
|
||||
<option value="CTR">CTR</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="encrypt-padding" class="block text-xs text-gray-500 mb-1">填充方式</label>
|
||||
<select id="encrypt-padding" class="w-full px-3 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-primary/50 focus:border-primary transition-custom">
|
||||
<option value="Pkcs7">PKCS#7</option>
|
||||
<option value="Iso97971">ISO 9797-1</option>
|
||||
<option value="AnsiX923">ANSI X.923</option>
|
||||
<option value="Iso10126">ISO 10126</option>
|
||||
<option value="ZeroPadding">Zero Padding</option>
|
||||
<option value="NoPadding">No Padding</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="iv-container" class="hidden">
|
||||
<label for="encrypt-iv" class="block text-sm font-medium text-gray-700 mb-1">初始化向量(IV)</label>
|
||||
<input type="text" id="encrypt-iv" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-primary/50 focus:border-primary transition-custom" placeholder="请输入16字节初始化向量...">
|
||||
</div>
|
||||
|
||||
<button id="encrypt-btn" class="w-full bg-primary hover:bg-primary/90 text-white font-medium py-3 px-4 rounded-lg transition-custom transform hover:scale-[1.02] flex items-center justify-center">
|
||||
<i class="fa-solid fa-lock mr-2"></i>加密
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 解密区域 -->
|
||||
<section class="bg-white rounded-2xl p-6 card-shadow transition-custom hover:shadow-xl">
|
||||
<h2 class="text-2xl font-bold text-dark mb-6 flex items-center">
|
||||
<i class="fa-solid fa-unlock text-secondary mr-2"></i>解密
|
||||
</h2>
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label for="ciphertext" class="block text-sm font-medium text-gray-700 mb-1">密文</label>
|
||||
<textarea id="ciphertext" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-secondary/50 focus:border-secondary transition-custom resize-none" rows="4" placeholder="请输入要解密的文本..."></textarea>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="decrypt-key" class="block text-sm font-medium text-gray-700 mb-1">密钥</label>
|
||||
<input type="text" id="decrypt-key" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-secondary/50 focus:border-secondary transition-custom" placeholder="请输入16/24/32字节密钥..." value="1234567890123456">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">解密选项</label>
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label for="decrypt-mode" class="block text-xs text-gray-500 mb-1">解密模式</label>
|
||||
<select id="decrypt-mode" class="w-full px-3 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-secondary/50 focus:border-secondary transition-custom">
|
||||
<option value="ECB">ECB</option>
|
||||
<option value="CBC">CBC</option>
|
||||
<option value="CFB">CFB</option>
|
||||
<option value="OFB">OFB</option>
|
||||
<option value="CTR">CTR</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="decrypt-padding" class="block text-xs text-gray-500 mb-1">填充方式</label>
|
||||
<select id="decrypt-padding" class="w-full px-3 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-secondary/50 focus:border-secondary transition-custom">
|
||||
<option value="Pkcs7">PKCS#7</option>
|
||||
<option value="Iso97971">ISO 9797-1</option>
|
||||
<option value="AnsiX923">ANSI X.923</option>
|
||||
<option value="Iso10126">ISO 10126</option>
|
||||
<option value="ZeroPadding">Zero Padding</option>
|
||||
<option value="NoPadding">No Padding</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="decrypt-iv-container" class="hidden">
|
||||
<label for="decrypt-iv" class="block text-sm font-medium text-gray-700 mb-1">初始化向量(IV)</label>
|
||||
<input type="text" id="decrypt-iv" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-secondary/50 focus:border-secondary transition-custom" placeholder="请输入16字节初始化向量...">
|
||||
</div>
|
||||
|
||||
<button id="decrypt-btn" class="w-full bg-secondary hover:bg-secondary/90 text-white font-medium py-3 px-4 rounded-lg transition-custom transform hover:scale-[1.02] flex items-center justify-center">
|
||||
<i class="fa-solid fa-unlock mr-2"></i>解密
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- 结果展示区 -->
|
||||
<section class="mt-8 bg-white rounded-2xl p-6 card-shadow">
|
||||
<h2 class="text-2xl font-bold text-dark mb-4 flex items-center">
|
||||
<i class="fa-solid fa-file-text text-accent mr-2"></i>结果
|
||||
</h2>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">加密结果</label>
|
||||
<div class="relative">
|
||||
<textarea id="encrypt-result" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-accent/50 focus:border-accent transition-custom resize-none" rows="4" readonly placeholder="加密结果将显示在这里..."></textarea>
|
||||
<button id="copy-encrypt" class="absolute right-2 top-2 text-gray-500 hover:text-accent transition-custom">
|
||||
<i class="fa-solid fa-copy"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">解密结果</label>
|
||||
<div class="relative">
|
||||
<textarea id="decrypt-result" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-accent/50 focus:border-accent transition-custom resize-none" rows="4" readonly placeholder="解密结果将显示在这里..."></textarea>
|
||||
<button id="copy-decrypt" class="absolute right-2 top-2 text-gray-500 hover:text-accent transition-custom">
|
||||
<i class="fa-solid fa-copy"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 信息提示区 -->
|
||||
<div id="notification" class="fixed bottom-4 right-4 bg-dark text-white px-6 py-3 rounded-lg shadow-lg transform translate-y-20 opacity-0 transition-all duration-300 flex items-center">
|
||||
<i id="notification-icon" class="fa-solid fa-info-circle mr-2"></i>
|
||||
<span id="notification-message">操作成功</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 加密函数
|
||||
function encrypt() {
|
||||
const plaintext = document.getElementById('plaintext').value.trim();
|
||||
const key = document.getElementById('encrypt-key').value.trim();
|
||||
const mode = document.getElementById('encrypt-mode').value;
|
||||
const padding = document.getElementById('encrypt-padding').value;
|
||||
const iv = document.getElementById('encrypt-iv').value.trim();
|
||||
|
||||
if (!plaintext) {
|
||||
showNotification('请输入明文', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!key) {
|
||||
showNotification('请输入密钥', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// 获取加密模式
|
||||
const modeObj = getModeObject(mode);
|
||||
|
||||
// 获取填充方式
|
||||
const paddingObj = getPaddingObject(padding);
|
||||
|
||||
// 准备加密参数
|
||||
const keyUtf8 = CryptoJS.enc.Utf8.parse(key);
|
||||
let encrypted;
|
||||
|
||||
// 根据模式是否需要IV
|
||||
if (mode === 'ECB') {
|
||||
encrypted = CryptoJS.AES.encrypt(plaintext, keyUtf8, {
|
||||
mode: modeObj,
|
||||
padding: paddingObj
|
||||
});
|
||||
} else {
|
||||
if (!iv) {
|
||||
showNotification('使用该模式需要输入初始化向量(IV)', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
const ivUtf8 = CryptoJS.enc.Utf8.parse(iv);
|
||||
encrypted = CryptoJS.AES.encrypt(plaintext, keyUtf8, {
|
||||
iv: ivUtf8,
|
||||
mode: modeObj,
|
||||
padding: paddingObj
|
||||
});
|
||||
}
|
||||
|
||||
// 显示加密结果
|
||||
const encryptedResult = encrypted.toString();
|
||||
document.getElementById('encrypt-result').value = encryptedResult;
|
||||
document.getElementById('ciphertext').value = encryptedResult;
|
||||
|
||||
showNotification('加密成功', 'success');
|
||||
} catch (error) {
|
||||
console.error('加密错误:', error);
|
||||
showNotification('加密失败: ' + error.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
// 解密函数
|
||||
function decrypt() {
|
||||
const ciphertext = document.getElementById('ciphertext').value.trim();
|
||||
const key = document.getElementById('decrypt-key').value.trim();
|
||||
const mode = document.getElementById('decrypt-mode').value;
|
||||
const padding = document.getElementById('decrypt-padding').value;
|
||||
const iv = document.getElementById('decrypt-iv').value.trim();
|
||||
|
||||
if (!ciphertext) {
|
||||
showNotification('请输入密文', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!key) {
|
||||
showNotification('请输入密钥', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// 获取解密模式
|
||||
const modeObj = getModeObject(mode);
|
||||
|
||||
// 获取填充方式
|
||||
const paddingObj = getPaddingObject(padding);
|
||||
|
||||
// 准备解密参数
|
||||
const keyUtf8 = CryptoJS.enc.Utf8.parse(key);
|
||||
|
||||
// 根据模式是否需要IV
|
||||
let decrypted;
|
||||
if (mode === 'ECB') {
|
||||
decrypted = CryptoJS.AES.decrypt(ciphertext, keyUtf8, {
|
||||
mode: modeObj,
|
||||
padding: paddingObj
|
||||
});
|
||||
} else {
|
||||
if (!iv) {
|
||||
showNotification('使用该模式需要输入初始化向量(IV)', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
const ivUtf8 = CryptoJS.enc.Utf8.parse(iv);
|
||||
decrypted = CryptoJS.AES.decrypt(ciphertext, keyUtf8, {
|
||||
iv: ivUtf8,
|
||||
mode: modeObj,
|
||||
padding: paddingObj
|
||||
});
|
||||
}
|
||||
|
||||
// 显示解密结果
|
||||
const decryptedResult = decrypted.toString(CryptoJS.enc.Utf8);
|
||||
document.getElementById('decrypt-result').value = decryptedResult;
|
||||
|
||||
showNotification('解密成功', 'success');
|
||||
} catch (error) {
|
||||
console.error('解密错误:', error);
|
||||
showNotification('解密失败: ' + error.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
// 根据名称获取加密/解密模式对象
|
||||
function getModeObject(modeName) {
|
||||
switch (modeName) {
|
||||
case 'ECB': return CryptoJS.mode.ECB;
|
||||
case 'CBC': return CryptoJS.mode.CBC;
|
||||
case 'CFB': return CryptoJS.mode.CFB;
|
||||
case 'OFB': return CryptoJS.mode.OFB;
|
||||
case 'CTR': return CryptoJS.mode.CTR;
|
||||
default: return CryptoJS.mode.ECB;
|
||||
}
|
||||
}
|
||||
|
||||
// 根据名称获取填充方式对象
|
||||
function getPaddingObject(paddingName) {
|
||||
switch (paddingName) {
|
||||
case 'Pkcs7': return CryptoJS.pad.Pkcs7;
|
||||
case 'Iso97971': return CryptoJS.pad.Iso97971;
|
||||
case 'AnsiX923': return CryptoJS.pad.AnsiX923;
|
||||
case 'Iso10126': return CryptoJS.pad.Iso10126;
|
||||
case 'ZeroPadding': return CryptoJS.pad.ZeroPadding;
|
||||
case 'NoPadding': return CryptoJS.pad.NoPadding;
|
||||
default: return CryptoJS.pad.Pkcs7;
|
||||
}
|
||||
}
|
||||
|
||||
// 生成随机密钥
|
||||
function generateRandomKey(length = 16) {
|
||||
const charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
let key = "";
|
||||
for (let i = 0; i < length; i++) {
|
||||
key += charset.charAt(Math.floor(Math.random() * charset.length));
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
// 显示通知
|
||||
function showNotification(message, type = 'info') {
|
||||
const notification = document.getElementById('notification');
|
||||
const notificationIcon = document.getElementById('notification-icon');
|
||||
const notificationMessage = document.getElementById('notification-message');
|
||||
|
||||
// 设置通知类型
|
||||
notification.className = 'fixed bottom-4 right-4 px-6 py-3 rounded-lg shadow-lg transform translate-y-20 opacity-0 transition-all duration-300 flex items-center';
|
||||
|
||||
if (type === 'success') {
|
||||
notification.classList.add('bg-green-500', 'text-white');
|
||||
notificationIcon.className = 'fa-solid fa-check-circle mr-2';
|
||||
} else if (type === 'error') {
|
||||
notification.classList.add('bg-red-500', 'text-white');
|
||||
notificationIcon.className = 'fa-solid fa-exclamation-circle mr-2';
|
||||
} else {
|
||||
notification.classList.add('bg-dark', 'text-white');
|
||||
notificationIcon.className = 'fa-solid fa-info-circle mr-2';
|
||||
}
|
||||
|
||||
// 设置通知消息
|
||||
notificationMessage.textContent = message;
|
||||
|
||||
// 显示通知
|
||||
setTimeout(() => {
|
||||
notification.classList.remove('translate-y-20', 'opacity-0');
|
||||
}, 10);
|
||||
|
||||
// 3秒后隐藏通知
|
||||
setTimeout(() => {
|
||||
notification.classList.add('translate-y-20', 'opacity-0');
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
// 复制到剪贴板
|
||||
function copyToClipboard(elementId) {
|
||||
const element = document.getElementById(elementId);
|
||||
element.select();
|
||||
document.execCommand('copy');
|
||||
showNotification('已复制到剪贴板', 'success');
|
||||
}
|
||||
|
||||
// 模式变更事件处理
|
||||
function handleModeChange() {
|
||||
const encryptMode = document.getElementById('encrypt-mode').value;
|
||||
const decryptMode = document.getElementById('decrypt-mode').value;
|
||||
|
||||
// 显示或隐藏加密IV输入框
|
||||
const encryptIvContainer = document.getElementById('iv-container');
|
||||
if (encryptMode === 'ECB') {
|
||||
encryptIvContainer.classList.add('hidden');
|
||||
} else {
|
||||
encryptIvContainer.classList.remove('hidden');
|
||||
}
|
||||
|
||||
// 显示或隐藏解密IV输入框
|
||||
const decryptIvContainer = document.getElementById('decrypt-iv-container');
|
||||
if (decryptMode === 'ECB') {
|
||||
decryptIvContainer.classList.add('hidden');
|
||||
} else {
|
||||
decryptIvContainer.classList.remove('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
// 生成随机密钥
|
||||
document.getElementById('generate-key').addEventListener('click', () => {
|
||||
document.getElementById('encrypt-key').value = generateRandomKey(16);
|
||||
document.getElementById('decrypt-key').value = document.getElementById('encrypt-key').value;
|
||||
showNotification('已生成随机密钥', 'success');
|
||||
});
|
||||
|
||||
// 加密按钮点击事件
|
||||
document.getElementById('encrypt-btn').addEventListener('click', encrypt);
|
||||
|
||||
// 解密按钮点击事件
|
||||
document.getElementById('decrypt-btn').addEventListener('click', decrypt);
|
||||
|
||||
// 复制加密结果
|
||||
document.getElementById('copy-encrypt').addEventListener('click', () => copyToClipboard('encrypt-result'));
|
||||
|
||||
// 复制解密结果
|
||||
document.getElementById('copy-decrypt').addEventListener('click', () => copyToClipboard('decrypt-result'));
|
||||
|
||||
// 模式变更事件
|
||||
document.getElementById('encrypt-mode').addEventListener('change', handleModeChange);
|
||||
document.getElementById('decrypt-mode').addEventListener('change', handleModeChange);
|
||||
|
||||
// 初始化
|
||||
handleModeChange();
|
||||
|
||||
// 添加示例数据
|
||||
document.getElementById('plaintext').value = '这是一个使用AES加密的示例文本,您可以替换为自己的内容。';
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
107
pom.xml
107
pom.xml
|
@ -1,54 +1,53 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.dite.znpt</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
</properties>
|
||||
<modules>
|
||||
<module>core</module>
|
||||
<module>sip</module>
|
||||
<module>web</module>
|
||||
<module>flowable</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<!-- 依赖声明 -->
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.7.18</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.24</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.1</version>
|
||||
<configuration>
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.dite.znpt</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
</properties>
|
||||
<modules>
|
||||
<module>core</module>
|
||||
<module>web</module>
|
||||
<module>flowable</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<!-- 依赖声明 -->
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.7.18</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.24</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.1</version>
|
||||
<configuration>
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -20,11 +20,6 @@
|
|||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.dite.znpt</groupId>
|
||||
<artifactId>sip</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.dite.znpt</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
|
@ -55,6 +50,7 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.dite.znpt.web.controller;
|
||||
|
||||
import com.dite.znpt.constant.Message;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.vo.ImageWorkReq;
|
||||
import com.dite.znpt.enums.*;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.service.ImageService;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -15,9 +15,9 @@ import javax.annotation.Resource;
|
|||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @Author: gaoxiong
|
||||
* @Date: 2025/4/29 23:06
|
||||
* @Description:
|
||||
* @author Bear.G
|
||||
* @date 2025/7/24/周四 14:35
|
||||
* @description
|
||||
*/
|
||||
@Api(tags = "公共信息")
|
||||
@RestController
|
||||
|
@ -175,5 +175,22 @@ public class CommonController {
|
|||
return Result.ok(EquipmentTypeEnum.listAll());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询设备状态", httpMethod = "GET")
|
||||
@GetMapping("/list/equipment-status")
|
||||
public Result<?> listEquipmentStatus(){
|
||||
return Result.ok(EquipmentStatusEnum.listAll());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询设备位置状态", httpMethod = "GET")
|
||||
@GetMapping("/list/location-status")
|
||||
public Result<?> listLocationStatus(){
|
||||
return Result.ok(LocationStatusEnum.listAll());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询设备健康状态", httpMethod = "GET")
|
||||
@GetMapping("/list/health-status")
|
||||
public Result<?> listHealthStatus(){
|
||||
return Result.ok(HealthStatusEnum.listAll());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.dite.znpt.web.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.dite.znpt.domain.PageResult;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.vo.EquipmentListReq;
|
||||
|
@ -12,14 +13,13 @@ import org.springframework.validation.annotation.Validated;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
* @date 2025/7/23/周三 17:41
|
||||
* @description
|
||||
*/
|
||||
@Api(tags = "设备信息")
|
||||
@Api(tags = "设备信息----------------------------")
|
||||
@RestController
|
||||
@RequestMapping("/equipment")
|
||||
public class EquipmentController {
|
||||
|
@ -30,13 +30,8 @@ public class EquipmentController {
|
|||
@ApiOperation(value = "分页查询设备信息列表", httpMethod = "GET")
|
||||
@GetMapping("/page")
|
||||
public PageResult<EquipmentResp> page(EquipmentListReq req) {
|
||||
return PageResult.ok(equipmentService.page(req));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询设备信息列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result<List<EquipmentResp>> list(EquipmentListReq req) {
|
||||
return Result.ok(equipmentService.list(req));
|
||||
IPage<EquipmentResp> page = equipmentService.page(req);
|
||||
return PageResult.ok(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询设备信息详情", httpMethod = "GET")
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
package com.dite.znpt.web.controller;
|
||||
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.vo.TrainingPlanListReq;
|
||||
import com.dite.znpt.domain.vo.TrainingPlanReq;
|
||||
import com.dite.znpt.service.TrainingPlanService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/01/01 00:00
|
||||
* @Description: 培训计划控制器
|
||||
*/
|
||||
@Api(tags = "培训..........................................计划管理")
|
||||
@RestController
|
||||
@RequestMapping("/training/plan")
|
||||
public class TrainingPlanController {
|
||||
|
||||
@Resource
|
||||
private TrainingPlanService trainingPlanService;
|
||||
|
||||
@ApiOperation(value = "分页查询培训计划列表", httpMethod = "GET")
|
||||
@GetMapping("/page")
|
||||
public Result<?> page(TrainingPlanListReq req) {
|
||||
return Result.ok(trainingPlanService.page(req));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询培训计划列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result<?> list(TrainingPlanListReq req) {
|
||||
return Result.ok(trainingPlanService.list(req));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询培训计划详情", httpMethod = "GET")
|
||||
@GetMapping("/detail/{planId}")
|
||||
public Result<?> detail(@PathVariable String planId) {
|
||||
return Result.ok(trainingPlanService.detail(planId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增培训计划", httpMethod = "POST")
|
||||
@PostMapping
|
||||
public Result<?> save(@Valid @RequestBody TrainingPlanReq req) {
|
||||
trainingPlanService.save(req);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "更新培训计划", httpMethod = "PUT")
|
||||
@PutMapping("/{planId}")
|
||||
public Result<?> update(@PathVariable String planId, @Valid @RequestBody TrainingPlanReq req) {
|
||||
trainingPlanService.update(planId, req);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除培训计划", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{planId}")
|
||||
public Result<?> delete(@PathVariable String planId) {
|
||||
trainingPlanService.deleteById(planId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "发布培训计划", httpMethod = "PUT")
|
||||
@PutMapping("/{planId}/publish")
|
||||
public Result<?> publish(@PathVariable String planId) {
|
||||
trainingPlanService.publish(planId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "取消培训计划", httpMethod = "PUT")
|
||||
@PutMapping("/{planId}/cancel")
|
||||
public Result<?> cancel(@PathVariable String planId) {
|
||||
trainingPlanService.cancel(planId);
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue