diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessPlanEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessPlanEntity.java index b58b9d9..a8d6a20 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessPlanEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessPlanEntity.java @@ -149,7 +149,23 @@ public class OperAccessPlanEntity extends TenantEntity { @ApiModelProperty("当前步骤任务名称") private String taskName; + /** + * 技术负责人 + */ + @ApiModelProperty(value = "技术负责人") + private String techLeadName; + /** + * 管理负责人 + */ + @ApiModelProperty(value = "管理负责人") + private String managerName; @ApiModelProperty("当前环节处理人") private String nextStepOperator; + + @ApiModelProperty(value = "创建用户名称") + private String createUserName; + + @ApiModelProperty(value = "创建用户名称") + private String updateUserName; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java index 273e5e1..336feff 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java @@ -111,4 +111,12 @@ public class OperAccessStatisticsEntity extends TenantEntity { @ApiModelProperty(value = "描述") private String descripiton; + @ApiModelProperty("创建人名称") + private String createUserName; + + @ApiModelProperty("修改人名称") + private String updateUserName; + + @ApiModelProperty("负责人名称") + private String managerName; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskDetailEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskDetailEntity.java index 42c2995..fef2bc3 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskDetailEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskDetailEntity.java @@ -49,7 +49,11 @@ public class OperAccessTaskDetailEntity extends TenantEntity { @ApiModelProperty(value = "任务内容") private String content; + @ApiModelProperty("创建人名称") + private String createUserName; + @ApiModelProperty("修改人名称") + private String updateUserName; public void setValue(OperAccessContentDetailEntity contentDetailEntity){ contentDetailId = contentDetailEntity.getId(); content = contentDetailEntity.getContent(); diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java index cd0e6f8..27345a2 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java @@ -132,5 +132,11 @@ public class OperAccessTaskEntity extends TenantEntity { @ApiModelProperty("当前环节处理人") private String nextStepOperator; + @ApiModelProperty(value = "任务执行人") + private String handlerName; + @ApiModelProperty(value = "创建用户名称") + private String createUserName; + @ApiModelProperty(value = "创建用户名称") + private String updateUserName; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java index 82364f4..d1f9a3f 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java @@ -1,5 +1,6 @@ package com.hnac.hzims.operational.maintenance.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.NullSerializer; @@ -72,6 +73,12 @@ public class OperMaintenancePlanEntity extends TenantEntity { @JsonSerialize(nullsUsing = NullSerializer.class) private Long disposer; /** + * 执行人 + */ + @ApiModelProperty(value = "执行人") + @JsonSerialize(nullsUsing = NullSerializer.class) + private String disposerName; + /** * 执行日期 */ @ApiModelProperty(value = "执行日期") @@ -114,4 +121,9 @@ public class OperMaintenancePlanEntity extends TenantEntity { */ private String stationCode; + @ApiModelProperty(value = "创建用户名称") + private String createUserName; + + @ApiModelProperty(value = "创建用户名称") + private String updateUserName; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java index b0104d5..2f9fa11 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java @@ -71,6 +71,13 @@ public class OperMaintenanceTaskEntity extends TenantEntity { @ApiModelProperty(value = "执行人") @JsonSerialize(nullsUsing = NullSerializer.class) private String disposer; + + /** + * 执行人 + */ + @ApiModelProperty(value = "执行人") + @JsonSerialize(nullsUsing = NullSerializer.class) + private String disposerName; /** * 执行日期 */ @@ -198,4 +205,10 @@ public class OperMaintenanceTaskEntity extends TenantEntity { @ApiModelProperty("是否延期") private Boolean isDelay; + + @ApiModelProperty(value = "创建用户名称") + private String createUserName; + + @ApiModelProperty(value = "创建用户名称") + private String updateUserName; } diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskUserEntity.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskUserEntity.java index 4ff234c..4c018c6 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskUserEntity.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/task/entity/TaskUserEntity.java @@ -50,4 +50,6 @@ public class TaskUserEntity extends TenantEntity { */ @ApiModelProperty(value = "领用时间") private LocalDateTime claimTime; + @ApiModelProperty(value = "用户ID") + private String userName; } \ No newline at end of file diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/ConferenceExportDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/ConferenceExportDTO.java index e72d988..b232cc4 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/ConferenceExportDTO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/ConferenceExportDTO.java @@ -22,11 +22,9 @@ public class ConferenceExportDTO { private String unit; @ApiModelProperty("会议计划开始时间") - @ExcelProperty(value = "会议计划开始时间", index = 1) private Date scheduledStartTime; @ApiModelProperty("会议计划结束时间") - @ExcelProperty(value = "会议计划结束时间", index = 2) private Date scheduledEndTime; @ApiModelProperty("会议主题") @@ -48,4 +46,12 @@ public class ConferenceExportDTO { @ApiModelProperty("会议状态") @ExcelProperty(value = "会议状态", index = 7) private String conferenceStatus; + + @ApiModelProperty("计划开始时间") + @ExcelProperty(value = "计划开始时间", index = 1) + private String startTime; + + @ApiModelProperty("计划结束时间") + @ExcelProperty(value = "计划结束时间", index = 2) + private String endTime; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/RehearsalExportDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/RehearsalExportDTO.java index df269e3..f79db79 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/RehearsalExportDTO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/RehearsalExportDTO.java @@ -26,11 +26,9 @@ public class RehearsalExportDTO { private String subject; @ApiModelProperty("演练计划开始时间") - @ExcelProperty(value = "计划开始时间", index = 2) private Date scheduledStartTime; @ApiModelProperty("演练计划结束时间") - @ExcelProperty(value = "计划结束时间", index = 3) private Date scheduledEndTime; @ApiModelProperty("演练地点") @@ -40,4 +38,12 @@ public class RehearsalExportDTO { @ApiModelProperty("演练状态") @ExcelProperty(value = "演练状态", index = 5) private String rehearsalStatus; + + @ApiModelProperty("计划开始时间") + @ExcelProperty(value = "计划开始时间", index = 2) + private String startTime; + + @ApiModelProperty("计划结束时间") + @ExcelProperty(value = "计划结束时间", index = 3) + private String endTime; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java index f93c6c8..fd77873 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/HygienePlanEntity.java @@ -1,5 +1,6 @@ package com.hnac.hzims.safeproduct.entity; +import com.alibaba.excel.annotation.ExcelProperty; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; @@ -23,13 +24,16 @@ import java.util.Date; public class HygienePlanEntity extends BaseEntity { @Size(max = 50, message = "计划名称字段长度不能超过50") + @ExcelProperty(value = "计划名称", index = 0) @ApiModelProperty("计划名称") private String name; @Size(max = 50, message = "单位字段长度不能超过50") + @ExcelProperty(value = "单位", index = 1) @ApiModelProperty("单位") private String unit; + @ExcelProperty(value = "标准总分值", index = 2) @ApiModelProperty("标准总分值") private Integer standardScore; @@ -43,6 +47,15 @@ public class HygienePlanEntity extends BaseEntity { @ApiModelProperty("计划结束时间") private Date scheduledEndTime; + @ExcelProperty(value = "自查计划状态", index = 5) @ApiModelProperty("自查计划状态") private String hygienePlanStatus; + + @ExcelProperty(value = "计划开始时间", index = 3) + @ApiModelProperty("计划开始时间") + private String startTime; + + @ExcelProperty(value = "计划结束时间", index = 4) + @ApiModelProperty("计划结束时间") + private String endTime; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalPlanEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalPlanEntity.java index 4cd4306..45acd49 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalPlanEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/RehearsalPlanEntity.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.mp.base.BaseEntity; +import org.springblade.core.tool.utils.DateUtil; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @@ -33,12 +34,12 @@ public class RehearsalPlanEntity extends BaseEntity { private String subject; @NotNull - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = DateUtil.PATTERN_DATE) @ApiModelProperty("演练计划开始时间") private Date scheduledStartTime; @NotNull - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = DateUtil.PATTERN_DATE) @ApiModelProperty("演练计划结束时间") private Date scheduledEndTime; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/DeviceEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceEntity.java similarity index 97% rename from hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/DeviceEntity.java rename to hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceEntity.java index 486b76f..5c12f90 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/DeviceEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceEntity.java @@ -18,7 +18,7 @@ import java.util.Date; @EqualsAndHashCode(callSuper = true) @TableName("hzims_device") @ApiModel(value = "特种设备实体类") -public class DeviceEntity extends BaseEntity { +public class SpecialDeviceEntity extends BaseEntity { @Size(max = 50, message = "设备名称长度不能超过50") @ApiModelProperty("设备名称") diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceInspectionEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceInspectionEntity.java new file mode 100644 index 0000000..697de96 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceInspectionEntity.java @@ -0,0 +1,43 @@ +package com.hnac.hzims.safeproduct.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; + +import javax.validation.constraints.Size; +import java.util.Date; + +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("hzims_device_inspection") +@ApiModel(value = "特种设备检验记录实体类") +public class SpecialDeviceInspectionEntity extends BaseEntity { + + @ApiModelProperty("设备id") + private Long deviceId; + + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("检验时间") + private Date inspectionTime; + + @Size(max = 255, message = "检验地点长度不能超过255") + @ApiModelProperty("检验地点") + private String location; + + @Size(max = 1000, message = "检验照片长度不能超过1000") + @ApiModelProperty("检验照片") + private String imgPath; + + @TableField(exist = false) + @ApiModelProperty("下次检验时间") + private Date nextInspectionTime; + + @TableField(exist = false) + @ApiModelProperty("上次检验时间") + private Date lastInspectionTime; +} diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainPlanEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainPlanEntity.java index 93db233..3f67a4d 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainPlanEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TrainPlanEntity.java @@ -35,13 +35,11 @@ public class TrainPlanEntity extends BaseEntity { @NotNull @JsonFormat(pattern = "yyyy-MM-dd") @ApiModelProperty("计划开始时间") - @ExcelProperty(value = "计划开始时间", index = 6) private Date scheduledStartTime; @NotNull @JsonFormat(pattern = "yyyy-MM-dd") @ApiModelProperty("计划结束时间") - @ExcelProperty(value = "计划结束时间", index = 7) private Date scheduledEndTime; @NotNull @@ -80,4 +78,14 @@ public class TrainPlanEntity extends BaseEntity { @ApiModelProperty("是否考试") @ExcelProperty(value = "是否考试", index = 5) private String hasTest; + + @TableField(exist = false) + @ApiModelProperty("计划开始时间") + @ExcelProperty(value = "计划开始时间", index = 6) + private String startTime; + + @TableField(exist = false) + @ApiModelProperty("计划结束时间") + @ExcelProperty(value = "计划结束时间", index = 7) + private String endTime; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java index 515a252..c876c9a 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java @@ -1,10 +1,12 @@ package com.hnac.hzims.safeproduct.vo; +import cn.afterturn.easypoi.entity.ImageEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; +import java.util.List; /** * @author liwen @@ -52,4 +54,13 @@ public class ConferenceRecordDetailVO { @ApiModelProperty("会议附件") private String filePath; + + @ApiModelProperty("图片列表") + private List images; + + @ApiModelProperty("年份") + private String year; + + @ApiModelProperty("月份") + private String month; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordPageVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordPageVO.java index 9cc2f9a..17793cc 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordPageVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/HygieneRecordPageVO.java @@ -17,6 +17,9 @@ public class HygieneRecordPageVO { @ApiModelProperty("卫生自查记录id") private Long id; + @ApiModelProperty("卫生自查计划id") + private Long hygienePlanId; + @ApiModelProperty("单位") private String unit; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailVO.java index 86afcbe..9b57e9c 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordDetailVO.java @@ -1,10 +1,12 @@ package com.hnac.hzims.safeproduct.vo; +import cn.afterturn.easypoi.entity.ImageEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; +import java.util.List; /** * @author liwen @@ -52,4 +54,13 @@ public class RehearsalRecordDetailVO { @ApiModelProperty("演练科目") private String subject; + + @ApiModelProperty("图片列表") + private List images; + + @ApiModelProperty("年份") + private String year; + + @ApiModelProperty("月份") + private String month; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailVO.java index ecf6b78..e7a6dff 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordDetailVO.java @@ -1,10 +1,12 @@ package com.hnac.hzims.safeproduct.vo; +import cn.afterturn.easypoi.entity.ImageEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; +import java.util.List; /** * @author liwen @@ -52,4 +54,13 @@ public class TrainRecordDetailVO { @ApiModelProperty("培训附件") private String filePath; + + @ApiModelProperty("图片列表") + private List images; + + @ApiModelProperty("年份") + private String year; + + @ApiModelProperty("月份") + private String month; } diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/TicketConstants.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/TicketConstants.java index 320d3e0..03808ec 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/TicketConstants.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/constants/TicketConstants.java @@ -25,6 +25,12 @@ public interface TicketConstants { String LICENSOR_ROLE = "licensor"; /** + * 操作票监护人确认结果 + */ + String OPERATION_TICKET_APPROVED = "approved"; + String OPERATION_TICKET_REJECTED = "rejected"; + + /** * 工作票安措新增类型 **/ String DUTY_PATTERN = "1"; diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java index ec3aa06..ade487d 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/standardTicket/entity/StandardTicketInfoEntity.java @@ -1,5 +1,6 @@ package com.hnac.hzims.ticket.standardTicket.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; @@ -106,7 +107,6 @@ public class StandardTicketInfoEntity extends TenantEntity implements Serializab @ApiModelProperty("是否评价") private Integer isEvaluate; - /** * AA/AAA/AAAA由建站时建站人填写必须系统验证唯一性 * 站点标识-两票编码 @@ -114,65 +114,30 @@ public class StandardTicketInfoEntity extends TenantEntity implements Serializab @ApiModelProperty("站点标识-两票编码") private String signage; - - /** - * 编号(原站点ID) - */ @ApiModelProperty("编号(原站点ID)") private String signageCode; - - /** - * 流程状态' - */ @ApiModelProperty("流程状态") private Integer flowStatus; - /** - * 流程描述 - */ @ApiModelProperty("流程描述") private String flowDescription; - - /** - * 下一个审批人 - */ @ApiModelProperty("下一个审批人") private String nextStepOperator; - - /** - * 用户Id - */ @ApiModelProperty("用户Id") private String flowUserId; - - /** - * 当前任务名 - */ @ApiModelProperty("当前任务名") private String flowTaskName; - - /** - * 当前任务名 - */ @ApiModelProperty("当前任务名") private String flowTaskId; - - /** - * 项目 - */ @ApiModelProperty("项目") private String projectName; - - /** - * - */ @ApiModelProperty("分组") private String classGroupName; @@ -182,7 +147,6 @@ public class StandardTicketInfoEntity extends TenantEntity implements Serializab @ApiModelProperty("更新人名称") private String updateUserName; - @ApiModelProperty("发令人名称") private String issueOrderPersonName; @@ -195,4 +159,7 @@ public class StandardTicketInfoEntity extends TenantEntity implements Serializab @ApiModelProperty("许可人名称") private String guardianName; + @TableField(exist = false) + @ApiModelProperty("监护人确认结果:approved-确认,rejected-作废") + private String verifyResult; } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java index 3c9b55d..314dff3 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java @@ -94,11 +94,14 @@ public class TaskController extends BladeController { TaskUserEntity taskUserEntity = taskUserService.getOne(Wrappers.query().lambda().eq(TaskUserEntity::getTaskId, id).eq(TaskUserEntity::getClaimStatus,ClaimStatusEnum.COLLECT.getStatus())); if(taskUserEntity!=null){ detail.setUserId(taskUserEntity.getUserId()); - User user = UserCache.getUser(taskUserEntity.getUserId()); - if(user!=null){ - String userName = user.getRealName(); - detail.setUserName(userName); + if(taskUserEntity.getUserId()!=null) { + detail.setUserName(taskUserEntity.getUserName()); } +// User user = UserCache.getUser(taskUserEntity.getUserId()); +// if(user!=null){ +// String userName = user.getRealName(); +// detail.setUserName(userName); +// } } //巡检记录 diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java index 9c2a6c5..dc1f1c4 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.dto.BusinessMessageDTO; import com.hnac.hzims.message.fegin.IMessageClient; @@ -28,6 +29,7 @@ import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.VerticalAlignment; import org.apache.poi.ss.util.CellRangeAddress; import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; @@ -39,6 +41,7 @@ import org.springblade.flow.core.feign.IFlowClient; import org.springblade.flow.core.utils.FlowUtil; import org.springblade.flow.core.utils.TaskUtil; import org.springblade.system.feign.ISysClient; +import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.entity.User; import org.springblade.system.user.feign.IUserClient; import org.springframework.stereotype.Service; @@ -120,6 +123,23 @@ public class AccessPlanV4ServiceImpl implements AccessPlanV4Service{ entity.setCode("PLAN_" + DateUtil.format(DateUtil.now(), DateUtil.PATTERN_DATETIME_MINI) + new DecimalFormat("###").format(RandomUtils.nextInt(0, 999))); entity.setProcDefId("overhaul_plan"); entity.setActStartTime(new Date()); + if (ObjectUtil.isNotEmpty(entity.getTechLead())){ + User user = UserCache.getUser(entity.getTechLead()); + if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){ + entity.setTechLeadName(user.getName()); + } + } + if (ObjectUtil.isNotEmpty(entity.getManager())){ + User user = UserCache.getUser(entity.getManager()); + if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){ + entity.setManagerName(user.getName()); + } + } + BladeUser user = AuthUtil.getUser(); + if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getUserName())){ + entity.setCreateUserName(user.getUserName()); + entity.setUpdateUserName(user.getUserName()); + } planService.save(entity); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java index ec72544..fe8dc20 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.dto.BusinessMessageDTO; import com.hnac.hzims.message.fegin.IMessageClient; @@ -31,6 +32,7 @@ import org.springblade.flow.core.feign.IFlowClient; import org.springblade.flow.core.utils.FlowUtil; import org.springblade.flow.core.utils.TaskUtil; import org.springblade.system.feign.ISysClient; +import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.entity.User; import org.springblade.system.user.feign.IUserClient; import org.springframework.stereotype.Service; @@ -113,6 +115,14 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service { private void save(AccessTaskV4DTO entity) { entity.setCode("TASK" + DateUtil.format(DateUtil.now(), DateUtil.PATTERN_DATETIME_MINI) + new DecimalFormat("###").format(RandomUtils.nextInt(0, 999))); List materialEntityList = JSONObject.parseArray(JSON.toJSONString(entity.getAccessMaterials()), OperAccessMaterialEntity.class); + if (ObjectUtil.isNotEmpty(entity.getHandler())){ + User user = UserCache.getUser(entity.getHandler()); + if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){ + entity.setHandlerName(user.getName()); + entity.setCreateUserName(user.getName()); + entity.setUpdateUserName(user.getName()); + } + } taskService.save(entity); } @@ -254,6 +264,7 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service { statisticsDTO.setEmCode(entity.getEmCode()); statisticsDTO.setPlanHours(entity.getPlanHours()); statisticsDTO.setManager(entity.getHandler()); + statisticsDTO.setManagerName(entity.getHandlerName()); OperAccessContentEntity content = contentService.getById(entity.getId()); if (ObjectUtil.isNotEmpty(content)) { statisticsDTO.setPid(content.getLibraryId()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java index 548fd15..15e1726 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java @@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.entity.ExportParams; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.operational.access.dto.OperAccessStatisticsDTO; import com.hnac.hzims.operational.access.entity.OperAccessStatisticsEntity; import com.hnac.hzims.operational.access.excel.OperAccessStatisticsExport; @@ -16,8 +17,13 @@ import org.apache.poi.ss.usermodel.Workbook; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.ObjectUtil; +import org.springblade.system.user.cache.UserCache; +import org.springblade.system.user.entity.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -38,7 +44,19 @@ public class OperAccessStatisticsServiceImpl extends BaseServiceImpl materialEntityList = JSONObject.parseArray(JSON.toJSONString(req.getAccessMaterials()), OperAccessMaterialEntity.class); if (super.save(req)) { if (CollectionUtil.isNotEmpty(materialEntityList)) { diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java index 1b085da..9dfb3f0 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java @@ -20,14 +20,7 @@ public class OperAccessStatisticsVO extends OperAccessStatisticsEntity { private static final long serialVersionUID = 1L; - @ApiModelProperty("创建人名称") - private String createUserName; - @ApiModelProperty("修改人名称") - private String updateUserName; - - @ApiModelProperty("负责人名称") - private String managerName; @ApiModelProperty(value = "任务名称") private String taskName; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskDetailVO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskDetailVO.java index 4281ee8..49542be 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskDetailVO.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskDetailVO.java @@ -17,9 +17,5 @@ public class OperAccessTaskDetailVO extends OperAccessTaskDetailEntity { private static final long serialVersionUID = 1L; - @ApiModelProperty("创建人名称") - private String createUserName; - @ApiModelProperty("修改人名称") - private String updateUserName; } \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskVO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskVO.java index 1254b4c..cdc7cae 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskVO.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessTaskVO.java @@ -20,14 +20,14 @@ public class OperAccessTaskVO extends OperAccessTaskEntity { private static final long serialVersionUID = 1L; - @ApiModelProperty("创建人名称") - private String createUserName; - - @ApiModelProperty("修改人名称") - private String updateUserName; - - @ApiModelProperty("执行人名称") - private String handlerName; +// @ApiModelProperty("创建人名称") +// private String createUserName; +// +// @ApiModelProperty("修改人名称") +// private String updateUserName; +// +// @ApiModelProperty("执行人名称") +// private String handlerName; @ApiModelProperty("状态名称") private String statusName; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessStatisticsWrapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessStatisticsWrapper.java index 6489318..894278d 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessStatisticsWrapper.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/wrapper/OperAccessStatisticsWrapper.java @@ -24,12 +24,12 @@ public class OperAccessStatisticsWrapper extends BaseEntityWrapper OperAccessTaskVO entityVOExtras(T entity) { OperAccessTaskVO vo = BeanUtil.copy(entity, OperAccessTaskVO.class); - User createUser = UserCache.getUser(entity.getCreateUser()); - User updateUser = UserCache.getUser(entity.getUpdateUser()); - User handlerName = UserCache.getUser(entity.getHandler()); - vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null)); - vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User::getName).orElse(null)); - vo.setHandlerName(Optional.ofNullable(handlerName).map(User :: getName).orElse(null)); +// User createUser = UserCache.getUser(entity.getCreateUser()); +// User updateUser = UserCache.getUser(entity.getUpdateUser()); +// User handlerName = UserCache.getUser(entity.getHandler()); +// vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null)); +// vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User::getName).orElse(null)); +// vo.setHandlerName(Optional.ofNullable(handlerName).map(User :: getName).orElse(null)); vo.setStatusName(DictCache.getValue(DictConstant.ACCESS_TASK_STATUS, entity.getStatus())); return vo; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java index 22831e7..fafd0e9 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java @@ -177,20 +177,23 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl() {{ - eq(ImsDutyMainPersonEntity::getDutyMainId, imsSchedulingVo.getId()); - last("limit 1"); - }}); - imsSchedulingVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson()); - } else { - ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(imsSchedulingVo.getGroupId()); - imsSchedulingVo.setGroupName(imsDutyGroupEntity.getGroupName()); - imsSchedulingVo.setGroupId(imsDutyGroupEntity.getId()); - imsSchedulingVo.setManagerId(imsDutyGroupEntity.getManagerId()); + if(ObjectUtil.isNotEmpty(imsSchedulingVo)) { + if (null == imsSchedulingVo.getGroupId()) { + imsSchedulingVo.setGroupName("临时班组"); + ImsDutyMainPersonEntity imsDutyMainPersonEntity = imsDutyMainPersonMapper.selectOne(new LambdaQueryWrapper() {{ + eq(ImsDutyMainPersonEntity::getDutyMainId, imsSchedulingVo.getId()); + last("limit 1"); + }}); + imsSchedulingVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson()); + } else { + ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(imsSchedulingVo.getGroupId()); + imsSchedulingVo.setGroupName(imsDutyGroupEntity.getGroupName()); + imsSchedulingVo.setGroupId(imsDutyGroupEntity.getId()); + imsSchedulingVo.setManagerId(imsDutyGroupEntity.getManagerId()); + } + return imsSchedulingVo; } - return imsSchedulingVo; + return new ImsSchedulingVo(); } @Override @@ -1257,6 +1260,9 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl userR = userClient.userInfoById(imsSchedulingVo.getManagerId()); imsSchedulingVo.setManagerName(userR.getData().getName()); imsSchedulingVo.setCreateDept(userR.getData().getCreateDept()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java index 83fbfed..ff91a6a 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Lists; +import com.hnac.hzims.equipment.entity.EmInfoEntity; import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.dto.MessagePushRecordDto; import com.hnac.hzims.message.fegin.IMessageClient; @@ -63,6 +64,7 @@ import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; import javax.annotation.Resource; +import javax.xml.ws.WebServiceException; import java.math.BigDecimal; import java.sql.Time; import java.text.SimpleDateFormat; @@ -455,6 +457,9 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpllambdaUpdate() - .set(ImsDutyLogEntity::getCarryTime, DateUtil.format(new Date(), PATTERN_DATETIME)) - .eq(ImsDutyLogEntity::getDutyId,imsDutyLogEntity.getDutyId()) - ); + ImsDutyLogEntity update = imsDutyLogService.getOne(Wrappers.lambdaQuery() + .eq(ImsDutyLogEntity::getDutyId, imsDutyLogEntity.getDutyId()) + .last("limit 1")); + update.setCarryTime(DateUtil.format(new Date(), PATTERN_DATETIME)); + imsDutyLogService.updateById(update); +// imsDutyLogService.update(Wrappers.lambdaUpdate() +// .set(ImsDutyLogEntity::getCarryTime, DateUtil.format(new Date(), PATTERN_DATETIME)) +// .eq(ImsDutyLogEntity::getDutyId,imsDutyLogEntity.getDutyId()) +// ); log.info("更新值班日志"); } ImsDutyRecEntity dutyRec = BeanUtil.copy(recDTO, ImsDutyRecEntity.class); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenancePlanController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenancePlanController.java index f5a2407..de37b9c 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenancePlanController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenancePlanController.java @@ -1,10 +1,12 @@ package com.hnac.hzims.operational.maintenance.controller; +import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.common.logs.annotation.OperationAnnotation; import com.hnac.hzims.common.logs.enums.BusinessType; import com.hnac.hzims.common.logs.enums.OperatorType; +import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.operational.maintenance.dto.OperMaintenancePlanDTO; import com.hnac.hzims.operational.maintenance.entity.OperMaintenancePlanEntity; import com.hnac.hzims.operational.maintenance.scheduled.MaintenancePlanCreateTask; @@ -18,8 +20,12 @@ import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.log.annotation.ApiLog; import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; +import org.springblade.system.user.cache.UserCache; +import org.springblade.system.user.entity.User; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; @@ -59,6 +65,17 @@ public class OperMaintenancePlanController extends BladeController { public R save(@Valid @RequestBody OperMaintenancePlanEntity req) { //设备为临时任务类型 req.setTaskType("1"); + if (ObjectUtil.isNotEmpty(req.getDisposer())){ + User user = UserCache.getUser(req.getDisposer()); + if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){ + req.setDisposerName(user.getName()); + } + } + BladeUser user = AuthUtil.getUser(); + if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getUserName())){ + req.setCreateUserName(user.getUserName()); + req.setUpdateUserName(user.getUserName()); + } planService.save(req); return R.data(req); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenancePlanWrapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenancePlanWrapper.java index ebe750f..3de3235 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenancePlanWrapper.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/wrapper/OperMaintenancePlanWrapper.java @@ -36,12 +36,12 @@ public class OperMaintenancePlanWrapper extends BaseEntityWrapper{ - List disposerList = Arrays.stream(s.split(",")).collect(Collectors.toList()); - return disposerList.stream().map(d ->{ - User user = UserCache.getUser(Long.parseLong(d)); - return Optional.ofNullable(user).map(User::getName).orElse(""); - }).collect(Collectors.joining(",")); - }).orElse(""); - vo.setDisposerName(disposerName); +// String disposerName = Optional.ofNullable(entity.getDisposer()).map(s->{ +// List disposerList = Arrays.stream(s.split(",")).collect(Collectors.toList()); +// return disposerList.stream().map(d ->{ +// User user = UserCache.getUser(Long.parseLong(d)); +// return Optional.ofNullable(user).map(User::getName).orElse(""); +// }).collect(Collectors.joining(",")); +// }).orElse(""); +// vo.setDisposerName(disposerName); return vo; } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java index 8b1f328..9856bec 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java @@ -2,7 +2,6 @@ package com.hnac.hzims.safeproduct.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import com.hnac.hzims.common.utils.Condition; import com.hnac.hzims.safeproduct.entity.ConferencePlanEntity; import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity; import com.hnac.hzims.safeproduct.service.IConferencePlanService; @@ -110,13 +109,14 @@ public class ConferenceController extends BladeController { @GetMapping("/recordPage") @ApiImplicitParams({ - @ApiImplicitParam(name = "conferencePlanId", value = "会议计划id", dataType = "query", paramType = "string") + @ApiImplicitParam(name = "conferencePlanId", value = "会议计划id", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "actualStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "actualEndTime", value = "计划结束时间", dataType = "query", paramType = "string") }) @ApiOperation(value = "会议记录分页") @ApiOperationSupport(order = 10) public R> recordPage(@ApiIgnore @RequestParam Map param, Query query) { - IPage page = conferenceRecordService.page(Condition.getPage(query), Condition.getQueryWrapper( - param, ConferenceRecordEntity.class).lambda().orderByDesc(ConferenceRecordEntity::getCreateTime)); + IPage page = conferenceRecordService.recordPage(param, query); return R.data(page); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DeviceController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DeviceController.java deleted file mode 100644 index c507455..0000000 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DeviceController.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.hnac.hzims.safeproduct.controller; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import com.hnac.hzims.common.utils.Condition; -import com.hnac.hzims.safeproduct.entity.DeviceEntity; -import com.hnac.hzims.safeproduct.service.IDeviceService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import lombok.AllArgsConstructor; -import org.springblade.core.boot.ctrl.BladeController; -import org.springblade.core.mp.support.Query; -import org.springblade.core.tool.api.R; -import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; - -import javax.validation.Valid; -import java.util.Map; - -/** - * 特种设备管理接口类 - * - * @author liwen - * @date 2024-01-12 - */ -@RequestMapping("/device") -@AllArgsConstructor -@RestController -@Api(value = "特种设备", tags = "特种设备接口") -public class DeviceController extends BladeController { - - private final IDeviceService deviceService; - - @PostMapping("/save") - @ApiOperation(value = "新增") - @ApiOperationSupport(order = 1) - public R save(@Valid @RequestBody DeviceEntity deviceEntity) { - return R.status(deviceService.save(deviceEntity)); - } - - @PostMapping("/update") - @ApiOperation(value = "修改") - @ApiOperationSupport(order = 2) - public R update(@Valid @RequestBody DeviceEntity deviceEntity) { - return R.status(deviceService.updateById(deviceEntity)); - } - - @PostMapping("/remove") - @ApiOperation(value = "删除") - @ApiOperationSupport(order = 3) - public R remove(@RequestParam Long id) { - return R.status(deviceService.removeById(id)); - } - - @GetMapping("/detail") - @ApiOperation(value = "详情") - @ApiOperationSupport(order = 4) - public R detail(@RequestParam Long id) { - return R.data(deviceService.getById(id)); - } - - @GetMapping("/page") - @ApiImplicitParams({ - @ApiImplicitParam(name = "name", value = "设备名称", dataType = "query", paramType = "string"), - @ApiImplicitParam(name = "deviceStatus", value = "设备状态", dataType = "query", paramType = "string") - }) - @ApiOperation(value = "分页") - @ApiOperationSupport(order = 5) - public R> page(@ApiIgnore @RequestParam Map param, Query query) { - IPage page = deviceService.page(Condition.getPage(query), Condition.getQueryWrapper(param, DeviceEntity.class) - .lambda().orderByDesc(DeviceEntity::getCreateTime)); - return R.data(page); - } -} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java index 0a271f9..0af5879 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java @@ -114,7 +114,10 @@ public class HygieneController extends BladeController { @GetMapping("/recordPage") @ApiImplicitParams({ - @ApiImplicitParam(name = "hygienePlanId", value = "卫生自查计划id", dataType = "query", paramType = "string") + @ApiImplicitParam(name = "hygienePlanId", value = "卫生自查计划id", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "actualStartTime", value = "开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "actualEndTime", value = "结束时间", dataType = "query", paramType = "string") }) @ApiOperation(value = "卫生自查记录分页") @ApiOperationSupport(order = 10) @@ -148,4 +151,17 @@ public class HygieneController extends BladeController { public void exportMonthData(@ApiIgnore @RequestParam Map param, Query query, HttpServletResponse response) { hygienePlanService.exportMonthData(param, query, response); } + + @GetMapping("/exportHygienePlanData") + @ApiImplicitParams({ + @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "name", value = "名称", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string") + }) + @ApiOperation(value = "卫生自查计划导出") + @ApiOperationSupport(order = 14) + public void exportHygienePlanData(@ApiIgnore @RequestParam Map param, HttpServletResponse response) { + hygienePlanService.exportHygienePlanData(param, response); + } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java index afb6c70..73c8b0a 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java @@ -112,13 +112,14 @@ public class RehearsalController extends BladeController { @GetMapping("/rehearsalRecordPage") @ApiImplicitParams({ - @ApiImplicitParam(name = "rehearsalPlanId", value = "演练计划id", dataType = "query", paramType = "string") + @ApiImplicitParam(name = "rehearsalPlanId", value = "演练计划id", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "actualStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "actualEndTime", value = "计划结束时间", dataType = "query", paramType = "string") }) @ApiOperation(value = "演练记录分页") @ApiOperationSupport(order = 10) public R> rehearsalRecordPage(@ApiIgnore @RequestParam Map param, Query query) { - IPage page = rehearsalRecordService.page(Condition.getPage(query), Condition.getQueryWrapper( - param, RehearsalRecordEntity.class).lambda().orderByDesc(RehearsalRecordEntity::getCreateTime)); + IPage page = rehearsalRecordService.rehearsalRecordPage(param, query); return R.data(page); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SpecialDeviceController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SpecialDeviceController.java new file mode 100644 index 0000000..4013e52 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SpecialDeviceController.java @@ -0,0 +1,121 @@ +package com.hnac.hzims.safeproduct.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.common.utils.Condition; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceEntity; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceInspectionEntity; +import com.hnac.hzims.safeproduct.service.ISpecialDeviceInspectionService; +import com.hnac.hzims.safeproduct.service.ISpecialDeviceService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.validation.Valid; +import java.util.Map; + +/** + * 特种设备管理接口类 + * + * @author liwen + * @date 2024-01-12 + */ +@RequestMapping("/specialDevice") +@AllArgsConstructor +@RestController +@Api(value = "特种设备", tags = "特种设备接口") +public class SpecialDeviceController extends BladeController { + + private final ISpecialDeviceService specialDeviceService; + + private final ISpecialDeviceInspectionService specialDeviceInspectionService; + + @PostMapping("/save") + @ApiOperation(value = "新增设备") + @ApiOperationSupport(order = 1) + public R save(@Valid @RequestBody SpecialDeviceEntity specialDeviceEntity) { + return R.status(specialDeviceService.save(specialDeviceEntity)); + } + + @PostMapping("/update") + @ApiOperation(value = "修改设备") + @ApiOperationSupport(order = 2) + public R update(@Valid @RequestBody SpecialDeviceEntity specialDeviceEntity) { + return R.status(specialDeviceService.updateById(specialDeviceEntity)); + } + + @PostMapping("/remove") + @ApiOperation(value = "删除设备") + @ApiOperationSupport(order = 3) + public R remove(@RequestParam Long id) { + return R.status(specialDeviceService.removeById(id)); + } + + @GetMapping("/detail") + @ApiOperation(value = "设备详情") + @ApiOperationSupport(order = 4) + public R detail(@RequestParam Long id) { + return R.data(specialDeviceService.getById(id)); + } + + @GetMapping("/page") + @ApiImplicitParams({ + @ApiImplicitParam(name = "name", value = "设备名称", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "deviceStatus", value = "设备状态", dataType = "query", paramType = "string") + }) + @ApiOperation(value = "设备分页") + @ApiOperationSupport(order = 5) + public R> page(@ApiIgnore @RequestParam Map param, Query query) { + IPage page = specialDeviceService.page(Condition.getPage(query), Condition.getQueryWrapper(param, SpecialDeviceEntity.class) + .lambda().orderByDesc(SpecialDeviceEntity::getCreateTime)); + return R.data(page); + } + + @PostMapping("/saveInspection") + @ApiOperation(value = "新增设备检验记录") + @ApiOperationSupport(order = 6) + public R saveInspection(@Valid @RequestBody SpecialDeviceInspectionEntity specialDeviceInspectionEntity) { + return R.status(specialDeviceInspectionService.saveInspection(specialDeviceInspectionEntity)); + } + + @PostMapping("/updateInspection") + @ApiOperation(value = "修改设备检验记录") + @ApiOperationSupport(order = 7) + public R updateInspection(@Valid @RequestBody SpecialDeviceInspectionEntity specialDeviceInspectionEntity) { + return R.status(specialDeviceInspectionService.updateInspection(specialDeviceInspectionEntity)); + } + + @PostMapping("/removeInspection") + @ApiOperation(value = "删除设备检验记录") + @ApiOperationSupport(order = 8) + public R removeInspection(@RequestParam Long id) { + return R.status(specialDeviceInspectionService.removeById(id)); + } + + @GetMapping("/inspectionDetail") + @ApiOperation(value = "设备检验记录详情") + @ApiOperationSupport(order = 9) + public R inspectionDetail(@RequestParam Long id) { + return R.data(specialDeviceInspectionService.getById(id)); + } + + @GetMapping("/inspectionPage") + @ApiImplicitParams({ + @ApiImplicitParam(name = "deviceId", value = "设备id", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "startTime", value = "开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "endTime", value = "结束时间", dataType = "query", paramType = "string") + }) + @ApiOperation(value = "设备检验记录分页") + @ApiOperationSupport(order = 10) + public R> inspectionPage(@ApiIgnore @RequestParam Map param, Query query) { + IPage page = specialDeviceInspectionService.getInspectionPage(param, query); + return R.data(page); + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/DeviceJob.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/SpecialDeviceJob.java similarity index 76% rename from hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/DeviceJob.java rename to hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/SpecialDeviceJob.java index 81b4964..e6ec1ab 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/DeviceJob.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/jobs/SpecialDeviceJob.java @@ -4,9 +4,9 @@ import com.hnac.hzims.common.constant.CommonConstant; import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.message.dto.BusinessMessageDTO; import com.hnac.hzims.message.fegin.IMessageClient; -import com.hnac.hzims.safeproduct.entity.DeviceEntity; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceEntity; import com.hnac.hzims.safeproduct.enums.DeviceStatusEnum; -import com.hnac.hzims.safeproduct.service.IDeviceService; +import com.hnac.hzims.safeproduct.service.ISpecialDeviceService; import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.handler.annotation.XxlJob; import lombok.extern.slf4j.Slf4j; @@ -30,10 +30,10 @@ import java.util.List; */ @Slf4j @Component -public class DeviceJob { +public class SpecialDeviceJob { @Autowired - IDeviceService deviceService; + ISpecialDeviceService deviceService; @Autowired IUserClient userClient; @@ -52,7 +52,7 @@ public class DeviceJob { String today = DateUtil.format(current, DateUtil.PATTERN_DATE); String yesterday = DateUtil.format(before, DateUtil.PATTERN_DATE); // 查询昨天的过期设备 - List list = deviceService.getExpiredDeviceByTime(yesterday, today); + List list = deviceService.getExpiredDeviceByTime(yesterday, today); if (CollectionUtils.isEmpty(list)) { return ReturnT.SUCCESS; } @@ -67,15 +67,15 @@ public class DeviceJob { /** * 推送设备过期消息 - * @param deviceEntity 特种设备实体类 + * @param specialDeviceEntity 特种设备实体类 */ - private void sendExpiredMessage(DeviceEntity deviceEntity) { - if (deviceEntity.getManagerId() == null) { + private void sendExpiredMessage(SpecialDeviceEntity specialDeviceEntity) { + if (specialDeviceEntity.getManagerId() == null) { log.error("系统无该用户信息,推送设备过期消息失败"); return; } // 查询用户 - R userRes = userClient.userInfoById(deviceEntity.getManagerId()); + R userRes = userClient.userInfoById(specialDeviceEntity.getManagerId()); User user = userRes.getData(); BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO(); if (StringUtils.isNotEmpty(user.getDeptId())) { @@ -84,11 +84,11 @@ public class DeviceJob { businessMessageDTO.setDeptName(sysClient.getDeptName(id).getData()); businessMessageDTO.setBusinessKey("设备到期"); businessMessageDTO.setBusinessClassify("system"); - businessMessageDTO.setTaskId(deviceEntity.getId()); + businessMessageDTO.setTaskId(specialDeviceEntity.getId()); businessMessageDTO.setSubject("设备到期通知"); - businessMessageDTO.setContent("您所管理的特种设备" + deviceEntity.getName() + "已到期,请尽快进行检验。"); - businessMessageDTO.setUserIds(String.valueOf(deviceEntity.getManagerId())); - businessMessageDTO.setCreateUser(deviceEntity.getCreateUser()); + businessMessageDTO.setContent("您所管理的特种设备" + specialDeviceEntity.getName() + "已到期,请尽快进行检验。"); + businessMessageDTO.setUserIds(String.valueOf(specialDeviceEntity.getManagerId())); + businessMessageDTO.setCreateUser(specialDeviceEntity.getCreateUser()); businessMessageDTO.setTenantId(CommonConstant.TENANT_ID); } messageClient.sendAppAndWsMsgByUsers(businessMessageDTO); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml index 36b935f..9f06eb5 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml @@ -14,7 +14,7 @@ diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java new file mode 100644 index 0000000..fec09d7 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java @@ -0,0 +1,26 @@ +package com.hnac.hzims.safeproduct.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceInspectionEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.Map; + +/** + * 特种设备检验记录Mapper类 + * + * @author liwen + * @date 2024-01-22 + */ +@Mapper +public interface SpecialDeviceInspectionMapper extends BaseMapper { + + /** + * 设备检验记录分页 + * @param param 入参 + * @param page 分页类 + * @return 设备检验记录数据 + */ + IPage getInspectionPage(IPage page, Map param); +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.xml new file mode 100644 index 0000000..adf843b --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.xml @@ -0,0 +1,24 @@ + + + + + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DeviceMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.java similarity index 61% rename from hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DeviceMapper.java rename to hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.java index c15512d..1c2ace4 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DeviceMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.java @@ -1,7 +1,7 @@ package com.hnac.hzims.safeproduct.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.hnac.hzims.safeproduct.entity.DeviceEntity; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceEntity; import org.apache.ibatis.annotations.Mapper; /** @@ -11,6 +11,6 @@ import org.apache.ibatis.annotations.Mapper; * @date 2024-01-12 */ @Mapper -public interface DeviceMapper extends BaseMapper { +public interface SpecialDeviceMapper extends BaseMapper { } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DeviceMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.xml similarity index 56% rename from hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DeviceMapper.xml rename to hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.xml index a863567..f9520d9 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/DeviceMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferenceRecordService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferenceRecordService.java index a792243..569623e 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferenceRecordService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferenceRecordService.java @@ -1,10 +1,13 @@ package com.hnac.hzims.safeproduct.service; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity; import com.hnac.hzims.safeproduct.vo.ConferenceRecordDetailVO; +import org.springblade.core.mp.support.Query; import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * 会议记录服务类 @@ -41,4 +44,12 @@ public interface IConferenceRecordService extends IService recordPage(Map param, Query query); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java index 5337d07..a564531 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java @@ -85,4 +85,11 @@ public interface IHygienePlanService extends IService { * @return 卫生自查计划数据 */ List getWaitingHygienePlanInTimeRange(String startTime, String endTime); + + /** + * 卫生自查计划数据导出 + * @param param 入参 + * @param response 响应类 + */ + void exportHygienePlanData(Map param, HttpServletResponse response); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java index 83dec8b..92b08c8 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalRecordService.java @@ -1,10 +1,13 @@ package com.hnac.hzims.safeproduct.service; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity; import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO; +import org.springblade.core.mp.support.Query; import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * 演练记录服务类 @@ -48,4 +51,12 @@ public interface IRehearsalRecordService extends IService * @return 演练记录表VO类 */ RehearsalRecordDetailVO getRecordDetailVOById(Long id); + + /** + * 演练记录分页 + * @param param 入参 + * @param query 分页类 + * @return 演练记录数据 + */ + IPage rehearsalRecordPage(Map param, Query query); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceInspectionService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceInspectionService.java new file mode 100644 index 0000000..c751eda --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceInspectionService.java @@ -0,0 +1,39 @@ +package com.hnac.hzims.safeproduct.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceInspectionEntity; +import org.springblade.core.mp.support.Query; + +import java.util.Map; + +/** + * 特种设备检验记录服务类 + * + * @author liwen + * @date 2024-01-22 + */ +public interface ISpecialDeviceInspectionService extends IService { + + /** + * 新增设备检验记录 + * @param specialDeviceInspectionEntity 特种设备检验记录实体类 + * @return true-成功,false-失败 + */ + boolean saveInspection(SpecialDeviceInspectionEntity specialDeviceInspectionEntity); + + /** + * 修改设备检验记录 + * @param specialDeviceInspectionEntity 特种设备检验记录实体类 + * @return true-成功,false-失败 + */ + boolean updateInspection(SpecialDeviceInspectionEntity specialDeviceInspectionEntity); + + /** + * 设备检验记录分页 + * @param param 入参 + * @param query 分页类 + * @return 设备检验记录数据 + */ + IPage getInspectionPage(Map param, Query query); +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IDeviceService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceService.java similarity index 59% rename from hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IDeviceService.java rename to hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceService.java index 5500bf9..ebcbe1c 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IDeviceService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceService.java @@ -1,7 +1,7 @@ package com.hnac.hzims.safeproduct.service; import com.baomidou.mybatisplus.extension.service.IService; -import com.hnac.hzims.safeproduct.entity.DeviceEntity; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceEntity; import java.util.List; @@ -11,12 +11,12 @@ import java.util.List; * @author liwen * @date 2024-01-12 */ -public interface IDeviceService extends IService { +public interface ISpecialDeviceService extends IService { /** * 查找时间范围内的过期设备 * @param startTime 开始时间 * @param endTime 结束时间 */ - List getExpiredDeviceByTime(String startTime, String endTime); + List getExpiredDeviceByTime(String startTime, String endTime); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java index 6a2dcf8..dbfb3cb 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java @@ -18,6 +18,7 @@ import com.hnac.hzims.safeproduct.service.IConferencePlanService; import com.hnac.hzims.safeproduct.service.IConferenceRecordService; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.utils.DateUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -89,7 +90,7 @@ public class ConferencePlanServiceImpl extends ServiceImpl conferenceList = getConferenceByUnitAndDate(unit, startTime, endTime); - // 处理会议数据信息 + // 数据处理 conferenceList.forEach(conference -> { // 会议方式 String method; @@ -111,6 +112,9 @@ public class ConferencePlanServiceImpl extends ServiceImpl list = new ArrayList<>(); + for (String img : imgArr) { + ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); + list.add(imageEntity); + } + conferenceRecordDetailVO.setImages(list); + } Map params = BaseUtil.obj2Map(conferenceRecordDetailVO); String templateFile = "template/会议记录表" + SafeProductConstant.DOCX_SUFFIX; String wordPath = savePath + "/会议记录表" + SafeProductConstant.DOCX_SUFFIX; @@ -110,13 +135,34 @@ public class ConferenceRecordServiceImpl extends ServiceImpl recordPage(Map param, Query query) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + String conferencePlanId = String.valueOf(param.get("conferencePlanId")); + String startTime = String.valueOf(param.get("actualStartTime")); + String endTime = String.valueOf((param.get("actualEndTime"))); + if (!conferencePlanId.equals("null") && !conferencePlanId.equals("")) { + queryWrapper.lambda().eq(ConferenceRecordEntity::getConferencePlanId, conferencePlanId); + } + if (!startTime.equals("null") && !startTime.equals("")) { + queryWrapper.lambda().ge(ConferenceRecordEntity::getActualStartTime, startTime); + } + if (!endTime.equals("null") && !endTime.equals("")) { + queryWrapper.lambda().le(ConferenceRecordEntity::getActualEndTime, endTime); + } + queryWrapper.lambda().orderByDesc(ConferenceRecordEntity::getCreateTime); + return this.page(Condition.getPage(query), queryWrapper); + } + + /** * 查询是否存在同月编号 * @param currentMonth 当月 * @return 存在则返回上一编号,否则返回null */ private String getLastCode(String currentMonth) { - String month = currentMonth.substring(currentMonth.length() - 2); - List list = getConferenceByMonth(month); + List list = getConferenceByMonth(currentMonth); if (CollectionUtils.isEmpty(list)) { return null; } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DeviceServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DeviceServiceImpl.java deleted file mode 100644 index bee1994..0000000 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DeviceServiceImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.hnac.hzims.safeproduct.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.hnac.hzims.safeproduct.entity.DeviceEntity; -import com.hnac.hzims.safeproduct.enums.DeviceStatusEnum; -import com.hnac.hzims.safeproduct.mapper.DeviceMapper; -import com.hnac.hzims.safeproduct.service.IDeviceService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 特种设备服务实现类 - * - * @author liwen - * @date 2024-01-12 - */ -@Service -public class DeviceServiceImpl extends ServiceImpl implements IDeviceService { - - /** - * 查找时间范围内的过期设备 - */ - @Override - public List getExpiredDeviceByTime(String startTime, String endTime) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(DeviceEntity::getDeviceStatus, DeviceStatusEnum.NORMAL.getValue()) - .ge(DeviceEntity::getInspectionNextTime, startTime) - .le(DeviceEntity::getInspectionNextTime, endTime); - return this.list(queryWrapper); - } -} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java index 4cf06fd..2c3b176 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java @@ -23,6 +23,7 @@ import com.hnac.hzims.safeproduct.vo.HygieneMonthVO; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.DateUtil; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -125,10 +126,7 @@ public class HygienePlanServiceImpl extends ServiceImpl standardScore) { - return R.fail("累计分值已超过标准总分值"); + throw new ServiceException("累计分值超过标准总分值"); } } - return sum < standardScore ? R.fail("标准总分值未全部分配") : R.data(sum); + if (sum < standardScore) { + throw new ServiceException("标准总分值未全部分配"); + } } /** @@ -297,4 +294,93 @@ public class HygienePlanServiceImpl extends ServiceImpl param, HttpServletResponse response) { + ServletOutputStream outputStream = null; + try { + outputStream = response.getOutputStream(); + String unit = String.valueOf(param.get("unit")); + String name = String.valueOf(param.get("name")); + String startTime = String.valueOf(param.get("scheduledStartTime")); + String endTime = String.valueOf(param.get("scheduledEndTime")); + List hygienePlanList = getHygienePlanByUnitNameAndTime(unit, name, startTime, endTime); + // 数据处理 + hygienePlanList.forEach(plan -> { + // 卫生自查状态 + String status; + if (plan.getHygienePlanStatus().equals(HygieneStatusEnum.WAITING.getValue())) { + status = HygieneStatusEnum.WAITING.getDesc(); + } else if (plan.getHygienePlanStatus().equals(HygieneStatusEnum.UNFINISHED.getValue())) { + status = HygieneStatusEnum.UNFINISHED.getDesc(); + } else { + status = HygieneStatusEnum.FINISHED.getDesc(); + } + plan.setHygienePlanStatus(status); + // 时间格式 + plan.setStartTime(DateUtil.format(plan.getScheduledStartTime(), DateUtil.PATTERN_DATE)); + plan.setEndTime(DateUtil.format(plan.getScheduledEndTime(), DateUtil.PATTERN_DATE)); + }); + // 设置响应头 + // URLEncoder.encode防止中文乱码 + String fileName = URLEncoder.encode("卫生自查计划表", "UTF-8"); + response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("UTF-8"); + // ExcelWriter初始化 + ExcelWriter excelWriter = EasyExcel + .write(response.getOutputStream()) + .autoCloseStream(Boolean.TRUE) + .registerConverter(new LongStringConverter()) + .registerWriteHandler(new SimpleColumnWidthStyleStrategy(25)) + .build(); + WriteSheet writeSheet = EasyExcel.writerSheet(1, "卫生自查计划表").head(HygienePlanEntity.class) + .build(); + excelWriter.write(hygienePlanList, writeSheet); + excelWriter.finish(); + } catch (Exception e) { + // 重置response + response.reset(); + response.setContentType("application/json"); + response.setCharacterEncoding("utf-8"); + throw new ServiceException("卫生自查计划表数据导出异常: " + e.getMessage()); + } finally { + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + log.error("卫生自查计划表数据导出输出流关闭异常: " + e.getMessage()); + } + } + } + } + + /** + * 根据单位、名称、时间查询卫生自查计划 + * @param unit 单位 + * @param name 名称 + * @param startTime 开始时间 + * @param endTime 结束时间 + * @return 卫生自查计划数据 + */ + private List getHygienePlanByUnitNameAndTime(String unit, String name, String startTime, String endTime) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!unit.equals("null") && !unit.equals("")) { + queryWrapper.lambda().like(HygienePlanEntity::getUnit, unit); + } + if (!name.equals("null") && !name.equals("")) { + queryWrapper.lambda().like(HygienePlanEntity::getName, name); + } + if (!startTime.equals("null") && !startTime.equals("")) { + queryWrapper.lambda().ge(HygienePlanEntity::getScheduledStartTime, startTime); + } + if (!endTime.equals("null") && !endTime.equals("")) { + queryWrapper.lambda().le(HygienePlanEntity::getScheduledEndTime, endTime); + } + queryWrapper.lambda().orderByDesc(HygienePlanEntity::getCreateTime); + return this.list(queryWrapper); + } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java index e37c3fd..608f1ed 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java @@ -20,12 +20,14 @@ import com.hnac.hzims.safeproduct.utils.BaseUtil; import com.hnac.hzims.safeproduct.vo.HygieneRecordPageVO; import com.hnac.hzims.safeproduct.vo.HygieneZoneDetailVO; import com.hnac.hzims.safeproduct.vo.HygieneRecordDetailVO; +import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; @@ -73,17 +75,19 @@ public class HygieneRecordServiceImpl extends ServiceImpl hygienePlanEntity.getStandardScore()) { - return R.fail("评分不能大于标准总分值"); + throw new ServiceException("评分不能大于标准总分值"); } } boolean save = this.save(hygieneRecordEntity); @@ -178,8 +182,7 @@ public class HygieneRecordServiceImpl extends ServiceImpl list = getHygieneByMonth(month); + List list = getHygieneByMonth(currentMonth); if (CollectionUtils.isEmpty(list)) { return null; } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java index 040e07a..a296345 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java @@ -21,6 +21,7 @@ import com.hnac.hzims.safeproduct.vo.RehearsalMonthVO; import com.hnac.hzims.safeproduct.vo.RehearsalYearVO; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.utils.DateUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -45,8 +46,7 @@ import java.util.stream.Collectors; * @date 2023-12-27 */ @Service -public class RehearsalPlanServiceImpl extends ServiceImpl - implements IRehearsalPlanService { +public class RehearsalPlanServiceImpl extends ServiceImpl implements IRehearsalPlanService { @Autowired IRehearsalRecordService rehearsalRecordService; @@ -190,8 +190,9 @@ public class RehearsalPlanServiceImpl extends ServiceImpl rehearsalList = getRehearsalByUnitAndDate(unit, startTime, endTime); - // 处理演练状态信息 + // 数据处理 rehearsalList.forEach(record -> { + // 演练状态 String status; if (record.getRehearsalStatus().equals(RehearsalStatusEnum.WAITING.getValue())) { status = RehearsalStatusEnum.WAITING.getDesc(); @@ -201,6 +202,9 @@ public class RehearsalPlanServiceImpl extends ServiceImpl list = new ArrayList<>(); + for (String img : imgArr) { + ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); + list.add(imageEntity); + } + rehearsalRecordDetailVO.setImages(list); + } + // 表头年月 + String code = rehearsalRecordDetailVO.getCode(); + rehearsalRecordDetailVO.setYear(code.substring(4, 8)); + rehearsalRecordDetailVO.setMonth(code.substring(8, 10)); + // 演练方式 String rehearsalMethod = rehearsalRecordDetailVO.getRehearsalMethod(); if (rehearsalMethod.equals(RehearsalMethodEnum.MIXED.getValue())) { rehearsalRecordDetailVO.setRehearsalMethod(RehearsalMethodEnum.MIXED.getDesc()); @@ -155,4 +177,26 @@ public class RehearsalRecordServiceImpl extends ServiceImpl rehearsalRecordPage(Map param, Query query) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + String rehearsalPlanId = String.valueOf(param.get("rehearsalPlanId")); + String actualStartTime = String.valueOf(param.get("actualStartTime")); + String actualEndTime = String.valueOf(param.get("actualEndTime")); + if (!rehearsalPlanId.equals("null") && !rehearsalPlanId.equals("")) { + queryWrapper.lambda().eq(RehearsalRecordEntity::getRehearsalPlanId, rehearsalPlanId); + } + if (!actualStartTime.equals("null") && !actualStartTime.equals("")) { + queryWrapper.lambda().ge(RehearsalRecordEntity::getActualStartTime, actualStartTime); + } + if (!actualEndTime.equals("null") && !actualEndTime.equals("")) { + queryWrapper.lambda().le(RehearsalRecordEntity::getActualEndTime, actualEndTime); + } + queryWrapper.lambda().orderByDesc(RehearsalRecordEntity::getCreateTime); + return this.page(Condition.getPage(query), queryWrapper); + } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceInspectionServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceInspectionServiceImpl.java new file mode 100644 index 0000000..7bfd8c2 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceInspectionServiceImpl.java @@ -0,0 +1,79 @@ +package com.hnac.hzims.safeproduct.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +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.hnac.hzims.safeproduct.entity.SpecialDeviceEntity; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceInspectionEntity; +import com.hnac.hzims.safeproduct.enums.DeviceStatusEnum; +import com.hnac.hzims.safeproduct.mapper.SpecialDeviceInspectionMapper; +import com.hnac.hzims.safeproduct.service.ISpecialDeviceInspectionService; +import com.hnac.hzims.safeproduct.service.ISpecialDeviceService; +import org.springblade.core.mp.support.Query; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Map; + +/** + * 特种设备检验记录服务实现类 + * + * @author liwen + * @date 2024-01-22 + */ +@Service +public class SpecialDeviceInspectionServiceImpl extends ServiceImpl implements ISpecialDeviceInspectionService { + + @Autowired + ISpecialDeviceService deviceService; + + /** + * 新增设备检验记录 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public boolean saveInspection(SpecialDeviceInspectionEntity specialDeviceInspectionEntity) { + boolean save = this.save(specialDeviceInspectionEntity); + if (save) { + SpecialDeviceEntity specialDeviceEntity = deviceService.getById(specialDeviceInspectionEntity.getDeviceId()); + if (specialDeviceEntity != null) { + specialDeviceEntity.setInspectionLastTime(specialDeviceInspectionEntity.getLastInspectionTime()); + specialDeviceEntity.setInspectionCurrentTime(specialDeviceInspectionEntity.getInspectionTime()); + specialDeviceEntity.setInspectionNextTime(specialDeviceInspectionEntity.getNextInspectionTime()); + specialDeviceEntity.setDeviceStatus(DeviceStatusEnum.NORMAL.getValue()); + return deviceService.updateById(specialDeviceEntity); + } + } + return false; + } + + /** + * 修改设备检验记录 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public boolean updateInspection(SpecialDeviceInspectionEntity specialDeviceInspectionEntity) { + boolean update = this.updateById(specialDeviceInspectionEntity); + if (update) { + SpecialDeviceEntity specialDeviceEntity = deviceService.getById(specialDeviceInspectionEntity.getDeviceId()); + if (specialDeviceEntity != null) { + specialDeviceEntity.setInspectionLastTime(specialDeviceInspectionEntity.getLastInspectionTime()); + specialDeviceEntity.setInspectionCurrentTime(specialDeviceInspectionEntity.getInspectionTime()); + specialDeviceEntity.setInspectionNextTime(specialDeviceInspectionEntity.getNextInspectionTime()); + return deviceService.updateById(specialDeviceEntity); + } + } + return false; + } + + /** + * 设备检验记录分页 + */ + @Override + public IPage getInspectionPage(Map param, Query query) { + IPage page = new Page<>(query.getCurrent(), query.getSize()); + return baseMapper.getInspectionPage(page, param); + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceServiceImpl.java new file mode 100644 index 0000000..179568e --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceServiceImpl.java @@ -0,0 +1,33 @@ +package com.hnac.hzims.safeproduct.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceEntity; +import com.hnac.hzims.safeproduct.enums.DeviceStatusEnum; +import com.hnac.hzims.safeproduct.mapper.SpecialDeviceMapper; +import com.hnac.hzims.safeproduct.service.ISpecialDeviceService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 特种设备服务实现类 + * + * @author liwen + * @date 2024-01-12 + */ +@Service +public class SpecialDeviceServiceImpl extends ServiceImpl implements ISpecialDeviceService { + + /** + * 查找时间范围内的过期设备 + */ + @Override + public List getExpiredDeviceByTime(String startTime, String endTime) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(SpecialDeviceEntity::getDeviceStatus, DeviceStatusEnum.NORMAL.getValue()) + .ge(SpecialDeviceEntity::getInspectionNextTime, startTime) + .le(SpecialDeviceEntity::getInspectionNextTime, endTime); + return this.list(queryWrapper); + } +} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java index eeaa00a..5573afa 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java @@ -87,6 +87,7 @@ public class TestServiceImpl extends ServiceImpl impleme /** * 删除关联考试记录 */ + @Transactional(rollbackFor = Exception.class) @Override public boolean removeRelativeTest(Long trainRecordId) { // 查询关联考试记录 diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java index 9dc05c5..37aabc0 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java @@ -23,6 +23,7 @@ import com.hnac.hzims.safeproduct.vo.TrainMonthVO; import com.hnac.hzims.safeproduct.vo.TrainYearVO; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.utils.DateUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -194,7 +195,7 @@ public class TrainPlanServiceImpl extends ServiceImpl trainPlanList = getTrainPlanByUnitAndDate(unit, startTime, endTime); - // 处理字段信息 + // 数据处理 trainPlanList.forEach(train -> { // 培训状态 String status; @@ -209,6 +210,9 @@ public class TrainPlanServiceImpl extends ServiceImpl list = new ArrayList<>(); + for (String img : imgArr) { + ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); + list.add(imageEntity); + } + trainRecordDetailVO.setImages(list); + } + // 表头年月 + String code = trainRecordDetailVO.getCode(); + trainRecordDetailVO.setYear(code.substring(4, 8)); + trainRecordDetailVO.setMonth(code.substring(8, 10)); Map params = BaseUtil.obj2Map(trainRecordDetailVO); String templateFile = "template/培训记录表" + SafeProductConstant.DOCX_SUFFIX; String wordPath = savePath + "/培训记录表" + SafeProductConstant.DOCX_SUFFIX; diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java index 1cc74f1..3118280 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java @@ -2,7 +2,7 @@ package com.hnac.hzims.safeproduct.utils; import cn.afterturn.easypoi.word.WordExportUtil; import com.hnac.hzims.common.logs.utils.StringUtils; -import com.hnac.hzims.ticket.annotation.DateTimeToMap; +import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.IOUtils; import org.apache.poi.xwpf.usermodel.XWPFDocument; @@ -13,10 +13,12 @@ import org.springblade.core.tool.utils.ObjectUtil; import javax.servlet.http.HttpServletResponse; import java.io.*; import java.lang.reflect.Field; +import java.net.HttpURLConnection; +import java.net.URL; import java.net.URLEncoder; +import java.nio.file.Files; import java.time.LocalDateTime; import java.util.*; -import java.util.stream.Collectors; /** * 公用工具类 @@ -156,8 +158,8 @@ public class BaseUtil { * @return map参数 */ public static Map obj2Map(Object obj) { + Map result = new HashMap<>(); if (ObjectUtil.isNotEmpty(obj) && null != obj.getClass()) { - Map result = new HashMap<>(); List fieldList = new ArrayList<>(); Class clazz = obj.getClass(); while (clazz != null) { @@ -172,59 +174,81 @@ public class BaseUtil { } catch (IllegalAccessException e) { throw new ServiceException("获取属性性出错"); } - if (value instanceof List) { - List> list = ((List) value).stream().map(BaseUtil::obj2Map).collect(Collectors.toList()); - result.put(field.getName(),list); - } - else if (value instanceof LocalDateTime) { - DateTimeToMap dateTimeToMap = field.getAnnotation(DateTimeToMap.class); - LocalDateTime time = (LocalDateTime) value; - if(ObjectUtil.isEmpty(dateTimeToMap)) { - result.put(field.getName(),time.format(DateUtil.TIME_FORMATTER)); - } - else { - result.putAll(LocalDateConvertMap(time,dateTimeToMap.prefix(),dateTimeToMap.split())); - } + if (value instanceof LocalDateTime) { + value = DateUtil.format((LocalDateTime) value, SafeProductConstant.SAFEPRODUCT_EXPORT_DATE); } else if (value instanceof Date) { - DateTimeToMap dateTimeToMap = field.getAnnotation(DateTimeToMap.class); - Date time = (Date) value; - if (ObjectUtil.isEmpty(dateTimeToMap)) { - result.put(field.getName(),DateUtil.format(time,DateUtil.PATTERN_DATETIME)); - } - else { - result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"year", time.getYear()); - result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"month", time.getMonth()); - result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"day", time.getDay()); - result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"hour", time.getHours()); - result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"minuter", time.getMinutes()); - result.put(dateTimeToMap.prefix()+dateTimeToMap.split()+"second", time.getSeconds()); - } - } - else { - result.put(field.getName(),value); + value = DateUtil.format((Date) value, SafeProductConstant.SAFEPRODUCT_EXPORT_DATE); } + result.put(field.getName(),value); }); - return result; } - return null; + return result; + } + + /** + * 图片转字节 + * @param tempImgPath 图片路径 + * @return 图片字节 + */ + public static byte[] imgToByte(String tempImgPath) { + File file = new File(tempImgPath); + byte[] buffer = null; + try { + FileInputStream fis = new FileInputStream(file); + ByteArrayOutputStream bos = new ByteArrayOutputStream(1000); + byte[] b = new byte[1000]; + int n; + while ((n = fis.read(b)) != -1) { + bos.write(b, 0, n); + } + fis.close(); + bos.close(); + buffer = bos.toByteArray(); + } catch (IOException e) { + log.error(e.getMessage()); + } + //删除临时文件 + file.delete(); + return buffer; } /** - * 将时间按格式转化为map对象 - * @param dateTime 待转换时间 - * @param prefix 转换格式Key前缀 - * @param split 转换格式Key分隔符 - * @return map对象 + * 下载文件 + * @param fileUrl 文件路径 + * @param downloadFileDir 下载路径 + * @return 下载文件路径 */ - public static Map LocalDateConvertMap(LocalDateTime dateTime,String prefix,String split) { - return new HashMap() {{ - put(prefix + split + "year", dateTime.getYear()); - put(prefix + split + "month", dateTime.getMonthValue()); - put(prefix + split + "day", dateTime.getDayOfMonth()); - put(prefix + split + "hour", dateTime.getHour()); - put(prefix + split + "minuter", dateTime.getMinute()); - put(prefix + split + "second", dateTime.getSecond()); - }}; + public static String downloadFileByUrl(String fileUrl, String downloadFileDir){ + URL url; + String fileName = null; + try { + url = new URL(fileUrl); + HttpURLConnection connection = (HttpURLConnection)url.openConnection(); + connection.setConnectTimeout(5000); + connection.setReadTimeout(5000); + connection.connect(); + int responseCode = connection.getResponseCode(); + if (responseCode == 200) { + InputStream inputStream = connection.getInputStream(); + int lastSlashIndex = fileUrl.lastIndexOf("/"); + if (lastSlashIndex > 0) { + fileName = fileUrl.substring(lastSlashIndex+1); + String filePath = downloadFileDir + fileName; + File file = new File(filePath); + if (file.exists()){ + file.delete(); + } + OutputStream outputStream = Files.newOutputStream(file.toPath()); + // 将文件流拷贝到本地处理 + IOUtils.copy(inputStream, outputStream); + } else { + throw new ServiceException("下载文件路径异常:" + downloadFileDir); + } + } + } catch (Exception e) { + throw new ServiceException("文件图片下载失败!"); + } + return fileName; } } diff --git a/hzims-service/safeproduct/src/main/resources/template/会议记录表.docx b/hzims-service/safeproduct/src/main/resources/template/会议记录表.docx index fd5f373..e4af627 100644 Binary files a/hzims-service/safeproduct/src/main/resources/template/会议记录表.docx and b/hzims-service/safeproduct/src/main/resources/template/会议记录表.docx differ diff --git a/hzims-service/safeproduct/src/main/resources/template/培训记录表.docx b/hzims-service/safeproduct/src/main/resources/template/培训记录表.docx index 9fd0baf..803c532 100644 Binary files a/hzims-service/safeproduct/src/main/resources/template/培训记录表.docx and b/hzims-service/safeproduct/src/main/resources/template/培训记录表.docx differ diff --git a/hzims-service/safeproduct/src/main/resources/template/演练记录表.docx b/hzims-service/safeproduct/src/main/resources/template/演练记录表.docx index ce1bbf9..f3c3438 100644 Binary files a/hzims-service/safeproduct/src/main/resources/template/演练记录表.docx and b/hzims-service/safeproduct/src/main/resources/template/演练记录表.docx differ diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java index d4c5c2c..05f9fa7 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java @@ -303,11 +303,16 @@ public class OperationTicketServiceImpl implements OperationTicketService { String taskId = response.getTaskId(); log.info("StringUtils.isBlank(taskId) = " + StringUtils.isBlank(taskId)); if (StringUtils.isBlank(taskId)) { - newStandardTicketInfoEntity.setFlowDescription("结束"); - newStandardTicketInfoEntity.setFlowTaskId(" "); - newStandardTicketInfoEntity.setFlowTaskName("结束"); - newStandardTicketInfoEntity.setNextStepOperator(" "); - newStandardTicketInfoEntity.setFlowStatus(999); + if (newStandardTicketInfoEntity.equals(TicketConstants.OPERATION_TICKET_APPROVED)) { + newStandardTicketInfoEntity.setFlowDescription("结束"); + newStandardTicketInfoEntity.setFlowTaskId(" "); + newStandardTicketInfoEntity.setFlowTaskName("结束"); + newStandardTicketInfoEntity.setNextStepOperator(" "); + newStandardTicketInfoEntity.setFlowStatus(999); + } else { + newStandardTicketInfoEntity.setFlowDescription("作废"); + newStandardTicketInfoEntity.setFlowTaskName("作废"); + } } else { //如果response.getHandleType() 是0使用户 newStandardTicketInfoEntity.setFlowUserId(response.getUserId()); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java index 9d8cd24..e777e6e 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/operation/StandardTicketInfoVo.java @@ -3,6 +3,7 @@ package com.hnac.hzims.ticket.twoTicket.vo.operation; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import org.springblade.core.tenant.mp.TenantEntity; import org.springframework.format.annotation.DateTimeFormat; @@ -17,22 +18,19 @@ import java.util.List; * @Date 2023/6/6 15:39 */ @Data +@EqualsAndHashCode(callSuper = true) @Accessors(chain = true) public class StandardTicketInfoVo extends TenantEntity { - @ApiModelProperty("票据类型") private String ticketType; - - @ApiModelProperty("单位") private String company; @ApiModelProperty("工作流ID") private String processInstanceId; - @ApiModelProperty("编号") private String code; @@ -97,7 +95,6 @@ public class StandardTicketInfoVo extends TenantEntity { @ApiModelProperty("是否评价") private Integer isEvaluate; - /** * AA/AAA/AAAA由建站时建站人填写必须系统验证唯一性 * 站点标识-两票编码 @@ -105,70 +102,33 @@ public class StandardTicketInfoVo extends TenantEntity { @ApiModelProperty("站点标识-两票编码") private String signage; - - /** - * 项目 - */ @ApiModelProperty("项目") private String projectName; - - /** - * - */ @ApiModelProperty("分组") private String classGroupName; - - /** - * 编号(原站点ID) - */ @ApiModelProperty("编号(原站点ID)") private String signageCode; - /** - * 流程状态' - */ @ApiModelProperty("流程状态") private Integer flowStatus; - /** - * 流程描述 - */ @ApiModelProperty("流程描述") private String flowDescription; - - - /** - * 下一个审批人 - */ @ApiModelProperty("下一个审批人") private String nextStepOperator; - - /** - * 用户Id - */ @ApiModelProperty("用户Id") private String flowUserId; - - /** - * 当前任务名 - */ @ApiModelProperty("当前任务名") private String flowTaskName; - - /** - * 当前任务名 - */ @ApiModelProperty("当前任务名") private String flowTaskId; - - @ApiModelProperty("创建人名称") private String createUserName; @@ -190,8 +150,6 @@ public class StandardTicketInfoVo extends TenantEntity { @ApiModelProperty("许可人名称") private String guardianName; - /** - * 安全措施 - */ + @ApiModelProperty("安全措施") private List standardTicketMeasureVos; } diff --git a/hzims-service/ticket/src/main/resources/file/线下工作票审批流程.bpmn20.xml b/hzims-service/ticket/src/main/resources/file/线下工作票审批流程.bpmn20.xml index 3e2c854..1ff2eac 100644 --- a/hzims-service/ticket/src/main/resources/file/线下工作票审批流程.bpmn20.xml +++ b/hzims-service/ticket/src/main/resources/file/线下工作票审批流程.bpmn20.xml @@ -1,6 +1,6 @@ - + @@ -60,8 +60,8 @@ - - + +