diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/controller/BudConstructionPlanController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/controller/BudConstructionPlanController.java new file mode 100644 index 00000000..0b42cd8b --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/controller/BudConstructionPlanController.java @@ -0,0 +1,106 @@ +package org.dromara.build.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.build.domain.bo.BudConstructionPlanBo; +import org.dromara.build.domain.vo.BudConstructionPlanVo; +import org.dromara.build.service.IBudConstructionPlanService; +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.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 施工完成计划 + * + * @author lilemy + * @date 2025-12-23 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/build/constructionPlan") +public class BudConstructionPlanController extends BaseController { + + private final IBudConstructionPlanService budConstructionPlanService; + + /** + * 查询施工完成计划列表 + */ + @SaCheckPermission("build:constructionPlan:list") + @GetMapping("/list") + public TableDataInfo list(BudConstructionPlanBo bo, PageQuery pageQuery) { + return budConstructionPlanService.queryPageList(bo, pageQuery); + } + + /** + * 导出施工完成计划列表 + */ + @SaCheckPermission("build:constructionPlan:export") + @Log(title = "施工完成计划", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(BudConstructionPlanBo bo, HttpServletResponse response) { + List list = budConstructionPlanService.queryList(bo); + ExcelUtil.exportExcel(list, "施工完成计划", BudConstructionPlanVo.class, response); + } + + /** + * 获取施工完成计划详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("build:constructionPlan:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(budConstructionPlanService.queryById(id)); + } + + /** + * 新增施工完成计划 + */ + @SaCheckPermission("build:constructionPlan:add") + @Log(title = "施工完成计划", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody BudConstructionPlanBo bo) { + return toAjax(budConstructionPlanService.insertByBo(bo)); + } + + /** + * 修改施工完成计划 + */ + @SaCheckPermission("build:constructionPlan:edit") + @Log(title = "施工完成计划", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody BudConstructionPlanBo bo) { + return toAjax(budConstructionPlanService.updateByBo(bo)); + } + + /** + * 删除施工完成计划 + * + * @param ids 主键串 + */ + @SaCheckPermission("build:constructionPlan:remove") + @Log(title = "施工完成计划", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(budConstructionPlanService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/controller/BudConstructionTemplateGroupController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/controller/BudConstructionTemplateGroupController.java index 1c8e417d..9f5e5df4 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/controller/BudConstructionTemplateGroupController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/controller/BudConstructionTemplateGroupController.java @@ -1,26 +1,27 @@ package org.dromara.build.controller; -import java.util.List; - -import lombok.RequiredArgsConstructor; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.validation.constraints.*; import cn.dev33.satoken.annotation.SaCheckPermission; -import org.springframework.web.bind.annotation.*; -import org.springframework.validation.annotation.Validated; -import org.dromara.common.idempotent.annotation.RepeatSubmit; -import org.dromara.common.log.annotation.Log; -import org.dromara.common.web.core.BaseController; -import org.dromara.common.mybatis.core.page.PageQuery; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.dromara.build.domain.bo.BudConstructionTemplateGroupBo; +import org.dromara.build.domain.vo.BudConstructionTemplateGroupVo; +import org.dromara.build.service.IBudConstructionTemplateGroupService; 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.log.enums.BusinessType; import org.dromara.common.excel.utils.ExcelUtil; -import org.dromara.build.domain.vo.BudConstructionTemplateGroupVo; -import org.dromara.build.domain.bo.BudConstructionTemplateGroupBo; -import org.dromara.build.service.IBudConstructionTemplateGroupService; +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.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; /** * 施工模板组(汇总) diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/controller/BudPlanFacilityController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/controller/BudPlanFacilityController.java new file mode 100644 index 00000000..4fcc1fa0 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/controller/BudPlanFacilityController.java @@ -0,0 +1,106 @@ +package org.dromara.build.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.build.domain.bo.BudPlanFacilityBo; +import org.dromara.build.domain.vo.BudPlanFacilityVo; +import org.dromara.build.service.IBudPlanFacilityService; +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.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 施工计划关联设施 + * + * @author lilemy + * @date 2025-12-23 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/build/planFacility") +public class BudPlanFacilityController extends BaseController { + + private final IBudPlanFacilityService budPlanFacilityService; + + /** + * 查询施工计划关联设施列表 + */ + @SaCheckPermission("build:planFacility:list") + @GetMapping("/list") + public TableDataInfo list(BudPlanFacilityBo bo, PageQuery pageQuery) { + return budPlanFacilityService.queryPageList(bo, pageQuery); + } + + /** + * 导出施工计划关联设施列表 + */ + @SaCheckPermission("build:planFacility:export") + @Log(title = "施工计划关联设施", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(BudPlanFacilityBo bo, HttpServletResponse response) { + List list = budPlanFacilityService.queryList(bo); + ExcelUtil.exportExcel(list, "施工计划关联设施", BudPlanFacilityVo.class, response); + } + + /** + * 获取施工计划关联设施详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("build:planFacility:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(budPlanFacilityService.queryById(id)); + } + + /** + * 新增施工计划关联设施 + */ + @SaCheckPermission("build:planFacility:add") + @Log(title = "施工计划关联设施", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody BudPlanFacilityBo bo) { + return toAjax(budPlanFacilityService.insertByBo(bo)); + } + + /** + * 修改施工计划关联设施 + */ + @SaCheckPermission("build:planFacility:edit") + @Log(title = "施工计划关联设施", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody BudPlanFacilityBo bo) { + return toAjax(budPlanFacilityService.updateByBo(bo)); + } + + /** + * 删除施工计划关联设施 + * + * @param ids 主键串 + */ + @SaCheckPermission("build:planFacility:remove") + @Log(title = "施工计划关联设施", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(budPlanFacilityService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudBoxChange.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudBoxChange.java index 37bab6b5..cbdcb03a 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudBoxChange.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudBoxChange.java @@ -50,7 +50,7 @@ public class BudBoxChange extends BaseEntity { private String positions; /** - * 完成状态(0未开始 1进行中 2完成) + * 完成状态(0未开始 1进行中 2已延期 3已完成) */ private String status; diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudConstructionPlan.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudConstructionPlan.java new file mode 100644 index 00000000..48220b3e --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudConstructionPlan.java @@ -0,0 +1,63 @@ +package org.dromara.build.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.LocalDate; + +/** + * 施工完成计划对象 bud_construction_plan + * + * @author lilemy + * @date 2025-12-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("bud_construction_plan") +public class BudConstructionPlan extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id") + private Long id; + + /** + * 项目 ID + */ + private Long projectId; + + /** + * 计划名称 + */ + private String planName; + + /** + * 计划开始日期 + */ + private LocalDate planStartDate; + + /** + * 计划完成日期 + */ + private LocalDate planEndDate; + + /** + * 计划状态 + */ + private String status; + + /** + * 备注 + */ + private String remark; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudInverter.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudInverter.java index 6b6e181e..6205eea9 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudInverter.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudInverter.java @@ -50,7 +50,7 @@ public class BudInverter extends BaseEntity { private String positions; /** - * 完成状态(0未开始 1进行中 2完成) + * 完成状态(0未开始 1进行中 2已延期 3已完成) */ private String status; diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudPillarPoint.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudPillarPoint.java index e62b5294..3e6bafde 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudPillarPoint.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudPillarPoint.java @@ -50,7 +50,7 @@ public class BudPillarPoint extends BaseEntity { private String positions; /** - * 完成状态(0未开始 1进行中 2完成) + * 完成状态(0未开始 1进行中 2已延期 3已完成) */ private String status; diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudPlanFacility.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudPlanFacility.java new file mode 100644 index 00000000..d30e47ee --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudPlanFacility.java @@ -0,0 +1,65 @@ +package org.dromara.build.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 施工计划关联设施对象 bud_plan_facility + * + * @author lilemy + * @date 2025-12-23 + */ +@Data +@TableName("bud_plan_facility") +public class BudPlanFacility implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id") + private Long id; + + /** + * 项目 ID + */ + private Long projectId; + + /** + * 施工计划 ID + */ + private Long planId; + + /** + * 设施类型 + */ + private String facilityType; + + /** + * 设施 ID + */ + private Long facilityId; + + /** + * 设施状态 + */ + private String status; + + /** + * 完成方式 + */ + private String finishMethod; + + /** + * 完成时间 + */ + private LocalDateTime finishTime; + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudSolarPanel.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudSolarPanel.java index ebfe3e40..22415fec 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudSolarPanel.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudSolarPanel.java @@ -50,7 +50,7 @@ public class BudSolarPanel extends BaseEntity { private String positions; /** - * 完成状态(0未开始 1进行中 2完成) + * 完成状态(0未开始 1进行中 2已延期 3已完成) */ private String status; diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudStandColumn.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudStandColumn.java index 1c727269..9f649c16 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudStandColumn.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudStandColumn.java @@ -50,7 +50,7 @@ public class BudStandColumn extends BaseEntity { private String positions; /** - * 完成状态(0未开始 1进行中 2完成) + * 完成状态(0未开始 1进行中 2已延期 3已完成) */ private String status; diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudSupportFrame.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudSupportFrame.java index 64233dae..2ee316a6 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudSupportFrame.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/BudSupportFrame.java @@ -50,7 +50,7 @@ public class BudSupportFrame extends BaseEntity { private String positions; /** - * 完成状态(0未开始 1进行中 2完成) + * 完成状态(0未开始 1进行中 2已延期 3已完成) */ private String status; diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudBoxChangeBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudBoxChangeBo.java index 684222b5..6a29ac11 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudBoxChangeBo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudBoxChangeBo.java @@ -57,9 +57,9 @@ public class BudBoxChangeBo extends BaseEntity { private String positions; /** - * 完成状态(0未开始 1进行中 2完成) + * 完成状态(0未开始 1进行中 2已延期 3已完成) */ - @NotBlank(message = "完成状态(0未开始 1进行中 2完成)不能为空", groups = {AddGroup.class, EditGroup.class}) + @NotBlank(message = "完成状态(0未开始 1进行中 2已延期 3已完成)不能为空", groups = {AddGroup.class, EditGroup.class}) private String status; /** diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudConstructionPlanBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudConstructionPlanBo.java new file mode 100644 index 00000000..21f369b3 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudConstructionPlanBo.java @@ -0,0 +1,77 @@ +package org.dromara.build.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.dromara.build.domain.BudConstructionPlan; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.mybatis.core.domain.BaseEntity; + +import java.io.Serial; +import java.time.LocalDate; +import java.util.List; + +/** + * 施工完成计划业务对象 bud_construction_plan + * + * @author lilemy + * @date 2025-12-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = BudConstructionPlan.class, reverseConvertGenerate = false) +public class BudConstructionPlanBo extends BaseEntity { + + @Serial + private static final long serialVersionUID = 6496839101835764379L; + + /** + * 主键 + */ + @NotNull(message = "主键不能为空", groups = {EditGroup.class}) + private Long id; + + /** + * 项目 ID + */ + @NotNull(message = "项目 ID不能为空", groups = {AddGroup.class, EditGroup.class}) + private Long projectId; + + /** + * 计划名称 + */ + @NotBlank(message = "计划名称不能为空", groups = {AddGroup.class, EditGroup.class}) + private String planName; + + /** + * 计划开始日期 + */ + @NotNull(message = "计划开始日期不能为空", groups = {AddGroup.class, EditGroup.class}) + private LocalDate planStartDate; + + /** + * 计划完成日期 + */ + @NotNull(message = "计划完成日期不能为空", groups = {AddGroup.class, EditGroup.class}) + private LocalDate planEndDate; + + /** + * 计划状态 + */ + private String status; + + /** + * 备注 + */ + private String remark; + + /** + * 计划设施列表 + */ + @NotNull(message = "计划设施列表不能为空", groups = {AddGroup.class, EditGroup.class}) + private List planFacilityList; + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudInverterBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudInverterBo.java index 68644895..67bab71e 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudInverterBo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudInverterBo.java @@ -57,9 +57,9 @@ public class BudInverterBo extends BaseEntity { private String positions; /** - * 完成状态(0未开始 1进行中 2完成) + * 完成状态(0未开始 1进行中 2已延期 3已完成) */ - @NotBlank(message = "完成状态(0未开始 1进行中 2完成)不能为空", groups = {AddGroup.class, EditGroup.class}) + @NotBlank(message = "完成状态(0未开始 1进行中 2已延期 3已完成)不能为空", groups = {AddGroup.class, EditGroup.class}) private String status; /** diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudPillarPointBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudPillarPointBo.java index 6a363d0c..bab3eeb2 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudPillarPointBo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudPillarPointBo.java @@ -57,9 +57,9 @@ public class BudPillarPointBo extends BaseEntity { private String positions; /** - * 完成状态(0未开始 1进行中 2完成) + * 完成状态(0未开始 1进行中 2已延期 3已完成) */ - @NotBlank(message = "完成状态(0未开始 1进行中 2完成)不能为空", groups = {AddGroup.class, EditGroup.class}) + @NotBlank(message = "完成状态(0未开始 1进行中 2已延期 3已完成)不能为空", groups = {AddGroup.class, EditGroup.class}) private String status; /** diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudPlanFacilityBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudPlanFacilityBo.java new file mode 100644 index 00000000..6502a396 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudPlanFacilityBo.java @@ -0,0 +1,65 @@ +package org.dromara.build.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import org.dromara.build.domain.BudPlanFacility; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * 施工计划关联设施业务对象 bud_plan_facility + * + * @author lilemy + * @date 2025-12-23 + */ +@Data +@AutoMapper(target = BudPlanFacility.class, reverseConvertGenerate = false) +public class BudPlanFacilityBo implements Serializable { + + @Serial + private static final long serialVersionUID = 2833374803608062065L; + + /** + * 主键 + */ + private Long id; + + /** + * 施工计划 ID + */ + private Long planId; + + /** + * 设施类型 + */ + @NotBlank(message = "设施类型不能为空", groups = {AddGroup.class, EditGroup.class}) + private String facilityType; + + /** + * 设施 ID + */ + @NotNull(message = "设施 ID不能为空", groups = {AddGroup.class, EditGroup.class}) + private Long facilityId; + + /** + * 设施状态 + */ + private String status; + + /** + * 完成方式 + */ + private String finishMethod; + + /** + * 完成时间 + */ + private LocalDateTime finishTime; + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudSolarPanelBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudSolarPanelBo.java index 0dd161f8..283e9064 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudSolarPanelBo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudSolarPanelBo.java @@ -57,9 +57,9 @@ public class BudSolarPanelBo extends BaseEntity { private String positions; /** - * 完成状态(0未开始 1进行中 2完成) + * 完成状态(0未开始 1进行中 2已延期 3已完成) */ - @NotBlank(message = "完成状态(0未开始 1进行中 2完成)不能为空", groups = {AddGroup.class, EditGroup.class}) + @NotBlank(message = "完成状态(0未开始 1进行中 2已延期 3已完成)不能为空", groups = {AddGroup.class, EditGroup.class}) private String status; /** diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudStandColumnBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudStandColumnBo.java index da4f2300..5f58c6ab 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudStandColumnBo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudStandColumnBo.java @@ -57,9 +57,9 @@ public class BudStandColumnBo extends BaseEntity { private String positions; /** - * 完成状态(0未开始 1进行中 2完成) + * 完成状态(0未开始 1进行中 2已延期 3已完成) */ - @NotBlank(message = "完成状态(0未开始 1进行中 2完成)不能为空", groups = {AddGroup.class, EditGroup.class}) + @NotBlank(message = "完成状态(0未开始 1进行中 2已延期 3已完成)不能为空", groups = {AddGroup.class, EditGroup.class}) private String status; /** diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudSupportFrameBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudSupportFrameBo.java index 43f74b22..24ef9309 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudSupportFrameBo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/bo/BudSupportFrameBo.java @@ -57,9 +57,9 @@ public class BudSupportFrameBo extends BaseEntity { private String positions; /** - * 完成状态(0未开始 1进行中 2完成) + * 完成状态(0未开始 1进行中 2已延期 3已完成) */ - @NotBlank(message = "完成状态(0未开始 1进行中 2完成)不能为空", groups = {AddGroup.class, EditGroup.class}) + @NotBlank(message = "完成状态(0未开始 1进行中 2已延期 3已完成)不能为空", groups = {AddGroup.class, EditGroup.class}) private String status; /** diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/enums/BudDesignType.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/enums/BudFacilityType.java similarity index 87% rename from xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/enums/BudDesignType.java rename to xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/enums/BudFacilityType.java index e3b6c3b7..1b27929e 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/enums/BudDesignType.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/enums/BudFacilityType.java @@ -11,7 +11,7 @@ import java.util.Objects; */ @Getter @AllArgsConstructor -public enum BudDesignType { +public enum BudFacilityType { /** * 方阵 @@ -63,8 +63,8 @@ public enum BudDesignType { * @param value 枚举值 * @return 枚举 */ - public static BudDesignType getEnumByValue(String value) { - for (BudDesignType type : values()) { + public static BudFacilityType getEnumByValue(String value) { + for (BudFacilityType type : values()) { if (Objects.equals(type.getValue(), value)) { return type; } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/enums/BudFinishStatus.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/enums/BudFinishStatus.java new file mode 100644 index 00000000..eded6b28 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/enums/BudFinishStatus.java @@ -0,0 +1,37 @@ +package org.dromara.build.domain.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author lilemy + * @date 2025-12-23 11:40 + */ +@Getter +@AllArgsConstructor +public enum BudFinishStatus { + + /** + * 未开始 + */ + NOT_STARTED("未开始", "0"), + + /** + * 进行中 + */ + IN_PROGRESS("进行中", "1"), + + /** + * 已延期 + */ + DELAYED("已延期", "2"), + + /** + * 已完成 + */ + COMPLETED("已完成", "3"); + + private final String text; + + private final String value; +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/interfaces/BudFinishable.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/interfaces/BudFinishable.java new file mode 100644 index 00000000..fa430da0 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/interfaces/BudFinishable.java @@ -0,0 +1,34 @@ +package org.dromara.build.domain.interfaces; + +import java.time.LocalDate; + +/** + * 构建完成接口 + * + * @author lilemy + * @date 2025-12-23 17:13 + */ +public interface BudFinishable { + + /** + * 获取 ID + * + * @return id + */ + Long getId(); + + /** + * 获取状态 + */ + void setStatus(String status); + + /** + * 获取完成方式 + */ + void setFinishType(String finishType); + + /** + * 获取完成时间 + */ + void setFinishDate(LocalDate finishDate); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudBoxChangeVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudBoxChangeVo.java index 6facd4a2..69396ed1 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudBoxChangeVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudBoxChangeVo.java @@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.ExcelProperty; import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; import org.dromara.build.domain.BudBoxChange; +import org.dromara.build.domain.interfaces.BudFinishable; import org.dromara.common.excel.annotation.ExcelDictFormat; import org.dromara.common.excel.convert.ExcelDictConvert; @@ -22,7 +23,7 @@ import java.time.LocalDate; @Data @ExcelIgnoreUnannotated @AutoMapper(target = BudBoxChange.class) -public class BudBoxChangeVo implements Serializable { +public class BudBoxChangeVo implements BudFinishable, Serializable { @Serial private static final long serialVersionUID = 1L; @@ -58,7 +59,7 @@ public class BudBoxChangeVo implements Serializable { private String positions; /** - * 完成状态(0未开始 1进行中 2完成) + * 完成状态(0未开始 1进行中 2已延期 3已完成) */ @ExcelProperty(value = "完成状态", converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "0=未开始,1=进行中,2=完成") diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudConstructionPlanVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudConstructionPlanVo.java new file mode 100644 index 00000000..d9287a91 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudConstructionPlanVo.java @@ -0,0 +1,73 @@ +package org.dromara.build.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.build.domain.BudConstructionPlan; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDate; + + +/** + * 施工完成计划视图对象 bud_construction_plan + * + * @author lilemy + * @date 2025-12-23 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = BudConstructionPlan.class) +public class BudConstructionPlanVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @ExcelProperty(value = "主键") + private Long id; + + /** + * 项目 ID + */ + @ExcelProperty(value = "项目 ID") + private Long projectId; + + /** + * 计划名称 + */ + @ExcelProperty(value = "计划名称") + private String planName; + + /** + * 计划开始日期 + */ + @ExcelProperty(value = "计划开始日期") + private LocalDate planStartDate; + + /** + * 计划完成日期 + */ + @ExcelProperty(value = "计划完成日期") + private LocalDate planEndDate; + + /** + * 计划状态 + */ + @ExcelProperty(value = "计划状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "build_finish_status") + private String status; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudDesignDrawingByBuildVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudDesignDrawingByBuildVo.java index 7639adc8..2822f8ef 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudDesignDrawingByBuildVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudDesignDrawingByBuildVo.java @@ -42,7 +42,7 @@ public class BudDesignDrawingByBuildVo implements Serializable { private String type; /** - * 完成状态(0未开始 1进行中 2完成) + * 完成状态(0未开始 1进行中 2已延期 3已完成) */ private String status; @@ -57,14 +57,9 @@ public class BudDesignDrawingByBuildVo implements Serializable { private LocalDate finishDate; /** - * 进度类型id + * 计划 ID */ - private Long progressCategoryId; - - /** - * 进度类别名称 - */ - private String progressCategoryName; + private Long planId; /** * 对象转vo @@ -72,18 +67,16 @@ public class BudDesignDrawingByBuildVo implements Serializable { * @param id 主键 * @param name 名称 * @param positions 位置字符串 - * @param status 完成状态(0未开始 1进行中 2完成) + * @param status 完成状态(0未开始 1进行中 2已延期 3已完成) * @return BudDesignDrawingByBuildVo */ - public static BudDesignDrawingByBuildVo obj2vo(Long id, String name, String positions, String finishType, LocalDate finishDate, - String status, Long progressCategoryId, String progressCategoryName) { + public static BudDesignDrawingByBuildVo obj2vo(Long id, String name, String positions, + String finishType, LocalDate finishDate, String status) { BudDesignDrawingByBuildVo vo = new BudDesignDrawingByBuildVo(); vo.setId(id); vo.setName(name); vo.setFinishType(finishType); vo.setFinishDate(finishDate); - vo.setProgressCategoryId(progressCategoryId); - vo.setProgressCategoryName(progressCategoryName); JSONArray positionList = JSONUtil.parseArray(positions); vo.setPositionList(positionList); vo.setStatus(status); diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudInverterVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudInverterVo.java index fb9e655a..a7cab85f 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudInverterVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudInverterVo.java @@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.ExcelProperty; import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; import org.dromara.build.domain.BudInverter; +import org.dromara.build.domain.interfaces.BudFinishable; import org.dromara.common.excel.annotation.ExcelDictFormat; import org.dromara.common.excel.convert.ExcelDictConvert; @@ -22,7 +23,7 @@ import java.time.LocalDate; @Data @ExcelIgnoreUnannotated @AutoMapper(target = BudInverter.class) -public class BudInverterVo implements Serializable { +public class BudInverterVo implements BudFinishable, Serializable { @Serial private static final long serialVersionUID = 1L; @@ -58,7 +59,7 @@ public class BudInverterVo implements Serializable { private String positions; /** - * 完成状态(0未开始 1进行中 2完成) + * 完成状态(0未开始 1进行中 2已延期 3已完成) */ @ExcelProperty(value = "完成状态", converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "0=未开始,1=进行中,2=完成") diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudPillarPointVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudPillarPointVo.java index 5a8e865a..a4356324 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudPillarPointVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudPillarPointVo.java @@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.ExcelProperty; import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; import org.dromara.build.domain.BudPillarPoint; +import org.dromara.build.domain.interfaces.BudFinishable; import org.dromara.common.excel.annotation.ExcelDictFormat; import org.dromara.common.excel.convert.ExcelDictConvert; @@ -22,7 +23,7 @@ import java.time.LocalDate; @Data @ExcelIgnoreUnannotated @AutoMapper(target = BudPillarPoint.class) -public class BudPillarPointVo implements Serializable { +public class BudPillarPointVo implements BudFinishable, Serializable { @Serial private static final long serialVersionUID = 1L; @@ -58,7 +59,7 @@ public class BudPillarPointVo implements Serializable { private String positions; /** - * 完成状态(0未开始 1进行中 2完成) + * 完成状态(0未开始 1进行中 2已延期 3已完成) */ @ExcelProperty(value = "完成状态", converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "0=未开始,1=进行中,2=完成") diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudPlanFacilityVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudPlanFacilityVo.java new file mode 100644 index 00000000..ff00966b --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudPlanFacilityVo.java @@ -0,0 +1,81 @@ +package org.dromara.build.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.build.domain.BudPlanFacility; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDateTime; + + +/** + * 施工计划关联设施视图对象 bud_plan_facility + * + * @author lilemy + * @date 2025-12-23 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = BudPlanFacility.class) +public class BudPlanFacilityVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @ExcelProperty(value = "主键") + private Long id; + + /** + * 项目 ID + */ + @ExcelProperty(value = "项目 ID") + private Long projectId; + + /** + * 施工计划 ID + */ + @ExcelProperty(value = "施工计划 ID") + private Long planId; + + /** + * 设施类型 + */ + @ExcelProperty(value = "设施类型", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "build_facility_type") + private String facilityType; + + /** + * 设施 ID + */ + @ExcelProperty(value = "设施 ID") + private Long facilityId; + + /** + * 设施状态 + */ + @ExcelProperty(value = "设施状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "build_finish_status") + private String status; + + /** + * 完成方式 + */ + @ExcelProperty(value = "完成方式", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "build_finish_type") + private String finishMethod; + + /** + * 完成时间 + */ + @ExcelProperty(value = "完成时间") + private LocalDateTime finishTime; + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudSolarPanelVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudSolarPanelVo.java index 1f4c01bb..dac6ae44 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudSolarPanelVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudSolarPanelVo.java @@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.ExcelProperty; import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; import org.dromara.build.domain.BudSolarPanel; +import org.dromara.build.domain.interfaces.BudFinishable; import org.dromara.common.excel.annotation.ExcelDictFormat; import org.dromara.common.excel.convert.ExcelDictConvert; @@ -22,7 +23,7 @@ import java.time.LocalDate; @Data @ExcelIgnoreUnannotated @AutoMapper(target = BudSolarPanel.class) -public class BudSolarPanelVo implements Serializable { +public class BudSolarPanelVo implements BudFinishable, Serializable { @Serial private static final long serialVersionUID = 1L; @@ -58,7 +59,7 @@ public class BudSolarPanelVo implements Serializable { private String positions; /** - * 完成状态(0未开始 1进行中 2完成) + * 完成状态(0未开始 1进行中 2已延期 3已完成) */ @ExcelProperty(value = "完成状态", converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "0=未开始,1=进行中,2=完成") diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudStandColumnVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudStandColumnVo.java index c11791e1..c92185f4 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudStandColumnVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudStandColumnVo.java @@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.ExcelProperty; import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; import org.dromara.build.domain.BudStandColumn; +import org.dromara.build.domain.interfaces.BudFinishable; import org.dromara.common.excel.annotation.ExcelDictFormat; import org.dromara.common.excel.convert.ExcelDictConvert; @@ -22,7 +23,7 @@ import java.time.LocalDate; @Data @ExcelIgnoreUnannotated @AutoMapper(target = BudStandColumn.class) -public class BudStandColumnVo implements Serializable { +public class BudStandColumnVo implements BudFinishable, Serializable { @Serial private static final long serialVersionUID = 1L; @@ -58,7 +59,7 @@ public class BudStandColumnVo implements Serializable { private String positions; /** - * 完成状态(0未开始 1进行中 2完成) + * 完成状态(0未开始 1进行中 2已延期 3已完成) */ @ExcelProperty(value = "完成状态", converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "0=未开始,1=进行中,2=完成") diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudSupportFrameVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudSupportFrameVo.java index 6debb880..ad7cb065 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudSupportFrameVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/domain/vo/BudSupportFrameVo.java @@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.ExcelProperty; import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; import org.dromara.build.domain.BudSupportFrame; +import org.dromara.build.domain.interfaces.BudFinishable; import org.dromara.common.excel.annotation.ExcelDictFormat; import org.dromara.common.excel.convert.ExcelDictConvert; @@ -22,7 +23,7 @@ import java.time.LocalDate; @Data @ExcelIgnoreUnannotated @AutoMapper(target = BudSupportFrame.class) -public class BudSupportFrameVo implements Serializable { +public class BudSupportFrameVo implements BudFinishable, Serializable { @Serial private static final long serialVersionUID = 1L; @@ -58,7 +59,7 @@ public class BudSupportFrameVo implements Serializable { private String positions; /** - * 完成状态(0未开始 1进行中 2完成) + * 完成状态(0未开始 1进行中 2已延期 3已完成) */ @ExcelProperty(value = "完成状态", converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "0=未开始,1=进行中,2=完成") diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/mapper/BudConstructionPlanMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/mapper/BudConstructionPlanMapper.java new file mode 100644 index 00000000..962acee1 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/mapper/BudConstructionPlanMapper.java @@ -0,0 +1,15 @@ +package org.dromara.build.mapper; + +import org.dromara.build.domain.BudConstructionPlan; +import org.dromara.build.domain.vo.BudConstructionPlanVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 施工完成计划Mapper接口 + * + * @author lilemy + * @date 2025-12-23 + */ +public interface BudConstructionPlanMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/mapper/BudPlanFacilityMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/mapper/BudPlanFacilityMapper.java new file mode 100644 index 00000000..33594595 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/mapper/BudPlanFacilityMapper.java @@ -0,0 +1,15 @@ +package org.dromara.build.mapper; + +import org.dromara.build.domain.BudPlanFacility; +import org.dromara.build.domain.vo.BudPlanFacilityVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 施工计划关联设施Mapper接口 + * + * @author lilemy + * @date 2025-12-23 + */ +public interface BudPlanFacilityMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/IBudConstructionPlanService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/IBudConstructionPlanService.java new file mode 100644 index 00000000..325cfa79 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/IBudConstructionPlanService.java @@ -0,0 +1,71 @@ +package org.dromara.build.service; + +import org.dromara.build.domain.vo.BudConstructionPlanVo; +import org.dromara.build.domain.bo.BudConstructionPlanBo; +import org.dromara.build.domain.BudConstructionPlan; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.Collection; +import java.util.List; + +/** + * 施工完成计划Service接口 + * + * @author lilemy + * @date 2025-12-23 + */ +public interface IBudConstructionPlanService extends IService { + + /** + * 查询施工完成计划 + * + * @param id 主键 + * @return 施工完成计划 + */ + BudConstructionPlanVo queryById(Long id); + + /** + * 分页查询施工完成计划列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 施工完成计划分页列表 + */ + TableDataInfo queryPageList(BudConstructionPlanBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的施工完成计划列表 + * + * @param bo 查询条件 + * @return 施工完成计划列表 + */ + List queryList(BudConstructionPlanBo bo); + + /** + * 新增施工完成计划 + * + * @param bo 施工完成计划 + * @return 是否新增成功 + */ + Boolean insertByBo(BudConstructionPlanBo bo); + + /** + * 修改施工完成计划 + * + * @param bo 施工完成计划 + * @return 是否修改成功 + */ + Boolean updateByBo(BudConstructionPlanBo bo); + + /** + * 校验并批量删除施工完成计划信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/IBudDesignDrawingService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/IBudDesignDrawingService.java index 08e79725..b79b8fc4 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/IBudDesignDrawingService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/IBudDesignDrawingService.java @@ -83,14 +83,6 @@ public interface IBudDesignDrawingService extends IService { */ Boolean insertByCadFile(MultipartFile file, BudDesignDrawingUploadReq req); - /** - * 新增施工设计图 - * - * @param bo 施工设计图 - * @return 是否新增成功 - */ - Boolean insertByBo(BudDesignDrawingBo bo); - /** * 新增施工设施 * diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/IBudPlanFacilityService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/IBudPlanFacilityService.java new file mode 100644 index 00000000..f2e76296 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/IBudPlanFacilityService.java @@ -0,0 +1,99 @@ +package org.dromara.build.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.dromara.build.domain.BudPlanFacility; +import org.dromara.build.domain.bo.BudPlanFacilityBo; +import org.dromara.build.domain.enums.BudFacilityType; +import org.dromara.build.domain.interfaces.BudFinishable; +import org.dromara.build.domain.vo.BudPlanFacilityVo; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +import java.util.Collection; +import java.util.List; + +/** + * 施工计划关联设施Service接口 + * + * @author lilemy + * @date 2025-12-23 + */ +public interface IBudPlanFacilityService extends IService { + + /** + * 查询施工计划关联设施 + * + * @param id 主键 + * @return 施工计划关联设施 + */ + BudPlanFacilityVo queryById(Long id); + + /** + * 分页查询施工计划关联设施列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 施工计划关联设施分页列表 + */ + TableDataInfo queryPageList(BudPlanFacilityBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的施工计划关联设施列表 + * + * @param bo 查询条件 + * @return 施工计划关联设施列表 + */ + List queryList(BudPlanFacilityBo bo); + + /** + * 新增施工计划关联设施 + * + * @param bo 施工计划关联设施 + * @return 是否新增成功 + */ + Boolean insertByBo(BudPlanFacilityBo bo); + + /** + * 修改施工计划关联设施 + * + * @param bo 施工计划关联设施 + * @return 是否修改成功 + */ + Boolean updateByBo(BudPlanFacilityBo bo); + + /** + * 校验并批量删除施工计划关联设施信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 保存或更新 + * + * @param projectId 项目 ID + * @param planId 计划 ID + * @param boList 列表 + * @param isUpdate 是否更新 + * @return 是否保存成功 + */ + Boolean saveOrUpdate(Long projectId, Long planId, List boList, Boolean isUpdate); + + /** + * 填充完成信息 + * + * @param target 目标对象 + * @param designType 施工类型 + */ + void fillFinishInfo(T target, BudFacilityType designType); + + /** + * 填充完成信息 + * + * @param list 列表 + * @param designType 施工类型 + */ + void fillFinishInfo(List list, BudFacilityType designType); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/IBudSolarPanelBaseService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/IBudSolarPanelBaseService.java index 3058e885..30ba9805 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/IBudSolarPanelBaseService.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/IBudSolarPanelBaseService.java @@ -6,6 +6,8 @@ import org.dromara.build.domain.geojson.BudFeature; import java.util.List; /** + * 光伏板基础信息(桩点、立柱、支架)服务 + * * @author lilemy * @date 2025-12-19 14:52 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudBoxChangeServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudBoxChangeServiceImpl.java index 76d34df0..e319f088 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudBoxChangeServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudBoxChangeServiceImpl.java @@ -13,12 +13,14 @@ import org.dromara.build.domain.BudBoxChange; import org.dromara.build.domain.BudDesignDrawing; import org.dromara.build.domain.BudMatrix; import org.dromara.build.domain.bo.BudBoxChangeBo; +import org.dromara.build.domain.enums.BudFacilityType; import org.dromara.build.domain.geojson.BudFeature; import org.dromara.build.domain.geojson.BudGeometry; import org.dromara.build.domain.vo.BudBoxChangeVo; import org.dromara.build.mapper.BudBoxChangeMapper; import org.dromara.build.service.IBudBoxChangeService; import org.dromara.build.service.IBudMatrixService; +import org.dromara.build.service.IBudPlanFacilityService; import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; @@ -32,7 +34,6 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Collection; import java.util.List; -import java.util.Map; /** * 箱变Service业务层处理 @@ -49,6 +50,9 @@ public class BudBoxChangeServiceImpl extends ServiceImpl queryPageList(BudBoxChangeBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + budPlanFacilityService.fillFinishInfo(result.getRecords(), BudFacilityType.BOX_CHANGE); return TableDataInfo.build(result); } @@ -83,22 +90,17 @@ public class BudBoxChangeServiceImpl extends ServiceImpl queryList(BudBoxChangeBo bo) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); - return baseMapper.selectVoList(lqw); + List voList = baseMapper.selectVoList(lqw); + budPlanFacilityService.fillFinishInfo(voList, BudFacilityType.BOX_CHANGE); + return voList; } private LambdaQueryWrapper buildQueryWrapper(BudBoxChangeBo bo) { - Map params = bo.getParams(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); lqw.orderByDesc(BudBoxChange::getId); lqw.eq(bo.getProjectId() != null, BudBoxChange::getProjectId, bo.getProjectId()); lqw.eq(bo.getMatrixId() != null, BudBoxChange::getMatrixId, bo.getMatrixId()); lqw.like(StringUtils.isNotBlank(bo.getName()), BudBoxChange::getName, bo.getName()); - lqw.eq(StringUtils.isNotBlank(bo.getPositions()), BudBoxChange::getPositions, bo.getPositions()); - lqw.eq(StringUtils.isNotBlank(bo.getStatus()), BudBoxChange::getStatus, bo.getStatus()); - lqw.eq(StringUtils.isNotBlank(bo.getFinishType()), BudBoxChange::getFinishType, bo.getFinishType()); - lqw.eq(bo.getFinishDate() != null, BudBoxChange::getFinishDate, bo.getFinishDate()); - lqw.eq(bo.getProgressCategoryId() != null, BudBoxChange::getProgressCategoryId, bo.getProgressCategoryId()); - lqw.like(StringUtils.isNotBlank(bo.getProgressCategoryName()), BudBoxChange::getProgressCategoryName, bo.getProgressCategoryName()); return lqw; } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudConstructionPlanServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudConstructionPlanServiceImpl.java new file mode 100644 index 00000000..9f6708f1 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudConstructionPlanServiceImpl.java @@ -0,0 +1,193 @@ +package org.dromara.build.service.impl; + +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.build.domain.BudConstructionPlan; +import org.dromara.build.domain.BudPlanFacility; +import org.dromara.build.domain.bo.BudConstructionPlanBo; +import org.dromara.build.domain.enums.BudFinishStatus; +import org.dromara.build.domain.vo.BudConstructionPlanVo; +import org.dromara.build.mapper.BudConstructionPlanMapper; +import org.dromara.build.service.IBudConstructionPlanService; +import org.dromara.build.service.IBudPlanFacilityService; +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.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * 施工完成计划Service业务层处理 + * + * @author lilemy + * @date 2025-12-23 + */ +@RequiredArgsConstructor +@Service +public class BudConstructionPlanServiceImpl extends ServiceImpl + implements IBudConstructionPlanService { + + private final IBudPlanFacilityService budPlanFacilityService; + + /** + * 查询施工完成计划 + * + * @param id 主键 + * @return 施工完成计划 + */ + @Override + public BudConstructionPlanVo queryById(Long id) { + return baseMapper.selectVoById(id); + } + + /** + * 分页查询施工完成计划列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 施工完成计划分页列表 + */ + @Override + public TableDataInfo queryPageList(BudConstructionPlanBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的施工完成计划列表 + * + * @param bo 查询条件 + * @return 施工完成计划列表 + */ + @Override + public List queryList(BudConstructionPlanBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(BudConstructionPlanBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(BudConstructionPlan::getId); + lqw.eq(bo.getProjectId() != null, BudConstructionPlan::getProjectId, bo.getProjectId()); + lqw.like(StringUtils.isNotBlank(bo.getPlanName()), BudConstructionPlan::getPlanName, bo.getPlanName()); + lqw.eq(bo.getPlanStartDate() != null, BudConstructionPlan::getPlanStartDate, bo.getPlanStartDate()); + lqw.eq(bo.getPlanEndDate() != null, BudConstructionPlan::getPlanEndDate, bo.getPlanEndDate()); + lqw.eq(StringUtils.isNotBlank(bo.getStatus()), BudConstructionPlan::getStatus, bo.getStatus()); + return lqw; + } + + /** + * 新增施工完成计划 + * + * @param bo 施工完成计划 + * @return 是否新增成功 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean insertByBo(BudConstructionPlanBo bo) { + BudConstructionPlan add = MapstructUtils.convert(bo, BudConstructionPlan.class); + if (add == null) { + throw new ServiceException("新增施工完成计划失败,参数错误"); + } + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (!flag) { + throw new ServiceException("新增施工完成计划失败"); + } + // 添加关联 + Boolean b = budPlanFacilityService.saveOrUpdate(bo.getProjectId(), add.getId(), bo.getPlanFacilityList(), false); + if (!b) { + throw new ServiceException("新增施工完成计划失败"); + } + return true; + } + + /** + * 修改施工完成计划 + * + * @param bo 施工完成计划 + * @return 是否修改成功 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean updateByBo(BudConstructionPlanBo bo) { + BudConstructionPlan update = MapstructUtils.convert(bo, BudConstructionPlan.class); + if (update == null) { + throw new ServiceException("修改施工完成计划失败,参数错误"); + } + validEntityBeforeSave(update); + boolean flag = this.updateById(update); + if (!flag) { + throw new ServiceException("修改施工完成计划失败"); + } + // 修改关联 + Boolean b = budPlanFacilityService.saveOrUpdate(bo.getProjectId(), update.getId(), bo.getPlanFacilityList(), true); + if (!b) { + throw new ServiceException("修改施工完成计划失败"); + } + return true; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(BudConstructionPlan entity) { + //TODO 做一些数据校验,如唯一约束 + Long projectId = entity.getProjectId(); + String planName = entity.getPlanName(); + LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(); + lqw.eq(BudConstructionPlan::getProjectId, projectId); + lqw.eq(BudConstructionPlan::getPlanName, planName); + if (entity.getId() != null) { + lqw.ne(BudConstructionPlan::getId, entity.getId()); + } + if (this.count(lqw) > 0) { + throw new ServiceException("计划名称不能重复"); + } + } + + /** + * 校验并批量删除施工完成计划信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + List relList = budPlanFacilityService.lambdaQuery() + .in(BudPlanFacility::getPlanId, ids) + .list(); + if (isValid) { + //TODO 做一些业务上的校验,判断是否需要校验 + relList.forEach(rel -> { + String status = rel.getStatus(); + if (BudFinishStatus.COMPLETED.getValue().equals(status)) { + throw new ServiceException("删除失败,存在已完成的施工计划"); + } + }); + } + // 删除关联 + boolean b = budPlanFacilityService.removeBatchByIds(relList); + if (!b) { + throw new ServiceException("删除失败,系统异常"); + } + boolean remove = this.removeBatchByIds(ids); + if (!remove) { + throw new ServiceException("删除失败,系统异常"); + } + return true; + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudDesignDrawingServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudDesignDrawingServiceImpl.java index 0d4512be..fd0d4fea 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudDesignDrawingServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudDesignDrawingServiceImpl.java @@ -17,7 +17,8 @@ import org.dromara.build.domain.bo.BudDesignDrawingBo; import org.dromara.build.domain.dto.BudCreateByLayerReq; import org.dromara.build.domain.dto.BudDesignDrawingQueryBuildReq; import org.dromara.build.domain.dto.BudDesignDrawingUploadReq; -import org.dromara.build.domain.enums.BudDesignType; +import org.dromara.build.domain.enums.BudFacilityType; +import org.dromara.build.domain.enums.BudFinishStatus; import org.dromara.build.domain.geojson.BudFeature; import org.dromara.build.domain.vo.BudDesignDrawingByBuildVo; import org.dromara.build.domain.vo.BudDesignDrawingVo; @@ -36,10 +37,13 @@ import org.springframework.web.multipart.MultipartFile; import java.io.File; import java.io.IOException; +import java.time.LocalDate; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; /** * 施工设计图Service业务层处理 @@ -83,6 +87,9 @@ public class BudDesignDrawingServiceImpl extends ServiceImpl list; switch (value) { // 方阵 @@ -175,8 +182,8 @@ public class BudDesignDrawingServiceImpl extends ServiceImpl BudDesignDrawingByBuildVo.obj2vo( - matrix.getId(), matrix.getName(), matrix.getPositions(), null, null, - null, null, null)).toList(); + matrix.getId(), matrix.getName(), matrix.getPositions(), null, null, null) + ).toList(); } // 光伏板 case SOLAR_PANEL -> { @@ -185,8 +192,9 @@ public class BudDesignDrawingServiceImpl extends ServiceImpl BudDesignDrawingByBuildVo.obj2vo( - panel.getId(), panel.getName(), panel.getPositions(), panel.getFinishType(), panel.getFinishDate(), - panel.getStatus(), panel.getProgressCategoryId(), panel.getProgressCategoryName())).toList(); + panel.getId(), panel.getName(), panel.getPositions(), + panel.getFinishType(), panel.getFinishDate(), panel.getStatus()) + ).toList(); } // 逆变器 case INVERTER -> { @@ -195,8 +203,9 @@ public class BudDesignDrawingServiceImpl extends ServiceImpl BudDesignDrawingByBuildVo.obj2vo( - inverter.getId(), inverter.getName(), inverter.getPositions(), inverter.getFinishType(), inverter.getFinishDate(), - inverter.getStatus(), inverter.getProgressCategoryId(), inverter.getProgressCategoryName())).toList(); + inverter.getId(), inverter.getName(), inverter.getPositions(), inverter.getFinishType(), + inverter.getFinishDate(), inverter.getStatus()) + ).toList(); } // 箱变 case BOX_CHANGE -> { @@ -205,8 +214,9 @@ public class BudDesignDrawingServiceImpl extends ServiceImpl BudDesignDrawingByBuildVo.obj2vo( - boxChange.getId(), boxChange.getName(), boxChange.getPositions(), boxChange.getFinishType(), boxChange.getFinishDate(), - boxChange.getStatus(), boxChange.getProgressCategoryId(), boxChange.getProgressCategoryName())).toList(); + boxChange.getId(), boxChange.getName(), boxChange.getPositions(), boxChange.getFinishType(), + boxChange.getFinishDate(), boxChange.getStatus()) + ).toList(); } // 红线 case RED_LINE -> { @@ -214,8 +224,8 @@ public class BudDesignDrawingServiceImpl extends ServiceImpl BudDesignDrawingByBuildVo.obj2vo( - redLine.getId(), redLine.getName(), redLine.getPositions(), null, null, - null, null, null)).toList(); + redLine.getId(), redLine.getName(), redLine.getPositions(), null, null, null) + ).toList(); } // 桩点 case PILLAR_POINT -> { @@ -225,8 +235,7 @@ public class BudDesignDrawingServiceImpl extends ServiceImpl BudDesignDrawingByBuildVo.obj2vo( pillarPoint.getId(), pillarPoint.getName(), pillarPoint.getPositions(), - pillarPoint.getFinishType(), pillarPoint.getFinishDate(), - pillarPoint.getStatus(), pillarPoint.getProgressCategoryId(), pillarPoint.getProgressCategoryName()) + pillarPoint.getFinishType(), pillarPoint.getFinishDate(), pillarPoint.getStatus()) ).toList(); } // 立柱 @@ -237,8 +246,7 @@ public class BudDesignDrawingServiceImpl extends ServiceImpl BudDesignDrawingByBuildVo.obj2vo( standColumn.getId(), standColumn.getName(), standColumn.getPositions(), - standColumn.getFinishType(), standColumn.getFinishDate(), - standColumn.getStatus(), standColumn.getProgressCategoryId(), standColumn.getProgressCategoryName()) + standColumn.getFinishType(), standColumn.getFinishDate(), standColumn.getStatus()) ).toList(); } // 支架 @@ -249,12 +257,33 @@ public class BudDesignDrawingServiceImpl extends ServiceImpl BudDesignDrawingByBuildVo.obj2vo( supportFrame.getId(), supportFrame.getName(), supportFrame.getPositions(), - supportFrame.getFinishType(), supportFrame.getFinishDate(), - supportFrame.getStatus(), supportFrame.getProgressCategoryId(), supportFrame.getProgressCategoryName()) + supportFrame.getFinishType(), supportFrame.getFinishDate(), supportFrame.getStatus()) ).toList(); } case null -> throw new ServiceException("参数错误"); } + // 封装完成情况等信息 + List facilityList = budPlanFacilityService.lambdaQuery() + .eq(BudPlanFacility::getFacilityType, buildType) + .in(BudPlanFacility::getProjectId, projectId) + .list(); + if (CollUtil.isNotEmpty(facilityList)) { + Map map = facilityList.stream() + .collect(Collectors.toMap(BudPlanFacility::getFacilityId, Function.identity(), (a, b) -> a)); + list.forEach(item -> { + if (map.containsKey(item.getId())) { + BudPlanFacility planFacility = map.get(item.getId()); + item.setPlanId(planFacility.getPlanId()); + item.setStatus(planFacility.getStatus()); + item.setFinishType(planFacility.getFinishMethod()); + if (planFacility.getFinishTime() != null) { + item.setFinishDate(LocalDate.from(planFacility.getFinishTime())); + } + } else { + item.setStatus(BudFinishStatus.NOT_STARTED.getValue()); + } + }); + } return list; } @@ -307,7 +336,6 @@ public class BudDesignDrawingServiceImpl extends ServiceImpl buildQueryWrapper(BudDesignDrawingBo bo) { - Map params = bo.getParams(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); lqw.orderByDesc(BudDesignDrawing::getId); lqw.eq(bo.getProjectId() != null, BudDesignDrawing::getProjectId, bo.getProjectId()); @@ -320,23 +348,6 @@ public class BudDesignDrawingServiceImpl extends ServiceImpl 0; - if (flag) { - bo.setId(add.getId()); - } - return flag; - } - /** * 新增施工设施 * @@ -380,7 +391,7 @@ public class BudDesignDrawingServiceImpl extends ServiceImpl nameLayers.contains(item.getProperties().getLayer_name())) .toList(); } - BudDesignType value = BudDesignType.getEnumByValue(type); + BudFacilityType value = BudFacilityType.getEnumByValue(type); Boolean save; switch (value) { // 方阵 @@ -435,7 +446,18 @@ public class BudDesignDrawingServiceImpl extends ServiceImpl ids, Boolean isValid) { if (isValid) { - //TODO 做一些业务上的校验,判断是否需要校验 + // 删除文件 + List budDesignDrawings = this.listByIds(ids); + for (BudDesignDrawing budDesignDrawing : budDesignDrawings) { + String filePath = budDesignDrawing.getFilePath(); + File file = new File(filePath); + if (file.exists()) { + boolean delete = file.delete(); + if (!delete) { + throw new ServiceException("删除文件失败"); + } + } + } } return baseMapper.deleteByIds(ids) > 0; } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudInverterServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudInverterServiceImpl.java index ddaed1c5..34b703c7 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudInverterServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudInverterServiceImpl.java @@ -13,12 +13,14 @@ import org.dromara.build.domain.BudDesignDrawing; import org.dromara.build.domain.BudInverter; import org.dromara.build.domain.BudMatrix; import org.dromara.build.domain.bo.BudInverterBo; +import org.dromara.build.domain.enums.BudFacilityType; import org.dromara.build.domain.geojson.BudFeature; import org.dromara.build.domain.geojson.BudGeometry; import org.dromara.build.domain.vo.BudInverterVo; import org.dromara.build.mapper.BudInverterMapper; import org.dromara.build.service.IBudInverterService; import org.dromara.build.service.IBudMatrixService; +import org.dromara.build.service.IBudPlanFacilityService; import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; @@ -49,6 +51,9 @@ public class BudInverterServiceImpl extends ServiceImpl queryPageList(BudInverterBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + budPlanFacilityService.fillFinishInfo(result.getRecords(), BudFacilityType.INVERTER); return TableDataInfo.build(result); } @@ -83,7 +91,9 @@ public class BudInverterServiceImpl extends ServiceImpl queryList(BudInverterBo bo) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); - return baseMapper.selectVoList(lqw); + List voList = baseMapper.selectVoList(lqw); + budPlanFacilityService.fillFinishInfo(voList, BudFacilityType.INVERTER); + return voList; } private LambdaQueryWrapper buildQueryWrapper(BudInverterBo bo) { @@ -93,12 +103,6 @@ public class BudInverterServiceImpl extends ServiceImpl implements IBudPillarPointService { + @Resource + private IBudPlanFacilityService budPlanFacilityService; + /** * 查询光伏板桩点 * @@ -39,7 +45,9 @@ public class BudPillarPointServiceImpl extends ServiceImpl queryPageList(BudPillarPointBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + budPlanFacilityService.fillFinishInfo(result.getRecords(), BudFacilityType.PILLAR_POINT); return TableDataInfo.build(result); } @@ -65,7 +74,9 @@ public class BudPillarPointServiceImpl extends ServiceImpl queryList(BudPillarPointBo bo) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); - return baseMapper.selectVoList(lqw); + List voList = baseMapper.selectVoList(lqw); + budPlanFacilityService.fillFinishInfo(voList, BudFacilityType.PILLAR_POINT); + return voList; } private LambdaQueryWrapper buildQueryWrapper(BudPillarPointBo bo) { diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudPlanFacilityServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudPlanFacilityServiceImpl.java new file mode 100644 index 00000000..7eb67b47 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudPlanFacilityServiceImpl.java @@ -0,0 +1,286 @@ +package org.dromara.build.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.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.RequiredArgsConstructor; +import org.dromara.build.domain.BudPlanFacility; +import org.dromara.build.domain.bo.BudPlanFacilityBo; +import org.dromara.build.domain.enums.BudFacilityType; +import org.dromara.build.domain.enums.BudFinishStatus; +import org.dromara.build.domain.interfaces.BudFinishable; +import org.dromara.build.domain.vo.BudPlanFacilityVo; +import org.dromara.build.mapper.BudPlanFacilityMapper; +import org.dromara.build.service.IBudPlanFacilityService; +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.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDate; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * 施工计划关联设施Service业务层处理 + * + * @author lilemy + * @date 2025-12-23 + */ +@RequiredArgsConstructor +@Service +public class BudPlanFacilityServiceImpl extends ServiceImpl + implements IBudPlanFacilityService { + + /** + * 查询施工计划关联设施 + * + * @param id 主键 + * @return 施工计划关联设施 + */ + @Override + public BudPlanFacilityVo queryById(Long id) { + return baseMapper.selectVoById(id); + } + + /** + * 分页查询施工计划关联设施列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 施工计划关联设施分页列表 + */ + @Override + public TableDataInfo queryPageList(BudPlanFacilityBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的施工计划关联设施列表 + * + * @param bo 查询条件 + * @return 施工计划关联设施列表 + */ + @Override + public List queryList(BudPlanFacilityBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(BudPlanFacilityBo bo) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(BudPlanFacility::getId); + lqw.eq(bo.getPlanId() != null, BudPlanFacility::getPlanId, bo.getPlanId()); + lqw.eq(StringUtils.isNotBlank(bo.getFacilityType()), BudPlanFacility::getFacilityType, bo.getFacilityType()); + lqw.eq(bo.getFacilityId() != null, BudPlanFacility::getFacilityId, bo.getFacilityId()); + lqw.eq(StringUtils.isNotBlank(bo.getStatus()), BudPlanFacility::getStatus, bo.getStatus()); + lqw.eq(StringUtils.isNotBlank(bo.getFinishMethod()), BudPlanFacility::getFinishMethod, bo.getFinishMethod()); + lqw.eq(bo.getFinishTime() != null, BudPlanFacility::getFinishTime, bo.getFinishTime()); + return lqw; + } + + /** + * 新增施工计划关联设施 + * + * @param bo 施工计划关联设施 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(BudPlanFacilityBo bo) { + BudPlanFacility add = MapstructUtils.convert(bo, BudPlanFacility.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改施工计划关联设施 + * + * @param bo 施工计划关联设施 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(BudPlanFacilityBo bo) { + BudPlanFacility update = MapstructUtils.convert(bo, BudPlanFacility.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(BudPlanFacility entity) { + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除施工计划关联设施信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if (isValid) { + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } + + /** + * 保存或更新 + * + * @param projectId 项目 ID + * @param planId 计划 ID + * @param boList 列表 + * @param isUpdate 是否更新 + * @return 是否保存成功 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean saveOrUpdate(Long projectId, Long planId, List boList, Boolean isUpdate) { + // 校验当前关联设施是否存在 + List facilityIds = boList.stream().map(BudPlanFacilityBo::getFacilityId).toList(); + Long count = this.lambdaQuery() + .in(BudPlanFacility::getFacilityId, facilityIds) + .count(); + if (count > 0) { + throw new ServiceException("存在已添加计划的设施,请勿重复添加"); + } + if (isUpdate) { + // 查询当前计划的关联设施 + List oldList = this.lambdaQuery() + .eq(BudPlanFacility::getPlanId, planId) + .list(); + Set oldIdSet = oldList.stream() + .map(BudPlanFacility::getFacilityId) + .collect(Collectors.toSet()); + // 过滤掉已完成的设施 + oldList = oldList.stream() + .filter(item -> !BudFinishStatus.COMPLETED.getValue().equals(item.getStatus())) + .toList(); + // 获取需要保存的设施 + List saveList = boList.stream() + .filter(item -> !oldIdSet.contains(item.getFacilityId())) + .map(item -> buildInit(projectId, planId, item)).toList(); + // 获取需要删除的设施 + List deleteList = oldList.stream() + .filter(item -> !facilityIds.contains(item.getFacilityId())) + .toList(); + if (CollUtil.isNotEmpty(deleteList)) { + boolean b = this.removeBatchByIds(deleteList); + if (!b) { + throw new ServiceException("修改设施计划失败"); + } + } + if (CollUtil.isNotEmpty(saveList)) { + boolean b = this.saveBatch(saveList); + if (!b) { + throw new ServiceException("修改设施计划失败"); + } + } + } else { + // 新增,直接保存 + List saveList = boList.stream() + .map(item -> buildInit(projectId, planId, item)).toList(); + return this.saveBatch(saveList); + } + return true; + } + + /** + * 填充完成信息 + * + * @param target 目标对象 + * @param designType 施工类型 + */ + @Override + public void fillFinishInfo(T target, BudFacilityType designType) { + if (target == null) { + return; + } + BudPlanFacility planFacility = this.lambdaQuery() + .eq(BudPlanFacility::getFacilityId, target.getId()) + .eq(BudPlanFacility::getFacilityType, designType.getValue()) + .last("limit 1") + .one(); + + if (planFacility != null) { + target.setStatus(planFacility.getStatus()); + target.setFinishType(planFacility.getFinishMethod()); + if (planFacility.getFinishTime() != null) { + target.setFinishDate(LocalDate.from(planFacility.getFinishTime())); + } + } + } + + /** + * 填充完成信息 + * + * @param list 列表 + * @param designType 施工类型 + */ + @Override + public void fillFinishInfo(List list, BudFacilityType designType) { + if (CollUtil.isEmpty(list)) { + return; + } + List ids = list.stream() + .map(BudFinishable::getId) + .toList(); + List planFacilityList = this.lambdaQuery() + .in(BudPlanFacility::getFacilityId, ids) + .eq(BudPlanFacility::getFacilityType, designType.getValue()) + .list(); + if (CollUtil.isEmpty(planFacilityList)) { + list.forEach(v -> + v.setStatus(BudFinishStatus.NOT_STARTED.getValue()) + ); + return; + } + Map facilityMap = planFacilityList.stream() + .collect(Collectors.toMap(BudPlanFacility::getFacilityId, v -> v)); + list.forEach(v -> { + BudPlanFacility pf = facilityMap.get(v.getId()); + if (pf != null) { + v.setStatus(pf.getStatus()); + v.setFinishType(pf.getFinishMethod()); + if (pf.getFinishTime() != null) { + v.setFinishDate(LocalDate.from(pf.getFinishTime())); + } + } + }); + } + + /** + * 构建初始数据 + * + * @param projectId 项目 ID + * @param planId 计划 ID + * @param bo bo + * @return 初始数据 + */ + private BudPlanFacility buildInit(Long projectId, Long planId, BudPlanFacilityBo bo) { + BudPlanFacility facility = new BudPlanFacility(); + facility.setProjectId(projectId); + facility.setPlanId(planId); + facility.setFacilityType(bo.getFacilityType()); + facility.setFacilityId(bo.getFacilityId()); + facility.setStatus(BudFinishStatus.IN_PROGRESS.getValue()); + return facility; + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudSolarPanelBaseServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudSolarPanelBaseServiceImpl.java index cf43b52b..36edfb10 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudSolarPanelBaseServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudSolarPanelBaseServiceImpl.java @@ -19,6 +19,8 @@ import java.util.function.Function; import java.util.stream.Collectors; /** + * 光伏板基础信息(桩点、立柱、支架)服务实现类 + * * @author lilemy * @date 2025-12-19 14:54 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudSolarPanelServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudSolarPanelServiceImpl.java index 049a00d9..48cc5e9c 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudSolarPanelServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudSolarPanelServiceImpl.java @@ -13,11 +13,13 @@ import org.dromara.build.domain.BudDesignDrawing; import org.dromara.build.domain.BudMatrix; import org.dromara.build.domain.BudSolarPanel; import org.dromara.build.domain.bo.BudSolarPanelBo; +import org.dromara.build.domain.enums.BudFacilityType; import org.dromara.build.domain.geojson.BudFeature; import org.dromara.build.domain.geojson.BudProperties; import org.dromara.build.domain.vo.BudSolarPanelVo; import org.dromara.build.mapper.BudSolarPanelMapper; import org.dromara.build.service.IBudMatrixService; +import org.dromara.build.service.IBudPlanFacilityService; import org.dromara.build.service.IBudSolarPanelService; import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.utils.MapstructUtils; @@ -48,6 +50,9 @@ public class BudSolarPanelServiceImpl extends ServiceImpl queryPageList(BudSolarPanelBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + budPlanFacilityService.fillFinishInfo(result.getRecords(), BudFacilityType.SOLAR_PANEL); return TableDataInfo.build(result); } @@ -82,7 +90,9 @@ public class BudSolarPanelServiceImpl extends ServiceImpl queryList(BudSolarPanelBo bo) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); - return baseMapper.selectVoList(lqw); + List voList = baseMapper.selectVoList(lqw); + budPlanFacilityService.fillFinishInfo(voList, BudFacilityType.SOLAR_PANEL); + return voList; } private LambdaQueryWrapper buildQueryWrapper(BudSolarPanelBo bo) { diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudStandColumnServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudStandColumnServiceImpl.java index f4c1f606..317b1b54 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudStandColumnServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudStandColumnServiceImpl.java @@ -4,11 +4,14 @@ 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 jakarta.annotation.Resource; import lombok.RequiredArgsConstructor; import org.dromara.build.domain.BudStandColumn; import org.dromara.build.domain.bo.BudStandColumnBo; +import org.dromara.build.domain.enums.BudFacilityType; import org.dromara.build.domain.vo.BudStandColumnVo; import org.dromara.build.mapper.BudStandColumnMapper; +import org.dromara.build.service.IBudPlanFacilityService; import org.dromara.build.service.IBudStandColumnService; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; @@ -31,6 +34,9 @@ import java.util.Map; public class BudStandColumnServiceImpl extends ServiceImpl implements IBudStandColumnService { + @Resource + private IBudPlanFacilityService budPlanFacilityService; + /** * 查询光伏板立柱 * @@ -39,7 +45,9 @@ public class BudStandColumnServiceImpl extends ServiceImpl queryPageList(BudStandColumnBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + budPlanFacilityService.fillFinishInfo(result.getRecords(), BudFacilityType.STAND_COLUMN); return TableDataInfo.build(result); } @@ -65,7 +74,9 @@ public class BudStandColumnServiceImpl extends ServiceImpl queryList(BudStandColumnBo bo) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); - return baseMapper.selectVoList(lqw); + List voList = baseMapper.selectVoList(lqw); + budPlanFacilityService.fillFinishInfo(voList, BudFacilityType.STAND_COLUMN); + return voList; } private LambdaQueryWrapper buildQueryWrapper(BudStandColumnBo bo) { diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudSupportFrameServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudSupportFrameServiceImpl.java index faaa5f32..0a1652e6 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudSupportFrameServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/build/service/impl/BudSupportFrameServiceImpl.java @@ -4,11 +4,14 @@ 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 jakarta.annotation.Resource; import lombok.RequiredArgsConstructor; import org.dromara.build.domain.BudSupportFrame; import org.dromara.build.domain.bo.BudSupportFrameBo; +import org.dromara.build.domain.enums.BudFacilityType; import org.dromara.build.domain.vo.BudSupportFrameVo; import org.dromara.build.mapper.BudSupportFrameMapper; +import org.dromara.build.service.IBudPlanFacilityService; import org.dromara.build.service.IBudSupportFrameService; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; @@ -31,6 +34,9 @@ import java.util.Map; public class BudSupportFrameServiceImpl extends ServiceImpl implements IBudSupportFrameService { + @Resource + private IBudPlanFacilityService budPlanFacilityService; + /** * 查询光伏板支架 * @@ -39,7 +45,9 @@ public class BudSupportFrameServiceImpl extends ServiceImpl queryPageList(BudSupportFrameBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + budPlanFacilityService.fillFinishInfo(result.getRecords(), BudFacilityType.SUPPORT_FRAME); return TableDataInfo.build(result); } @@ -65,7 +74,9 @@ public class BudSupportFrameServiceImpl extends ServiceImpl queryList(BudSupportFrameBo bo) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); - return baseMapper.selectVoList(lqw); + List voList = baseMapper.selectVoList(lqw); + budPlanFacilityService.fillFinishInfo(voList, BudFacilityType.SUPPORT_FRAME); + return voList; } private LambdaQueryWrapper buildQueryWrapper(BudSupportFrameBo bo) { diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/build/BudConstructionPlanMapper.xml b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/build/BudConstructionPlanMapper.xml new file mode 100644 index 00000000..17305230 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/build/BudConstructionPlanMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/build/BudPlanFacilityMapper.xml b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/build/BudPlanFacilityMapper.xml new file mode 100644 index 00000000..231bf217 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/resources/mapper/build/BudPlanFacilityMapper.xml @@ -0,0 +1,7 @@ + + + + +