施工模版
This commit is contained in:
@ -380,4 +380,4 @@ rabbitmq:
|
||||
dead-letter-queue: dev-dlx-queue
|
||||
dead-letter-routing-key: dev.dlx.routing.key
|
||||
cad:
|
||||
url: http://192.168.110.186:8911
|
||||
url: http://192.168.110.2:8911
|
||||
|
||||
@ -355,4 +355,4 @@ rabbitmq:
|
||||
dead-letter-queue: local-dlx-queue
|
||||
dead-letter-routing-key: local.dlx.routing.key
|
||||
cad:
|
||||
url: http://192.168.110.186:8911
|
||||
url: http://192.168.110.2:8911
|
||||
|
||||
@ -355,4 +355,4 @@ rabbitmq:
|
||||
dead-letter-queue: local-dlx-queue
|
||||
dead-letter-routing-key: local.dlx.routing.key
|
||||
cad:
|
||||
url: http://192.168.110.186:8911
|
||||
url: http://192.168.110.2:8911
|
||||
|
||||
@ -370,4 +370,4 @@ rabbitmq:
|
||||
dead-letter-queue: prod-dlx-queue
|
||||
dead-letter-routing-key: prod.dlx.routing.key
|
||||
cad:
|
||||
url: http://192.168.110.186:8911
|
||||
url: http://192.168.110.2:8911
|
||||
|
||||
@ -0,0 +1,105 @@
|
||||
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 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.BudConstructionTemplateVo;
|
||||
import org.dromara.build.domain.bo.BudConstructionTemplateBo;
|
||||
import org.dromara.build.service.IBudConstructionTemplateService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 施工模版
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-22
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/build/constructionTemplate")
|
||||
public class BudConstructionTemplateController extends BaseController {
|
||||
|
||||
private final IBudConstructionTemplateService budConstructionTemplateService;
|
||||
|
||||
/**
|
||||
* 查询施工模版列表
|
||||
*/
|
||||
@SaCheckPermission("build:constructionTemplate:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BudConstructionTemplateVo> list(BudConstructionTemplateBo bo, PageQuery pageQuery) {
|
||||
return budConstructionTemplateService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出施工模版列表
|
||||
*/
|
||||
@SaCheckPermission("build:constructionTemplate:export")
|
||||
@Log(title = "施工模版", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BudConstructionTemplateBo bo, HttpServletResponse response) {
|
||||
List<BudConstructionTemplateVo> list = budConstructionTemplateService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "施工模版", BudConstructionTemplateVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取施工模版详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("build:constructionTemplate:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BudConstructionTemplateVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(budConstructionTemplateService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增施工模版
|
||||
*/
|
||||
@SaCheckPermission("build:constructionTemplate:add")
|
||||
@Log(title = "施工模版", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BudConstructionTemplateBo bo) {
|
||||
return toAjax(budConstructionTemplateService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改施工模版
|
||||
*/
|
||||
@SaCheckPermission("build:constructionTemplate:edit")
|
||||
@Log(title = "施工模版", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BudConstructionTemplateBo bo) {
|
||||
return toAjax(budConstructionTemplateService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除施工模版
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("build:constructionTemplate:remove")
|
||||
@Log(title = "施工模版", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(budConstructionTemplateService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,105 @@
|
||||
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 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.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 施工模板组(汇总)
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-22
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/build/constructionTemplateGroup")
|
||||
public class BudConstructionTemplateGroupController extends BaseController {
|
||||
|
||||
private final IBudConstructionTemplateGroupService budConstructionTemplateGroupService;
|
||||
|
||||
/**
|
||||
* 查询施工模板组(汇总)列表
|
||||
*/
|
||||
@SaCheckPermission("build:constructionTemplateGroup:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BudConstructionTemplateGroupVo> list(BudConstructionTemplateGroupBo bo, PageQuery pageQuery) {
|
||||
return budConstructionTemplateGroupService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出施工模板组(汇总)列表
|
||||
*/
|
||||
@SaCheckPermission("build:constructionTemplateGroup:export")
|
||||
@Log(title = "施工模板组(汇总)", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BudConstructionTemplateGroupBo bo, HttpServletResponse response) {
|
||||
List<BudConstructionTemplateGroupVo> list = budConstructionTemplateGroupService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "施工模板组(汇总)", BudConstructionTemplateGroupVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取施工模板组(汇总)详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("build:constructionTemplateGroup:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BudConstructionTemplateGroupVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(budConstructionTemplateGroupService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增施工模板组(汇总)
|
||||
*/
|
||||
@SaCheckPermission("build:constructionTemplateGroup:add")
|
||||
@Log(title = "施工模板组(汇总)", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BudConstructionTemplateGroupBo bo) {
|
||||
return toAjax(budConstructionTemplateGroupService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改施工模板组(汇总)
|
||||
*/
|
||||
@SaCheckPermission("build:constructionTemplateGroup:edit")
|
||||
@Log(title = "施工模板组(汇总)", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BudConstructionTemplateGroupBo bo) {
|
||||
return toAjax(budConstructionTemplateGroupService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除施工模板组(汇总)
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("build:constructionTemplateGroup:remove")
|
||||
@Log(title = "施工模板组(汇总)", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(budConstructionTemplateGroupService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package org.dromara.build.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 施工和项目类型关联对象 bud_construction_project_rel
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bud_construction_project_rel")
|
||||
public class BudConstructionProjectRel extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 施工模版 ID
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
private Long constructionId;
|
||||
|
||||
/**
|
||||
* 项目类型 ID
|
||||
*/
|
||||
private Long projectTypeId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 施工模版对象 bud_construction_template
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bud_construction_template")
|
||||
public class BudConstructionTemplate extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键 ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 施工模板组 ID
|
||||
*/
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 父模版 ID
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 模版名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 计量方式(0无 1数量 2百分比)
|
||||
*/
|
||||
private String unitType;
|
||||
|
||||
/**
|
||||
* 工作类型
|
||||
*/
|
||||
private String workType;
|
||||
|
||||
/**
|
||||
* 关联结构(1项目 2方阵 3子项目)
|
||||
*/
|
||||
private String relevancyStructure;
|
||||
|
||||
/**
|
||||
* 祖级列表
|
||||
*/
|
||||
private String ancestors;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Long sort;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package org.dromara.build.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 施工模板组(汇总)对象 bud_construction_template_group
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bud_construction_template_group")
|
||||
public class BudConstructionTemplateGroup extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 施工模板组 ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 模板组名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 项目ID(0表示通用)
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package org.dromara.build.domain.bo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.build.domain.BudConstructionProjectRel;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 施工和项目类型关联业务对象 bud_construction_project_rel
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BudConstructionProjectRel.class, reverseConvertGenerate = false)
|
||||
public class BudConstructionProjectRelBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 施工模版 ID
|
||||
*/
|
||||
@NotNull(message = "施工模版 ID不能为空", groups = {EditGroup.class})
|
||||
private Long constructionId;
|
||||
|
||||
/**
|
||||
* 项目类型 ID
|
||||
*/
|
||||
@NotNull(message = "项目类型 ID不能为空", groups = {EditGroup.class})
|
||||
private Long projectTypeId;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
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.BudConstructionTemplate;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 施工模版业务对象 bud_construction_template
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BudConstructionTemplate.class, reverseConvertGenerate = false)
|
||||
public class BudConstructionTemplateBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键 ID
|
||||
*/
|
||||
@NotNull(message = "主键 ID不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 施工模板组 ID
|
||||
*/
|
||||
@NotNull(message = "施工模板组 ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 父模版 ID
|
||||
*/
|
||||
@NotNull(message = "父模版 ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 模版名称
|
||||
*/
|
||||
@NotBlank(message = "模版名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 计量方式(0无 1数量 2百分比)
|
||||
*/
|
||||
@NotBlank(message = "计量方式(0无 1数量 2百分比)不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String unitType;
|
||||
|
||||
/**
|
||||
* 工作类型
|
||||
*/
|
||||
private String workType;
|
||||
|
||||
/**
|
||||
* 关联结构(1项目 2方阵 3子项目)
|
||||
*/
|
||||
@NotBlank(message = "关联结构(1项目 2方阵 3子项目)不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String relevancyStructure;
|
||||
|
||||
/**
|
||||
* 祖级列表
|
||||
*/
|
||||
@NotBlank(message = "祖级列表不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String ancestors;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@NotNull(message = "排序不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long sort;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
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.BudConstructionTemplateGroup;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 施工模板组(汇总)业务对象 bud_construction_template_group
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BudConstructionTemplateGroup.class, reverseConvertGenerate = false)
|
||||
public class BudConstructionTemplateGroupBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 施工模板组 ID
|
||||
*/
|
||||
@NotNull(message = "施工模板组 ID不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 模板组名称
|
||||
*/
|
||||
@NotBlank(message = "模板组名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 项目ID(0表示通用)
|
||||
*/
|
||||
@NotNull(message = "项目ID(0表示通用)不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 项目类型 ID
|
||||
*/
|
||||
private List<Long> projectTypeIds;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
package org.dromara.build.domain.geojson;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025/4/24 17:37
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BudGeoJson {
|
||||
|
||||
private String name;
|
||||
|
||||
private String type;
|
||||
|
||||
private List<BudFeature> features;
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
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.BudConstructionProjectRel;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 施工和项目类型关联视图对象 bud_construction_project_rel
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-22
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BudConstructionProjectRel.class)
|
||||
public class BudConstructionProjectRelVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 施工模版 ID
|
||||
*/
|
||||
@ExcelProperty(value = "施工模版 ID")
|
||||
private Long constructionId;
|
||||
|
||||
/**
|
||||
* 项目类型 ID
|
||||
*/
|
||||
@ExcelProperty(value = "项目类型 ID")
|
||||
private Long projectTypeId;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
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.BudConstructionTemplateGroup;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 施工模板组(汇总)视图对象 bud_construction_template_group
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-22
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BudConstructionTemplateGroup.class)
|
||||
public class BudConstructionTemplateGroupVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 施工模板组 ID
|
||||
*/
|
||||
@ExcelProperty(value = "施工模板组 ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 模板组名称
|
||||
*/
|
||||
@ExcelProperty(value = "模板组名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 项目ID(0表示通用)
|
||||
*/
|
||||
@ExcelProperty(value = "项目ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=表示通用")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 模版列表
|
||||
*/
|
||||
private List<BudConstructionTemplateVo> templateList;
|
||||
|
||||
}
|
||||
@ -0,0 +1,92 @@
|
||||
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.BudConstructionTemplate;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 施工模版视图对象 bud_construction_template
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-22
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BudConstructionTemplate.class)
|
||||
public class BudConstructionTemplateVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键 ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键 ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 施工模板组 ID
|
||||
*/
|
||||
@ExcelProperty(value = "施工模板组 ID")
|
||||
private Long groupId;
|
||||
|
||||
/**
|
||||
* 父模版 ID
|
||||
*/
|
||||
@ExcelProperty(value = "父模版 ID")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 模版名称
|
||||
*/
|
||||
@ExcelProperty(value = "模版名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 计量方式(0无 1数量 2百分比)
|
||||
*/
|
||||
@ExcelProperty(value = "计量方式", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "progress_unit_type")
|
||||
private String unitType;
|
||||
|
||||
/**
|
||||
* 工作类型
|
||||
*/
|
||||
@ExcelProperty(value = "工作类型", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "progress_work_type")
|
||||
private String workType;
|
||||
|
||||
/**
|
||||
* 关联结构(1项目 2方阵 3子项目)
|
||||
*/
|
||||
@ExcelProperty(value = "关联结构(1项目 2方阵 3子项目)")
|
||||
private String relevancyStructure;
|
||||
|
||||
/**
|
||||
* 祖级列表
|
||||
*/
|
||||
@ExcelProperty(value = "祖级列表")
|
||||
private String ancestors;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@ExcelProperty(value = "排序")
|
||||
private Long sort;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package org.dromara.build.mapper;
|
||||
|
||||
import org.dromara.build.domain.BudConstructionProjectRel;
|
||||
import org.dromara.build.domain.vo.BudConstructionProjectRelVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 施工和项目类型关联Mapper接口
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-22
|
||||
*/
|
||||
public interface BudConstructionProjectRelMapper extends BaseMapperPlus<BudConstructionProjectRel, BudConstructionProjectRelVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package org.dromara.build.mapper;
|
||||
|
||||
import org.dromara.build.domain.BudConstructionTemplateGroup;
|
||||
import org.dromara.build.domain.vo.BudConstructionTemplateGroupVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 施工模板组(汇总)Mapper接口
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-22
|
||||
*/
|
||||
public interface BudConstructionTemplateGroupMapper extends BaseMapperPlus<BudConstructionTemplateGroup, BudConstructionTemplateGroupVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package org.dromara.build.mapper;
|
||||
|
||||
import org.dromara.build.domain.BudConstructionTemplate;
|
||||
import org.dromara.build.domain.vo.BudConstructionTemplateVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 施工模版Mapper接口
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-22
|
||||
*/
|
||||
public interface BudConstructionTemplateMapper extends BaseMapperPlus<BudConstructionTemplate, BudConstructionTemplateVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package org.dromara.build.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.dromara.build.domain.BudConstructionProjectRel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 施工和项目类型关联Service接口
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-22
|
||||
*/
|
||||
public interface IBudConstructionProjectRelService extends IService<BudConstructionProjectRel> {
|
||||
|
||||
/**
|
||||
* 创建或更新关联
|
||||
*
|
||||
* @param constructionId 施工 ID
|
||||
* @param projectTypeIds 项目类型 ID 列表
|
||||
* @param isUpdate 是否更新
|
||||
* @return 是否成功
|
||||
*/
|
||||
Boolean createOrUpdate(Long constructionId, List<Long> projectTypeIds, boolean isUpdate);
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package org.dromara.build.service;
|
||||
|
||||
import org.dromara.build.domain.vo.BudConstructionTemplateGroupVo;
|
||||
import org.dromara.build.domain.bo.BudConstructionTemplateGroupBo;
|
||||
import org.dromara.build.domain.BudConstructionTemplateGroup;
|
||||
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-22
|
||||
*/
|
||||
public interface IBudConstructionTemplateGroupService extends IService<BudConstructionTemplateGroup> {
|
||||
|
||||
/**
|
||||
* 查询施工模板组(汇总)
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 施工模板组(汇总)
|
||||
*/
|
||||
BudConstructionTemplateGroupVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询施工模板组(汇总)列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 施工模板组(汇总)分页列表
|
||||
*/
|
||||
TableDataInfo<BudConstructionTemplateGroupVo> queryPageList(BudConstructionTemplateGroupBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的施工模板组(汇总)列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 施工模板组(汇总)列表
|
||||
*/
|
||||
List<BudConstructionTemplateGroupVo> queryList(BudConstructionTemplateGroupBo bo);
|
||||
|
||||
/**
|
||||
* 新增施工模板组(汇总)
|
||||
*
|
||||
* @param bo 施工模板组(汇总)
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BudConstructionTemplateGroupBo bo);
|
||||
|
||||
/**
|
||||
* 修改施工模板组(汇总)
|
||||
*
|
||||
* @param bo 施工模板组(汇总)
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BudConstructionTemplateGroupBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除施工模板组(汇总)信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
package org.dromara.build.service;
|
||||
|
||||
import org.dromara.build.domain.vo.BudConstructionTemplateVo;
|
||||
import org.dromara.build.domain.bo.BudConstructionTemplateBo;
|
||||
import org.dromara.build.domain.BudConstructionTemplate;
|
||||
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-22
|
||||
*/
|
||||
public interface IBudConstructionTemplateService extends IService<BudConstructionTemplate> {
|
||||
|
||||
/**
|
||||
* 查询施工模版
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 施工模版
|
||||
*/
|
||||
BudConstructionTemplateVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询施工模版列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 施工模版分页列表
|
||||
*/
|
||||
TableDataInfo<BudConstructionTemplateVo> queryPageList(BudConstructionTemplateBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的施工模版列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 施工模版列表
|
||||
*/
|
||||
List<BudConstructionTemplateVo> queryList(BudConstructionTemplateBo bo);
|
||||
|
||||
/**
|
||||
* 新增施工模版
|
||||
*
|
||||
* @param bo 施工模版
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BudConstructionTemplateBo bo);
|
||||
|
||||
/**
|
||||
* 修改施工模版
|
||||
*
|
||||
* @param bo 施工模版
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BudConstructionTemplateBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除施工模版信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 获取Vo列表
|
||||
*
|
||||
* @param templateList 数据列表
|
||||
* @return Vo列表
|
||||
*/
|
||||
List<BudConstructionTemplateVo> getVoList(List<BudConstructionTemplate> templateList);
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
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.service.impl.ServiceImpl;
|
||||
import org.dromara.build.domain.BudConstructionProjectRel;
|
||||
import org.dromara.build.mapper.BudConstructionProjectRelMapper;
|
||||
import org.dromara.build.service.IBudConstructionProjectRelService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 施工和项目类型关联Service业务层处理
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-22
|
||||
*/
|
||||
@Service
|
||||
public class BudConstructionProjectRelServiceImpl extends ServiceImpl<BudConstructionProjectRelMapper, BudConstructionProjectRel>
|
||||
implements IBudConstructionProjectRelService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean createOrUpdate(Long constructionId, List<Long> projectTypeIds, boolean isUpdate) {
|
||||
if (isUpdate) {
|
||||
LambdaQueryWrapper<BudConstructionProjectRel> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(BudConstructionProjectRel::getConstructionId, constructionId);
|
||||
boolean remove = this.remove(lqw);
|
||||
if (!remove) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return this.saveBatch(projectTypeIds.stream().map(projectTypeId -> {
|
||||
BudConstructionProjectRel rel = new BudConstructionProjectRel();
|
||||
rel.setConstructionId(constructionId);
|
||||
rel.setProjectTypeId(projectTypeId);
|
||||
return rel;
|
||||
}).toList());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,223 @@
|
||||
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.BudConstructionProjectRel;
|
||||
import org.dromara.build.domain.BudConstructionTemplate;
|
||||
import org.dromara.build.domain.BudConstructionTemplateGroup;
|
||||
import org.dromara.build.domain.bo.BudConstructionTemplateGroupBo;
|
||||
import org.dromara.build.domain.vo.BudConstructionTemplateGroupVo;
|
||||
import org.dromara.build.mapper.BudConstructionTemplateGroupMapper;
|
||||
import org.dromara.build.service.IBudConstructionProjectRelService;
|
||||
import org.dromara.build.service.IBudConstructionTemplateGroupService;
|
||||
import org.dromara.build.service.IBudConstructionTemplateService;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.warm.flow.core.utils.SqlHelper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 施工模板组(汇总)Service业务层处理
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-22
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BudConstructionTemplateGroupServiceImpl extends ServiceImpl<BudConstructionTemplateGroupMapper, BudConstructionTemplateGroup>
|
||||
implements IBudConstructionTemplateGroupService {
|
||||
|
||||
private final IBudConstructionTemplateService budConstructionTemplateService;
|
||||
|
||||
private final IBudConstructionProjectRelService budConstructionProjectRelService;
|
||||
|
||||
/**
|
||||
* 查询施工模板组(汇总)
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 施工模板组(汇总)
|
||||
*/
|
||||
@Override
|
||||
public BudConstructionTemplateGroupVo queryById(Long id) {
|
||||
BudConstructionTemplateGroupVo groupVo = baseMapper.selectVoById(id);
|
||||
getTemp(groupVo);
|
||||
return groupVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询施工模板组(汇总)列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 施工模板组(汇总)分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BudConstructionTemplateGroupVo> queryPageList(BudConstructionTemplateGroupBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BudConstructionTemplateGroup> lqw = buildQueryWrapper(bo);
|
||||
Page<BudConstructionTemplateGroupVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
List<BudConstructionTemplateGroupVo> records = result.getRecords();
|
||||
getTemp(records);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的施工模板组(汇总)列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 施工模板组(汇总)列表
|
||||
*/
|
||||
@Override
|
||||
public List<BudConstructionTemplateGroupVo> queryList(BudConstructionTemplateGroupBo bo) {
|
||||
LambdaQueryWrapper<BudConstructionTemplateGroup> lqw = buildQueryWrapper(bo);
|
||||
List<BudConstructionTemplateGroupVo> groupVoList = baseMapper.selectVoList(lqw);
|
||||
getTemp(groupVoList);
|
||||
return groupVoList;
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BudConstructionTemplateGroup> buildQueryWrapper(BudConstructionTemplateGroupBo bo) {
|
||||
LambdaQueryWrapper<BudConstructionTemplateGroup> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BudConstructionTemplateGroup::getId);
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), BudConstructionTemplateGroup::getName, bo.getName());
|
||||
lqw.eq(bo.getProjectId() != null, BudConstructionTemplateGroup::getProjectId, bo.getProjectId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增施工模板组(汇总)
|
||||
*
|
||||
* @param bo 施工模板组(汇总)
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BudConstructionTemplateGroupBo bo) {
|
||||
BudConstructionTemplateGroup add = MapstructUtils.convert(bo, BudConstructionTemplateGroup.class);
|
||||
if (add == null) {
|
||||
throw new ServiceException("新增施工模板组失败,参数错误");
|
||||
}
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
// 添加关联
|
||||
Boolean result = budConstructionProjectRelService.createOrUpdate(add.getId(), bo.getProjectTypeIds(), false);
|
||||
if (!result) {
|
||||
throw new ServiceException("施工模板组修改失败");
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改施工模板组(汇总)
|
||||
*
|
||||
* @param bo 施工模板组(汇总)
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BudConstructionTemplateGroupBo bo) {
|
||||
BudConstructionTemplateGroup update = MapstructUtils.convert(bo, BudConstructionTemplateGroup.class);
|
||||
if (update == null) {
|
||||
throw new ServiceException("修改施工模板组失败,参数错误");
|
||||
}
|
||||
validEntityBeforeSave(update);
|
||||
if (!SqlHelper.retBool(baseMapper.updateById(update))) {
|
||||
throw new ServiceException("施工模板组修改失败");
|
||||
}
|
||||
List<Long> projectTypeIds = bo.getProjectTypeIds();
|
||||
// 修改关联
|
||||
Boolean flag = budConstructionProjectRelService.createOrUpdate(update.getId(), projectTypeIds, true);
|
||||
if (!flag) {
|
||||
throw new ServiceException("施工模板组修改失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BudConstructionTemplateGroup entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
Long id = entity.getId();
|
||||
String name = entity.getName();
|
||||
// 判断名称是否重复
|
||||
LambdaQueryWrapper<BudConstructionTemplateGroup> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(BudConstructionTemplateGroup::getName, name);
|
||||
if (id != null) {
|
||||
lqw.ne(BudConstructionTemplateGroup::getId, id);
|
||||
}
|
||||
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) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
List<BudConstructionTemplate> templateList = budConstructionTemplateService.lambdaQuery()
|
||||
.in(BudConstructionTemplate::getGroupId, ids)
|
||||
.list();
|
||||
if (CollUtil.isNotEmpty(templateList)) {
|
||||
throw new ServiceException("请先删除该组下的所有模板");
|
||||
}
|
||||
}
|
||||
// 删除关联
|
||||
LambdaQueryWrapper<BudConstructionProjectRel> lqw = Wrappers.lambdaQuery();
|
||||
lqw.in(BudConstructionProjectRel::getConstructionId, ids);
|
||||
boolean remove = budConstructionProjectRelService.remove(lqw);
|
||||
if (!remove) {
|
||||
throw new ServiceException("施工模板组删除失败");
|
||||
}
|
||||
boolean batchByIds = this.removeBatchByIds(ids);
|
||||
if (!batchByIds) {
|
||||
throw new ServiceException("施工模板组删除失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板
|
||||
*
|
||||
* @param groupVo 模板组
|
||||
*/
|
||||
public void getTemp(BudConstructionTemplateGroupVo groupVo) {
|
||||
List<BudConstructionTemplate> templateList = budConstructionTemplateService.lambdaQuery()
|
||||
.eq(BudConstructionTemplate::getGroupId, groupVo.getId())
|
||||
.eq(BudConstructionTemplate::getParentId, 0)
|
||||
.list();
|
||||
groupVo.setTemplateList(budConstructionTemplateService.getVoList(templateList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板
|
||||
*
|
||||
* @param groupVoList 模板组
|
||||
*/
|
||||
public void getTemp(List<BudConstructionTemplateGroupVo> groupVoList) {
|
||||
if (CollUtil.isEmpty(groupVoList)) {
|
||||
return;
|
||||
}
|
||||
for (BudConstructionTemplateGroupVo groupVo : groupVoList) {
|
||||
getTemp(groupVo);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,153 @@
|
||||
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.BudConstructionTemplate;
|
||||
import org.dromara.build.domain.bo.BudConstructionTemplateBo;
|
||||
import org.dromara.build.domain.vo.BudConstructionTemplateVo;
|
||||
import org.dromara.build.mapper.BudConstructionTemplateMapper;
|
||||
import org.dromara.build.service.IBudConstructionTemplateService;
|
||||
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.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 施工模版Service业务层处理
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-22
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BudConstructionTemplateServiceImpl extends ServiceImpl<BudConstructionTemplateMapper, BudConstructionTemplate>
|
||||
implements IBudConstructionTemplateService {
|
||||
|
||||
/**
|
||||
* 查询施工模版
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 施工模版
|
||||
*/
|
||||
@Override
|
||||
public BudConstructionTemplateVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询施工模版列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 施工模版分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BudConstructionTemplateVo> queryPageList(BudConstructionTemplateBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BudConstructionTemplate> lqw = buildQueryWrapper(bo);
|
||||
Page<BudConstructionTemplateVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的施工模版列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 施工模版列表
|
||||
*/
|
||||
@Override
|
||||
public List<BudConstructionTemplateVo> queryList(BudConstructionTemplateBo bo) {
|
||||
LambdaQueryWrapper<BudConstructionTemplate> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BudConstructionTemplate> buildQueryWrapper(BudConstructionTemplateBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BudConstructionTemplate> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BudConstructionTemplate::getId);
|
||||
lqw.eq(bo.getGroupId() != null, BudConstructionTemplate::getGroupId, bo.getGroupId());
|
||||
lqw.eq(bo.getParentId() != null, BudConstructionTemplate::getParentId, bo.getParentId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), BudConstructionTemplate::getName, bo.getName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUnitType()), BudConstructionTemplate::getUnitType, bo.getUnitType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getWorkType()), BudConstructionTemplate::getWorkType, bo.getWorkType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRelevancyStructure()), BudConstructionTemplate::getRelevancyStructure, bo.getRelevancyStructure());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAncestors()), BudConstructionTemplate::getAncestors, bo.getAncestors());
|
||||
lqw.eq(bo.getSort() != null, BudConstructionTemplate::getSort, bo.getSort());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增施工模版
|
||||
*
|
||||
* @param bo 施工模版
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BudConstructionTemplateBo bo) {
|
||||
BudConstructionTemplate add = MapstructUtils.convert(bo, BudConstructionTemplate.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改施工模版
|
||||
*
|
||||
* @param bo 施工模版
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BudConstructionTemplateBo bo) {
|
||||
BudConstructionTemplate update = MapstructUtils.convert(bo, BudConstructionTemplate.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BudConstructionTemplate entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除施工模版信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Vo列表
|
||||
*
|
||||
* @param templateList 数据列表
|
||||
* @return Vo列表
|
||||
*/
|
||||
@Override
|
||||
public List<BudConstructionTemplateVo> getVoList(List<BudConstructionTemplate> templateList) {
|
||||
return templateList.stream().map(template -> {
|
||||
BudConstructionTemplateVo templateVo = new BudConstructionTemplateVo();
|
||||
BeanUtils.copyProperties(template, templateVo);
|
||||
return templateVo;
|
||||
}).toList();
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,11 @@
|
||||
package org.dromara.xzd.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
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;
|
||||
|
||||
@ -24,6 +26,7 @@ public class XzdCustomertypeInfo extends BaseEntity {
|
||||
/**
|
||||
* 1客户 2供应商
|
||||
*/
|
||||
@TableId(type = IdType.NONE)
|
||||
private String type;
|
||||
|
||||
/**
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
package org.dromara.xzd.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
@ -23,6 +23,7 @@ public class XzdPoiArea {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
private Long adcode;
|
||||
|
||||
/**
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
package org.dromara.xzd.fapiaotaizhang.zengzhishui.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 征税项目对象 tax_info
|
||||
@ -15,7 +16,7 @@ import java.io.Serial;
|
||||
*/
|
||||
@Data
|
||||
@TableName("xzd_tax_info")
|
||||
public class TaxInfo {
|
||||
public class TaxInfo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -23,6 +24,7 @@ public class TaxInfo {
|
||||
/**
|
||||
* 征收编码
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
private String levyCode;
|
||||
|
||||
/**
|
||||
|
||||
@ -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.BudConstructionProjectRelMapper">
|
||||
|
||||
</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.BudConstructionTemplateGroupMapper">
|
||||
|
||||
</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.BudConstructionTemplateMapper">
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user