Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@ -310,7 +310,7 @@ public class ProgressBigScreenServiceImpl implements ProgressBigScreenService {
|
||||
reviewedDesignLastM = reviewedDesignLastM.add(BigDecimal.ONE);
|
||||
}
|
||||
}
|
||||
} else if (BusinessStatusEnum.WAITING.getStatus().equals(status)) {
|
||||
} else if (BusinessStatusEnum.WAITING.getStatus().equals(status) || BusinessStatusEnum.DRAFT.getStatus().equals(status)) {
|
||||
pendingReviewDesign++;
|
||||
Date createTime = file.getCreateTime();
|
||||
LocalDate createDate = createTime.toInstant()
|
||||
|
||||
@ -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<BudConstructionPlanVo> 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<BudConstructionPlanVo> list = budConstructionPlanService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "施工完成计划", BudConstructionPlanVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取施工完成计划详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("build:constructionPlan:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BudConstructionPlanVo> 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<Void> 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<Void> 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<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(budConstructionPlanService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* 施工模板组(汇总)
|
||||
|
||||
@ -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<BudPlanFacilityVo> 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<BudPlanFacilityVo> list = budPlanFacilityService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "施工计划关联设施", BudPlanFacilityVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取施工计划关联设施详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("build:planFacility:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BudPlanFacilityVo> 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<Void> 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<Void> 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<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(budPlanFacilityService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@ -50,7 +50,7 @@ public class BudBoxChange extends BaseEntity {
|
||||
private String positions;
|
||||
|
||||
/**
|
||||
* 完成状态(0未开始 1进行中 2完成)
|
||||
* 完成状态(0未开始 1进行中 2已延期 3已完成)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
}
|
||||
@ -50,7 +50,7 @@ public class BudInverter extends BaseEntity {
|
||||
private String positions;
|
||||
|
||||
/**
|
||||
* 完成状态(0未开始 1进行中 2完成)
|
||||
* 完成状态(0未开始 1进行中 2已延期 3已完成)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ public class BudPillarPoint extends BaseEntity {
|
||||
private String positions;
|
||||
|
||||
/**
|
||||
* 完成状态(0未开始 1进行中 2完成)
|
||||
* 完成状态(0未开始 1进行中 2已延期 3已完成)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
}
|
||||
@ -50,7 +50,7 @@ public class BudSolarPanel extends BaseEntity {
|
||||
private String positions;
|
||||
|
||||
/**
|
||||
* 完成状态(0未开始 1进行中 2完成)
|
||||
* 完成状态(0未开始 1进行中 2已延期 3已完成)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ public class BudStandColumn extends BaseEntity {
|
||||
private String positions;
|
||||
|
||||
/**
|
||||
* 完成状态(0未开始 1进行中 2完成)
|
||||
* 完成状态(0未开始 1进行中 2已延期 3已完成)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ public class BudSupportFrame extends BaseEntity {
|
||||
private String positions;
|
||||
|
||||
/**
|
||||
* 完成状态(0未开始 1进行中 2完成)
|
||||
* 完成状态(0未开始 1进行中 2已延期 3已完成)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@ -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<BudPlanFacilityBo> planFacilityList;
|
||||
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@ -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;
|
||||
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
@ -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=完成")
|
||||
|
||||
@ -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;
|
||||
|
||||
}
|
||||
@ -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);
|
||||
|
||||
@ -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=完成")
|
||||
|
||||
@ -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=完成")
|
||||
|
||||
@ -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;
|
||||
|
||||
}
|
||||
@ -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=完成")
|
||||
|
||||
@ -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=完成")
|
||||
|
||||
@ -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=完成")
|
||||
|
||||
@ -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<BudConstructionPlan, BudConstructionPlanVo> {
|
||||
|
||||
}
|
||||
@ -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<BudPlanFacility, BudPlanFacilityVo> {
|
||||
|
||||
}
|
||||
@ -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<BudConstructionPlan> {
|
||||
|
||||
/**
|
||||
* 查询施工完成计划
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 施工完成计划
|
||||
*/
|
||||
BudConstructionPlanVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询施工完成计划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 施工完成计划分页列表
|
||||
*/
|
||||
TableDataInfo<BudConstructionPlanVo> queryPageList(BudConstructionPlanBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的施工完成计划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 施工完成计划列表
|
||||
*/
|
||||
List<BudConstructionPlanVo> 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<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -83,14 +83,6 @@ public interface IBudDesignDrawingService extends IService<BudDesignDrawing> {
|
||||
*/
|
||||
Boolean insertByCadFile(MultipartFile file, BudDesignDrawingUploadReq req);
|
||||
|
||||
/**
|
||||
* 新增施工设计图
|
||||
*
|
||||
* @param bo 施工设计图
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BudDesignDrawingBo bo);
|
||||
|
||||
/**
|
||||
* 新增施工设施
|
||||
*
|
||||
|
||||
@ -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<BudPlanFacility> {
|
||||
|
||||
/**
|
||||
* 查询施工计划关联设施
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 施工计划关联设施
|
||||
*/
|
||||
BudPlanFacilityVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询施工计划关联设施列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 施工计划关联设施分页列表
|
||||
*/
|
||||
TableDataInfo<BudPlanFacilityVo> queryPageList(BudPlanFacilityBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的施工计划关联设施列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 施工计划关联设施列表
|
||||
*/
|
||||
List<BudPlanFacilityVo> 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<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 保存或更新
|
||||
*
|
||||
* @param projectId 项目 ID
|
||||
* @param planId 计划 ID
|
||||
* @param boList 列表
|
||||
* @param isUpdate 是否更新
|
||||
* @return 是否保存成功
|
||||
*/
|
||||
Boolean saveOrUpdate(Long projectId, Long planId, List<BudPlanFacilityBo> boList, Boolean isUpdate);
|
||||
|
||||
/**
|
||||
* 填充完成信息
|
||||
*
|
||||
* @param target 目标对象
|
||||
* @param designType 施工类型
|
||||
*/
|
||||
<T extends BudFinishable> void fillFinishInfo(T target, BudFacilityType designType);
|
||||
|
||||
/**
|
||||
* 填充完成信息
|
||||
*
|
||||
* @param list 列表
|
||||
* @param designType 施工类型
|
||||
*/
|
||||
<T extends BudFinishable> void fillFinishInfo(List<T> list, BudFacilityType designType);
|
||||
}
|
||||
@ -6,6 +6,8 @@ import org.dromara.build.domain.geojson.BudFeature;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 光伏板基础信息(桩点、立柱、支架)服务
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-19 14:52
|
||||
*/
|
||||
|
||||
@ -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<BudBoxChangeMapper, Bud
|
||||
@Resource
|
||||
private IBudMatrixService budMatrixService;
|
||||
|
||||
@Resource
|
||||
private IBudPlanFacilityService budPlanFacilityService;
|
||||
|
||||
/**
|
||||
* 查询箱变
|
||||
*
|
||||
@ -57,7 +61,9 @@ public class BudBoxChangeServiceImpl extends ServiceImpl<BudBoxChangeMapper, Bud
|
||||
*/
|
||||
@Override
|
||||
public BudBoxChangeVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
BudBoxChangeVo budBoxChangeVo = baseMapper.selectVoById(id);
|
||||
budPlanFacilityService.fillFinishInfo(budBoxChangeVo, BudFacilityType.BOX_CHANGE);
|
||||
return budBoxChangeVo;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -71,6 +77,7 @@ public class BudBoxChangeServiceImpl extends ServiceImpl<BudBoxChangeMapper, Bud
|
||||
public TableDataInfo<BudBoxChangeVo> queryPageList(BudBoxChangeBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BudBoxChange> lqw = buildQueryWrapper(bo);
|
||||
Page<BudBoxChangeVo> 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<BudBoxChangeMapper, Bud
|
||||
@Override
|
||||
public List<BudBoxChangeVo> queryList(BudBoxChangeBo bo) {
|
||||
LambdaQueryWrapper<BudBoxChange> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
List<BudBoxChangeVo> voList = baseMapper.selectVoList(lqw);
|
||||
budPlanFacilityService.fillFinishInfo(voList, BudFacilityType.BOX_CHANGE);
|
||||
return voList;
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BudBoxChange> buildQueryWrapper(BudBoxChangeBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BudBoxChange> 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;
|
||||
}
|
||||
|
||||
|
||||
@ -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<BudConstructionPlanMapper, BudConstructionPlan>
|
||||
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<BudConstructionPlanVo> queryPageList(BudConstructionPlanBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BudConstructionPlan> lqw = buildQueryWrapper(bo);
|
||||
Page<BudConstructionPlanVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的施工完成计划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 施工完成计划列表
|
||||
*/
|
||||
@Override
|
||||
public List<BudConstructionPlanVo> queryList(BudConstructionPlanBo bo) {
|
||||
LambdaQueryWrapper<BudConstructionPlan> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BudConstructionPlan> buildQueryWrapper(BudConstructionPlanBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BudConstructionPlan> 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<BudConstructionPlan> 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<Long> ids, Boolean isValid) {
|
||||
List<BudPlanFacility> 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;
|
||||
}
|
||||
}
|
||||
@ -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<BudDesignDrawingMap
|
||||
@Resource
|
||||
private IBudSupportFrameService budSupportFrameService;
|
||||
|
||||
@Resource
|
||||
private IBudPlanFacilityService budPlanFacilityService;
|
||||
|
||||
/**
|
||||
* 查询施工设计图
|
||||
*
|
||||
@ -165,7 +172,7 @@ public class BudDesignDrawingServiceImpl extends ServiceImpl<BudDesignDrawingMap
|
||||
String buildType = req.getBuildType();
|
||||
Long projectId = req.getProjectId();
|
||||
Long matrixId = req.getMatrixId();
|
||||
BudDesignType value = BudDesignType.getEnumByValue(buildType);
|
||||
BudFacilityType value = BudFacilityType.getEnumByValue(buildType);
|
||||
List<BudDesignDrawingByBuildVo> list;
|
||||
switch (value) {
|
||||
// 方阵
|
||||
@ -175,8 +182,8 @@ public class BudDesignDrawingServiceImpl extends ServiceImpl<BudDesignDrawingMap
|
||||
.eq(matrixId != null, BudMatrix::getId, matrixId)
|
||||
.list();
|
||||
list = matrixList.stream().map(matrix -> 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<BudDesignDrawingMap
|
||||
.eq(matrixId != null, BudSolarPanel::getMatrixId, matrixId)
|
||||
.list();
|
||||
list = photovoltaicPanelList.stream().map(panel -> 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<BudDesignDrawingMap
|
||||
.eq(matrixId != null, BudInverter::getMatrixId, matrixId)
|
||||
.list();
|
||||
list = inverterList.stream().map(inverter -> 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<BudDesignDrawingMap
|
||||
.eq(matrixId != null, BudBoxChange::getMatrixId, matrixId)
|
||||
.list();
|
||||
list = boxChangeList.stream().map(boxChange -> 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<BudDesignDrawingMap
|
||||
.eq(BudRedLine::getProjectId, projectId)
|
||||
.list();
|
||||
list = redLineList.stream().map(redLine -> 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<BudDesignDrawingMap
|
||||
.list();
|
||||
list = pillarPointList.stream().map(pillarPoint -> 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<BudDesignDrawingMap
|
||||
.list();
|
||||
list = standColumnList.stream().map(standColumn -> 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<BudDesignDrawingMap
|
||||
.list();
|
||||
list = supportFrameList.stream().map(supportFrame -> 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<BudPlanFacility> facilityList = budPlanFacilityService.lambdaQuery()
|
||||
.eq(BudPlanFacility::getFacilityType, buildType)
|
||||
.in(BudPlanFacility::getProjectId, projectId)
|
||||
.list();
|
||||
if (CollUtil.isNotEmpty(facilityList)) {
|
||||
Map<Long, BudPlanFacility> 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<BudDesignDrawingMap
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BudDesignDrawing> buildQueryWrapper(BudDesignDrawingBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BudDesignDrawing> 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<BudDesignDrawingMap
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增施工设计图
|
||||
*
|
||||
* @param bo 施工设计图
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BudDesignDrawingBo bo) {
|
||||
BudDesignDrawing add = MapstructUtils.convert(bo, BudDesignDrawing.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增施工设施
|
||||
*
|
||||
@ -380,7 +391,7 @@ public class BudDesignDrawingServiceImpl extends ServiceImpl<BudDesignDrawingMap
|
||||
.filter(item -> 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<BudDesignDrawingMap
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
// 删除文件
|
||||
List<BudDesignDrawing> 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;
|
||||
}
|
||||
|
||||
@ -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<BudInverterMapper, BudIn
|
||||
@Resource
|
||||
private IBudMatrixService budMatrixService;
|
||||
|
||||
@Resource
|
||||
private IBudPlanFacilityService budPlanFacilityService;
|
||||
|
||||
/**
|
||||
* 查询逆变器
|
||||
*
|
||||
@ -57,7 +62,9 @@ public class BudInverterServiceImpl extends ServiceImpl<BudInverterMapper, BudIn
|
||||
*/
|
||||
@Override
|
||||
public BudInverterVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
BudInverterVo vo = baseMapper.selectVoById(id);
|
||||
budPlanFacilityService.fillFinishInfo(vo, BudFacilityType.INVERTER);
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -71,6 +78,7 @@ public class BudInverterServiceImpl extends ServiceImpl<BudInverterMapper, BudIn
|
||||
public TableDataInfo<BudInverterVo> queryPageList(BudInverterBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BudInverter> lqw = buildQueryWrapper(bo);
|
||||
Page<BudInverterVo> 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<BudInverterMapper, BudIn
|
||||
@Override
|
||||
public List<BudInverterVo> queryList(BudInverterBo bo) {
|
||||
LambdaQueryWrapper<BudInverter> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
List<BudInverterVo> voList = baseMapper.selectVoList(lqw);
|
||||
budPlanFacilityService.fillFinishInfo(voList, BudFacilityType.INVERTER);
|
||||
return voList;
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BudInverter> buildQueryWrapper(BudInverterBo bo) {
|
||||
@ -93,12 +103,6 @@ public class BudInverterServiceImpl extends ServiceImpl<BudInverterMapper, BudIn
|
||||
lqw.eq(bo.getProjectId() != null, BudInverter::getProjectId, bo.getProjectId());
|
||||
lqw.eq(bo.getMatrixId() != null, BudInverter::getMatrixId, bo.getMatrixId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), BudInverter::getName, bo.getName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPositions()), BudInverter::getPositions, bo.getPositions());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), BudInverter::getStatus, bo.getStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFinishType()), BudInverter::getFinishType, bo.getFinishType());
|
||||
lqw.eq(bo.getFinishDate() != null, BudInverter::getFinishDate, bo.getFinishDate());
|
||||
lqw.eq(bo.getProgressCategoryId() != null, BudInverter::getProgressCategoryId, bo.getProgressCategoryId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getProgressCategoryName()), BudInverter::getProgressCategoryName, bo.getProgressCategoryName());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
@ -4,12 +4,15 @@ 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.BudPillarPoint;
|
||||
import org.dromara.build.domain.bo.BudPillarPointBo;
|
||||
import org.dromara.build.domain.enums.BudFacilityType;
|
||||
import org.dromara.build.domain.vo.BudPillarPointVo;
|
||||
import org.dromara.build.mapper.BudPillarPointMapper;
|
||||
import org.dromara.build.service.IBudPillarPointService;
|
||||
import org.dromara.build.service.IBudPlanFacilityService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
@ -31,6 +34,9 @@ import java.util.Map;
|
||||
public class BudPillarPointServiceImpl extends ServiceImpl<BudPillarPointMapper, BudPillarPoint>
|
||||
implements IBudPillarPointService {
|
||||
|
||||
@Resource
|
||||
private IBudPlanFacilityService budPlanFacilityService;
|
||||
|
||||
/**
|
||||
* 查询光伏板桩点
|
||||
*
|
||||
@ -39,7 +45,9 @@ public class BudPillarPointServiceImpl extends ServiceImpl<BudPillarPointMapper,
|
||||
*/
|
||||
@Override
|
||||
public BudPillarPointVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
BudPillarPointVo vo = baseMapper.selectVoById(id);
|
||||
budPlanFacilityService.fillFinishInfo(vo, BudFacilityType.PILLAR_POINT);
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -53,6 +61,7 @@ public class BudPillarPointServiceImpl extends ServiceImpl<BudPillarPointMapper,
|
||||
public TableDataInfo<BudPillarPointVo> queryPageList(BudPillarPointBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BudPillarPoint> lqw = buildQueryWrapper(bo);
|
||||
Page<BudPillarPointVo> 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<BudPillarPointMapper,
|
||||
@Override
|
||||
public List<BudPillarPointVo> queryList(BudPillarPointBo bo) {
|
||||
LambdaQueryWrapper<BudPillarPoint> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
List<BudPillarPointVo> voList = baseMapper.selectVoList(lqw);
|
||||
budPlanFacilityService.fillFinishInfo(voList, BudFacilityType.PILLAR_POINT);
|
||||
return voList;
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BudPillarPoint> buildQueryWrapper(BudPillarPointBo bo) {
|
||||
|
||||
@ -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<BudPlanFacilityMapper, BudPlanFacility>
|
||||
implements IBudPlanFacilityService {
|
||||
|
||||
/**
|
||||
* 查询施工计划关联设施
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 施工计划关联设施
|
||||
*/
|
||||
@Override
|
||||
public BudPlanFacilityVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询施工计划关联设施列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 施工计划关联设施分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BudPlanFacilityVo> queryPageList(BudPlanFacilityBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BudPlanFacility> lqw = buildQueryWrapper(bo);
|
||||
Page<BudPlanFacilityVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的施工计划关联设施列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 施工计划关联设施列表
|
||||
*/
|
||||
@Override
|
||||
public List<BudPlanFacilityVo> queryList(BudPlanFacilityBo bo) {
|
||||
LambdaQueryWrapper<BudPlanFacility> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BudPlanFacility> buildQueryWrapper(BudPlanFacilityBo bo) {
|
||||
LambdaQueryWrapper<BudPlanFacility> 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<Long> 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<BudPlanFacilityBo> boList, Boolean isUpdate) {
|
||||
// 校验当前关联设施是否存在
|
||||
List<Long> 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<BudPlanFacility> oldList = this.lambdaQuery()
|
||||
.eq(BudPlanFacility::getPlanId, planId)
|
||||
.list();
|
||||
Set<Long> oldIdSet = oldList.stream()
|
||||
.map(BudPlanFacility::getFacilityId)
|
||||
.collect(Collectors.toSet());
|
||||
// 过滤掉已完成的设施
|
||||
oldList = oldList.stream()
|
||||
.filter(item -> !BudFinishStatus.COMPLETED.getValue().equals(item.getStatus()))
|
||||
.toList();
|
||||
// 获取需要保存的设施
|
||||
List<BudPlanFacility> saveList = boList.stream()
|
||||
.filter(item -> !oldIdSet.contains(item.getFacilityId()))
|
||||
.map(item -> buildInit(projectId, planId, item)).toList();
|
||||
// 获取需要删除的设施
|
||||
List<BudPlanFacility> 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<BudPlanFacility> saveList = boList.stream()
|
||||
.map(item -> buildInit(projectId, planId, item)).toList();
|
||||
return this.saveBatch(saveList);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 填充完成信息
|
||||
*
|
||||
* @param target 目标对象
|
||||
* @param designType 施工类型
|
||||
*/
|
||||
@Override
|
||||
public <T extends BudFinishable> 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 <T extends BudFinishable> void fillFinishInfo(List<T> list, BudFacilityType designType) {
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
List<Long> ids = list.stream()
|
||||
.map(BudFinishable::getId)
|
||||
.toList();
|
||||
List<BudPlanFacility> 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<Long, BudPlanFacility> 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;
|
||||
}
|
||||
}
|
||||
@ -19,6 +19,8 @@ import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 光伏板基础信息(桩点、立柱、支架)服务实现类
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-19 14:54
|
||||
*/
|
||||
|
||||
@ -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<BudSolarPanelMapper, B
|
||||
@Resource
|
||||
private IBudMatrixService budMatrixService;
|
||||
|
||||
@Resource
|
||||
private IBudPlanFacilityService budPlanFacilityService;
|
||||
|
||||
/**
|
||||
* 查询光伏板
|
||||
*
|
||||
@ -56,7 +61,9 @@ public class BudSolarPanelServiceImpl extends ServiceImpl<BudSolarPanelMapper, B
|
||||
*/
|
||||
@Override
|
||||
public BudSolarPanelVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
BudSolarPanelVo vo = baseMapper.selectVoById(id);
|
||||
budPlanFacilityService.fillFinishInfo(vo, BudFacilityType.SOLAR_PANEL);
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -70,6 +77,7 @@ public class BudSolarPanelServiceImpl extends ServiceImpl<BudSolarPanelMapper, B
|
||||
public TableDataInfo<BudSolarPanelVo> queryPageList(BudSolarPanelBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BudSolarPanel> lqw = buildQueryWrapper(bo);
|
||||
Page<BudSolarPanelVo> 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<BudSolarPanelMapper, B
|
||||
@Override
|
||||
public List<BudSolarPanelVo> queryList(BudSolarPanelBo bo) {
|
||||
LambdaQueryWrapper<BudSolarPanel> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
List<BudSolarPanelVo> voList = baseMapper.selectVoList(lqw);
|
||||
budPlanFacilityService.fillFinishInfo(voList, BudFacilityType.SOLAR_PANEL);
|
||||
return voList;
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BudSolarPanel> buildQueryWrapper(BudSolarPanelBo bo) {
|
||||
|
||||
@ -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<BudStandColumnMapper, BudStandColumn>
|
||||
implements IBudStandColumnService {
|
||||
|
||||
@Resource
|
||||
private IBudPlanFacilityService budPlanFacilityService;
|
||||
|
||||
/**
|
||||
* 查询光伏板立柱
|
||||
*
|
||||
@ -39,7 +45,9 @@ public class BudStandColumnServiceImpl extends ServiceImpl<BudStandColumnMapper,
|
||||
*/
|
||||
@Override
|
||||
public BudStandColumnVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
BudStandColumnVo vo = baseMapper.selectVoById(id);
|
||||
budPlanFacilityService.fillFinishInfo(vo, BudFacilityType.STAND_COLUMN);
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -53,6 +61,7 @@ public class BudStandColumnServiceImpl extends ServiceImpl<BudStandColumnMapper,
|
||||
public TableDataInfo<BudStandColumnVo> queryPageList(BudStandColumnBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BudStandColumn> lqw = buildQueryWrapper(bo);
|
||||
Page<BudStandColumnVo> 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<BudStandColumnMapper,
|
||||
@Override
|
||||
public List<BudStandColumnVo> queryList(BudStandColumnBo bo) {
|
||||
LambdaQueryWrapper<BudStandColumn> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
List<BudStandColumnVo> voList = baseMapper.selectVoList(lqw);
|
||||
budPlanFacilityService.fillFinishInfo(voList, BudFacilityType.STAND_COLUMN);
|
||||
return voList;
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BudStandColumn> buildQueryWrapper(BudStandColumnBo bo) {
|
||||
|
||||
@ -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<BudSupportFrameMapper, BudSupportFrame>
|
||||
implements IBudSupportFrameService {
|
||||
|
||||
@Resource
|
||||
private IBudPlanFacilityService budPlanFacilityService;
|
||||
|
||||
/**
|
||||
* 查询光伏板支架
|
||||
*
|
||||
@ -39,7 +45,9 @@ public class BudSupportFrameServiceImpl extends ServiceImpl<BudSupportFrameMappe
|
||||
*/
|
||||
@Override
|
||||
public BudSupportFrameVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
BudSupportFrameVo vo = baseMapper.selectVoById(id);
|
||||
budPlanFacilityService.fillFinishInfo(vo, BudFacilityType.SUPPORT_FRAME);
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -53,6 +61,7 @@ public class BudSupportFrameServiceImpl extends ServiceImpl<BudSupportFrameMappe
|
||||
public TableDataInfo<BudSupportFrameVo> queryPageList(BudSupportFrameBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BudSupportFrame> lqw = buildQueryWrapper(bo);
|
||||
Page<BudSupportFrameVo> 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<BudSupportFrameMappe
|
||||
@Override
|
||||
public List<BudSupportFrameVo> queryList(BudSupportFrameBo bo) {
|
||||
LambdaQueryWrapper<BudSupportFrame> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
List<BudSupportFrameVo> voList = baseMapper.selectVoList(lqw);
|
||||
budPlanFacilityService.fillFinishInfo(voList, BudFacilityType.SUPPORT_FRAME);
|
||||
return voList;
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BudSupportFrame> buildQueryWrapper(BudSupportFrameBo bo) {
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.build.mapper.BudConstructionPlanMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.build.mapper.BudPlanFacilityMapper">
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user