diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/HazardHiddenDangerRectifyController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/HazardHiddenDangerRectifyController.java new file mode 100644 index 00000000..3f83e2c6 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/controller/HazardHiddenDangerRectifyController.java @@ -0,0 +1,108 @@ +package org.dromara.safety.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.web.core.BaseController; +import org.dromara.safety.domain.bo.HazardHiddenDangerBo; +import org.dromara.safety.domain.bo.HazardHiddenDangerRectifyBo; +import org.dromara.safety.domain.vo.HazardHiddenDangerRectifyVo; +import org.dromara.safety.domain.vo.HazardHiddenDangerVo; +import org.dromara.safety.service.IHazardHiddenDangerRectifyService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 隐患整改情况 + * + * @author lilemy + * @date 2025-12-04 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/safety/hiddenDangerRectify") +public class HazardHiddenDangerRectifyController extends BaseController { + + private final IHazardHiddenDangerRectifyService hazardHiddenDangerRectifyService; + + /** + * 查询隐患整改情况列表 + */ + @SaCheckPermission("safety:hiddenDangerRectify:list") + @GetMapping("/list") + public TableDataInfo list(HazardHiddenDangerBo bo, PageQuery pageQuery) { + return hazardHiddenDangerRectifyService.queryPageList(bo, pageQuery); + } + + /** + * 导出隐患整改情况列表 + */ + @SaCheckPermission("safety:hiddenDangerRectify:export") + @Log(title = "隐患整改情况", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HazardHiddenDangerRectifyBo bo, HttpServletResponse response) { + List list = hazardHiddenDangerRectifyService.queryList(bo); + ExcelUtil.exportExcel(list, "隐患整改情况", HazardHiddenDangerRectifyVo.class, response); + } + + /** + * 获取隐患整改情况详细信息 + * + * @param hiddenDangerId 主键 + */ + @SaCheckPermission("safety:hiddenDangerRectify:query") + @GetMapping("/{hiddenDangerId}") + public R getInfo(@NotNull(message = "隐患主键不能为空") + @PathVariable Long hiddenDangerId) { + return R.ok(hazardHiddenDangerRectifyService.queryById(hiddenDangerId)); + } + + /** + * 新增隐患整改情况 + */ + @SaCheckPermission("safety:hiddenDangerRectify:add") + @Log(title = "隐患整改情况", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody HazardHiddenDangerRectifyBo bo) { + return toAjax(hazardHiddenDangerRectifyService.insertByBo(bo)); + } + + /** + * 修改隐患整改情况 + */ + @SaCheckPermission("safety:hiddenDangerRectify:edit") + @Log(title = "隐患整改情况", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody HazardHiddenDangerRectifyBo bo) { + return toAjax(hazardHiddenDangerRectifyService.updateByBo(bo)); + } + + /** + * 删除隐患整改情况 + * + * @param ids 主键串 + */ + @SaCheckPermission("safety:hiddenDangerRectify:remove") + @Log(title = "隐患整改情况", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(hazardHiddenDangerRectifyService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/HazardHiddenDanger.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/HazardHiddenDanger.java index 238bc8a2..84faaec2 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/HazardHiddenDanger.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/HazardHiddenDanger.java @@ -1,9 +1,10 @@ package org.dromara.safety.domain; -import org.dromara.common.mybatis.core.domain.BaseEntity; -import com.baomidou.mybatisplus.annotation.*; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; +import org.dromara.common.mybatis.core.domain.BaseEntity; import java.io.Serial; import java.time.LocalDateTime; @@ -32,7 +33,7 @@ public class HazardHiddenDanger extends BaseEntity { public static final String CLOSED = "4"; /** - * 角色ID + * id */ @TableId(value = "id") private Long id; @@ -40,7 +41,7 @@ public class HazardHiddenDanger extends BaseEntity { /** * 项目ID */ - private Long projectId; + private Long projectId; /** * 隐患编号 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/HazardHiddenDangerRectify.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/HazardHiddenDangerRectify.java new file mode 100644 index 00000000..3ca995de --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/HazardHiddenDangerRectify.java @@ -0,0 +1,92 @@ +package org.dromara.safety.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.dromara.common.mybatis.core.domain.BaseEntity; + +import java.io.Serial; +import java.time.LocalDateTime; + +/** + * 隐患整改情况对象 hazard_hidden_danger_rectify + * + * @author lilemy + * @date 2025-12-04 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("hazard_hidden_danger_rectify") +public class HazardHiddenDangerRectify extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id") + private Long id; + + /** + * 关联隐患ID + */ + private Long hiddenDangerId; + + /** + * 整改次数 + */ + private Long rectifyCount; + + /** + * 整改人ID + */ + private Long rectifyUserId; + + /** + * 整改说明 + */ + private String rectifyDesc; + + /** + * 整改附件 + */ + private String rectifyFiles; + + /** + * 完成整改时间 + */ + private LocalDateTime rectifyTime; + + /** + * 复查人ID + */ + private Long reviewUserId; + + /** + * 复查说明 + */ + private String reviewDesc; + + /** + * 复查附件 + */ + private String reviewFiles; + + /** + * 复查时间 + */ + private LocalDateTime reviewTime; + + /** + * 复查状态(1待复查 2复查通过 3复查不通过) + */ + private String reviewStatus; + + /** + * 备注 + */ + private String remark; + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/bo/HazardHiddenDangerRectifyBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/bo/HazardHiddenDangerRectifyBo.java new file mode 100644 index 00000000..ff0cc5dc --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/bo/HazardHiddenDangerRectifyBo.java @@ -0,0 +1,99 @@ +package org.dromara.safety.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.safety.domain.HazardHiddenDangerRectify; + +import java.io.Serial; +import java.time.LocalDateTime; + +/** + * 隐患整改情况业务对象 hazard_hidden_danger_rectify + * + * @author lilemy + * @date 2025-12-04 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = HazardHiddenDangerRectify.class, reverseConvertGenerate = false) +public class HazardHiddenDangerRectifyBo extends BaseEntity { + + @Serial + private static final long serialVersionUID = -211811062254843066L; + + /** + * 主键 + */ + @NotNull(message = "主键不能为空", groups = {EditGroup.class}) + private Long id; + + /** + * 关联隐患ID + */ + @NotNull(message = "关联隐患ID不能为空", groups = {AddGroup.class, EditGroup.class}) + private Long hiddenDangerId; + + /** + * 整改次数 + */ + @NotNull(message = "整改次数不能为空", groups = {AddGroup.class, EditGroup.class}) + private Long rectifyCount; + + /** + * 整改人ID + */ + @NotNull(message = "整改人ID不能为空", groups = {AddGroup.class, EditGroup.class}) + private Long rectifyUserId; + + /** + * 整改说明 + */ + private String rectifyDesc; + + /** + * 整改附件 + */ + private String rectifyFiles; + + /** + * 完成整改时间 + */ + private LocalDateTime rectifyTime; + + /** + * 复查人ID + */ + private Long reviewUserId; + + /** + * 复查说明 + */ + private String reviewDesc; + + /** + * 复查附件 + */ + private String reviewFiles; + + /** + * 复查时间 + */ + private LocalDateTime reviewTime; + + /** + * 复查状态(1待复查 2复查通过 3复查不通过) + */ + private String reviewStatus; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/hiddendangerrectify/HazardHiddenDangerRectifyRectificationReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/hiddendangerrectify/HazardHiddenDangerRectifyRectificationReq.java new file mode 100644 index 00000000..9cb431b7 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/hiddendangerrectify/HazardHiddenDangerRectifyRectificationReq.java @@ -0,0 +1,36 @@ +package org.dromara.safety.domain.dto.hiddendangerrectify; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + +/** + * @author lilemy + * @date 2025-12-04 14:58 + */ +@Data +public class HazardHiddenDangerRectifyRectificationReq implements Serializable { + + @Serial + private static final long serialVersionUID = 3378774493193429015L; + + /** + * 主键 + */ + @NotNull(message = "主键不能为空") + private Long id; + + /** + * 整改说明 + */ + @NotBlank(message = "整改说明不能为空") + private String rectifyDesc; + + /** + * 整改附件 + */ + private String rectifyFiles; +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/hiddendangerrectify/HazardHiddenDangerRectifyReviewReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/hiddendangerrectify/HazardHiddenDangerRectifyReviewReq.java new file mode 100644 index 00000000..a64671d4 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/dto/hiddendangerrectify/HazardHiddenDangerRectifyReviewReq.java @@ -0,0 +1,19 @@ +package org.dromara.safety.domain.dto.hiddendangerrectify; + +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + +/** + * @author lilemy + * @date 2025-12-04 15:07 + */ +@Data +public class HazardHiddenDangerRectifyReviewReq implements Serializable { + + @Serial + private static final long serialVersionUID = 6999133950832111753L; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/HazardHiddenDangerRectifyVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/HazardHiddenDangerRectifyVo.java new file mode 100644 index 00000000..21d3fa8d --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/HazardHiddenDangerRectifyVo.java @@ -0,0 +1,128 @@ +package org.dromara.safety.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import org.dromara.common.translation.annotation.Translation; +import org.dromara.common.translation.constant.TransConstant; +import org.dromara.safety.domain.HazardHiddenDangerRectify; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDateTime; + + +/** + * 隐患整改情况视图对象 hazard_hidden_danger_rectify + * + * @author lilemy + * @date 2025-12-04 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = HazardHiddenDangerRectify.class) +public class HazardHiddenDangerRectifyVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @ExcelProperty(value = "主键") + private Long id; + + /** + * 关联隐患ID + */ + @ExcelProperty(value = "关联隐患ID") + private Long hiddenDangerId; + + /** + * 整改次数 + */ + @ExcelProperty(value = "整改次数") + private Long rectifyCount; + + /** + * 整改人ID + */ + @ExcelProperty(value = "整改人ID") + private Long rectifyUserId; + + /** + * 整改人名字 + */ + @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "rectifyUserId") + private String rectifyUserName; + + /** + * 整改说明 + */ + @ExcelProperty(value = "整改说明") + private String rectifyDesc; + + /** + * 整改附件 + */ + @ExcelProperty(value = "整改附件") + private String rectifyFiles; + + /** + * 整改附件Url + */ + @Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "rectifyFiles") + private String rectifyFilesUrl; + + /** + * 完成整改时间 + */ + @ExcelProperty(value = "完成整改时间") + private LocalDateTime rectifyTime; + + /** + * 复查人ID + */ + @ExcelProperty(value = "复查人ID") + private Long reviewUserId; + + /** + * 复查说明 + */ + @ExcelProperty(value = "复查说明") + private String reviewDesc; + + /** + * 复查附件 + */ + @ExcelProperty(value = "复查附件") + private String reviewFiles; + + /** + * 复查附件Url + */ + @Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "reviewFiles") + private String reviewFilesUrl; + /** + * 复查时间 + */ + @ExcelProperty(value = "复查时间") + private LocalDateTime reviewTime; + + /** + * 复查状态(1待复查 2复查通过 3复查不通过) + */ + @ExcelProperty(value = "复查状态(1待复查 2复查通过 3复查不通过)", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "hazard_review_status") + private String reviewStatus; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/HazardHiddenDangerVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/HazardHiddenDangerVo.java index c2b6a31b..725a41a3 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/HazardHiddenDangerVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/HazardHiddenDangerVo.java @@ -1,20 +1,19 @@ package org.dromara.safety.domain.vo; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; import org.dromara.common.translation.annotation.Translation; import org.dromara.common.translation.constant.TransConstant; import org.dromara.safety.domain.HazardHiddenDanger; -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; -import com.alibaba.excel.annotation.ExcelProperty; -import org.dromara.common.excel.annotation.ExcelDictFormat; -import org.dromara.common.excel.convert.ExcelDictConvert; -import io.github.linpeilie.annotations.AutoMapper; -import lombok.Data; import java.io.Serial; import java.io.Serializable; import java.time.LocalDateTime; -import java.util.Date; - +import java.util.List; /** @@ -32,15 +31,15 @@ public class HazardHiddenDangerVo implements Serializable { private static final long serialVersionUID = 1L; /** - * 角色ID + * id */ - @ExcelProperty(value = "角色ID") + @ExcelProperty(value = "id") private Long id; /** * 项目ID */ - private Long projectId; + private Long projectId; /** * 隐患编号 @@ -116,7 +115,7 @@ public class HazardHiddenDangerVo implements Serializable { @ExcelProperty(value = "评估人") private Long evaluator; - /** + /** * 评估人名字 */ @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "evaluator") @@ -195,6 +194,13 @@ public class HazardHiddenDangerVo implements Serializable { @ExcelProperty(value = "备注") private String remark; + /** + * 最新整改次数 + */ + private Integer latestRectifyTimes; - + /** + * 整改信息列表 + */ + private List rectifyList; } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/RectifyTimesVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/RectifyTimesVo.java new file mode 100644 index 00000000..04478be2 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/domain/vo/RectifyTimesVo.java @@ -0,0 +1,17 @@ +package org.dromara.safety.domain.vo; + +import lombok.Data; + +@Data +public class RectifyTimesVo { + + /** + * 隐患ID + */ + private Long hiddenDangerId; + + /** + * 最新整改次数 + */ + private Integer latestRectifyTimes; +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/mapper/HazardHiddenDangerRectifyMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/mapper/HazardHiddenDangerRectifyMapper.java new file mode 100644 index 00000000..6a71a8cf --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/mapper/HazardHiddenDangerRectifyMapper.java @@ -0,0 +1,26 @@ +package org.dromara.safety.mapper; + +import org.apache.ibatis.annotations.Param; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; +import org.dromara.safety.domain.HazardHiddenDangerRectify; +import org.dromara.safety.domain.vo.HazardHiddenDangerRectifyVo; +import org.dromara.safety.domain.vo.RectifyTimesVo; + +import java.util.List; + +/** + * 隐患整改情况Mapper接口 + * + * @author lilemy + * @date 2025-12-04 + */ +public interface HazardHiddenDangerRectifyMapper extends BaseMapperPlus { + + /** + * 获取最近一次整改时间 + * + * @param ids 隐患ID + * @return 最近一次整改时间 + */ + List getLatestRectifyTimes(@Param("ids") List ids); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/IHazardHiddenDangerRectifyService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/IHazardHiddenDangerRectifyService.java new file mode 100644 index 00000000..45a4eb06 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/IHazardHiddenDangerRectifyService.java @@ -0,0 +1,90 @@ +package org.dromara.safety.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.safety.domain.HazardHiddenDangerRectify; +import org.dromara.safety.domain.bo.HazardHiddenDangerBo; +import org.dromara.safety.domain.bo.HazardHiddenDangerRectifyBo; +import org.dromara.safety.domain.dto.hiddendangerrectify.HazardHiddenDangerRectifyRectificationReq; +import org.dromara.safety.domain.dto.hiddendangerrectify.HazardHiddenDangerRectifyReviewReq; +import org.dromara.safety.domain.vo.HazardHiddenDangerRectifyVo; +import org.dromara.safety.domain.vo.HazardHiddenDangerVo; + +import java.util.Collection; +import java.util.List; + +/** + * 隐患整改情况Service接口 + * + * @author lilemy + * @date 2025-12-04 + */ +public interface IHazardHiddenDangerRectifyService extends IService { + + /** + * 查询隐患整改情况 + * + * @param id 主键 + * @return 隐患整改情况 + */ + HazardHiddenDangerVo queryById(Long id); + + /** + * 分页查询隐患整改情况列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 隐患整改情况分页列表 + */ + TableDataInfo queryPageList(HazardHiddenDangerBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的隐患整改情况列表 + * + * @param bo 查询条件 + * @return 隐患整改情况列表 + */ + List queryList(HazardHiddenDangerRectifyBo bo); + + /** + * 新增隐患整改情况 + * + * @param bo 隐患整改情况 + * @return 是否新增成功 + */ + Boolean insertByBo(HazardHiddenDangerRectifyBo bo); + + /** + * 修改隐患整改情况 + * + * @param bo 隐患整改情况 + * @return 是否修改成功 + */ + Boolean updateByBo(HazardHiddenDangerRectifyBo bo); + + /** + * 隐患整改 + * + * @param req 隐患整改参数 + * @return 是否整改成功 + */ + Boolean rectification(HazardHiddenDangerRectifyRectificationReq req); + + /** + * 隐患复查 + * + * @param req 隐患复查参数 + * @return 是否审核成功 + */ + Boolean review(HazardHiddenDangerRectifyReviewReq req); + + /** + * 校验并批量删除隐患整改情况信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/IHazardHiddenDangerService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/IHazardHiddenDangerService.java index 5366ebad..9798746e 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/IHazardHiddenDangerService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/IHazardHiddenDangerService.java @@ -1,16 +1,14 @@ package org.dromara.safety.service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.IService; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.safety.domain.HazardHiddenDanger; +import org.dromara.safety.domain.bo.HazardHiddenDangerBo; import org.dromara.safety.domain.dto.EvaluateDto; import org.dromara.safety.domain.vo.HazardHiddenDangerVo; -import org.dromara.safety.domain.bo.HazardHiddenDangerBo; -import org.dromara.safety.domain.HazardHiddenDanger; -import org.dromara.common.mybatis.core.page.TableDataInfo; -import org.dromara.common.mybatis.core.page.PageQuery; - -import com.baomidou.mybatisplus.extension.service.IService; import org.dromara.safety.domain.vo.HiddenDangerCountVo; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; import java.util.Collection; import java.util.List; @@ -21,7 +19,7 @@ import java.util.List; * @author Lion Li * @date 2025-12-03 */ -public interface IHazardHiddenDangerService extends IService{ +public interface IHazardHiddenDangerService extends IService { /** * 查询隐患信息 @@ -40,6 +38,15 @@ public interface IHazardHiddenDangerService extends IService */ TableDataInfo queryPageList(HazardHiddenDangerBo bo, PageQuery pageQuery); + /** + * 分页查询隐患信息列表 + * + * @param lqw 查询条件 + * @param pageQuery 分页参数 + * @return 隐患信息分页列表 + */ + TableDataInfo queryPageList(LambdaQueryWrapper lqw, PageQuery pageQuery); + /** * 查询符合条件的隐患信息列表 * @@ -48,6 +55,14 @@ public interface IHazardHiddenDangerService extends IService */ List queryList(HazardHiddenDangerBo bo); + /** + * 构建查询条件 + * + * @param bo 查询条件 + * @return 查询条件 + */ + LambdaQueryWrapper buildQueryWrapper(HazardHiddenDangerBo bo); + /** * 新增隐患信息 * diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HazardHiddenDangerRectifyServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HazardHiddenDangerRectifyServiceImpl.java new file mode 100644 index 00000000..50c6120c --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HazardHiddenDangerRectifyServiceImpl.java @@ -0,0 +1,190 @@ +package org.dromara.safety.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.RequiredArgsConstructor; +import org.dromara.common.core.exception.ServiceException; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.safety.domain.HazardHiddenDanger; +import org.dromara.safety.domain.HazardHiddenDangerRectify; +import org.dromara.safety.domain.bo.HazardHiddenDangerBo; +import org.dromara.safety.domain.bo.HazardHiddenDangerRectifyBo; +import org.dromara.safety.domain.dto.hiddendangerrectify.HazardHiddenDangerRectifyRectificationReq; +import org.dromara.safety.domain.dto.hiddendangerrectify.HazardHiddenDangerRectifyReviewReq; +import org.dromara.safety.domain.vo.HazardHiddenDangerRectifyVo; +import org.dromara.safety.domain.vo.HazardHiddenDangerVo; +import org.dromara.safety.domain.vo.RectifyTimesVo; +import org.dromara.safety.mapper.HazardHiddenDangerRectifyMapper; +import org.dromara.safety.service.IHazardHiddenDangerRectifyService; +import org.dromara.safety.service.IHazardHiddenDangerService; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * 隐患整改情况Service业务层处理 + * + * @author lilemy + * @date 2025-12-04 + */ +@RequiredArgsConstructor +@Service +public class HazardHiddenDangerRectifyServiceImpl extends ServiceImpl + implements IHazardHiddenDangerRectifyService { + + private final IHazardHiddenDangerService hazardHiddenDangerService; + + /** + * 查询隐患整改情况 + * + * @param id 主键 + * @return 隐患整改情况 + */ + @Override + public HazardHiddenDangerVo queryById(Long id) { + HazardHiddenDangerVo dangerVo = hazardHiddenDangerService.queryById(id); + if (dangerVo == null) { + throw new ServiceException("未找到该数据"); + } + List dangerRectifyVos = baseMapper.selectVoList(new LambdaQueryWrapper<>(HazardHiddenDangerRectify.class) + .eq(HazardHiddenDangerRectify::getHiddenDangerId, id) + .orderByAsc(HazardHiddenDangerRectify::getRectifyCount)); + dangerVo.setRectifyList(dangerRectifyVos); + return dangerVo; + } + + /** + * 分页查询隐患整改情况列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 隐患整改情况分页列表 + */ + @Override + public TableDataInfo queryPageList(HazardHiddenDangerBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = hazardHiddenDangerService.buildQueryWrapper(bo); + lqw.ne(HazardHiddenDanger::getStatus, HazardHiddenDanger.EVALUATE); + TableDataInfo result = hazardHiddenDangerService.queryPageList(lqw, pageQuery); + List rows = result.getRows(); + if (CollUtil.isNotEmpty(rows)) { + List ids = rows.stream().map(HazardHiddenDangerVo::getId).toList(); + List rectifyTimes = baseMapper.getLatestRectifyTimes(ids); + rows.forEach(row -> rectifyTimes.stream() + .filter(rectifyTimesVo -> rectifyTimesVo.getHiddenDangerId().equals(row.getId())) + .findFirst() + .ifPresent(rectifyTime -> row.setLatestRectifyTimes(rectifyTime.getLatestRectifyTimes()))); + } + return TableDataInfo.build(rows); + } + + /** + * 查询符合条件的隐患整改情况列表 + * + * @param bo 查询条件 + * @return 隐患整改情况列表 + */ + @Override + public List queryList(HazardHiddenDangerRectifyBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(HazardHiddenDangerRectifyBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(HazardHiddenDangerRectify::getId); + lqw.eq(bo.getHiddenDangerId() != null, HazardHiddenDangerRectify::getHiddenDangerId, bo.getHiddenDangerId()); + lqw.eq(bo.getRectifyCount() != null, HazardHiddenDangerRectify::getRectifyCount, bo.getRectifyCount()); + lqw.eq(bo.getRectifyUserId() != null, HazardHiddenDangerRectify::getRectifyUserId, bo.getRectifyUserId()); + lqw.eq(StringUtils.isNotBlank(bo.getRectifyDesc()), HazardHiddenDangerRectify::getRectifyDesc, bo.getRectifyDesc()); + lqw.eq(StringUtils.isNotBlank(bo.getRectifyFiles()), HazardHiddenDangerRectify::getRectifyFiles, bo.getRectifyFiles()); + lqw.eq(bo.getRectifyTime() != null, HazardHiddenDangerRectify::getRectifyTime, bo.getRectifyTime()); + lqw.eq(bo.getReviewUserId() != null, HazardHiddenDangerRectify::getReviewUserId, bo.getReviewUserId()); + lqw.eq(StringUtils.isNotBlank(bo.getReviewDesc()), HazardHiddenDangerRectify::getReviewDesc, bo.getReviewDesc()); + lqw.eq(StringUtils.isNotBlank(bo.getReviewFiles()), HazardHiddenDangerRectify::getReviewFiles, bo.getReviewFiles()); + lqw.eq(bo.getReviewTime() != null, HazardHiddenDangerRectify::getReviewTime, bo.getReviewTime()); + lqw.eq(StringUtils.isNotBlank(bo.getReviewStatus()), HazardHiddenDangerRectify::getReviewStatus, bo.getReviewStatus()); + return lqw; + } + + /** + * 新增隐患整改情况 + * + * @param bo 隐患整改情况 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(HazardHiddenDangerRectifyBo bo) { + HazardHiddenDangerRectify add = MapstructUtils.convert(bo, HazardHiddenDangerRectify.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改隐患整改情况 + * + * @param bo 隐患整改情况 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(HazardHiddenDangerRectifyBo bo) { + HazardHiddenDangerRectify update = MapstructUtils.convert(bo, HazardHiddenDangerRectify.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 隐患整改 + * + * @param req 隐患整改参数 + * @return 是否整改成功 + */ + @Override + public Boolean rectification(HazardHiddenDangerRectifyRectificationReq req) { + return null; + } + + /** + * 隐患复查 + * + * @param req 隐患复查参数 + * @return 是否审核成功 + */ + @Override + public Boolean review(HazardHiddenDangerRectifyReviewReq req) { + return null; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(HazardHiddenDangerRectify entity) { + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除隐患整改情况信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if (isValid) { + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HazardHiddenDangerServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HazardHiddenDangerServiceImpl.java index 00bfe7ec..309f70f6 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HazardHiddenDangerServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HazardHiddenDangerServiceImpl.java @@ -3,30 +3,30 @@ package org.dromara.safety.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.lang.Snowflake; import cn.hutool.core.util.IdUtil; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.dromara.common.core.utils.MapstructUtils; -import org.dromara.common.core.utils.StringUtils; -import org.dromara.common.mybatis.core.page.TableDataInfo; -import org.dromara.common.mybatis.core.page.PageQuery; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import lombok.RequiredArgsConstructor; -import org.dromara.safety.domain.HazardRule; -import org.dromara.safety.domain.dto.EvaluateDto; -import org.dromara.safety.domain.vo.HiddenDangerCountVo; -import org.dromara.safety.service.IHazardRuleService; -import org.springframework.stereotype.Service; -import org.dromara.safety.domain.bo.HazardHiddenDangerBo; -import org.dromara.safety.domain.vo.HazardHiddenDangerVo; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.safety.domain.HazardHiddenDanger; +import org.dromara.safety.domain.HazardRule; +import org.dromara.safety.domain.bo.HazardHiddenDangerBo; +import org.dromara.safety.domain.dto.EvaluateDto; +import org.dromara.safety.domain.vo.HazardHiddenDangerVo; +import org.dromara.safety.domain.vo.HiddenDangerCountVo; import org.dromara.safety.mapper.HazardHiddenDangerMapper; import org.dromara.safety.service.IHazardHiddenDangerService; +import org.dromara.safety.service.IHazardRuleService; +import org.springframework.stereotype.Service; import java.time.LocalDateTime; +import java.util.Collection; import java.util.List; import java.util.Map; -import java.util.Collection; /** * 隐患信息Service业务层处理 @@ -50,7 +50,7 @@ public class HazardHiddenDangerServiceImpl extends ServiceImpl queryPageList(LambdaQueryWrapper lqw, PageQuery pageQuery) { + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + /** * 查询符合条件的隐患信息列表 * @@ -80,11 +93,18 @@ public class HazardHiddenDangerServiceImpl extends ServiceImpl buildQueryWrapper(HazardHiddenDangerBo bo) { + /** + * 构建查询条件 + * + * @param bo 查询条件 + * @return 查询条件 + */ + @Override + public LambdaQueryWrapper buildQueryWrapper(HazardHiddenDangerBo bo) { Map params = bo.getParams(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); lqw.orderByDesc(HazardHiddenDanger::getId); - lqw.eq(bo.getProjectId()!=null, HazardHiddenDanger::getProjectId, bo.getProjectId()); + lqw.eq(bo.getProjectId() != null, HazardHiddenDanger::getProjectId, bo.getProjectId()); lqw.eq(StringUtils.isNotBlank(bo.getDangerType()), HazardHiddenDanger::getDangerType, bo.getDangerType()); lqw.eq(StringUtils.isNotBlank(bo.getDangerCode()), HazardHiddenDanger::getDangerCode, bo.getDangerCode()); lqw.like(StringUtils.isNotBlank(bo.getDangerName()), HazardHiddenDanger::getDangerName, bo.getDangerName()); @@ -117,7 +137,7 @@ public class HazardHiddenDangerServiceImpl extends ServiceImpl 0; if (flag) { bo.setId(add.getId()); @@ -141,7 +161,7 @@ public class HazardHiddenDangerServiceImpl extends ServiceImpl ids, Boolean isValid) { - if(isValid){ + if (isValid) { //TODO 做一些业务上的校验,判断是否需要校验 } return baseMapper.deleteByIds(ids) > 0; @@ -169,15 +189,15 @@ public class HazardHiddenDangerServiceImpl extends ServiceImpl item.getStatus().equals(HazardHiddenDanger.RECTIFY)).count()); count.setWaitReview(list.stream().filter(item -> item.getStatus().equals(HazardHiddenDanger.REVIEW)).count()); count.setClosed(list.stream().filter(item -> item.getStatus().equals(HazardHiddenDanger.CLOSED)).count()); - count.setOverdue(list.stream().filter(item ->item.getRectifyTime()!=null && item.getRectifyTime().isBefore(LocalDateTime.now()) - && item.getStatus().equals(HazardHiddenDanger.RECTIFY)).count()); + count.setOverdue(list.stream().filter(item -> item.getRectifyTime() != null && item.getRectifyTime().isBefore(LocalDateTime.now()) + && item.getStatus().equals(HazardHiddenDanger.RECTIFY)).count()); return count; } @Override public Boolean evaluate(EvaluateDto dto) { HazardHiddenDanger hazardHiddenDanger = baseMapper.selectById(dto.getId()); - BeanUtil.copyProperties(dto,hazardHiddenDanger); + BeanUtil.copyProperties(dto, hazardHiddenDanger); HazardRule byId = hazardRuleService.getById(hazardHiddenDanger.getDangerLevelId()); String responseUnit = byId.getResponseUnit(); hazardHiddenDanger.setStatus(HazardHiddenDanger.RECTIFY); diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HazardRuleNotifyObjectServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HazardRuleNotifyObjectServiceImpl.java index a5c0c869..a4a7f803 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HazardRuleNotifyObjectServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HazardRuleNotifyObjectServiceImpl.java @@ -8,7 +8,13 @@ import org.dromara.safety.domain.vo.HazardRuleNotifyObjectVo; import org.dromara.safety.domain.vo.HazardRuleVo; import org.dromara.safety.mapper.HazardRuleNotifyObjectMapper; import org.dromara.safety.service.IHazardRuleNotifyObjectService; +import org.dromara.system.domain.vo.SysDeptVo; +import org.dromara.system.domain.vo.SysPostVo; +import org.dromara.system.domain.vo.SysRoleVo; import org.dromara.system.domain.vo.SysUserVo; +import org.dromara.system.service.ISysDeptService; +import org.dromara.system.service.ISysPostService; +import org.dromara.system.service.ISysRoleService; import org.dromara.system.service.ISysUserService; import org.springframework.stereotype.Service; @@ -30,6 +36,12 @@ public class HazardRuleNotifyObjectServiceImpl extends ServiceImpl roleIds = value.stream() + .map(HazardRuleNotifyObject::getNotifyId) + .toList(); + List roleVos = roleService.selectRoleByIds(roleIds); + Map roleNameMap = roleVos.stream() + .collect(Collectors.toMap(SysRoleVo::getRoleId, SysRoleVo::getRoleName, (k, v) -> k)); + List vos = value.stream().map(v -> { + HazardRuleNotifyObjectVo vo = new HazardRuleNotifyObjectVo(); + vo.setRuleId(v.getRuleId()); + vo.setNotifyId(v.getNotifyId()); + vo.setNotifyName(roleNameMap.getOrDefault(v.getNotifyId(), "")); + vo.setNotifyType(key); + return vo; + }).toList(); + voList.addAll(vos); + } + case "3": { + List deptIds = value.stream() + .map(HazardRuleNotifyObject::getNotifyId) + .toList(); + List deptVos = deptService.selectDeptByIds(deptIds); + Map deptNameMap = deptVos.stream() + .collect(Collectors.toMap(SysDeptVo::getDeptId, SysDeptVo::getDeptName, (k, v) -> k)); + List vos = value.stream().map(v -> { + HazardRuleNotifyObjectVo vo = new HazardRuleNotifyObjectVo(); + vo.setRuleId(v.getRuleId()); + vo.setNotifyId(v.getNotifyId()); + vo.setNotifyName(deptNameMap.getOrDefault(v.getNotifyId(), "")); + vo.setNotifyType(key); + return vo; + }).toList(); + voList.addAll(vos); + } + case "4": { + List postIds = value.stream() + .map(HazardRuleNotifyObject::getNotifyId) + .toList(); + List postVos = postService.selectPostByIds(postIds); + Map postNameMap = postVos.stream() + .collect(Collectors.toMap(SysPostVo::getPostId, SysPostVo::getPostName, (k, v) -> k)); + List vos = value.stream().map(v -> { + HazardRuleNotifyObjectVo vo = new HazardRuleNotifyObjectVo(); + vo.setRuleId(v.getRuleId()); + vo.setNotifyId(v.getNotifyId()); + vo.setNotifyName(postNameMap.getOrDefault(v.getNotifyId(), "")); + vo.setNotifyType(key); + return vo; + }).toList(); + voList.addAll(vos); + } case null, default: break; } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/safety/HazardHiddenDangerRectifyMapper.xml b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/safety/HazardHiddenDangerRectifyMapper.xml new file mode 100644 index 00000000..948a34e8 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/safety/HazardHiddenDangerRectifyMapper.xml @@ -0,0 +1,18 @@ + + + + + + diff --git a/xinnengyuan/script/sql/xinnengyuan.sql b/xinnengyuan/script/sql/xinnengyuan.sql index 55ae5e37..bd700940 100644 --- a/xinnengyuan/script/sql/xinnengyuan.sql +++ b/xinnengyuan/script/sql/xinnengyuan.sql @@ -2039,34 +2039,70 @@ values (1996139632219136006, '隐患分级通知规则导出', 19961396322191360 -- 隐患整改情况表 +DROP TABLE IF EXISTS hazard_hidden_danger_rectify; create table hazard_hidden_danger_rectify ( - `id` bigint not null auto_increment comment '主键', - hidden_danger_id bigint not null comment '关联隐患ID', - rectify_times int not null comment '整改次数', + id bigint not null auto_increment comment '主键', + hidden_danger_id bigint not null comment '关联隐患ID', + rectify_count int not null comment '整改次数', - rectify_desc text null comment '整改说明', - rectify_files varchar(1000) null comment '整改凭证附件', - rectify_finish_time datetime null comment '完成整改时间', + rectify_deadline datetime not null comment '整改期限', + rectify_user_id bigint not null comment '整改人ID', + rectify_desc text null comment '整改说明', + rectify_files varchar(1024) null comment '整改附件', + rectify_time datetime null comment '完成整改时间', - review_user_id bigint null comment '复查人ID', - review_opinion text null comment '复查意见', - review_files varchar(1000) null comment '复查凭证附件', - review_time datetime null comment '复查时间', + review_user_id bigint null comment '复查人ID', + review_desc text null comment '复查说明', + review_files varchar(1024) null comment '复查附件', + review_time datetime null comment '复查时间', - review_status char not null default '0' comment '复查状态 0-待复查 1-复查通过 2-复查不通过', - `remark` varchar(512) null comment '备注', - `create_by` bigint null comment '创建者', - `update_by` bigint null comment '更新者', - `create_dept` bigint null comment '创建部门', - `create_time` datetime default CURRENT_TIMESTAMP null comment '创建时间', - `update_time` datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间', + review_status char default '0' not null comment '复查状态(1待复查 2复查通过 3复查不通过)', + `remark` varchar(512) null comment '备注', + `create_by` bigint null comment '创建者', + `update_by` bigint null comment '更新者', + `create_dept` bigint null comment '创建部门', + `create_time` datetime default CURRENT_TIMESTAMP null comment '创建时间', + `update_time` datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间', PRIMARY KEY (`id`) USING BTREE, - index `idx_hidden_danger_id` (`hidden_danger_id` asc) using btree comment '关联隐患ID', -) - comment '隐患整改情况表' row_format = DYNAMIC; + index `idx_hidden_danger_id` (`hidden_danger_id` asc) using btree comment '关联隐患ID' +) comment '隐患整改情况'; -- 索引 create index idx_rectify_times - on hazard_hidden_danger_rectify (hidden_danger_id, rectify_times); + on hazard_hidden_danger_rectify (hidden_danger_id, rectify_count); + + +-- 菜单 SQL +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, + status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values (1996413868087308290, '隐患整改情况', '1996118434672001025', '1', 'hiddenDangerRectify', + 'safety/hiddenDangerRectify/index', 1, 0, 'C', '0', '0', 'safety:hiddenDangerRectify:list', '#', 103, 1, + sysdate(), null, null, '隐患整改情况菜单'); + +-- 按钮 SQL +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, + status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values (1996413868087308291, '隐患整改情况查询', 1996413868087308290, '1', '#', '', 1, 0, 'F', '0', '0', + 'safety:hiddenDangerRectify:query', '#', 103, 1, sysdate(), null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, + status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values (1996413868087308292, '隐患整改情况新增', 1996413868087308290, '2', '#', '', 1, 0, 'F', '0', '0', + 'safety:hiddenDangerRectify:add', '#', 103, 1, sysdate(), null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, + status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values (1996413868087308293, '隐患整改情况修改', 1996413868087308290, '3', '#', '', 1, 0, 'F', '0', '0', + 'safety:hiddenDangerRectify:edit', '#', 103, 1, sysdate(), null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, + status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values (1996413868087308294, '隐患整改情况删除', 1996413868087308290, '4', '#', '', 1, 0, 'F', '0', '0', + 'safety:hiddenDangerRectify:remove', '#', 103, 1, sysdate(), null, null, ''); + +insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, + status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) +values (1996413868087308295, '隐患整改情况导出', 1996413868087308290, '5', '#', '', 1, 0, 'F', '0', '0', + 'safety:hiddenDangerRectify:export', '#', 103, 1, sysdate(), null, null, '');