diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/drone/service/impl/DroProjectDroneServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/drone/service/impl/DroProjectDroneServiceImpl.java index 92048eb4..0c1bf8d5 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/drone/service/impl/DroProjectDroneServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/drone/service/impl/DroProjectDroneServiceImpl.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import jakarta.annotation.Resource; 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; @@ -114,7 +115,15 @@ public class DroProjectDroneServiceImpl extends ServiceImpl 0) { + throw new ServiceException("无人机已存在于其他项目"); + } } /** diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/controller/OutConstructionValueController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/controller/OutConstructionValueController.java index 6765ab8e..e54ea5e7 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/controller/OutConstructionValueController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/controller/OutConstructionValueController.java @@ -16,6 +16,7 @@ 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.out.domain.bo.OutConstructionValueBo; +import org.dromara.out.domain.bo.OutConstructionValueFacilityReq; import org.dromara.out.domain.vo.OutConstructionAllValueVo; import org.dromara.out.domain.vo.OutConstructionValueVo; import org.dromara.out.service.IOutConstructionValueService; @@ -113,4 +114,24 @@ public class OutConstructionValueController extends BaseController { @PathVariable Long[] ids) { return toAjax(outConstructionValueService.deleteWithValidByIds(List.of(ids), true)); } + + /** + * 新增进度计划详情 + */ + @SaCheckPermission("out:constructionValue:edit") + @RepeatSubmit() + @PostMapping("/insert/facility") + public R insertFinishedDetail(@Validated @RequestBody OutConstructionValueFacilityReq req) { + return toAjax(outConstructionValueService.insertFacilityDetail(req)); + } + + /** + * 删除进度计划详情 + */ + @SaCheckPermission("out:constructionValue:edit") + @RepeatSubmit() + @DeleteMapping("/remove/facility") + public R removeDetail(@Validated OutConstructionValueFacilityReq req) { + return toAjax(outConstructionValueService.removeFacilityDetail(req)); + } } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/bo/OutConstructionValueFacilityReq.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/bo/OutConstructionValueFacilityReq.java new file mode 100644 index 00000000..38ab9a12 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/bo/OutConstructionValueFacilityReq.java @@ -0,0 +1,42 @@ +package org.dromara.out.domain.bo; + +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDate; +import java.util.List; + +/** + * @author lilemy + * @date 2025-10-12 17:51 + */ +@Data +public class OutConstructionValueFacilityReq implements Serializable { + + @Serial + private static final long serialVersionUID = -5491058421687762904L; + + /** + * 主键ID + */ + @NotNull(message = "主键ID不能为空") + private Long id; + + /** + * 上报日期 + */ + private LocalDate reportDate; + + /** + * 详情主键id + */ + @NotNull(message = "详情主键id不能为空") + private Long detailId; + + /** + * 详情id列表 + */ + private List detailIdList; +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/vo/OutConstructionValueVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/vo/OutConstructionValueVo.java index a500d817..2116e848 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/vo/OutConstructionValueVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/domain/vo/OutConstructionValueVo.java @@ -166,4 +166,9 @@ public class OutConstructionValueVo implements Serializable { * 对甲产值 */ private BigDecimal ownerValue; + + /** + * 工作类型 + */ + private String workType; } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/service/IOutConstructionValueService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/service/IOutConstructionValueService.java index 35940fe4..dbe452fe 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/service/IOutConstructionValueService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/out/service/IOutConstructionValueService.java @@ -5,6 +5,7 @@ import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.out.domain.OutConstructionValue; import org.dromara.out.domain.bo.OutConstructionValueBo; +import org.dromara.out.domain.bo.OutConstructionValueFacilityReq; import org.dromara.out.domain.vo.OutConstructionAllValueVo; import org.dromara.out.domain.vo.OutConstructionValueVo; @@ -86,4 +87,20 @@ public interface IOutConstructionValueService extends IService> listGantt(@NotNull(message = "主键不能为空") + @PathVariable Long projectId) { + return R.ok(pgsProgressCategoryService.listGanttByProject(projectId)); + } + /** * 新增分项工程单价 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/controller/PgsProgressPlanDetailController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/controller/PgsProgressPlanDetailController.java index 74fc8b0b..229ccb0a 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/controller/PgsProgressPlanDetailController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/controller/PgsProgressPlanDetailController.java @@ -46,7 +46,7 @@ public class PgsProgressPlanDetailController extends BaseController { @RepeatSubmit() @PostMapping("/insert/detail") public R insertFinishedDetail(@Validated @RequestBody PgsProgressPlanDetailFinishedCreateReq req) { - return toAjax(pgsProgressPlanDetailService.insertFinishedDetail(req)); + return toAjax(pgsProgressPlanDetailService.insertFinishedDetail(req, true)); } /** @@ -100,7 +100,7 @@ public class PgsProgressPlanDetailController extends BaseController { @RepeatSubmit() @DeleteMapping("/remove/detail") public R removeDetail(@Validated PgsProgressPlanDetailRemoveReq req) { - return toAjax(pgsProgressPlanDetailService.removeDetail(req)); + return toAjax(pgsProgressPlanDetailService.removeDetail(req, true)); } } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/controller/app/PgsProgressPlanDetailAppController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/controller/app/PgsProgressPlanDetailAppController.java index d4c193f2..c79932d5 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/controller/app/PgsProgressPlanDetailAppController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/controller/app/PgsProgressPlanDetailAppController.java @@ -48,7 +48,7 @@ public class PgsProgressPlanDetailAppController extends BaseController { @RepeatSubmit() @PostMapping("/insert/detail") public R insertFinishedDetail(@Validated @RequestBody PgsProgressPlanDetailFinishedCreateReq req) { - return toAjax(progressPlanDetailService.insertFinishedDetail(req)); + return toAjax(progressPlanDetailService.insertFinishedDetail(req, true)); } /** @@ -90,7 +90,7 @@ public class PgsProgressPlanDetailAppController extends BaseController { @RepeatSubmit() @DeleteMapping("/remove/detail") public R removeDetail(@Validated PgsProgressPlanDetailRemoveReq req) { - return toAjax(progressPlanDetailService.removeDetail(req)); + return toAjax(progressPlanDetailService.removeDetail(req, true)); } } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/domain/vo/progresscategory/PgsProgressCategoryGanttVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/domain/vo/progresscategory/PgsProgressCategoryGanttVo.java new file mode 100644 index 00000000..c4a0d7b1 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/domain/vo/progresscategory/PgsProgressCategoryGanttVo.java @@ -0,0 +1,49 @@ +package org.dromara.progress.domain.vo.progresscategory; + +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDate; + +/** + * @author lilemy + * @date 2025-10-12 15:15 + */ +@Data +public class PgsProgressCategoryGanttVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1759675635511567284L; + + /** + * id + */ + private Long id; + + /** + * 父级id + */ + private Long parentId; + + /** + * 名称 + */ + private String text; + + /** + * 开始时间 + */ + private LocalDate startDate; + + /** + * 结束时间 + */ + private LocalDate endDate; + + /** + * 进度 + */ + private BigDecimal progress; +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/IPgsProgressCategoryService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/IPgsProgressCategoryService.java index 583396e3..0ca22b2a 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/IPgsProgressCategoryService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/IPgsProgressCategoryService.java @@ -165,6 +165,15 @@ public interface IPgsProgressCategoryService extends IService getLeafNodesByTopId(Long topId); + /** + * 获取最底层的叶子节点 + * + * @param topId 顶级节点id + * @param allCategory 所有节点 + * @return 最底层的叶子节点 + */ + List getLeafNodesByTopId(Long topId, List allCategory); + /** * 获取最底层的叶子节点(支持多个顶级id) * @@ -212,4 +221,12 @@ public interface IPgsProgressCategoryService extends IService listGanttByProject(Long projectId); } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/IPgsProgressPlanDetailService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/IPgsProgressPlanDetailService.java index 7b7a593c..b2de11d3 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/IPgsProgressPlanDetailService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/IPgsProgressPlanDetailService.java @@ -38,7 +38,7 @@ public interface IPgsProgressPlanDetailService extends IService getLeafNodesByTopId(Long topId, List allCategory) { + if (allCategory == null || allCategory.isEmpty()) { + return Collections.emptyList(); + } + + // 1. 找出所有属于该顶级节点的子孙节点(Ancestors 字段包含 ,topId,) + List allChildren = allCategory.stream() + .filter(item -> { + String ancestors = item.getAncestors(); + return ancestors != null && ancestors.contains("," + topId + ","); + }) + .toList(); + + if (allChildren.isEmpty()) { + return Collections.emptyList(); + } + + // 2. 找出所有的 parentId(即有孩子的节点) + Set parentIds = allChildren.stream() + .map(PgsProgressCategory::getParentId) + .filter(Objects::nonNull) + .collect(Collectors.toSet()); + + // 3. 过滤出没有作为别人 parentId 出现的节点 → 叶子节点 + return allChildren.stream() + .filter(item -> !parentIds.contains(item.getId())) + .toList(); + } + /** * 获取最底层的叶子节点(支持多个顶级id) * @@ -1823,4 +1860,69 @@ public class PgsProgressCategoryServiceImpl extends ServiceImpl listGanttByProject(Long projectId) { + List ganttList = new ArrayList<>(); + // 获取项目 + BusProject project = projectService.getById(projectId); + if (project == null) { + throw new ServiceException("项目不存在", HttpStatus.NOT_FOUND); + } + // 获取当前项目的所有子项目 + List projectList = projectService.lambdaQuery() + .eq(BusProject::getPId, projectId) + .list(); + projectList.add(project); + if (CollUtil.isEmpty(projectList)) { + return ganttList; + } + List projectIds = projectList.stream().map(BusProject::getId).toList(); + // 获取当前项目所有进度类别 + List progressCategoryList = this.lambdaQuery() + .in(PgsProgressCategory::getProjectId, projectIds) + .eq(PgsProgressCategory::getMatrixId, 0) + .list(); + if (CollUtil.isEmpty(progressCategoryList)) { + return ganttList; + } + // 封装进度类别数据 + List list = progressCategoryList.stream().map(p -> { + // 获取所有子节点 + List children = this.getLeafNodesByTopId(p.getId(), progressCategoryList); + PgsProgressCategoryGanttVo vo = new PgsProgressCategoryGanttVo(); + vo.setId(p.getId()); + vo.setParentId(p.getParentId()); + vo.setText(p.getName()); + vo.setStartDate(null); + vo.setEndDate(null); + vo.setProgress(this.getCompletedPercentage(children) + .divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP)); + return vo; + }).toList(); + ganttList.addAll(list); + // 获取当前项目所有计划 + List planList = progressPlanService.lambdaQuery() + .eq(PgsProgressPlan::getProjectId, projectId) + .list(); + List list1 = planList.stream().map(p -> { + PgsProgressCategoryGanttVo vo = new PgsProgressCategoryGanttVo(); + vo.setId(p.getId()); + vo.setParentId(p.getProgressCategoryId()); + vo.setText(p.getProgressCategoryName() + "-" + "计划"); + vo.setStartDate(p.getStartDate()); + vo.setEndDate(p.getEndDate()); + vo.setProgress(BigDecimalUtil.toPercentage(p.getFinishedNumber(), p.getPlanNumber()) + .divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP)); + return vo; + }).toList(); + ganttList.addAll(list1); + return ganttList; + } + } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/impl/PgsProgressPlanDetailServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/impl/PgsProgressPlanDetailServiceImpl.java index bd091c4a..b51a55e5 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/impl/PgsProgressPlanDetailServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/progress/service/impl/PgsProgressPlanDetailServiceImpl.java @@ -156,7 +156,7 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl finishedDetailIdList = req.getFinishedDetailIdList(); if (CollUtil.isEmpty(finishedDetailIdList)) { return true; @@ -168,7 +168,7 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl detailIdList = req.getDetailIdList(); if (CollUtil.isEmpty(detailIdList)) { @@ -637,6 +637,10 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl finishedVoList = JSONUtil.toList(finishedDetail, PgsProgressPlanDetailFinishedVo.class); @@ -977,6 +981,7 @@ public class PgsProgressPlanDetailServiceImpl extends ServiceImpl "2".equals(q.getIsReply())) + .toList() + .size()); gisVo.setCorrectSituation(String.format("%.2f", passCount * 100.0 / qualityInspectionList.size())); return gisVo; } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyInspectionServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyInspectionServiceImpl.java index fc4470a9..49a563d6 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyInspectionServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/safety/service/impl/HseSafetyInspectionServiceImpl.java @@ -30,12 +30,10 @@ import org.dromara.project.domain.BusProjectTeam; import org.dromara.project.service.IBusProjectService; import org.dromara.project.service.IBusProjectTeamMemberService; import org.dromara.project.service.IBusProjectTeamService; -import org.dromara.quality.domain.enums.QltQualityInspectionStatusEnum; import org.dromara.safety.constant.HseSafetyConstant; import org.dromara.safety.domain.HseSafetyInspection; import org.dromara.safety.domain.HseTeamMeeting; import org.dromara.safety.domain.dto.safetyinspection.*; -import org.dromara.safety.domain.enums.HseSafetyInspectionReviewTypeEnum; import org.dromara.safety.domain.enums.HseSafetyInspectionStatusEnum; import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionListGisVo; import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionVo; @@ -225,18 +223,16 @@ public class HseSafetyInspectionServiceImpl extends ServiceImpl "2".equals(q.getIsReply())) + .toList().size()); gisVo.setCorrectSituationCount(passCount); gisVo.setCorrectSituation(String.format("%.2f", passCount * 100.0 / safetyInspectionList.size())); return gisVo;