From ecc0595ec32ecdce229dd58f94b8b34152f2a78f Mon Sep 17 00:00:00 2001 From: lcj <2331845269@qq.com> Date: Fri, 5 Dec 2025 08:58:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=BD=E5=B7=A5=E4=BA=A7=E5=80=BC=EF=BC=8C?= =?UTF-8?q?=E9=9A=90=E6=82=A3=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SubConstructionUserFileServiceImpl.java | 4 +- .../impl/SubConstructionUserServiceImpl.java | 4 +- .../OutConstructionValueMatrixVo.java | 2 + .../OutConstructionValueProjectVo.java | 2 + .../OutConstructionValueSubProjectVo.java | 2 + .../OutConstructionValueRangeMatrixVo.java | 2 + .../OutConstructionValueRangeProjectVo.java | 2 + ...OutConstructionValueRangeSubProjectVo.java | 2 + .../impl/OutConstructionValueServiceImpl.java | 14 +-- .../HazardHiddenDangerRectifyController.java | 22 +++- .../domain/HazardHiddenDangerRectify.java | 4 +- .../bo/HazardHiddenDangerRectifyBo.java | 8 +- .../HazardHiddenDangerRectifyReviewReq.java | 8 +- .../vo/HazardHiddenDangerRectifyVo.java | 6 +- .../HazardHiddenDangerRectifyServiceImpl.java | 117 +++++++++++++++++- .../HazardRuleNotifyObjectServiceImpl.java | 33 ++--- .../service/impl/HazardRuleServiceImpl.java | 20 +++ 17 files changed, 196 insertions(+), 56 deletions(-) diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/service/impl/SubConstructionUserFileServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/service/impl/SubConstructionUserFileServiceImpl.java index 7c28b00c..70c09e5d 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/service/impl/SubConstructionUserFileServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/service/impl/SubConstructionUserFileServiceImpl.java @@ -231,7 +231,7 @@ public class SubConstructionUserFileServiceImpl extends ServiceImpl userIdList = constructionUserFileList.stream().map(SubConstructionUserFile::getUserId).toList(); diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/service/impl/SubConstructionUserServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/service/impl/SubConstructionUserServiceImpl.java index 3cbcf475..19d25689 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/service/impl/SubConstructionUserServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/contractor/service/impl/SubConstructionUserServiceImpl.java @@ -230,7 +230,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl categoryLqw = new LambdaQueryWrapper<>(); categoryLqw.select(PgsProgressCategory::getId); - categoryLqw.eq(PgsProgressCategory::getUnitType, bo.getUnitType()); + categoryLqw.eq(StringUtils.isNotBlank(bo.getUnitType()), PgsProgressCategory::getUnitType, bo.getUnitType()); categoryLqw.eq(bo.getMatrixId() != null, PgsProgressCategory::getMatrixId, bo.getMatrixId()); categoryLqw.in(CollUtil.isNotEmpty(ids), PgsProgressCategory::getProjectId, ids); if (StringUtils.isNotBlank(bo.getProjectType())) { - if (bo.getProjectType().equals("1")) { - categoryLqw.in(PgsProgressCategory::getRelevancyStructure, - PgsRelevancyStructureEnum.SUB_PROJECT.getValue(), PgsRelevancyStructureEnum.MATRIX.getValue()); - } else if (bo.getProjectType().equals("2")) { - categoryLqw.eq(PgsProgressCategory::getRelevancyStructure, PgsRelevancyStructureEnum.MATRIX.getValue()); - } + categoryLqw.in(bo.getProjectType().equals("1"), PgsProgressCategory::getRelevancyStructure, + PgsRelevancyStructureEnum.SUB_PROJECT.getValue(), PgsRelevancyStructureEnum.MATRIX.getValue()); + categoryLqw.eq(bo.getProjectType().equals("2"), PgsProgressCategory::getRelevancyStructure, PgsRelevancyStructureEnum.MATRIX.getValue()); } - categoryLqw.eq(StringUtils.isNotBlank(bo.getProjectType()), PgsProgressCategory::getRelevancyStructure, bo.getProjectType()); List progressCategories = pgsProgressCategoryService.list(categoryLqw); if (CollUtil.isNotEmpty(progressCategories)) { List categoryIds = progressCategories.stream().map(PgsProgressCategory::getId).toList(); 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 index 3f83e2c6..0ffad25e 100644 --- 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 @@ -7,7 +7,6 @@ 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; @@ -17,6 +16,8 @@ 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.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.service.IHazardHiddenDangerRectifyService; @@ -83,14 +84,25 @@ public class HazardHiddenDangerRectifyController extends BaseController { } /** - * 修改隐患整改情况 + * 隐患整改 */ @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)); + @PutMapping("/rectification") + public R rectification(@Validated @RequestBody HazardHiddenDangerRectifyRectificationReq req) { + return toAjax(hazardHiddenDangerRectifyService.rectification(req)); + } + + /** + * 隐患复查 + */ + @SaCheckPermission("safety:hiddenDangerRectify:edit") + @Log(title = "隐患整改情况", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping("/review") + public R review(@Validated @RequestBody HazardHiddenDangerRectifyReviewReq req) { + return toAjax(hazardHiddenDangerRectifyService.review(req)); } /** 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 index 3ca995de..84dfd714 100644 --- 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 @@ -37,7 +37,7 @@ public class HazardHiddenDangerRectify extends BaseEntity { /** * 整改次数 */ - private Long rectifyCount; + private Integer rectifyCount; /** * 整改人ID @@ -80,7 +80,7 @@ public class HazardHiddenDangerRectify extends BaseEntity { private LocalDateTime reviewTime; /** - * 复查状态(1待复查 2复查通过 3复查不通过) + * 复查状态(0待复查 1复查通过 2复查不通过) */ private String reviewStatus; 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 index ff0cc5dc..e4375f58 100644 --- 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 @@ -38,12 +38,6 @@ public class HazardHiddenDangerRectifyBo extends BaseEntity { @NotNull(message = "关联隐患ID不能为空", groups = {AddGroup.class, EditGroup.class}) private Long hiddenDangerId; - /** - * 整改次数 - */ - @NotNull(message = "整改次数不能为空", groups = {AddGroup.class, EditGroup.class}) - private Long rectifyCount; - /** * 整改人ID */ @@ -86,7 +80,7 @@ public class HazardHiddenDangerRectifyBo extends BaseEntity { private LocalDateTime reviewTime; /** - * 复查状态(1待复查 2复查通过 3复查不通过) + * 复查状态(0待复查 1复查通过 2复查不通过) */ private String reviewStatus; 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 index 1d0bfd0c..ae7d8842 100644 --- 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 @@ -6,6 +6,7 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; +import java.time.LocalDateTime; /** * @author lilemy @@ -40,8 +41,13 @@ public class HazardHiddenDangerRectifyReviewReq implements Serializable { private String reviewFiles; /** - * 复查状态(1待复查 2复查通过 3复查不通过) + * 复查状态(0待复查 1复查通过 2复查不通过) */ @NotBlank(message = "请选择复查状态") private String reviewStatus; + + /** + * 整改期限 + */ + private LocalDateTime rectificationDeadline; } 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 index 21d3fa8d..29982281 100644 --- 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 @@ -45,7 +45,7 @@ public class HazardHiddenDangerRectifyVo implements Serializable { * 整改次数 */ @ExcelProperty(value = "整改次数") - private Long rectifyCount; + private Integer rectifyCount; /** * 整改人ID @@ -113,9 +113,9 @@ public class HazardHiddenDangerRectifyVo implements Serializable { private LocalDateTime reviewTime; /** - * 复查状态(1待复查 2复查通过 3复查不通过) + * 复查状态(0待复查 1复查通过 2复查不通过) */ - @ExcelProperty(value = "复查状态(1待复查 2复查通过 3复查不通过)", converter = ExcelDictConvert.class) + @ExcelProperty(value = "复查状态(0待复查 1复查通过 2复查不通过)", converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "hazard_review_status") private String reviewStatus; 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 index fa1ef646..2bdb9d85 100644 --- 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 @@ -10,23 +10,29 @@ 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.common.satoken.utils.LoginHelper; 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.enums.HseSafetyInspectionReviewTypeEnum; 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.beans.BeanUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import java.time.LocalDateTime; import java.util.Collection; import java.util.List; import java.util.Map; +import java.util.Objects; /** * 隐患整改情况Service业务层处理 @@ -101,7 +107,6 @@ public class HazardHiddenDangerRectifyServiceImpl extends ServiceImpl 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()); @@ -151,13 +156,50 @@ public class HazardHiddenDangerRectifyServiceImpl extends ServiceImpl> entry : map.entrySet()) { String key = entry.getKey(); List value = entry.getValue(); + List ids = value.stream() + .map(HazardRuleNotifyObject::getNotifyId) + .toList(); switch (key) { - case "1": { - List userIds = value.stream() - .map(HazardRuleNotifyObject::getNotifyId) - .toList(); - List userVos = userService.selectUserByIds(userIds, null); + case "1" -> { + List userVos = userService.selectUserByIds(ids, null); Map userNameMap = userVos.stream() .collect(Collectors.toMap(SysUserVo::getUserId, SysUserVo::getNickName, (k, v) -> k)); List vos = value.stream().map(v -> { @@ -88,11 +88,8 @@ public class HazardRuleNotifyObjectServiceImpl extends ServiceImpl roleIds = value.stream() - .map(HazardRuleNotifyObject::getNotifyId) - .toList(); - List roleVos = roleService.selectRoleByIds(roleIds); + case "2" -> { + List roleVos = roleService.selectRoleByIds(ids); Map roleNameMap = roleVos.stream() .collect(Collectors.toMap(SysRoleVo::getRoleId, SysRoleVo::getRoleName, (k, v) -> k)); List vos = value.stream().map(v -> { @@ -105,11 +102,8 @@ public class HazardRuleNotifyObjectServiceImpl extends ServiceImpl deptIds = value.stream() - .map(HazardRuleNotifyObject::getNotifyId) - .toList(); - List deptVos = deptService.selectDeptByIds(deptIds); + case "3" -> { + List deptVos = deptService.selectDeptByIds(ids); Map deptNameMap = deptVos.stream() .collect(Collectors.toMap(SysDeptVo::getDeptId, SysDeptVo::getDeptName, (k, v) -> k)); List vos = value.stream().map(v -> { @@ -122,11 +116,8 @@ public class HazardRuleNotifyObjectServiceImpl extends ServiceImpl postIds = value.stream() - .map(HazardRuleNotifyObject::getNotifyId) - .toList(); - List postVos = postService.selectPostByIds(postIds); + case "4" -> { + List postVos = postService.selectPostByIds(ids); Map postNameMap = postVos.stream() .collect(Collectors.toMap(SysPostVo::getPostId, SysPostVo::getPostName, (k, v) -> k)); List vos = value.stream().map(v -> { @@ -139,8 +130,6 @@ public class HazardRuleNotifyObjectServiceImpl extends ServiceImpl 0) { + throw new ServiceException("权重已存在", HttpStatus.ERROR); + } + Long count1 = this.lambdaQuery() + .ne(id != null, HazardRule::getId, id) + .eq(HazardRule::getHazardLevel, hazardLevel) + .eq(HazardRule::getProjectId, projectId) + .count(); + if (count1 > 0) { + throw new ServiceException("等级已存在", HttpStatus.ERROR); + } } /**