第二阶段源码

This commit is contained in:
2026-04-23 11:38:47 +08:00
parent 27904a9257
commit 85bb29a749
449 changed files with 45904 additions and 1813 deletions

View File

@@ -1,20 +1,29 @@
package com.yhy.module.core.controller.admin.boq;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.boq.vo.*;
import com.yhy.module.core.controller.admin.boq.vo.BoqCatalogItemBindQuotaReqVO;
import com.yhy.module.core.controller.admin.boq.vo.BoqCatalogItemRespVO;
import com.yhy.module.core.controller.admin.boq.vo.BoqCatalogItemSaveReqVO;
import com.yhy.module.core.controller.admin.boq.vo.BoqCatalogItemSwapSortReqVO;
import com.yhy.module.core.service.boq.BoqCatalogItemService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 清单配置目录树 Controller
@@ -33,14 +42,16 @@ public class BoqCatalogItemController {
@PostMapping("/create")
@Operation(summary = "创建清单配置目录树节点")
@PreAuthorize("@ss.hasPermission('core:boq-catalog-item:create')")
public CommonResult<Long> createBoqCatalogItem(@Valid @RequestBody BoqCatalogItemSaveReqVO createReqVO) {
public CommonResult<Long> createBoqCatalogItem(
@Validated(BoqCatalogItemSaveReqVO.CreateGroup.class) @RequestBody BoqCatalogItemSaveReqVO createReqVO) {
return success(boqCatalogItemService.createBoqCatalogItem(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新清单配置目录树节点")
@PreAuthorize("@ss.hasPermission('core:boq-catalog-item:update')")
public CommonResult<Boolean> updateBoqCatalogItem(@Valid @RequestBody BoqCatalogItemSaveReqVO updateReqVO) {
public CommonResult<Boolean> updateBoqCatalogItem(
@Validated(BoqCatalogItemSaveReqVO.UpdateGroup.class) @RequestBody BoqCatalogItemSaveReqVO updateReqVO) {
boqCatalogItemService.updateBoqCatalogItem(updateReqVO);
return success(true);
}

View File

@@ -1,90 +0,0 @@
package com.yhy.module.core.controller.admin.boq;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.boq.vo.BoqDetailTreeRespVO;
import com.yhy.module.core.controller.admin.boq.vo.BoqDetailTreeSaveReqVO;
import com.yhy.module.core.controller.admin.boq.vo.BoqDetailTreeSwapSortReqVO;
import com.yhy.module.core.service.boq.BoqDetailTreeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
* 清单明细树 Controller
*
* @author yhy
*/
@Tag(name = "管理后台 - 清单明细树")
@RestController
@RequestMapping("/core/boq/detail-tree")
@Validated
public class BoqDetailTreeController {
@Resource
private BoqDetailTreeService boqDetailTreeService;
@PostMapping("/create")
@Operation(summary = "创建清单明细树节点")
@PreAuthorize("@ss.hasPermission('core:boq:detail-tree:create')")
public CommonResult<Long> createNode(@Valid @RequestBody BoqDetailTreeSaveReqVO createReqVO) {
return success(boqDetailTreeService.createNode(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新清单明细树节点")
@PreAuthorize("@ss.hasPermission('core:boq:detail-tree:update')")
public CommonResult<Boolean> updateNode(@Valid @RequestBody BoqDetailTreeSaveReqVO updateReqVO) {
boqDetailTreeService.updateNode(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除清单明细树节点")
@Parameter(name = "id", description = "节点ID", required = true)
@PreAuthorize("@ss.hasPermission('core:boq:detail-tree:delete')")
public CommonResult<Boolean> deleteNode(@RequestParam("id") Long id) {
boqDetailTreeService.deleteNode(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获取清单明细树节点详情")
@Parameter(name = "id", description = "节点ID", required = true)
@PreAuthorize("@ss.hasPermission('core:boq:detail-tree:query')")
public CommonResult<BoqDetailTreeRespVO> getNode(@RequestParam("id") Long id) {
return success(boqDetailTreeService.getNode(id));
}
@GetMapping("/tree")
@Operation(summary = "获取清单明细树形结构")
@Parameter(name = "boqSubItemId", description = "清单子项ID", required = true)
@PreAuthorize("@ss.hasPermission('core:boq:detail-tree:query')")
public CommonResult<List<BoqDetailTreeRespVO>> getTree(@RequestParam("boqSubItemId") Long boqSubItemId) {
return success(boqDetailTreeService.getTree(boqSubItemId));
}
@GetMapping("/list")
@Operation(summary = "获取清单明细树列表")
@Parameter(name = "boqSubItemId", description = "清单子项ID", required = true)
@PreAuthorize("@ss.hasPermission('core:boq:detail-tree:query')")
public CommonResult<List<BoqDetailTreeRespVO>> getList(@RequestParam("boqSubItemId") Long boqSubItemId) {
return success(boqDetailTreeService.getList(boqSubItemId));
}
@PostMapping("/swap-sort")
@Operation(summary = "交换清单明细树节点排序")
@PreAuthorize("@ss.hasPermission('core:boq:detail-tree:update')")
public CommonResult<Boolean> swapSort(@Valid @RequestBody BoqDetailTreeSwapSortReqVO reqVO) {
boqDetailTreeService.swapSort(reqVO.getNodeId1(), reqVO.getNodeId2());
return success(true);
}
}

View File

@@ -0,0 +1,117 @@
package com.yhy.module.core.controller.admin.boq;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.*;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.boq.vo.BoqGuideTreeRespVO;
import com.yhy.module.core.controller.admin.boq.vo.BoqGuideTreeSaveReqVO;
import com.yhy.module.core.controller.admin.boq.vo.BoqGuideTreeSwapSortReqVO;
import com.yhy.module.core.controller.admin.boq.vo.QuotaCodeValidateRespVO;
import com.yhy.module.core.service.boq.BoqGuideTreeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 清单指引树 Controller
*
* @author yhy
*/
@Tag(name = "管理后台 - 清单指引树")
@RestController
@RequestMapping("/core/boq/guide-tree")
@Validated
public class BoqGuideTreeController {
@Resource
private BoqGuideTreeService boqGuideTreeService;
@PostMapping("/create")
@Operation(summary = "创建清单指引树节点")
@PreAuthorize("@ss.hasPermission('core:boq:guide-tree:create')")
public CommonResult<Long> createNode(@Valid @RequestBody BoqGuideTreeSaveReqVO createReqVO) {
return success(boqGuideTreeService.createNode(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新清单指引树节点")
@PreAuthorize("@ss.hasPermission('core:boq:guide-tree:update')")
public CommonResult<Boolean> updateNode(@Valid @RequestBody BoqGuideTreeSaveReqVO updateReqVO) {
boqGuideTreeService.updateNode(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除清单指引树节点")
@Parameter(name = "id", description = "节点ID", required = true)
@PreAuthorize("@ss.hasPermission('core:boq:guide-tree:delete')")
public CommonResult<Boolean> deleteNode(@RequestParam("id") Long id) {
boqGuideTreeService.deleteNode(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获取清单指引树节点详情")
@Parameter(name = "id", description = "节点ID", required = true)
@PreAuthorize("@ss.hasPermission('core:boq:guide-tree:query')")
public CommonResult<BoqGuideTreeRespVO> getNode(@RequestParam("id") Long id) {
return success(boqGuideTreeService.getNode(id));
}
@GetMapping("/tree")
@Operation(summary = "获取清单指引树形结构")
@Parameter(name = "boqSubItemId", description = "清单子项ID", required = true)
@PreAuthorize("@ss.hasPermission('core:boq:guide-tree:query')")
public CommonResult<List<BoqGuideTreeRespVO>> getTree(@RequestParam("boqSubItemId") Long boqSubItemId) {
return success(boqGuideTreeService.getTree(boqSubItemId));
}
@GetMapping("/list")
@Operation(summary = "获取清单指引树列表")
@Parameter(name = "boqSubItemId", description = "清单子项ID", required = true)
@PreAuthorize("@ss.hasPermission('core:boq:guide-tree:query')")
public CommonResult<List<BoqGuideTreeRespVO>> getList(@RequestParam("boqSubItemId") Long boqSubItemId) {
return success(boqGuideTreeService.getList(boqSubItemId));
}
@PostMapping("/swap-sort")
@Operation(summary = "交换清单指引树节点排序")
@PreAuthorize("@ss.hasPermission('core:boq:guide-tree:update')")
public CommonResult<Boolean> swapSort(@Valid @RequestBody BoqGuideTreeSwapSortReqVO reqVO) {
boqGuideTreeService.swapSort(reqVO.getNodeId1(), reqVO.getNodeId2());
return success(true);
}
@GetMapping("/validate-quota-code")
@Operation(summary = "验证定额编码是否存在于绑定范围内")
@Parameter(name = "boqSubItemId", description = "清单子项ID", required = true)
@Parameter(name = "code", description = "定额编码", required = true)
@PreAuthorize("@ss.hasPermission('core:boq:guide-tree:query')")
public CommonResult<Long> validateQuotaCode(@RequestParam("boqSubItemId") Long boqSubItemId,
@RequestParam("code") String code) {
return success(boqGuideTreeService.validateQuotaCodeInRange(boqSubItemId, code));
}
@GetMapping("/validate-quota-code-with-info")
@Operation(summary = "验证定额编码并返回定额信息(包含名称)")
@Parameter(name = "boqSubItemId", description = "清单子项ID", required = true)
@Parameter(name = "code", description = "定额编码", required = true)
@PreAuthorize("@ss.hasPermission('core:boq:guide-tree:query')")
public CommonResult<QuotaCodeValidateRespVO> validateQuotaCodeWithInfo(@RequestParam("boqSubItemId") Long boqSubItemId,
@RequestParam("code") String code) {
return success(boqGuideTreeService.validateQuotaCodeWithInfo(boqSubItemId, code));
}
}

View File

@@ -1,6 +1,9 @@
package com.yhy.module.core.controller.admin.boq;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.boq.vo.BoqItemTreeDeleteCheckRespVO;
import com.yhy.module.core.controller.admin.boq.vo.BoqItemTreeRespVO;
import com.yhy.module.core.controller.admin.boq.vo.BoqItemTreeSaveReqVO;
import com.yhy.module.core.controller.admin.boq.vo.BoqItemTreeSwapSortReqVO;
@@ -8,15 +11,19 @@ import com.yhy.module.core.service.boq.BoqItemTreeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 清单项树 Controller
@@ -35,14 +42,16 @@ public class BoqItemTreeController {
@PostMapping("/create")
@Operation(summary = "创建清单项树节点")
@PreAuthorize("@ss.hasPermission('core:boq:item-tree:create')")
public CommonResult<Long> createBoqItemTree(@Valid @RequestBody BoqItemTreeSaveReqVO createReqVO) {
public CommonResult<Long> createBoqItemTree(
@Validated(BoqItemTreeSaveReqVO.CreateGroup.class) @RequestBody BoqItemTreeSaveReqVO createReqVO) {
return success(boqItemTreeService.createBoqItemTree(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新清单项树节点")
@PreAuthorize("@ss.hasPermission('core:boq:item-tree:update')")
public CommonResult<Boolean> updateBoqItemTree(@Valid @RequestBody BoqItemTreeSaveReqVO updateReqVO) {
public CommonResult<Boolean> updateBoqItemTree(
@Validated(BoqItemTreeSaveReqVO.UpdateGroup.class) @RequestBody BoqItemTreeSaveReqVO updateReqVO) {
boqItemTreeService.updateBoqItemTree(updateReqVO);
return success(true);
}
@@ -87,4 +96,21 @@ public class BoqItemTreeController {
boqItemTreeService.swapSort(swapReqVO);
return success(true);
}
@GetMapping("/check-delete")
@Operation(summary = "检查删除清单项树节点前的关联数据")
@Parameter(name = "id", description = "节点ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:boq:item-tree:delete')")
public CommonResult<BoqItemTreeDeleteCheckRespVO> checkDeleteBoqItemTree(@RequestParam("id") Long id) {
return success(boqItemTreeService.checkDeleteBoqItemTree(id));
}
@DeleteMapping("/force-delete")
@Operation(summary = "强制删除清单项树节点(级联删除所有关联数据)")
@Parameter(name = "id", description = "节点ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:boq:item-tree:delete')")
public CommonResult<Boolean> forceDeleteBoqItemTree(@RequestParam("id") Long id) {
boqItemTreeService.forceDeleteBoqItemTree(id);
return success(true);
}
}

View File

@@ -1,5 +1,7 @@
package com.yhy.module.core.controller.admin.boq;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.boq.vo.BoqSubItemRespVO;
import com.yhy.module.core.controller.admin.boq.vo.BoqSubItemSaveReqVO;
@@ -8,15 +10,19 @@ import com.yhy.module.core.service.boq.BoqSubItemService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 清单子项 Controller
@@ -35,14 +41,16 @@ public class BoqSubItemController {
@PostMapping("/create")
@Operation(summary = "创建清单子项")
@PreAuthorize("@ss.hasPermission('core:boq:sub-item:create')")
public CommonResult<Long> createBoqSubItem(@Valid @RequestBody BoqSubItemSaveReqVO createReqVO) {
public CommonResult<Long> createBoqSubItem(
@Validated(BoqSubItemSaveReqVO.CreateGroup.class) @RequestBody BoqSubItemSaveReqVO createReqVO) {
return success(boqSubItemService.createBoqSubItem(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新清单子项")
@PreAuthorize("@ss.hasPermission('core:boq:sub-item:update')")
public CommonResult<Boolean> updateBoqSubItem(@Valid @RequestBody BoqSubItemSaveReqVO updateReqVO) {
public CommonResult<Boolean> updateBoqSubItem(
@Validated(BoqSubItemSaveReqVO.UpdateGroup.class) @RequestBody BoqSubItemSaveReqVO updateReqVO) {
boqSubItemService.updateBoqSubItem(updateReqVO);
return success(true);
}

View File

@@ -3,6 +3,7 @@ package com.yhy.module.core.controller.admin.boq.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.Data;
/**
@@ -14,22 +15,33 @@ import lombok.Data;
@Data
public class BoqCatalogItemSaveReqVO {
/**
* 创建时的校验分组
*/
public interface CreateGroup {}
/**
* 更新时的校验分组
*/
public interface UpdateGroup {}
@Schema(description = "主键ID", example = "1")
@NotNull(message = "ID不能为空", groups = UpdateGroup.class)
private Long id;
@Schema(description = "父节点ID", example = "1")
private Long parentId;
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "BOQ_GD")
@NotBlank(message = "编码不能为空")
@NotBlank(message = "编码不能为空", groups = CreateGroup.class)
private String code;
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "广东")
@NotBlank(message = "名称不能为空")
@NotBlank(message = "名称不能为空", groups = CreateGroup.class)
private String name;
@Schema(description = "节点类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "province")
@NotBlank(message = "节点类型不能为空")
@NotBlank(message = "节点类型不能为空", groups = CreateGroup.class)
private String nodeType;
@Schema(description = "排序", example = "1")

View File

@@ -1,19 +1,19 @@
package com.yhy.module.core.controller.admin.boq.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import lombok.Data;
/**
* 清单明细 - Response VO
* 清单指引 - Response VO
*
* @author yhy
*/
@Schema(description = "管理后台 - 清单明细树 Response VO")
@Schema(description = "管理后台 - 清单指引树 Response VO")
@Data
public class BoqDetailTreeRespVO {
public class BoqGuideTreeRespVO {
@Schema(description = "节点ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long id;
@@ -33,7 +33,7 @@ public class BoqDetailTreeRespVO {
@Schema(description = "单位", example = "")
private String unit;
@Schema(description = "节点类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "directory")
@Schema(description = "节点类型directory-目录quota-定额", requiredMode = Schema.RequiredMode.REQUIRED, example = "directory")
private String nodeType;
@Schema(description = "定额基价【第三层】节点ID", example = "1003")
@@ -51,6 +51,12 @@ public class BoqDetailTreeRespVO {
@Schema(description = "排序", example = "1")
private Integer sortOrder;
@Schema(description = "除税基价", example = "100.00")
private BigDecimal basePriceExTax;
@Schema(description = "含税基价", example = "113.00")
private BigDecimal basePriceInTax;
@Schema(description = "层级路径", example = "[\"1\", \"2\"]")
private String[] path;
@@ -58,7 +64,7 @@ public class BoqDetailTreeRespVO {
private Integer level;
@Schema(description = "子节点列表")
private List<BoqDetailTreeRespVO> children;
private List<BoqGuideTreeRespVO> children;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;

View File

@@ -1,19 +1,18 @@
package com.yhy.module.core.controller.admin.boq.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.Data;
/**
* 清单明细 - 创建/更新 Request VO
* 清单指引 - 创建/更新 Request VO
*
* @author yhy
*/
@Schema(description = "管理后台 - 清单明细树创建/更新 Request VO")
@Schema(description = "管理后台 - 清单指引树创建/更新 Request VO")
@Data
public class BoqDetailTreeSaveReqVO {
public class BoqGuideTreeSaveReqVO {
@Schema(description = "节点ID更新时必填", example = "1")
private Long id;
@@ -36,11 +35,11 @@ public class BoqDetailTreeSaveReqVO {
@Schema(description = "单位", example = "")
private String unit;
@Schema(description = "节点类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "directory")
@Schema(description = "节点类型directory-目录quota-定额", requiredMode = Schema.RequiredMode.REQUIRED, example = "directory")
@NotBlank(message = "节点类型不能为空")
private String nodeType;
@Schema(description = "定额基价【第三层】节点IDcontent类型需要)", example = "1003")
@Schema(description = "定额基价【第三层】节点IDquota类型需要)", example = "1003")
private Long quotaCatalogItemId;
@Schema(description = "排序", example = "1")

View File

@@ -1,18 +1,17 @@
package com.yhy.module.core.controller.admin.boq.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.NotNull;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 清单明细 - 交换排序 Request VO
* 清单指引 - 交换排序 Request VO
*
* @author yhy
*/
@Schema(description = "管理后台 - 清单明细树交换排序 Request VO")
@Schema(description = "管理后台 - 清单指引树交换排序 Request VO")
@Data
public class BoqDetailTreeSwapSortReqVO {
public class BoqGuideTreeSwapSortReqVO {
@Schema(description = "节点ID1", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "节点ID1不能为空")

View File

@@ -0,0 +1,36 @@
package com.yhy.module.core.controller.admin.boq.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 清单项树删除检查响应VO
*/
@Schema(description = "管理后台 - 清单项树删除检查 Response VO")
@Data
public class BoqItemTreeDeleteCheckRespVO {
@Schema(description = "是否有子节点")
private Boolean hasChildren;
@Schema(description = "子节点数量")
private Integer childrenCount;
@Schema(description = "是否有清单子目")
private Boolean hasSubItems;
@Schema(description = "清单子目数量")
private Integer subItemsCount;
@Schema(description = "是否有清单指引")
private Boolean hasGuides;
@Schema(description = "清单指引数量")
private Integer guidesCount;
@Schema(description = "是否可以直接删除(无任何关联数据)")
private Boolean canDirectDelete;
@Schema(description = "确认删除提示信息")
private String confirmMessage;
}

View File

@@ -34,6 +34,9 @@ public class BoqItemTreeRespVO {
@Schema(description = "单位", example = "")
private String unit;
@Schema(description = "说明(富文本)", example = "<p>适用于土石方工程的计量与描述</p>")
private String description;
@Schema(description = "排序", example = "1")
private Integer sortOrder;

View File

@@ -1,11 +1,10 @@
package com.yhy.module.core.controller.admin.boq.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Map;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Map;
import lombok.Data;
/**
* 清单项树保存 Request VO
@@ -16,27 +15,40 @@ import java.util.Map;
@Data
public class BoqItemTreeSaveReqVO {
/**
* 创建时的校验分组
*/
public interface CreateGroup {}
/**
* 更新时的校验分组
*/
public interface UpdateGroup {}
@Schema(description = "节点ID", example = "1")
@NotNull(message = "ID不能为空", groups = UpdateGroup.class)
private Long id;
@Schema(description = "清单专业ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "清单专业ID不能为空")
@NotNull(message = "清单专业ID不能为空", groups = CreateGroup.class)
private Long boqCatalogItemId;
@Schema(description = "父节点ID", example = "1")
private Long parentId;
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "01")
@NotBlank(message = "编码不能为空")
@Schema(description = "编码", example = "01")
private String code;
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "土石方工程")
@NotBlank(message = "名称不能为空")
@NotBlank(message = "名称不能为空", groups = CreateGroup.class)
private String name;
@Schema(description = "单位", example = "")
private String unit;
@Schema(description = "说明(富文本)", example = "<p>适用于土石方工程的计量与描述</p>")
private String description;
@Schema(description = "排序", example = "1")
private Integer sortOrder;

View File

@@ -1,10 +1,9 @@
package com.yhy.module.core.controller.admin.boq.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.Map;
import lombok.Data;
/**
* 清单子项 Response VO
@@ -33,6 +32,9 @@ public class BoqSubItemRespVO {
@Schema(description = "清单说明(富文本)", example = "<p>适用于建筑场地的平整工程</p>")
private String description;
@Schema(description = "项目特征", example = "人工挖土;弃土外运")
private String features;
@Schema(description = "排序", example = "1")
private Integer sortOrder;
@@ -44,4 +46,7 @@ public class BoqSubItemRespVO {
@Schema(description = "更新时间")
private LocalDateTime updateTime;
@Schema(description = "关联的定额专业ID从清单专业获取", example = "1")
private Long quotaCatalogItemId;
}

View File

@@ -1,11 +1,10 @@
package com.yhy.module.core.controller.admin.boq.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Map;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Map;
import lombok.Data;
/**
* 清单子项保存 Request VO
@@ -16,19 +15,29 @@ import java.util.Map;
@Data
public class BoqSubItemSaveReqVO {
/**
* 创建时的校验分组
*/
public interface CreateGroup {}
/**
* 更新时的校验分组
*/
public interface UpdateGroup {}
@Schema(description = "子项ID", example = "1")
@NotNull(message = "ID不能为空", groups = UpdateGroup.class)
private Long id;
@Schema(description = "清单项树ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "清单项树ID不能为空")
@NotNull(message = "清单项树ID不能为空", groups = CreateGroup.class)
private Long boqItemTreeId;
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "010101001")
@NotBlank(message = "编码不能为空")
@Schema(description = "编码", example = "010101001")
private String code;
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "平整场地(人工)")
@NotBlank(message = "名称不能为空")
@NotBlank(message = "名称不能为空", groups = CreateGroup.class)
private String name;
@Schema(description = "单位", example = "")
@@ -37,6 +46,9 @@ public class BoqSubItemSaveReqVO {
@Schema(description = "清单说明(富文本)", example = "<p>适用于建筑场地的平整工程</p>")
private String description;
@Schema(description = "项目特征", example = "人工挖土;弃土外运")
private String features;
@Schema(description = "排序", example = "1")
private Integer sortOrder;

View File

@@ -0,0 +1,32 @@
package com.yhy.module.core.controller.admin.boq.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 定额编码验证结果 Response VO
*
* @author yhy
*/
@Schema(description = "管理后台 - 定额编码验证结果 Response VO")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class QuotaCodeValidateRespVO {
@Schema(description = "定额基价ID", example = "10")
private Long id;
@Schema(description = "定额编码", example = "de6")
private String code;
@Schema(description = "定额名称", example = "土石方工程")
private String name;
@Schema(description = "单位", example = "")
private String unit;
}

View File

@@ -0,0 +1,82 @@
package com.yhy.module.core.controller.admin.calcbaserate;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.calcbaserate.vo.CalcBaseRateCatalogRespVO;
import com.yhy.module.core.controller.admin.calcbaserate.vo.CalcBaseRateCatalogSaveReqVO;
import com.yhy.module.core.service.calcbaserate.CalcBaseRateCatalogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
* 基数费率目录树 Controller
*
* @author yhy
*/
@Tag(name = "管理后台 - 基数费率目录树")
@RestController
@RequestMapping("/core/calc-base-rate/catalog")
@Validated
public class CalcBaseRateCatalogController {
@Resource
private CalcBaseRateCatalogService calcBaseRateCatalogService;
@PostMapping("/create")
@Operation(summary = "创建基数费率目录树节点")
@PreAuthorize("@ss.hasPermission('core:calc-base-rate-catalog:create')")
public CommonResult<Long> createCalcBaseRateCatalog(
@Valid @Validated(CalcBaseRateCatalogSaveReqVO.CreateGroup.class)
@RequestBody CalcBaseRateCatalogSaveReqVO createReqVO) {
return success(calcBaseRateCatalogService.createCalcBaseRateCatalog(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新基数费率目录树节点")
@PreAuthorize("@ss.hasPermission('core:calc-base-rate-catalog:update')")
public CommonResult<Boolean> updateCalcBaseRateCatalog(
@Valid @Validated(CalcBaseRateCatalogSaveReqVO.UpdateGroup.class)
@RequestBody CalcBaseRateCatalogSaveReqVO updateReqVO) {
calcBaseRateCatalogService.updateCalcBaseRateCatalog(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除基数费率目录树节点")
@Parameter(name = "id", description = "节点ID", required = true)
@PreAuthorize("@ss.hasPermission('core:calc-base-rate-catalog:delete')")
public CommonResult<Boolean> deleteCalcBaseRateCatalog(@RequestParam("id") Long id) {
calcBaseRateCatalogService.deleteCalcBaseRateCatalog(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获取基数费率目录树节点")
@Parameter(name = "id", description = "节点ID", required = true)
@PreAuthorize("@ss.hasPermission('core:calc-base-rate-catalog:query')")
public CommonResult<CalcBaseRateCatalogRespVO> getCalcBaseRateCatalog(@RequestParam("id") Long id) {
return success(calcBaseRateCatalogService.getCalcBaseRateCatalog(id));
}
@GetMapping("/tree")
@Operation(summary = "获取基数费率目录树")
@PreAuthorize("@ss.hasPermission('core:calc-base-rate-catalog:query')")
public CommonResult<List<CalcBaseRateCatalogRespVO>> getCalcBaseRateCatalogTree() {
return success(calcBaseRateCatalogService.getCalcBaseRateCatalogTree());
}
}

View File

@@ -0,0 +1,102 @@
package com.yhy.module.core.controller.admin.calcbaserate;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.calcbaserate.vo.CalcBaseRateDirectoryRespVO;
import com.yhy.module.core.controller.admin.calcbaserate.vo.CalcBaseRateDirectorySaveReqVO;
import com.yhy.module.core.controller.admin.calcbaserate.vo.CalcBaseRateDirectorySwapSortReqVO;
import com.yhy.module.core.service.calcbaserate.CalcBaseRateDirectoryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
* 基数费率目录 Controller
*
* @author yhy
*/
@Tag(name = "管理后台 - 基数费率目录")
@RestController
@RequestMapping("/core/calc-base-rate/directory")
@Validated
public class CalcBaseRateDirectoryController {
@Resource
private CalcBaseRateDirectoryService calcBaseRateDirectoryService;
@PostMapping("/create")
@Operation(summary = "创建基数费率目录节点")
@PreAuthorize("@ss.hasPermission('core:calc-base-rate-directory:create')")
public CommonResult<Long> createCalcBaseRateDirectory(
@Valid @Validated(CalcBaseRateDirectorySaveReqVO.CreateGroup.class)
@RequestBody CalcBaseRateDirectorySaveReqVO createReqVO) {
return success(calcBaseRateDirectoryService.createCalcBaseRateDirectory(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新基数费率目录节点")
@PreAuthorize("@ss.hasPermission('core:calc-base-rate-directory:update')")
public CommonResult<Boolean> updateCalcBaseRateDirectory(
@Valid @Validated(CalcBaseRateDirectorySaveReqVO.UpdateGroup.class)
@RequestBody CalcBaseRateDirectorySaveReqVO updateReqVO) {
calcBaseRateDirectoryService.updateCalcBaseRateDirectory(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除基数费率目录节点")
@Parameter(name = "id", description = "节点ID", required = true)
@PreAuthorize("@ss.hasPermission('core:calc-base-rate-directory:delete')")
public CommonResult<Boolean> deleteCalcBaseRateDirectory(@RequestParam("id") Long id) {
calcBaseRateDirectoryService.deleteCalcBaseRateDirectory(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获取基数费率目录节点")
@Parameter(name = "id", description = "节点ID", required = true)
@PreAuthorize("@ss.hasPermission('core:calc-base-rate-directory:query')")
public CommonResult<CalcBaseRateDirectoryRespVO> getCalcBaseRateDirectory(@RequestParam("id") Long id) {
return success(calcBaseRateDirectoryService.getCalcBaseRateDirectory(id));
}
@GetMapping("/tree")
@Operation(summary = "获取基数费率目录树")
@Parameter(name = "calcBaseRateCatalogId", description = "基数费率目录树节点ID", required = true)
@PreAuthorize("@ss.hasPermission('core:calc-base-rate-directory:query')")
public CommonResult<List<CalcBaseRateDirectoryRespVO>> getCalcBaseRateDirectoryTree(
@RequestParam("calcBaseRateCatalogId") Long calcBaseRateCatalogId) {
return success(calcBaseRateDirectoryService.getCalcBaseRateDirectoryTree(calcBaseRateCatalogId));
}
@PostMapping("/swap-sort")
@Operation(summary = "交换排序")
@PreAuthorize("@ss.hasPermission('core:calc-base-rate-directory:update')")
public CommonResult<Boolean> swapSort(@Valid @RequestBody CalcBaseRateDirectorySwapSortReqVO swapReqVO) {
calcBaseRateDirectoryService.swapSort(swapReqVO);
return success(true);
}
@DeleteMapping("/force-delete")
@Operation(summary = "强制删除目录节点(级联删除所有关联数据)")
@Parameter(name = "id", description = "节点ID", required = true)
@PreAuthorize("@ss.hasPermission('core:calc-base-rate-directory:delete')")
public CommonResult<Boolean> forceDeleteCalcBaseRateDirectory(@RequestParam("id") Long id) {
calcBaseRateDirectoryService.forceDeleteCalcBaseRateDirectory(id);
return success(true);
}
}

View File

@@ -0,0 +1,84 @@
package com.yhy.module.core.controller.admin.calcbaserate;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.calcbaserate.vo.CalcBaseRateItemRespVO;
import com.yhy.module.core.controller.admin.calcbaserate.vo.CalcBaseRateItemSaveReqVO;
import com.yhy.module.core.service.calcbaserate.CalcBaseRateItemService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
* 基数费率项 Controller
*
* @author yhy
*/
@Tag(name = "管理后台 - 基数费率项")
@RestController
@RequestMapping("/core/calc-base-rate/item")
@Validated
public class CalcBaseRateItemController {
@Resource
private CalcBaseRateItemService calcBaseRateItemService;
@PostMapping("/create")
@Operation(summary = "创建基数费率项")
@PreAuthorize("@ss.hasPermission('core:calc-base-rate-item:create')")
public CommonResult<Long> createCalcBaseRateItem(
@Valid @Validated(CalcBaseRateItemSaveReqVO.CreateGroup.class)
@RequestBody CalcBaseRateItemSaveReqVO createReqVO) {
return success(calcBaseRateItemService.createCalcBaseRateItem(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新基数费率项")
@PreAuthorize("@ss.hasPermission('core:calc-base-rate-item:update')")
public CommonResult<Boolean> updateCalcBaseRateItem(
@Valid @Validated(CalcBaseRateItemSaveReqVO.UpdateGroup.class)
@RequestBody CalcBaseRateItemSaveReqVO updateReqVO) {
calcBaseRateItemService.updateCalcBaseRateItem(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除基数费率项")
@Parameter(name = "id", description = "费率项ID", required = true)
@PreAuthorize("@ss.hasPermission('core:calc-base-rate-item:delete')")
public CommonResult<Boolean> deleteCalcBaseRateItem(@RequestParam("id") Long id) {
calcBaseRateItemService.deleteCalcBaseRateItem(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获取基数费率项")
@Parameter(name = "id", description = "费率项ID", required = true)
@PreAuthorize("@ss.hasPermission('core:calc-base-rate-item:query')")
public CommonResult<CalcBaseRateItemRespVO> getCalcBaseRateItem(@RequestParam("id") Long id) {
return success(calcBaseRateItemService.getCalcBaseRateItem(id));
}
@GetMapping("/list")
@Operation(summary = "获取费率项列表")
@Parameter(name = "calcBaseRateDirectoryId", description = "目录ID", required = true)
@PreAuthorize("@ss.hasPermission('core:calc-base-rate-item:query')")
public CommonResult<List<CalcBaseRateItemRespVO>> getCalcBaseRateItemList(
@RequestParam("calcBaseRateDirectoryId") Long calcBaseRateDirectoryId) {
return success(calcBaseRateItemService.getCalcBaseRateItemList(calcBaseRateDirectoryId));
}
}

View File

@@ -0,0 +1,53 @@
package com.yhy.module.core.controller.admin.calcbaserate.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import lombok.Data;
/**
* 基数费率目录树 Response VO
*
* @author yhy
*/
@Schema(description = "管理后台 - 基数费率目录树 Response VO")
@Data
public class CalcBaseRateCatalogRespVO {
@Schema(description = "主键ID", example = "1")
private Long id;
@Schema(description = "父节点ID", example = "1")
private Long parentId;
@Schema(description = "编码", example = "CBR_GD")
private String code;
@Schema(description = "名称", example = "广东")
private String name;
@Schema(description = "节点类型", example = "province")
private String nodeType;
@Schema(description = "排序", example = "1")
private Integer sortOrder;
@Schema(description = "树路径")
private String[] path;
@Schema(description = "层级", example = "1")
private Integer level;
@Schema(description = "扩展属性")
private Map<String, Object> attributes;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "更新时间")
private LocalDateTime updateTime;
@Schema(description = "子节点列表")
private List<CalcBaseRateCatalogRespVO> children;
}

View File

@@ -0,0 +1,52 @@
package com.yhy.module.core.controller.admin.calcbaserate.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.Data;
/**
* 基数费率目录树保存 Request VO
*
* @author yhy
*/
@Schema(description = "管理后台 - 基数费率目录树保存 Request VO")
@Data
public class CalcBaseRateCatalogSaveReqVO {
/**
* 创建时的校验分组
*/
public interface CreateGroup {}
/**
* 更新时的校验分组
*/
public interface UpdateGroup {}
@Schema(description = "主键ID", example = "1")
@NotNull(message = "ID不能为空", groups = UpdateGroup.class)
private Long id;
@Schema(description = "父节点ID", example = "1")
private Long parentId;
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "CBR_GD")
@NotBlank(message = "编码不能为空", groups = CreateGroup.class)
private String code;
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "广东")
@NotBlank(message = "名称不能为空", groups = CreateGroup.class)
private String name;
@Schema(description = "节点类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "province")
@NotBlank(message = "节点类型不能为空", groups = CreateGroup.class)
private String nodeType;
@Schema(description = "排序", example = "1")
private Integer sortOrder;
@Schema(description = "扩展属性")
private Map<String, Object> attributes;
}

View File

@@ -0,0 +1,50 @@
package com.yhy.module.core.controller.admin.calcbaserate.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import lombok.Data;
/**
* 基数费率目录 Response VO
*
* @author yhy
*/
@Schema(description = "管理后台 - 基数费率目录 Response VO")
@Data
public class CalcBaseRateDirectoryRespVO {
@Schema(description = "主键ID", example = "1")
private Long id;
@Schema(description = "关联基数费率目录树节点ID", example = "1")
private Long calcBaseRateCatalogId;
@Schema(description = "父节点ID", example = "1")
private Long parentId;
@Schema(description = "目录名称", example = "目录1")
private String name;
@Schema(description = "排序", example = "1")
private Integer sortOrder;
@Schema(description = "树路径")
private String[] path;
@Schema(description = "层级", example = "1")
private Integer level;
@Schema(description = "扩展属性")
private Map<String, Object> attributes;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "更新时间")
private LocalDateTime updateTime;
@Schema(description = "子节点列表")
private List<CalcBaseRateDirectoryRespVO> children;
}

View File

@@ -0,0 +1,46 @@
package com.yhy.module.core.controller.admin.calcbaserate.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map;
import javax.validation.constraints.NotNull;
import lombok.Data;
/**
* 基数费率目录保存 Request VO
*
* @author yhy
*/
@Schema(description = "管理后台 - 基数费率目录保存 Request VO")
@Data
public class CalcBaseRateDirectorySaveReqVO {
/**
* 创建时的校验分组
*/
public interface CreateGroup {}
/**
* 更新时的校验分组
*/
public interface UpdateGroup {}
@Schema(description = "主键ID", example = "1")
@NotNull(message = "ID不能为空", groups = UpdateGroup.class)
private Long id;
@Schema(description = "关联基数费率目录树节点ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "目录树节点ID不能为空", groups = CreateGroup.class)
private Long calcBaseRateCatalogId;
@Schema(description = "父节点ID", example = "1")
private Long parentId;
@Schema(description = "目录名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "目录1")
private String name;
@Schema(description = "排序", example = "1")
private Integer sortOrder;
@Schema(description = "扩展属性")
private Map<String, Object> attributes;
}

View File

@@ -0,0 +1,23 @@
package com.yhy.module.core.controller.admin.calcbaserate.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.NotNull;
import lombok.Data;
/**
* 基数费率目录交换排序 Request VO
*
* @author yhy
*/
@Schema(description = "管理后台 - 基数费率目录交换排序 Request VO")
@Data
public class CalcBaseRateDirectorySwapSortReqVO {
@Schema(description = "节点1 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "节点1 ID不能为空")
private Long nodeId1;
@Schema(description = "节点2 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotNull(message = "节点2 ID不能为空")
private Long nodeId2;
}

View File

@@ -0,0 +1,43 @@
package com.yhy.module.core.controller.admin.calcbaserate.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.util.Map;
import lombok.Data;
/**
* 基数费率项 Response VO
*
* @author yhy
*/
@Schema(description = "管理后台 - 基数费率项 Response VO")
@Data
public class CalcBaseRateItemRespVO {
@Schema(description = "主键ID", example = "1")
private Long id;
@Schema(description = "关联基数费率目录ID", example = "1")
private Long calcBaseRateDirectoryId;
@Schema(description = "名称", example = "人工费")
private String name;
@Schema(description = "费率", example = "3.5%")
private String rate;
@Schema(description = "备注", example = "...")
private String remark;
@Schema(description = "排序", example = "1")
private Integer sortOrder;
@Schema(description = "扩展属性")
private Map<String, Object> attributes;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "更新时间")
private LocalDateTime updateTime;
}

View File

@@ -0,0 +1,49 @@
package com.yhy.module.core.controller.admin.calcbaserate.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map;
import javax.validation.constraints.NotNull;
import lombok.Data;
/**
* 基数费率项保存 Request VO
*
* @author yhy
*/
@Schema(description = "管理后台 - 基数费率项保存 Request VO")
@Data
public class CalcBaseRateItemSaveReqVO {
/**
* 创建时的校验分组
*/
public interface CreateGroup {}
/**
* 更新时的校验分组
*/
public interface UpdateGroup {}
@Schema(description = "主键ID", example = "1")
@NotNull(message = "ID不能为空", groups = UpdateGroup.class)
private Long id;
@Schema(description = "关联基数费率目录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "目录ID不能为空", groups = CreateGroup.class)
private Long calcBaseRateDirectoryId;
@Schema(description = "名称", example = "人工费")
private String name;
@Schema(description = "费率", example = "3.5%")
private String rate;
@Schema(description = "备注", example = "...")
private String remark;
@Schema(description = "排序", example = "1")
private Integer sortOrder;
@Schema(description = "扩展属性")
private Map<String, Object> attributes;
}

View File

@@ -0,0 +1,89 @@
package com.yhy.module.core.controller.admin.config;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.config.vo.ConfigProjectInfoRespVO;
import com.yhy.module.core.controller.admin.config.vo.ConfigProjectInfoSaveReqVO;
import com.yhy.module.core.controller.admin.config.vo.ConfigProjectInfoSwapSortReqVO;
import com.yhy.module.core.service.config.ConfigProjectInfoService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 工程信息配置 Controller
*
* @author yhy
*/
@Tag(name = "管理后台 - 工程信息配置")
@RestController
@RequestMapping("/core/config/project-info")
@Validated
public class ConfigProjectInfoController {
@Resource
private ConfigProjectInfoService configProjectInfoService;
@PostMapping("/create")
@Operation(summary = "创建工程信息配置")
@PreAuthorize("@ss.hasPermission('core:config-project-info:create')")
public CommonResult<Long> createConfigProjectInfo(@Valid @RequestBody ConfigProjectInfoSaveReqVO createReqVO) {
return success(configProjectInfoService.createConfigProjectInfo(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新工程信息配置")
@PreAuthorize("@ss.hasPermission('core:config-project-info:update')")
public CommonResult<Boolean> updateConfigProjectInfo(@Valid @RequestBody ConfigProjectInfoSaveReqVO updateReqVO) {
configProjectInfoService.updateConfigProjectInfo(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除工程信息配置")
@Parameter(name = "id", description = "ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:config-project-info:delete')")
public CommonResult<Boolean> deleteConfigProjectInfo(@RequestParam("id") Long id) {
configProjectInfoService.deleteConfigProjectInfo(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获取工程信息配置详情")
@Parameter(name = "id", description = "ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:config-project-info:query')")
public CommonResult<ConfigProjectInfoRespVO> getConfigProjectInfo(@RequestParam("id") Long id) {
return success(configProjectInfoService.getConfigProjectInfo(id));
}
@GetMapping("/tree")
@Operation(summary = "获取工程信息配置树(按行业节点)")
@Parameter(name = "configTreeId", description = "行业节点ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:config-project-info:query')")
public CommonResult<List<ConfigProjectInfoRespVO>> getConfigProjectInfoTree(
@RequestParam("configTreeId") Long configTreeId) {
return success(configProjectInfoService.getConfigProjectInfoTree(configTreeId));
}
@PostMapping("/swap-sort")
@Operation(summary = "交换排序")
@PreAuthorize("@ss.hasPermission('core:config-project-info:update')")
public CommonResult<Boolean> swapSort(@Valid @RequestBody ConfigProjectInfoSwapSortReqVO swapReqVO) {
configProjectInfoService.swapSort(swapReqVO);
return success(true);
}
}

View File

@@ -0,0 +1,94 @@
package com.yhy.module.core.controller.admin.config;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.*;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.config.vo.ConfigProjectTreeRespVO;
import com.yhy.module.core.controller.admin.config.vo.ConfigProjectTreeSaveReqVO;
import com.yhy.module.core.controller.admin.config.vo.ConfigProjectTreeSwapSortReqVO;
import com.yhy.module.core.service.config.ConfigProjectTreeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 项目界面配置树 Controller
*
* @author yhy
*/
@Tag(name = "管理后台 - 项目界面配置树")
@RestController
@RequestMapping("/core/config/project-tree")
@Validated
public class ConfigProjectTreeController {
@Resource
private ConfigProjectTreeService configProjectTreeService;
@PostMapping("/create")
@Operation(summary = "创建项目界面配置树节点")
@PreAuthorize("@ss.hasPermission('core:config-project-tree:create')")
public CommonResult<Long> createConfigProjectTree(@Valid @RequestBody ConfigProjectTreeSaveReqVO createReqVO) {
return success(configProjectTreeService.createConfigProjectTree(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新项目界面配置树节点")
@PreAuthorize("@ss.hasPermission('core:config-project-tree:update')")
public CommonResult<Boolean> updateConfigProjectTree(@Valid @RequestBody ConfigProjectTreeSaveReqVO updateReqVO) {
configProjectTreeService.updateConfigProjectTree(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除项目界面配置树节点")
@Parameter(name = "id", description = "节点ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:config-project-tree:delete')")
public CommonResult<Boolean> deleteConfigProjectTree(@RequestParam("id") Long id) {
configProjectTreeService.deleteConfigProjectTree(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获取项目界面配置树节点")
@Parameter(name = "id", description = "节点ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:config-project-tree:query')")
public CommonResult<ConfigProjectTreeRespVO> getConfigProjectTree(@RequestParam("id") Long id) {
return success(configProjectTreeService.getConfigProjectTree(id));
}
@GetMapping("/tree")
@Operation(summary = "获取项目界面配置树(树形结构)")
@PreAuthorize("@ss.hasPermission('core:config-project-tree:query')")
public CommonResult<List<ConfigProjectTreeRespVO>> getConfigProjectTreeList() {
return success(configProjectTreeService.getConfigProjectTreeList());
}
@PostMapping("/swap-sort")
@Operation(summary = "交换排序")
@PreAuthorize("@ss.hasPermission('core:config-project-tree:update')")
public CommonResult<Boolean> swapSort(@Valid @RequestBody ConfigProjectTreeSwapSortReqVO swapReqVO) {
configProjectTreeService.swapSort(swapReqVO);
return success(true);
}
@GetMapping("/industry-options")
@Operation(summary = "获取行业下拉选项(省市-行业两级结构)")
@PreAuthorize("@ss.hasPermission('core:config-project-tree:query')")
public CommonResult<List<ConfigProjectTreeRespVO>> getIndustryOptions() {
return success(configProjectTreeService.getIndustryOptions());
}
}

View File

@@ -0,0 +1,80 @@
package com.yhy.module.core.controller.admin.config;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.config.vo.ConfigUnitDivisionTemplateRespVO;
import com.yhy.module.core.controller.admin.config.vo.ConfigUnitDivisionTemplateSaveReqVO;
import com.yhy.module.core.service.config.ConfigUnitDivisionTemplateService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@Tag(name = "管理后台 - 单位工程界面配置 - 分部分项模板")
@RestController
@RequestMapping("/core/config/unit-division-template")
@Validated
public class ConfigUnitDivisionTemplateController {
@Resource
private ConfigUnitDivisionTemplateService service;
@PostMapping("/create")
@Operation(summary = "创建分部分项模板节点")
@PreAuthorize("@ss.hasPermission('core:config:unit-division-template:create')")
public CommonResult<Long> create(@Valid @RequestBody ConfigUnitDivisionTemplateSaveReqVO reqVO) {
return success(service.create(reqVO));
}
@PutMapping("/update")
@Operation(summary = "更新分部分项模板节点")
@PreAuthorize("@ss.hasPermission('core:config:unit-division-template:update')")
public CommonResult<Boolean> update(@Valid @RequestBody ConfigUnitDivisionTemplateSaveReqVO reqVO) {
service.update(reqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除分部分项模板节点(级联删除子节点和引用)")
@Parameter(name = "id", description = "ID", required = true)
@PreAuthorize("@ss.hasPermission('core:config:unit-division-template:delete')")
public CommonResult<Boolean> delete(@RequestParam("id") Long id) {
service.delete(id);
return success(true);
}
@GetMapping("/tree")
@Operation(summary = "获取模板树(按标签页类型)")
@Parameters({
@Parameter(name = "catalogItemId", description = "fields_majors 节点ID", required = true),
@Parameter(name = "tabType", description = "标签页类型division/measure/other/unit_summary", required = true)
})
@PreAuthorize("@ss.hasPermission('core:config:unit-division-template:query')")
public CommonResult<List<ConfigUnitDivisionTemplateRespVO>> getTree(@RequestParam("catalogItemId") Long catalogItemId,
@RequestParam("tabType") String tabType) {
return success(service.getTree(catalogItemId, tabType));
}
@PostMapping("/swap-sort")
@Operation(summary = "交换排序")
@PreAuthorize("@ss.hasPermission('core:config:unit-division-template:update')")
public CommonResult<Boolean> swapSort(@RequestParam("nodeId1") Long nodeId1,
@RequestParam("nodeId2") Long nodeId2) {
service.swapSort(nodeId1, nodeId2);
return success(true);
}
}

View File

@@ -0,0 +1,91 @@
package com.yhy.module.core.controller.admin.config;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.config.vo.ConfigUnitFieldHiddenFieldsRespVO;
import com.yhy.module.core.controller.admin.config.vo.ConfigUnitFieldRespVO;
import com.yhy.module.core.controller.admin.config.vo.ConfigUnitFieldSaveReqVO;
import com.yhy.module.core.service.config.ConfigUnitFieldService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@Tag(name = "管理后台 - 单位工程界面配置 - 工作台字段设置")
@RestController
@RequestMapping("/core/config/unit-field")
@Validated
public class ConfigUnitFieldController {
@Resource
private ConfigUnitFieldService configUnitFieldService;
@PostMapping("/create")
@Operation(summary = "创建工作台字段设置")
@PreAuthorize("@ss.hasPermission('core:config:unit-field:create')")
public CommonResult<Long> create(@Valid @RequestBody ConfigUnitFieldSaveReqVO createReqVO) {
return success(configUnitFieldService.create(createReqVO));
}
@PostMapping("/batch-create")
@Operation(summary = "批量创建工作台字段设置")
@PreAuthorize("@ss.hasPermission('core:config:unit-field:create')")
public CommonResult<Boolean> batchCreate(@Valid @RequestBody List<ConfigUnitFieldSaveReqVO> createReqVOs) {
configUnitFieldService.batchCreate(createReqVOs);
return success(true);
}
@PutMapping("/update")
@Operation(summary = "更新工作台字段设置")
@PreAuthorize("@ss.hasPermission('core:config:unit-field:update')")
public CommonResult<Boolean> update(@Valid @RequestBody ConfigUnitFieldSaveReqVO updateReqVO) {
configUnitFieldService.update(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除工作台字段设置")
@Parameter(name = "id", description = "ID", required = true)
@PreAuthorize("@ss.hasPermission('core:config:unit-field:delete')")
public CommonResult<Boolean> delete(@RequestParam("id") Long id) {
configUnitFieldService.delete(id);
return success(true);
}
@GetMapping("/list")
@Operation(summary = "获取工作台字段设置列表")
@Parameter(name = "catalogItemId", description = "fields_majors 节点ID", required = true)
@PreAuthorize("@ss.hasPermission('core:config:unit-field:query')")
public CommonResult<List<ConfigUnitFieldRespVO>> getList(@RequestParam("catalogItemId") Long catalogItemId) {
return success(configUnitFieldService.getList(catalogItemId));
}
@PostMapping("/swap-sort")
@Operation(summary = "交换排序")
@PreAuthorize("@ss.hasPermission('core:config:unit-field:update')")
public CommonResult<Boolean> swapSort(@RequestParam("nodeId1") Long nodeId1,
@RequestParam("nodeId2") Long nodeId2) {
configUnitFieldService.swapSort(nodeId1, nodeId2);
return success(true);
}
@GetMapping("/hidden-fields")
@Operation(summary = "获取隐藏字段列表(供工作台调用)")
@Parameter(name = "catalogItemId", description = "fields_majors 节点ID", required = true)
public CommonResult<ConfigUnitFieldHiddenFieldsRespVO> getHiddenFields(@RequestParam("catalogItemId") Long catalogItemId) {
return success(configUnitFieldService.getHiddenFields(catalogItemId));
}
}

View File

@@ -0,0 +1,90 @@
package com.yhy.module.core.controller.admin.config;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.config.vo.ConfigUnitResourceFieldRespVO;
import com.yhy.module.core.controller.admin.config.vo.ConfigUnitResourceFieldSaveReqVO;
import com.yhy.module.core.service.config.ConfigUnitResourceFieldService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@Tag(name = "管理后台 - 单位工程界面配置 - 工料机字段")
@RestController
@RequestMapping("/core/config/unit-resource-field")
@Validated
public class ConfigUnitResourceFieldController {
@Resource
private ConfigUnitResourceFieldService service;
@PostMapping("/create")
@Operation(summary = "创建工料机字段设置")
@PreAuthorize("@ss.hasPermission('core:config:unit-resource-field:create')")
public CommonResult<Long> create(@Valid @RequestBody ConfigUnitResourceFieldSaveReqVO reqVO) {
return success(service.create(reqVO));
}
@PostMapping("/batch-create")
@Operation(summary = "批量创建工料机字段设置")
@PreAuthorize("@ss.hasPermission('core:config:unit-resource-field:create')")
public CommonResult<Boolean> batchCreate(@Valid @RequestBody List<ConfigUnitResourceFieldSaveReqVO> createReqVOs) {
service.batchCreate(createReqVOs);
return success(true);
}
@PutMapping("/update")
@Operation(summary = "更新工料机字段设置")
@PreAuthorize("@ss.hasPermission('core:config:unit-resource-field:update')")
public CommonResult<Boolean> update(@Valid @RequestBody ConfigUnitResourceFieldSaveReqVO reqVO) {
service.update(reqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除工料机字段设置")
@Parameter(name = "id", description = "ID", required = true)
@PreAuthorize("@ss.hasPermission('core:config:unit-resource-field:delete')")
public CommonResult<Boolean> delete(@RequestParam("id") Long id) {
service.delete(id);
return success(true);
}
@GetMapping("/list")
@Operation(summary = "获取工料机字段设置列表")
@Parameter(name = "catalogItemId", description = "fields_majors 节点ID", required = true)
@PreAuthorize("@ss.hasPermission('core:config:unit-resource-field:query')")
public CommonResult<List<ConfigUnitResourceFieldRespVO>> getList(@RequestParam("catalogItemId") Long catalogItemId) {
return success(service.getList(catalogItemId));
}
@PostMapping("/swap-sort")
@Operation(summary = "交换排序")
@PreAuthorize("@ss.hasPermission('core:config:unit-resource-field:update')")
public CommonResult<Boolean> swapSort(@RequestParam("nodeId1") Long nodeId1,
@RequestParam("nodeId2") Long nodeId2) {
service.swapSort(nodeId1, nodeId2);
return success(true);
}
@GetMapping("/hidden-fields")
@Operation(summary = "获取隐藏字段列表(供工作台调用)")
@Parameter(name = "catalogItemId", description = "fields_majors 节点ID", required = true)
public CommonResult<List<String>> getHiddenFields(@RequestParam("catalogItemId") Long catalogItemId) {
return success(service.getHiddenFields(catalogItemId));
}
}

View File

@@ -0,0 +1,72 @@
package com.yhy.module.core.controller.admin.config;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.config.vo.ConfigUnitTabRefRespVO;
import com.yhy.module.core.controller.admin.config.vo.ConfigUnitTabRefSaveReqVO;
import com.yhy.module.core.service.config.ConfigUnitTabRefService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@Tag(name = "管理后台 - 单位工程界面配置 - 标签页引用")
@RestController
@RequestMapping("/core/config/unit-tab-ref")
@Validated
public class ConfigUnitTabRefController {
@Resource
private ConfigUnitTabRefService service;
@PostMapping("/save-refs")
@Operation(summary = "批量保存引用(覆盖式)")
@PreAuthorize("@ss.hasPermission('core:config:unit-tab-ref:create')")
public CommonResult<Boolean> saveRefs(@Valid @RequestBody ConfigUnitTabRefSaveReqVO reqVO) {
service.saveRefs(reqVO);
return success(true);
}
@GetMapping("/list")
@Operation(summary = "获取引用列表(含模板节点详情)")
@Parameters({
@Parameter(name = "catalogItemId", description = "fields_majors 节点ID", required = true),
@Parameter(name = "tabType", description = "标签页类型measure/other/unit_summary", required = true)
})
@PreAuthorize("@ss.hasPermission('core:config:unit-tab-ref:query')")
public CommonResult<List<ConfigUnitTabRefRespVO>> getList(@RequestParam("catalogItemId") Long catalogItemId,
@RequestParam("tabType") String tabType) {
return success(service.getList(catalogItemId, tabType));
}
@DeleteMapping("/delete")
@Operation(summary = "取消单个引用")
@Parameter(name = "id", description = "引用ID", required = true)
@PreAuthorize("@ss.hasPermission('core:config:unit-tab-ref:delete')")
public CommonResult<Boolean> delete(@RequestParam("id") Long id) {
service.delete(id);
return success(true);
}
@PostMapping("/swap-sort")
@Operation(summary = "交换排序")
@PreAuthorize("@ss.hasPermission('core:config:unit-tab-ref:update')")
public CommonResult<Boolean> swapSort(@RequestParam("nodeId1") Long nodeId1,
@RequestParam("nodeId2") Long nodeId2) {
service.swapSort(nodeId1, nodeId2);
return success(true);
}
}

View File

@@ -0,0 +1,45 @@
package com.yhy.module.core.controller.admin.config.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import lombok.Data;
/**
* 工程信息配置 Response VO
*/
@Schema(description = "管理后台 - 工程信息配置 Response VO")
@Data
public class ConfigProjectInfoRespVO {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long id;
@Schema(description = "关联的行业节点ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long configTreeId;
@Schema(description = "父节点ID", example = "0")
private Long parentId;
@Schema(description = "代号", example = "TAX_RATE")
private String code;
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "税率设置")
private String name;
@Schema(description = "内容配置")
private Map<String, Object> content;
@Schema(description = "排序号", example = "1")
private Integer sortOrder;
@Schema(description = "层级路径")
private String[] path;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "子节点列表")
private List<ConfigProjectInfoRespVO> children;
}

View File

@@ -0,0 +1,38 @@
package com.yhy.module.core.controller.admin.config.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import lombok.Data;
/**
* 工程信息配置 创建/更新 Request VO
*/
@Schema(description = "管理后台 - 工程信息配置创建/更新 Request VO")
@Data
public class ConfigProjectInfoSaveReqVO {
@Schema(description = "ID更新时必填", example = "1")
private Long id;
@Schema(description = "关联的行业节点ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "关联的行业节点ID不能为空")
private Long configTreeId;
@Schema(description = "父节点ID", example = "0")
private Long parentId;
@Schema(description = "代号", example = "TAX_RATE")
@Size(max = 50, message = "代号长度不能超过50个字符")
private String code;
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "税率设置")
@NotBlank(message = "名称不能为空")
@Size(max = 200, message = "名称长度不能超过200个字符")
private String name;
@Schema(description = "内容配置JSONB存储复杂控制逻辑")
private Map<String, Object> content;
}

View File

@@ -0,0 +1,21 @@
package com.yhy.module.core.controller.admin.config.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.NotNull;
import lombok.Data;
/**
* 工程信息配置 交换排序 Request VO
*/
@Schema(description = "管理后台 - 工程信息配置交换排序 Request VO")
@Data
public class ConfigProjectInfoSwapSortReqVO {
@Schema(description = "节点1 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "节点1 ID不能为空")
private Long nodeId1;
@Schema(description = "节点2 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotNull(message = "节点2 ID不能为空")
private Long nodeId2;
}

View File

@@ -0,0 +1,45 @@
package com.yhy.module.core.controller.admin.config.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import lombok.Data;
/**
* 项目界面配置树 Response VO
*/
@Schema(description = "管理后台 - 项目界面配置树 Response VO")
@Data
public class ConfigProjectTreeRespVO {
@Schema(description = "节点ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long id;
@Schema(description = "父节点ID", example = "0")
private Long parentId;
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "GD")
private String code;
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "广东")
private String name;
@Schema(description = "节点类型root-根节点, province-省市, industry-行业", requiredMode = Schema.RequiredMode.REQUIRED, example = "province")
private String nodeType;
@Schema(description = "排序号", example = "1")
private Integer sortOrder;
@Schema(description = "层级路径")
private String[] path;
@Schema(description = "扩展属性")
private Map<String, Object> attributes;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "子节点列表")
private List<ConfigProjectTreeRespVO> children;
}

View File

@@ -0,0 +1,42 @@
package com.yhy.module.core.controller.admin.config.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import lombok.Data;
/**
* 项目界面配置树 创建/更新 Request VO
*/
@Schema(description = "管理后台 - 项目界面配置树创建/更新 Request VO")
@Data
public class ConfigProjectTreeSaveReqVO {
@Schema(description = "节点ID更新时必填", example = "1")
private Long id;
@Schema(description = "父节点ID", example = "0")
private Long parentId;
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "GD")
@NotBlank(message = "编码不能为空")
@Size(max = 50, message = "编码长度不能超过50个字符")
private String code;
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "广东")
@NotBlank(message = "名称不能为空")
@Size(max = 200, message = "名称长度不能超过200个字符")
private String name;
@Schema(description = "节点类型root-根节点, province-省市, industry-行业", requiredMode = Schema.RequiredMode.REQUIRED, example = "province")
@NotBlank(message = "节点类型不能为空")
private String nodeType;
@Schema(description = "扩展属性")
private Map<String, Object> attributes;
// 验证分组
public interface CreateGroup {}
public interface UpdateGroup {}
}

View File

@@ -0,0 +1,21 @@
package com.yhy.module.core.controller.admin.config.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.NotNull;
import lombok.Data;
/**
* 项目界面配置树 交换排序 Request VO
*/
@Schema(description = "管理后台 - 项目界面配置树交换排序 Request VO")
@Data
public class ConfigProjectTreeSwapSortReqVO {
@Schema(description = "节点1 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "节点1 ID不能为空")
private Long nodeId1;
@Schema(description = "节点2 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotNull(message = "节点2 ID不能为空")
private Long nodeId2;
}

View File

@@ -0,0 +1,56 @@
package com.yhy.module.core.controller.admin.config.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.util.List;
import lombok.Data;
@Schema(description = "管理后台 - 分部分项模板 Response VO")
@Data
public class ConfigUnitDivisionTemplateRespVO {
@Schema(description = "ID")
private Long id;
@Schema(description = "关联 fields_majors 节点ID")
private Long catalogItemId;
@Schema(description = "父节点ID")
private Long parentId;
@Schema(description = "节点类型division/boq")
private String nodeType;
@Schema(description = "编码")
private String code;
@Schema(description = "名称")
private String name;
@Schema(description = "单位")
private String unit;
@Schema(description = "排序")
private Integer sortOrder;
@Schema(description = "标签页类型")
private String tabType;
@Schema(description = "扩展属性")
private java.util.Map<String, Object> attributes;
@Schema(description = "费率")
private java.math.BigDecimal rate;
@Schema(description = "备注")
private String remark;
@Schema(description = "费用代号")
private String costCode;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "子节点列表")
private List<ConfigUnitDivisionTemplateRespVO> children;
}

View File

@@ -0,0 +1,61 @@
package com.yhy.module.core.controller.admin.config.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.Data;
@Schema(description = "管理后台 - 分部分项模板 创建/更新 Request VO")
@Data
public class ConfigUnitDivisionTemplateSaveReqVO {
@Schema(description = "ID更新时必填")
private Long id;
@Schema(description = "关联 fields_majors 节点ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "catalogItemId 不能为空")
private Long catalogItemId;
@Schema(description = "父节点ID")
private Long parentId;
@Schema(description = "节点类型division/boq", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "节点类型不能为空")
private String nodeType;
@Schema(description = "编码")
private String code;
@Schema(description = "名称")
private String name;
@Schema(description = "单位")
private String unit;
@Schema(description = "扩展属性含基数calcBase、基数范围baseNumberRange等")
private java.util.Map<String, Object> attributes;
@Schema(description = "费率")
private java.math.BigDecimal rate;
@Schema(description = "备注")
private String remark;
@Schema(description = "费用代号(只允许英文字母)")
@javax.validation.constraints.Pattern(regexp = "^[a-zA-Z]*$", message = "费用代号只允许英文字母")
private String costCode;
@Schema(description = "标签页类型division/measure/other/unit_summary", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "标签页类型不能为空")
private String tabType;
@Schema(description = "插入位置above/below/end")
private String insertPosition;
@Schema(description = "参考节点ID")
private Long referenceNodeId;
public static final String INSERT_POSITION_ABOVE = "above";
public static final String INSERT_POSITION_BELOW = "below";
public static final String INSERT_POSITION_END = "end";
}

View File

@@ -0,0 +1,24 @@
package com.yhy.module.core.controller.admin.config.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
import lombok.Builder;
import lombok.Data;
@Schema(description = "管理后台 - 工作台字段隐藏列表 Response VO供工作台调用")
@Data
@Builder
public class ConfigUnitFieldHiddenFieldsRespVO {
@Schema(description = "分部分项隐藏的字段编码列表")
private List<String> divisionHiddenFields;
@Schema(description = "措施项目隐藏的字段编码列表")
private List<String> measureHiddenFields;
@Schema(description = "其他项目隐藏的字段编码列表")
private List<String> otherHiddenFields;
@Schema(description = "汇总分析隐藏的字段编码列表")
private List<String> summaryHiddenFields;
}

View File

@@ -0,0 +1,46 @@
package com.yhy.module.core.controller.admin.config.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import lombok.Data;
@Schema(description = "管理后台 - 工作台字段设置 Response VO")
@Data
public class ConfigUnitFieldRespVO {
@Schema(description = "ID")
private Long id;
@Schema(description = "关联 fields_majors 节点ID")
private Long catalogItemId;
@Schema(description = "序号")
private Integer seqNo;
@Schema(description = "字段名称")
private String fieldName;
@Schema(description = "字段编码")
private String fieldCode;
@Schema(description = "分部分项隐藏")
private Boolean divisionHidden;
@Schema(description = "措施项目隐藏")
private Boolean measureHidden;
@Schema(description = "其他项目隐藏")
private Boolean otherHidden;
@Schema(description = "汇总分析隐藏")
private Boolean summaryHidden;
@Schema(description = "备注")
private String remark;
@Schema(description = "排序")
private Integer sortOrder;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,55 @@
package com.yhy.module.core.controller.admin.config.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.Data;
@Schema(description = "管理后台 - 工作台字段设置 创建/更新 Request VO")
@Data
public class ConfigUnitFieldSaveReqVO {
@Schema(description = "ID更新时必填")
private Long id;
@Schema(description = "关联 fields_majors 节点ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "catalogItemId 不能为空")
private Long catalogItemId;
@Schema(description = "序号(用户录入)")
private Integer seqNo;
@Schema(description = "字段名称", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "字段名称不能为空")
private String fieldName;
@Schema(description = "字段编码(英文)", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "字段编码不能为空")
private String fieldCode;
@Schema(description = "分部分项隐藏")
private Boolean divisionHidden;
@Schema(description = "措施项目隐藏")
private Boolean measureHidden;
@Schema(description = "其他项目隐藏")
private Boolean otherHidden;
@Schema(description = "汇总分析隐藏")
private Boolean summaryHidden;
@Schema(description = "备注")
private String remark;
// 排序相关
@Schema(description = "插入位置above/below/end")
private String insertPosition;
@Schema(description = "参考节点ID")
private Long referenceNodeId;
public static final String INSERT_POSITION_ABOVE = "above";
public static final String INSERT_POSITION_BELOW = "below";
public static final String INSERT_POSITION_END = "end";
}

View File

@@ -0,0 +1,37 @@
package com.yhy.module.core.controller.admin.config.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import lombok.Data;
@Schema(description = "管理后台 - 工料机字段设置 Response VO")
@Data
public class ConfigUnitResourceFieldRespVO {
@Schema(description = "ID")
private Long id;
@Schema(description = "关联 fields_majors 节点ID")
private Long catalogItemId;
@Schema(description = "序号")
private Integer seqNo;
@Schema(description = "字段名称")
private String fieldName;
@Schema(description = "字段编码")
private String fieldCode;
@Schema(description = "是否显示")
private Boolean visible;
@Schema(description = "备注")
private String remark;
@Schema(description = "排序")
private Integer sortOrder;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,41 @@
package com.yhy.module.core.controller.admin.config.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.Data;
@Schema(description = "管理后台 - 工料机字段设置 创建/更新 Request VO")
@Data
public class ConfigUnitResourceFieldSaveReqVO {
@Schema(description = "ID更新时必填")
private Long id;
@Schema(description = "关联 fields_majors 节点ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "catalogItemId 不能为空")
private Long catalogItemId;
@Schema(description = "序号")
private Integer seqNo;
@Schema(description = "字段名称", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "字段名称不能为空")
private String fieldName;
@Schema(description = "字段编码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "字段编码不能为空")
private String fieldCode;
@Schema(description = "是否显示")
private Boolean visible;
@Schema(description = "备注")
private String remark;
@Schema(description = "插入位置above/below/end")
private String insertPosition;
@Schema(description = "参考节点ID")
private Long referenceNodeId;
}

View File

@@ -0,0 +1,45 @@
package com.yhy.module.core.controller.admin.config.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.util.List;
import lombok.Data;
@Schema(description = "管理后台 - 标签页引用 Response VO")
@Data
public class ConfigUnitTabRefRespVO {
@Schema(description = "引用ID")
private Long id;
@Schema(description = "关联 fields_majors 节点ID")
private Long catalogItemId;
@Schema(description = "标签页类型")
private String tabType;
@Schema(description = "引用的模板节点ID")
private Long templateNodeId;
@Schema(description = "排序")
private Integer sortOrder;
@Schema(description = "创建时间")
private LocalDateTime createTime;
// 关联的模板节点信息
@Schema(description = "模板节点类型")
private String nodeType;
@Schema(description = "模板节点编码")
private String code;
@Schema(description = "模板节点名称")
private String name;
@Schema(description = "模板节点单位")
private String unit;
@Schema(description = "子节点列表(引用分部时包含其下的清单)")
private List<ConfigUnitDivisionTemplateRespVO> children;
}

View File

@@ -0,0 +1,24 @@
package com.yhy.module.core.controller.admin.config.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.Data;
@Schema(description = "管理后台 - 标签页引用 批量保存 Request VO")
@Data
public class ConfigUnitTabRefSaveReqVO {
@Schema(description = "关联 fields_majors 节点ID", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "catalogItemId 不能为空")
private Long catalogItemId;
@Schema(description = "标签页类型measure/other/unit_summary", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "标签页类型不能为空")
private String tabType;
@Schema(description = "引用的模板节点ID列表", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "模板节点ID列表不能为空")
private List<Long> templateNodeIds;
}

View File

@@ -2,9 +2,11 @@ package com.yhy.module.core.controller.admin.infoprice;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
import com.yhy.module.core.controller.admin.infoprice.vo.InfoPriceBookPageReqVO;
import com.yhy.module.core.controller.admin.infoprice.vo.InfoPriceBookRespVO;
import com.yhy.module.core.controller.admin.infoprice.vo.InfoPriceBookSaveReqVO;
import com.yhy.module.core.controller.admin.infoprice.vo.InfoPriceResourceRespVO;
import com.yhy.module.core.service.infoprice.InfoPriceBookService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -65,4 +67,44 @@ public class InfoPriceBookController {
public CommonResult<PageResult<InfoPriceBookRespVO>> getInfoPriceBookPage(@Valid InfoPriceBookPageReqVO pageReqVO) {
return success(infoPriceBookService.getInfoPriceBookPage(pageReqVO));
}
@GetMapping("/copyPage")
@Operation(summary = "分页查询信息价册-复制按钮排除租户1")
@PreAuthorize("@ss.hasPermission('core:info-price:query')")
public CommonResult<PageResult<InfoPriceBookRespVO>> getInfoPriceBookCopyPage(@Valid InfoPriceBookPageReqVO pageReqVO) {
// 忽略租户过滤,查询所有租户数据,然后在 Service 层排除租户1
PageResult<InfoPriceBookRespVO> result = TenantUtils.executeIgnore(() ->
infoPriceBookService.getInfoPriceBookPageExcludeTenant(pageReqVO, 1L)
);
return success(result);
}
@PostMapping("/create/copy")
@Operation(summary = "创建信息价册-复制")
@PreAuthorize("@ss.hasPermission('core:info-price:create')")
public CommonResult<Long> createInfoPriceBookCopy(@RequestParam("id") Long id) {
return success(infoPriceBookService.copyInfoPriceBook(id));
}
@GetMapping("/list")
@Operation(summary = "根据树节点ID查询全部信息价册")
@Parameter(name = "treeNodeId", description = "树节点ID", required = true)
@Parameter(name = "excludeBookId", description = "排除的信息价册ID", required = false)
@PreAuthorize("@ss.hasPermission('core:info-price:query')")
public CommonResult<java.util.List<InfoPriceBookRespVO>> getInfoPriceBookAll(InfoPriceBookPageReqVO pageReqVO) {
java.util.List<InfoPriceBookRespVO> result = TenantUtils.execute(1L,() ->
infoPriceBookService.getInfoPriceBookAll(pageReqVO)
);
return success(result);
}
@GetMapping("/wb-list")
@Operation(summary = "根据树节点ID查询信息价册列表工作台专用不过滤发布状态")
@Parameter(name = "treeNodeId", description = "树节点ID", required = true)
@PreAuthorize("@ss.hasPermission('core:info-price:query')")
public CommonResult<java.util.List<InfoPriceBookRespVO>> getInfoPriceBookListForWorkbench(@RequestParam("treeNodeId") Long treeNodeId) {
java.util.List<InfoPriceBookRespVO> result = TenantUtils.execute(1L, () ->
infoPriceBookService.getInfoPriceBookListForWorkbench(treeNodeId)
);
return success(result);
}
}

View File

@@ -2,10 +2,13 @@ package com.yhy.module.core.controller.admin.infoprice;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
import com.yhy.module.core.controller.admin.infoprice.vo.InfoPriceResourcePageReqVO;
import com.yhy.module.core.controller.admin.infoprice.vo.InfoPriceResourceRespVO;
import com.yhy.module.core.controller.admin.infoprice.vo.InfoPriceResourceSaveReqVO;
import com.yhy.module.core.dal.dataobject.resource.ResourceCatalogItemDO;
import com.yhy.module.core.service.infoprice.InfoPriceResourceService;
import com.yhy.module.core.service.infoprice.InfoPriceResourcePriceService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -28,6 +31,9 @@ public class InfoPriceResourceController {
@Resource
private InfoPriceResourceService resourceService;
@Resource
private InfoPriceResourcePriceService resourcePriceService;
@PostMapping("/create")
@Operation(summary = "创建信息价工料机信息")
@PreAuthorize("@ss.hasPermission('core:info-price:create')")
@@ -78,4 +84,26 @@ public class InfoPriceResourceController {
return success(list);
}
@PostMapping("/create-batch")
@Operation(summary = "批量创建信息价工料机信息")
@PreAuthorize("@ss.hasPermission('core:info-price:create')")
public CommonResult<List<Long>> createResourceBatch(@Valid @RequestBody List<InfoPriceResourceSaveReqVO> createReqVOList) {
List<Long> resourceBatch = resourceService.createResourceBatch(createReqVOList);
if(resourceBatch.size() > 0){
// 根据sourceResourceItemId查询对应InfoPriceResourcePriceService信息价工料机价格历史并创建复制内容
resourcePriceService.copyResourcePriceHistories(createReqVOList, resourceBatch);
}
return success(resourceBatch);
}
@GetMapping("/history")
@Operation(summary = "调用历史信息-获得信息价工料机信息分页")
@PreAuthorize("@ss.hasPermission('core:info-price:query')")
public CommonResult<PageResult<InfoPriceResourceRespVO>> getResourcePageHistory(@Valid InfoPriceResourcePageReqVO pageReqVO) {
pageReqVO.setHistory(true);
PageResult<InfoPriceResourceRespVO> pageResult = TenantUtils.executeIgnore(() ->
resourceService.getResourcePage(pageReqVO)
);
return success(pageResult);
}
}

View File

@@ -2,9 +2,11 @@ package com.yhy.module.core.controller.admin.infoprice;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
import com.yhy.module.core.controller.admin.infoprice.vo.InfoPriceResourcePricePageReqVO;
import com.yhy.module.core.controller.admin.infoprice.vo.InfoPriceResourcePriceRespVO;
import com.yhy.module.core.controller.admin.infoprice.vo.InfoPriceResourcePriceSaveReqVO;
import com.yhy.module.core.controller.admin.infoprice.vo.InfoPriceResourceRespVO;
import com.yhy.module.core.service.infoprice.InfoPriceResourcePriceService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -78,4 +80,13 @@ public class InfoPriceResourcePriceController {
return success(list);
}
@GetMapping("/history")
@Operation(summary = "调用历史信息-获得信息价工料机价格历史分页")
@PreAuthorize("@ss.hasPermission('core:info-price:query')")
public CommonResult<PageResult<InfoPriceResourcePriceRespVO>> getResourcePricePageHistory(@Valid InfoPriceResourcePricePageReqVO pageReqVO) {
PageResult<InfoPriceResourcePriceRespVO> pageResult = TenantUtils.executeIgnore(() ->
resourcePriceService.getResourcePricePage(pageReqVO)
);
return success(pageResult);
}
}

View File

@@ -1,6 +1,9 @@
package com.yhy.module.core.controller.admin.infoprice;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
import com.yhy.module.core.controller.admin.infoprice.vo.InfoPriceBookRespVO;
import com.yhy.module.core.controller.admin.infoprice.vo.InfoPriceTreeRespVO;
import com.yhy.module.core.controller.admin.infoprice.vo.InfoPriceTreeSaveReqVO;
import com.yhy.module.core.controller.admin.infoprice.vo.InfoPriceTreeSwapSortReqVO;
@@ -64,7 +67,11 @@ public class InfoPriceTreeController {
@Parameter(name = "enumType", description = "枚举类型", required = true, example = "region_a")
@PreAuthorize("@ss.hasPermission('core:info-price:query')")
public CommonResult<List<InfoPriceTreeRespVO>> getInfoPriceTreeList(@RequestParam("enumType") String enumType) {
return success(infoPriceTreeService.getInfoPriceTreeList(enumType));
// 忽略租户过滤,查询所有租户数据,然后在 Service 层排除租户1
List<InfoPriceTreeRespVO> result = TenantUtils.executeIgnore(() ->
infoPriceTreeService.getInfoPriceTreeList(enumType)
);
return success(result);
}
@PostMapping("/swap-sort")

View File

@@ -1,6 +1,7 @@
package com.yhy.module.core.controller.admin.infoprice.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -28,17 +29,28 @@ public class InfoPriceBookPageReqVO extends PageParam {
@Schema(description = "开始时间-开始", example = "2024-01-01")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private LocalDate startTimeBegin;
@Schema(description = "开始时间-结束", example = "2024-01-31")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private LocalDate startTimeEnd;
@Schema(description = "结束时间-开始", example = "2024-01-01")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private LocalDate endTimeBegin;
@Schema(description = "结束时间-结束", example = "2024-01-31")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private LocalDate endTimeEnd;
@Schema(description = "是否有附件", example = "true")
private Boolean attachment;
@Schema(description = "除非树节点ID", example = "1")
private Long excludeBookId;
}

View File

@@ -1,11 +1,15 @@
package com.yhy.module.core.controller.admin.infoprice.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 信息价册 Response VO")
@Data
public class InfoPriceBookRespVO {
@@ -26,17 +30,22 @@ public class InfoPriceBookRespVO {
private String name;
@Schema(description = "开始时间", example = "2024-01-01")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private LocalDate startTime;
@Schema(description = "结束时间", example = "2024-01-31")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private LocalDate endTime;
@Schema(description = "发布状态", example = "published")
private String publishStatus;
@Schema(description = "发布时间", example = "2024-01-01 10:00:00")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime publishTime;
@Schema(description = "完成时间", example = "2024-01-01 10:00:00")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime completedTime;
@Schema(description = "附件", example = "http://example.com/file.pdf")
private String attachment;
@@ -54,4 +63,9 @@ public class InfoPriceBookRespVO {
@Schema(description = "更新时间")
private LocalDateTime updateTime;
@Schema(description = "分类树子节点列表")
private List<InfoPriceCategoryTreeRespVO> children;
@Schema(description = "工料机总数(虚拟字段)", example = "100")
private Long resourceCount;
}

View File

@@ -1,5 +1,6 @@
package com.yhy.module.core.controller.admin.infoprice.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
@@ -32,11 +33,13 @@ public class InfoPriceBookSaveReqVO {
@Schema(description = "开始时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-01-01")
@NotNull(message = "开始时间不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private LocalDate startTime;
@Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-01-31")
@NotNull(message = "结束时间不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private LocalDate endTime;
@Schema(description = "发布状态", example = "published")

View File

@@ -6,16 +6,13 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.validation.constraints.NotNull;
@Schema(description = "管理后台 - 信息价工料机信息分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class InfoPriceResourcePageReqVO extends PageParam {
@Schema(description = "分类树节点ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "分类树节点ID不能为空")
@Schema(description = "分类树节点ID", example = "1")
private Long categoryTreeId;
@Schema(description = "编码(模糊查询)", example = "RES001")
@@ -24,4 +21,22 @@ public class InfoPriceResourcePageReqVO extends PageParam {
@Schema(description = "名称(模糊查询)", example = "水泥")
private String name;
@Schema(description = "工料机ID精确匹配", example = "100")
private Long sourceResourceItemId;
@Schema(description = "规格型号(模糊查询)", example = "P.O 42.5")
private String spec;
@Schema(description = "信息价专业类型", example = "profession_1")
private String professionType;
@Schema(description = "信息价树节点ID地区", example = "1")
private String treeNodeId;
@Schema(description = "排除已关联的资源ID列表用于未关联表格")
private java.util.List<Long> excludeIds;
@Schema(description = "是否查询历史")
private Boolean history;
}

View File

@@ -5,8 +5,10 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
@Schema(description = "管理后台 - 信息价工料机价格历史分页 Request VO")
@Data
@@ -18,4 +20,12 @@ public class InfoPriceResourcePricePageReqVO extends PageParam {
@NotNull(message = "工料机信息ID不能为空")
private Long resourceId;
@Schema(description = "开始时间(查询范围)", example = "2024-01-01")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate startTime;
@Schema(description = "结束时间(查询范围)", example = "2024-12-31")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate endTime;
}

View File

@@ -1,5 +1,6 @@
package com.yhy.module.core.controller.admin.infoprice.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -8,6 +9,8 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Map;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
@Schema(description = "管理后台 - 信息价工料机价格历史 Response VO")
@Data
public class InfoPriceResourcePriceRespVO {
@@ -22,9 +25,11 @@ public class InfoPriceResourcePriceRespVO {
private Long resourceId;
@Schema(description = "开始时间", example = "2024-01-01")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private LocalDate startTime;
@Schema(description = "结束时间", example = "2024-01-31")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private LocalDate endTime;
@Schema(description = "除税单价", example = "450.00")

View File

@@ -23,13 +23,16 @@ public class InfoPriceResourceRespVO {
@Schema(description = "编码", example = "RES001")
private String code;
@Schema(description = "名称", example = "水泥")
@Schema(description = "引用工料机ID", example = "1")
private Long sourceResourceItemId;
@Schema(description = "名称(虚拟字段,从工料机表获取)", example = "水泥")
private String name;
@Schema(description = "型号规格", example = "P.O 42.5")
@Schema(description = "型号规格(虚拟字段,从工料机表获取)", example = "P.O 42.5")
private String spec;
@Schema(description = "单位", example = "t")
@Schema(description = "单位(虚拟字段,从工料机表获取)", example = "t")
private String unit;
@Schema(description = "除税编制价", example = "450.00")
@@ -53,13 +56,22 @@ public class InfoPriceResourceRespVO {
@Schema(description = "排序", example = "1")
private Integer sortOrder;
@Schema(description = "资源项ID可选关联标准库", example = "1")
private Long resourceItemId;
@Schema(description = "扩展属性", example = "{}")
private Map<String, Object> attributes;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "信息价册名称(虚拟字段,从信息价册表获取)", example = "2024年1月深圳建筑工程信息价")
private String bookName;
@Schema(description = "信息价册附件(虚拟字段,从信息价册表获取)", example = "http://example.com/attachment.pdf")
private String bookAttachment;
@Schema(description = "信息价专业类型(虚拟字段,从信息价树表获取)", example = "profession_1")
private String professionType;
@Schema(description = "完整地区路径(虚拟字段,从信息价树表获取)", example = "广东 / 深圳 / 南山区")
private String fullRegion;
}

View File

@@ -4,7 +4,6 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Map;
@@ -15,22 +14,21 @@ public class InfoPriceResourceSaveReqVO {
@Schema(description = "主键", example = "1")
private Long id;
@Schema(description = "分类树节点ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "分类树节点ID不能为空")
@Schema(description = "分类树节点ID(创建时必填,更新时可选)", example = "1")
private Long categoryTreeId;
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "RES001")
@NotBlank(message = "编码不能为空")
private String code;
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "水泥")
@Schema(description = "名称(用于查找或创建工料机)", requiredMode = Schema.RequiredMode.REQUIRED, example = "水泥")
@NotBlank(message = "名称不能为空")
private String name;
@Schema(description = "型号规格", example = "P.O 42.5")
@Schema(description = "型号规格(用于查找或创建工料机)", example = "P.O 42.5")
private String spec;
@Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "t")
@Schema(description = "单位(用于查找或创建工料机)", requiredMode = Schema.RequiredMode.REQUIRED, example = "t")
@NotBlank(message = "单位不能为空")
private String unit;
@@ -49,12 +47,12 @@ public class InfoPriceResourceSaveReqVO {
@Schema(description = "分类ID", example = "1")
private Long categoryId;
@Schema(description = "源工料机ID用于复制价格历史", example = "1")
private Long sourceResourceItemId;
@Schema(description = "备注", example = "备注信息")
private String remark;
@Schema(description = "资源项ID可选关联标准库", example = "1")
private Long resourceItemId;
@Schema(description = "扩展属性", example = "{}")
private Map<String, Object> attributes;

View File

@@ -73,7 +73,7 @@ public class QuotaAdjustmentDetailController {
@GetMapping("/list")
@Operation(summary = "获得定额调整明细列表")
@Parameter(name = "quotaItemId", description = "定额子目ID", required = true, example = "1")
@Parameter(name = "quotaItemId", description = "定额基价ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:quota:adjustment-detail:query')")
public CommonResult<List<QuotaAdjustmentDetailRespVO>> getQuotaAdjustmentDetailList(@RequestParam("quotaItemId") Long quotaItemId) {
List<QuotaAdjustmentDetailDO> list = quotaAdjustmentDetailService.getQuotaAdjustmentDetailListByQuotaItem(quotaItemId);
@@ -99,7 +99,7 @@ public class QuotaAdjustmentDetailController {
@GetMapping("/combined-list")
@Operation(summary = "获取调整设置与明细的组合列表")
@Parameter(name = "quotaItemId", description = "定额子目ID", required = true, example = "1")
@Parameter(name = "quotaItemId", description = "定额基价ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:quota:adjustment-detail:query')")
public CommonResult<List<QuotaAdjustmentCombinedRespVO>> getCombinedList(@RequestParam("quotaItemId") Long quotaItemId) {
return success(quotaAdjustmentDetailService.getCombinedList(quotaItemId));

View File

@@ -70,7 +70,7 @@ public class QuotaAdjustmentSettingController {
@GetMapping("/list")
@Operation(summary = "获得定额调整设置列表")
@Parameter(name = "quotaItemId", description = "定额子目ID", required = true, example = "1")
@Parameter(name = "quotaItemId", description = "定额基价ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:quota:adjustment-setting:query')")
public CommonResult<List<QuotaAdjustmentSettingRespVO>> getQuotaAdjustmentSettingList(@RequestParam("quotaItemId") Long quotaItemId) {
List<QuotaAdjustmentSettingDO> list = quotaAdjustmentSettingService.getQuotaAdjustmentSettingList(quotaItemId);

View File

@@ -1,6 +1,6 @@
package com.yhy.module.core.controller.admin.quota;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.*;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.quota.vo.QuotaCatalogItemBindSpecialtyReqVO;
@@ -82,6 +82,14 @@ public class QuotaCatalogItemController {
return success(quotaCatalogItemService.getQuotaCatalogItemList());
}
@GetMapping("/children")
@Operation(summary = "获得指定节点的子节点列表")
@Parameter(name = "parentId", description = "父节点ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:quota:query')")
public CommonResult<List<QuotaCatalogItemRespVO>> getChildrenByParentId(@RequestParam("parentId") Long parentId) {
return success(quotaCatalogItemService.getChildrenByParentId(parentId));
}
@GetMapping("/tree")
@Operation(summary = "获得定额专业树结构(第一层)")
@PreAuthorize("@ss.hasPermission('core:quota:query')")

View File

@@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@Tag(name = "管理后台 - 定额子目")
@Tag(name = "管理后台 - 定额基价")
@RestController
@RequestMapping("/core/quota/catalog-tree")
@Validated
@@ -34,14 +34,14 @@ public class QuotaCatalogTreeController {
private QuotaCatalogTreeService quotaCatalogTreeService;
@PostMapping("/create")
@Operation(summary = "创建定额子目树节点")
@Operation(summary = "创建定额基价树节点")
@PreAuthorize("@ss.hasPermission('core:quota:catalog-tree:create')")
public CommonResult<Long> createCatalogTree(@Valid @RequestBody QuotaCatalogTreeSaveReqVO createReqVO) {
return success(quotaCatalogTreeService.createCatalogTree(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新定额子目树节点")
@Operation(summary = "更新定额基价树节点")
@PreAuthorize("@ss.hasPermission('core:quota:catalog-tree:update')")
public CommonResult<Boolean> updateCatalogTree(@Valid @RequestBody QuotaCatalogTreeSaveReqVO updateReqVO) {
quotaCatalogTreeService.updateCatalogTree(updateReqVO);
@@ -49,7 +49,7 @@ public class QuotaCatalogTreeController {
}
@DeleteMapping("/delete")
@Operation(summary = "删除定额子目树节点")
@Operation(summary = "删除定额基价树节点")
@Parameter(name = "id", description = "节点ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:quota:catalog-tree:delete')")
public CommonResult<Boolean> deleteCatalogTree(@RequestParam("id") Long id) {
@@ -58,7 +58,7 @@ public class QuotaCatalogTreeController {
}
@GetMapping("/get")
@Operation(summary = "获取定额子目树节点详情")
@Operation(summary = "获取定额基价树节点详情")
@Parameter(name = "id", description = "节点ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:quota:catalog-tree:query')")
public CommonResult<QuotaCatalogTreeRespVO> getCatalogTree(@RequestParam("id") Long id) {
@@ -66,7 +66,7 @@ public class QuotaCatalogTreeController {
}
@GetMapping("/list")
@Operation(summary = "获取定额子目树节点列表")
@Operation(summary = "获取定额基价树节点列表")
@Parameter(name = "catalogItemId", description = "定额专业节点ID", required = true, example = "1")
@Parameter(name = "parentId", description = "父节点ID", example = "1")
@PreAuthorize("@ss.hasPermission('core:quota:catalog-tree:query')")
@@ -77,7 +77,7 @@ public class QuotaCatalogTreeController {
}
@GetMapping("/tree")
@Operation(summary = "获取定额子目树结构")
@Operation(summary = "获取定额基价树结构")
@Parameter(name = "catalogItemId", description = "定额专业节点ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:quota:catalog-tree:query')")
public CommonResult<List<QuotaCatalogTreeRespVO>> getCatalogTreeTree(
@@ -94,7 +94,7 @@ public class QuotaCatalogTreeController {
}
@GetMapping("/list-by-rate-item")
@Operation(summary = "根据费率项ID查询绑定的定额子目")
@Operation(summary = "根据费率项ID查询绑定的定额基价")
@Parameter(name = "rateItemId", description = "费率项ID", required = true, example = "3011")
@PreAuthorize("@ss.hasPermission('core:quota:catalog-tree:query')")
public CommonResult<List<QuotaCatalogTreeRespVO>> getCatalogTreeByRateItem(

View File

@@ -1,6 +1,6 @@
package com.yhy.module.core.controller.admin.quota;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.*;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.quota.vo.QuotaItemRespVO;
@@ -25,11 +25,11 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 定额子目 Controller
* 定额基价 Controller
*
* @author yhy
*/
@Tag(name = "管理后台 - 定额子目")
@Tag(name = "管理后台 - 定额基价")
@RestController
@RequestMapping("/core/quota/item")
@Validated
@@ -39,14 +39,14 @@ public class QuotaItemController {
private QuotaItemService quotaItemService;
@PostMapping("/create")
@Operation(summary = "创建定额子目")
@Operation(summary = "创建定额基价")
@PreAuthorize("@ss.hasPermission('core:quota:create')")
public CommonResult<Long> createQuotaItem(@Valid @RequestBody QuotaItemSaveReqVO createReqVO) {
return success(quotaItemService.createQuotaItem(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新定额子目")
@Operation(summary = "更新定额基价")
@PreAuthorize("@ss.hasPermission('core:quota:update')")
public CommonResult<Boolean> updateQuotaItem(@Valid @RequestBody QuotaItemSaveReqVO updateReqVO) {
quotaItemService.updateQuotaItem(updateReqVO);
@@ -54,7 +54,7 @@ public class QuotaItemController {
}
@DeleteMapping("/delete")
@Operation(summary = "删除定额子目")
@Operation(summary = "删除定额基价")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('core:quota:delete')")
public CommonResult<Boolean> deleteQuotaItem(@RequestParam("id") Long id) {
@@ -63,7 +63,7 @@ public class QuotaItemController {
}
@GetMapping("/get")
@Operation(summary = "获得定额子目详情")
@Operation(summary = "获得定额基价详情")
@Parameter(name = "id", description = "编号", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:quota:query')")
public CommonResult<QuotaItemRespVO> getQuotaItem(@RequestParam("id") Long id) {
@@ -71,7 +71,7 @@ public class QuotaItemController {
}
@GetMapping("/list")
@Operation(summary = "获得定额子目列表")
@Operation(summary = "获得定额基价列表")
@Parameter(name = "catalogItemId", description = "定额条目ID", required = false, example = "1")
@PreAuthorize("@ss.hasPermission('core:quota:query')")
public CommonResult<List<QuotaItemRespVO>> getQuotaItemList(@RequestParam(value = "catalogItemId", required = false) Long catalogItemId) {
@@ -83,10 +83,26 @@ public class QuotaItemController {
@PostMapping("/calculate-price")
@Operation(summary = "计算定额基价")
@Parameter(name = "id", description = "定额子目ID", required = true)
@Parameter(name = "id", description = "定额基价ID", required = true)
@PreAuthorize("@ss.hasPermission('core:quota:update')")
public CommonResult<Boolean> calculateBasePrice(@RequestParam("id") Long id) {
quotaItemService.calculateBasePrice(id);
return success(true);
}
@GetMapping("/get-by-code")
@Operation(summary = "根据编码查询定额基价")
@Parameter(name = "code", description = "编码", required = true, example = "A001")
@PreAuthorize("@ss.hasPermission('core:quota:query')")
public CommonResult<List<QuotaItemRespVO>> getQuotaItemByCode(@RequestParam("code") String code) {
return success(quotaItemService.getQuotaItemByCode(code));
}
@GetMapping("/get-rate-mode-id")
@Operation(summary = "获取定额基价对应的费率模式节点ID")
@Parameter(name = "quotaItemId", description = "定额基价ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:quota:query')")
public CommonResult<Long> getRateModeIdByQuotaItem(@RequestParam("quotaItemId") Long quotaItemId) {
return success(quotaItemService.getRateModeIdByQuotaItem(quotaItemId));
}
}

View File

@@ -0,0 +1,109 @@
package com.yhy.module.core.controller.admin.quota;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.quota.vo.QuotaMarketMaterialRespVO;
import com.yhy.module.core.controller.admin.quota.vo.QuotaMarketMaterialSaveReqVO;
import com.yhy.module.core.controller.admin.resource.vo.ResourceItemRespVO;
import com.yhy.module.core.service.quota.QuotaMarketMaterialService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 定额市场主材设备 Controller
*
* @author yhy
*/
@Tag(name = "管理后台 - 定额市场主材设备")
@RestController
@RequestMapping("/core/quota/market-material")
@Validated
public class QuotaMarketMaterialController {
@Resource
private QuotaMarketMaterialService quotaMarketMaterialService;
@PostMapping("/create")
@Operation(summary = "添加定额市场主材设备")
@PreAuthorize("@ss.hasPermission('core:quota:create')")
public CommonResult<Long> createMarketMaterial(@Valid @RequestBody QuotaMarketMaterialSaveReqVO createReqVO) {
return success(quotaMarketMaterialService.createMarketMaterial(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新定额市场主材设备")
@PreAuthorize("@ss.hasPermission('core:quota:update')")
public CommonResult<Boolean> updateMarketMaterial(@Valid @RequestBody QuotaMarketMaterialSaveReqVO updateReqVO) {
quotaMarketMaterialService.updateMarketMaterial(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除定额市场主材设备")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('core:quota:delete')")
public CommonResult<Boolean> deleteMarketMaterial(@RequestParam("id") Long id) {
quotaMarketMaterialService.deleteMarketMaterial(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得定额市场主材设备")
@Parameter(name = "id", description = "编号", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:quota:query')")
public CommonResult<QuotaMarketMaterialRespVO> getMarketMaterial(@RequestParam("id") Long id) {
return success(quotaMarketMaterialService.getMarketMaterialList(id).stream().findFirst().orElse(null));
}
@GetMapping("/list")
@Operation(summary = "获得定额市场主材设备列表")
@Parameter(name = "quotaItemId", description = "定额基价ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:quota:query')")
public CommonResult<List<QuotaMarketMaterialRespVO>> getMarketMaterialList(@RequestParam("quotaItemId") Long quotaItemId) {
return success(quotaMarketMaterialService.getMarketMaterialList(quotaItemId));
}
@GetMapping("/available-list")
@Operation(summary = "获取可选的工料机列表(已过滤范围,支持模糊查询)")
@Parameter(name = "quotaItemId", description = "定额基价ID", required = true, example = "1")
@Parameter(name = "code", description = "编码(模糊查询)", required = false, example = "C001")
@Parameter(name = "name", description = "名称(模糊查询)", required = false, example = "水泥")
@Parameter(name = "spec", description = "型号规格(模糊查询)", required = false, example = "P.O 42.5")
@PreAuthorize("@ss.hasPermission('core:quota:query')")
public CommonResult<List<ResourceItemRespVO>> getAvailableResourceItems(
@RequestParam("quotaItemId") Long quotaItemId,
@RequestParam(value = "code", required = false) String code,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "spec", required = false) String spec) {
if (code == null && name == null && spec == null) {
return success(quotaMarketMaterialService.getAvailableResourceItems(quotaItemId));
}
return success(quotaMarketMaterialService.getAvailableResourceItemsWithFilter(quotaItemId, code, name, spec));
}
@GetMapping("/get-by-code")
@Operation(summary = "根据编码查询可用工料机(精确匹配)")
@Parameter(name = "quotaItemId", description = "定额基价ID", required = true, example = "1")
@Parameter(name = "code", description = "工料机编码", required = true, example = "C001")
@PreAuthorize("@ss.hasPermission('core:quota:query')")
public CommonResult<ResourceItemRespVO> getResourceItemByCode(
@RequestParam("quotaItemId") Long quotaItemId,
@RequestParam("code") String code) {
return success(quotaMarketMaterialService.getResourceItemByCode(quotaItemId, code));
}
}

View File

@@ -72,7 +72,7 @@ public class QuotaResourceController {
@GetMapping("/list")
@Operation(summary = "获得定额工料机组成列表")
@Parameter(name = "quotaItemId", description = "定额子目ID", required = true, example = "1")
@Parameter(name = "quotaItemId", description = "定额基价ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:quota:query')")
public CommonResult<List<QuotaResourceRespVO>> getQuotaResourceList(@RequestParam("quotaItemId") Long quotaItemId) {
return success(quotaResourceService.getQuotaResourceList(quotaItemId));
@@ -80,7 +80,7 @@ public class QuotaResourceController {
@GetMapping("/available-list")
@Operation(summary = "获取可选的工料机列表(已过滤范围,支持模糊查询)")
@Parameter(name = "quotaItemId", description = "定额子目ID", required = true, example = "1")
@Parameter(name = "quotaItemId", description = "定额基价ID", required = true, example = "1")
@Parameter(name = "code", description = "编码(模糊查询)", required = false, example = "C001")
@Parameter(name = "name", description = "名称(模糊查询)", required = false, example = "水泥")
@Parameter(name = "spec", description = "型号规格(模糊查询)", required = false, example = "P.O 42.5")
@@ -97,4 +97,20 @@ public class QuotaResourceController {
// 有查询条件时使用带过滤的方法
return success(quotaResourceService.getAvailableResourceItemsWithFilter(quotaItemId, code, name, spec));
}
@GetMapping("/get-by-code")
@Operation(summary = "根据编码查询可用工料机(精确匹配)")
@Parameter(name = "quotaItemId", description = "定额基价ID", required = true, example = "1")
@Parameter(name = "code", description = "工料机编码", required = true, example = "C001")
@PreAuthorize("@ss.hasPermission('core:quota:query')")
public CommonResult<ResourceItemRespVO> getResourceItemByCode(
@RequestParam("quotaItemId") Long quotaItemId,
@RequestParam("code") String code) {
return success(quotaResourceService.getResourceItemByCode(quotaItemId, code));
}
// 【已删除】后台定额调整功能改为纯展示效果,以下接口已删除:
// - /apply-adjustment
// - /apply-dynamic-adjustment
// - /apply-dynamic-merge
}

View File

@@ -0,0 +1,93 @@
package com.yhy.module.core.controller.admin.quota;
import cn.hutool.core.bean.BeanUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.quota.vo.QuotaFeeItemWithRateRespVO;
import com.yhy.module.core.controller.admin.quota.vo.QuotaUnifiedFeeRespVO;
import com.yhy.module.core.controller.admin.quota.vo.QuotaUnifiedFeeSaveReqVO;
import com.yhy.module.core.dal.dataobject.quota.QuotaUnifiedFeeDO;
import com.yhy.module.core.service.quota.QuotaUnifiedFeeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 统一取费单价")
@RestController
@RequestMapping("/core/quota/unified-fee")
@Validated
public class QuotaUnifiedFeeController {
@Resource
private QuotaUnifiedFeeService unifiedFeeService;
@PostMapping("/create")
@Operation(summary = "创建统一取费单价")
public CommonResult<Long> createUnifiedFee(@Valid @RequestBody QuotaUnifiedFeeSaveReqVO createReqVO) {
return success(unifiedFeeService.createUnifiedFee(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新统一取费单价")
public CommonResult<Boolean> updateUnifiedFee(@Valid @RequestBody QuotaUnifiedFeeSaveReqVO updateReqVO) {
unifiedFeeService.updateUnifiedFee(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除统一取费单价")
@Parameter(name = "id", description = "编号", required = true)
public CommonResult<Boolean> deleteUnifiedFee(@RequestParam("id") Long id) {
unifiedFeeService.deleteUnifiedFee(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获取统一取费单价详情")
@Parameter(name = "id", description = "编号", required = true)
public CommonResult<QuotaUnifiedFeeRespVO> getUnifiedFee(@RequestParam("id") Long id) {
QuotaUnifiedFeeDO unifiedFee = unifiedFeeService.getUnifiedFee(id);
return success(BeanUtil.copyProperties(unifiedFee, QuotaUnifiedFeeRespVO.class));
}
@GetMapping("/list")
@Operation(summary = "获取统一取费单价列表")
@Parameter(name = "catalogItemId", description = "模式节点ID", required = true)
public CommonResult<List<QuotaUnifiedFeeRespVO>> getUnifiedFeeList(
@RequestParam("catalogItemId") Long catalogItemId) {
List<QuotaUnifiedFeeDO> list = unifiedFeeService.getUnifiedFeeList(catalogItemId);
return success(list.stream()
.map(item -> BeanUtil.copyProperties(item, QuotaUnifiedFeeRespVO.class))
.collect(Collectors.toList()));
}
@GetMapping("/tree")
@Operation(summary = "获取统一取费单价树(与定额取费显示一致的费率项+取费项合并视图)")
@Parameter(name = "catalogItemId", description = "模式节点ID", required = true)
public CommonResult<List<QuotaFeeItemWithRateRespVO>> getUnifiedFeeTree(
@RequestParam("catalogItemId") Long catalogItemId) {
return success(unifiedFeeService.getUnifiedFeeTree(catalogItemId));
}
@PostMapping("/swap-sort")
@Operation(summary = "交换排序")
public CommonResult<Boolean> swapSort(@RequestParam("nodeId1") Long nodeId1,
@RequestParam("nodeId2") Long nodeId2) {
unifiedFeeService.swapSort(nodeId1, nodeId2);
return success(true);
}
}

View File

@@ -0,0 +1,183 @@
package com.yhy.module.core.controller.admin.quota;
import cn.hutool.core.bean.BeanUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.quota.vo.QuotaUnifiedFeeResourceRespVO;
import com.yhy.module.core.controller.admin.quota.vo.QuotaUnifiedFeeResourceSaveReqVO;
import com.yhy.module.core.controller.admin.quota.vo.QuotaUnifiedFeeSettingRespVO;
import com.yhy.module.core.controller.admin.quota.vo.QuotaUnifiedFeeSettingSaveReqVO;
import com.yhy.module.core.dal.dataobject.quota.QuotaUnifiedFeeResourceDO;
import com.yhy.module.core.dal.dataobject.quota.QuotaUnifiedFeeSettingDO;
import com.yhy.module.core.service.quota.QuotaUnifiedFeeResourceService;
import com.yhy.module.core.service.quota.QuotaUnifiedFeeSettingService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 统一取费设置")
@RestController
@RequestMapping("/core/quota/unified-fee-setting")
@Validated
public class QuotaUnifiedFeeSettingController {
@Resource
private QuotaUnifiedFeeSettingService unifiedFeeSettingService;
@Resource
private QuotaUnifiedFeeResourceService unifiedFeeResourceService;
@PostMapping("/create")
@Operation(summary = "创建统一取费设置")
public CommonResult<Long> createUnifiedFeeSetting(@Valid @RequestBody QuotaUnifiedFeeSettingSaveReqVO createReqVO) {
return success(unifiedFeeSettingService.createUnifiedFeeSetting(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新统一取费设置")
public CommonResult<Boolean> updateUnifiedFeeSetting(@Valid @RequestBody QuotaUnifiedFeeSettingSaveReqVO updateReqVO) {
unifiedFeeSettingService.updateUnifiedFeeSetting(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除统一取费设置")
@Parameter(name = "id", description = "编号", required = true)
public CommonResult<Boolean> deleteUnifiedFeeSetting(@RequestParam("id") Long id) {
unifiedFeeSettingService.deleteUnifiedFeeSetting(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获取统一取费设置详情")
@Parameter(name = "id", description = "编号", required = true)
public CommonResult<QuotaUnifiedFeeSettingRespVO> getUnifiedFeeSetting(@RequestParam("id") Long id) {
QuotaUnifiedFeeSettingDO unifiedFeeSetting = unifiedFeeSettingService.getUnifiedFeeSetting(id);
return success(BeanUtil.copyProperties(unifiedFeeSetting, QuotaUnifiedFeeSettingRespVO.class));
}
@GetMapping("/list")
@Operation(summary = "获取统一取费设置列表")
@Parameter(name = "catalogItemId", description = "模式节点ID", required = true)
public CommonResult<List<QuotaUnifiedFeeSettingRespVO>> getUnifiedFeeSettingList(
@RequestParam("catalogItemId") Long catalogItemId) {
List<QuotaUnifiedFeeSettingDO> list = unifiedFeeSettingService.getUnifiedFeeSettingList(catalogItemId);
return success(list.stream()
.map(item -> BeanUtil.copyProperties(item, QuotaUnifiedFeeSettingRespVO.class))
.collect(Collectors.toList()));
}
@GetMapping("/tree")
@Operation(summary = "获取统一取费设置树")
@Parameter(name = "catalogItemId", description = "模式节点ID", required = true)
public CommonResult<List<QuotaUnifiedFeeSettingRespVO>> getUnifiedFeeSettingTree(
@RequestParam("catalogItemId") Long catalogItemId) {
return success(unifiedFeeSettingService.getUnifiedFeeSettingTree(catalogItemId));
}
@GetMapping("/parent-list")
@Operation(summary = "获取父定额列表(用于工作台,包含子定额取费章节组合用于范围过滤)")
@Parameter(name = "catalogItemId", description = "模式节点ID", required = true)
public CommonResult<List<QuotaUnifiedFeeSettingRespVO>> getParentList(
@RequestParam("catalogItemId") Long catalogItemId) {
// 返回父定额列表但每个父定额的feeChapter字段包含其所有子定额的取费章节组合
return success(unifiedFeeSettingService.getParentListWithChildFeeChapters(catalogItemId));
}
@GetMapping("/child-list")
@Operation(summary = "获取子定额列表")
@Parameter(name = "parentId", description = "父定额ID", required = true)
public CommonResult<List<QuotaUnifiedFeeSettingRespVO>> getChildList(
@RequestParam("parentId") Long parentId) {
List<QuotaUnifiedFeeSettingDO> list = unifiedFeeSettingService.getChildList(parentId);
return success(list.stream()
.map(item -> BeanUtil.copyProperties(item, QuotaUnifiedFeeSettingRespVO.class))
.collect(Collectors.toList()));
}
@PostMapping("/swap-sort")
@Operation(summary = "交换排序")
public CommonResult<Boolean> swapSort(@RequestParam("nodeId1") Long nodeId1,
@RequestParam("nodeId2") Long nodeId2) {
unifiedFeeSettingService.swapSort(nodeId1, nodeId2);
return success(true);
}
// ==================== 子目工料机相关接口 ====================
@PostMapping("/resource/create")
@Operation(summary = "创建子目工料机")
public CommonResult<Long> createUnifiedFeeResource(@Valid @RequestBody QuotaUnifiedFeeResourceSaveReqVO createReqVO) {
return success(unifiedFeeResourceService.createUnifiedFeeResource(createReqVO));
}
@PutMapping("/resource/update")
@Operation(summary = "更新子目工料机")
public CommonResult<Boolean> updateUnifiedFeeResource(@Valid @RequestBody QuotaUnifiedFeeResourceSaveReqVO updateReqVO) {
unifiedFeeResourceService.updateUnifiedFeeResource(updateReqVO);
return success(true);
}
@DeleteMapping("/resource/delete")
@Operation(summary = "删除子目工料机")
@Parameter(name = "id", description = "编号", required = true)
public CommonResult<Boolean> deleteUnifiedFeeResource(@RequestParam("id") Long id) {
unifiedFeeResourceService.deleteUnifiedFeeResource(id);
return success(true);
}
@GetMapping("/resource/list")
@Operation(summary = "获取子目工料机列表")
@Parameter(name = "unifiedFeeSettingId", description = "子定额ID", required = true)
public CommonResult<List<QuotaUnifiedFeeResourceRespVO>> getUnifiedFeeResourceList(
@RequestParam("unifiedFeeSettingId") Long unifiedFeeSettingId) {
return success(unifiedFeeResourceService.getUnifiedFeeResourceList(unifiedFeeSettingId));
}
@PostMapping("/resource/swap-sort")
@Operation(summary = "交换子目工料机排序")
public CommonResult<Boolean> swapResourceSort(@RequestParam("nodeId1") Long nodeId1,
@RequestParam("nodeId2") Long nodeId2) {
unifiedFeeResourceService.swapSort(nodeId1, nodeId2);
return success(true);
}
@GetMapping("/resource/get-by-code")
@Operation(summary = "根据编码查询工料机")
@Parameter(name = "unifiedFeeSettingId", description = "统一取费设置ID", required = true)
@Parameter(name = "code", description = "工料机编码", required = true)
public CommonResult<com.yhy.module.core.controller.admin.resource.vo.ResourceItemRespVO> getResourceItemByCode(
@RequestParam("unifiedFeeSettingId") Long unifiedFeeSettingId,
@RequestParam("code") String code) {
return success(unifiedFeeResourceService.getResourceItemByCode(unifiedFeeSettingId, code));
}
@GetMapping("/resource/available-list")
@Operation(summary = "获取可选工料机列表(支持模糊查询)")
@Parameter(name = "unifiedFeeSettingId", description = "统一取费设置ID", required = true)
@Parameter(name = "code", description = "编码(模糊查询)", required = false)
@Parameter(name = "name", description = "名称(模糊查询)", required = false)
@Parameter(name = "spec", description = "型号规格(模糊查询)", required = false)
public CommonResult<List<com.yhy.module.core.controller.admin.resource.vo.ResourceItemRespVO>> getAvailableResourceItems(
@RequestParam("unifiedFeeSettingId") Long unifiedFeeSettingId,
@RequestParam(value = "code", required = false) String code,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "spec", required = false) String spec) {
return success(unifiedFeeResourceService.getAvailableResourceItemsWithFilter(
unifiedFeeSettingId, code, name, spec));
}
}

View File

@@ -0,0 +1,140 @@
package com.yhy.module.core.controller.admin.quota;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import com.yhy.module.core.controller.admin.quota.vo.QuotaVariableSettingRespVO;
import com.yhy.module.core.controller.admin.quota.vo.QuotaVariableSettingSaveReqVO;
import com.yhy.module.core.dal.dataobject.quota.QuotaVariableSettingDO;
import com.yhy.module.core.service.quota.QuotaVariableSettingService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@Tag(name = "管理后台 - 单位工程变量设置")
@RestController
@RequestMapping("/core/quota/variable-setting")
@Validated
public class QuotaVariableSettingController {
@Resource
private QuotaVariableSettingService quotaVariableSettingService;
@PostMapping("/create")
@Operation(summary = "创建变量设置")
@PreAuthorize("@ss.hasPermission('core:quota:variable-setting:create')")
public CommonResult<Long> createVariableSetting(@Valid @RequestBody QuotaVariableSettingSaveReqVO createReqVO) {
return success(quotaVariableSettingService.createVariableSetting(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新变量设置")
@PreAuthorize("@ss.hasPermission('core:quota:variable-setting:update')")
public CommonResult<Boolean> updateVariableSetting(@Valid @RequestBody QuotaVariableSettingSaveReqVO updateReqVO) {
quotaVariableSettingService.updateVariableSetting(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除变量设置")
@Parameter(name = "id", description = "变量设置ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:quota:variable-setting:delete')")
public CommonResult<Boolean> deleteVariableSetting(@RequestParam("id") Long id) {
quotaVariableSettingService.deleteVariableSetting(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获取变量设置详情")
@Parameter(name = "id", description = "变量设置ID", required = true, example = "1")
@PreAuthorize("@ss.hasPermission('core:quota:variable-setting:query')")
public CommonResult<QuotaVariableSettingRespVO> getVariableSetting(@RequestParam("id") Long id) {
QuotaVariableSettingDO variableSetting = quotaVariableSettingService.getVariableSetting(id);
return success(BeanUtils.toBean(variableSetting, QuotaVariableSettingRespVO.class));
}
@GetMapping("/list")
@Operation(summary = "获取变量设置列表")
@Parameters({
@Parameter(name = "catalogItemId", description = "费率模式节点ID", required = true, example = "1002"),
@Parameter(name = "category", description = "类别division/measure/other/unit_summary", required = true, example = "division")
})
@PreAuthorize("@ss.hasPermission('core:quota:variable-setting:query')")
public CommonResult<List<QuotaVariableSettingRespVO>> getVariableSettingList(
@RequestParam("catalogItemId") Long catalogItemId,
@RequestParam("category") String category) {
List<QuotaVariableSettingRespVO> list = quotaVariableSettingService.getVariableSettingListWithFeeItems(catalogItemId, category);
return success(list);
}
@GetMapping("/list-all")
@Operation(summary = "获取所有类别的变量设置列表")
@Parameter(name = "catalogItemId", description = "费率模式节点ID", required = true, example = "1002")
@PreAuthorize("@ss.hasPermission('core:quota:variable-setting:query')")
public CommonResult<List<QuotaVariableSettingRespVO>> getVariableSettingListAll(
@RequestParam("catalogItemId") Long catalogItemId) {
List<QuotaVariableSettingRespVO> list = quotaVariableSettingService.getVariableSettingListAllWithFeeItems(catalogItemId);
return success(list);
}
@GetMapping("/list-all-with-summary")
@Operation(summary = "获取所有类别的变量设置列表(包含汇总值计算)")
@Parameters({
@Parameter(name = "catalogItemId", description = "定额专业节点ID", required = true, example = "1002"),
@Parameter(name = "compileTreeId", description = "编制模式树的单位工程节点ID", required = true, example = "1001"),
@Parameter(name = "baseNumberRangeIds", description = "基数范围选中的节点ID列表逗号分隔", required = false, example = "1,2,3")
})
@PreAuthorize("@ss.hasPermission('core:quota:variable-setting:query')")
public CommonResult<List<QuotaVariableSettingRespVO>> getVariableSettingListAllWithSummary(
@RequestParam("catalogItemId") Long catalogItemId,
@RequestParam("compileTreeId") Long compileTreeId,
@RequestParam(value = "baseNumberRangeIds", required = false) List<Long> baseNumberRangeIds) {
List<QuotaVariableSettingRespVO> list = quotaVariableSettingService.getVariableSettingListAllWithSummary(
catalogItemId, compileTreeId, baseNumberRangeIds);
return success(list);
}
@GetMapping("/list-by-compile-tree")
@Operation(summary = "根据编制树ID获取所有变量设置自动合并所有定额专业")
@Parameters({
@Parameter(name = "compileTreeId", description = "编制模式树的单位工程节点ID", required = true, example = "1001"),
@Parameter(name = "baseNumberRangeIds", description = "基数范围选中的节点ID列表逗号分隔", required = false, example = "1,2,3")
})
@PreAuthorize("@ss.hasPermission('core:quota:variable-setting:query')")
public CommonResult<List<QuotaVariableSettingRespVO>> getVariableSettingListByCompileTree(
@RequestParam("compileTreeId") Long compileTreeId,
@RequestParam(value = "baseNumberRangeIds", required = false) List<Long> baseNumberRangeIds) {
List<QuotaVariableSettingRespVO> list = quotaVariableSettingService.getVariableSettingListByCompileTree(
compileTreeId, baseNumberRangeIds);
return success(list);
}
@PostMapping("/swap-sort")
@Operation(summary = "交换排序")
@Parameters({
@Parameter(name = "nodeId1", description = "节点1 ID", required = true, example = "1"),
@Parameter(name = "nodeId2", description = "节点2 ID", required = true, example = "2")
})
@PreAuthorize("@ss.hasPermission('core:quota:variable-setting:update')")
public CommonResult<Boolean> swapSort(
@RequestParam("nodeId1") Long nodeId1,
@RequestParam("nodeId2") Long nodeId2) {
quotaVariableSettingService.swapSort(nodeId1, nodeId2);
return success(true);
}
}

View File

@@ -14,7 +14,7 @@ public class QuotaAdjustmentCombinedRespVO {
@Schema(description = "调整设置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long id;
@Schema(description = "定额子目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@Schema(description = "定额基价ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long quotaItemId;
@Schema(description = "调整名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "人工费调整")

View File

@@ -13,7 +13,7 @@ public class QuotaAdjustmentSettingRespVO {
@Schema(description = "主键ID", example = "1")
private Long id;
@Schema(description = "定额子目ID", example = "1")
@Schema(description = "定额基价ID", example = "1")
private Long quotaItemId;
@Schema(description = "调整名称", example = "人工费调整")

View File

@@ -14,8 +14,8 @@ public class QuotaAdjustmentSettingSaveReqVO {
@Schema(description = "主键ID", example = "1")
private Long id;
@Schema(description = "定额子目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "定额子目ID不能为空")
@Schema(description = "定额基价ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "定额基价ID不能为空")
private Long quotaItemId;
@Schema(description = "调整名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "人工费调整")

View File

@@ -6,7 +6,7 @@ import java.util.List;
import java.util.Map;
import lombok.Data;
@Schema(description = "管理后台 - 定额子目树 Response VO")
@Schema(description = "管理后台 - 定额基价树 Response VO")
@Data
public class QuotaCatalogTreeRespVO {
@@ -49,6 +49,9 @@ public class QuotaCatalogTreeRespVO {
@Schema(description = "扩展属性")
private Map<String, Object> attributes;
@Schema(description = "注解/备注", example = "这是一个注解")
private String remark;
@Schema(description = "创建时间")
private LocalDateTime createTime;

View File

@@ -6,7 +6,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.Data;
@Schema(description = "管理后台 - 定额子目树保存 Request VO")
@Schema(description = "管理后台 - 定额基价树保存 Request VO")
@Data
public class QuotaCatalogTreeSaveReqVO {
@@ -61,4 +61,7 @@ public class QuotaCatalogTreeSaveReqVO {
@Schema(description = "扩展属性")
private Map<String, Object> attributes;
@Schema(description = "注解/备注", example = "这是一个注解")
private String remark;
}

View File

@@ -4,7 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.NotNull;
import lombok.Data;
@Schema(description = "管理后台 - 定额子目树交换排序 Request VO")
@Schema(description = "管理后台 - 定额基价树交换排序 Request VO")
@Data
public class QuotaCatalogTreeSwapSortReqVO {

View File

@@ -0,0 +1,25 @@
package com.yhy.module.core.controller.admin.quota.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.util.Map;
import javax.validation.constraints.NotNull;
import lombok.Data;
@Schema(description = "管理后台 - 定额动态调整请求 VO")
@Data
public class QuotaDynamicAdjustReqVO {
@Schema(description = "定额基价ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "定额基价ID不能为空")
private Long quotaItemId;
@Schema(description = "调整设置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "调整设置ID不能为空")
private Long adjustmentSettingId;
@Schema(description = "输入值映射key=类别名称value=输入值)", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "输入值不能为空")
private Map<String, BigDecimal> inputValues;
}

View File

@@ -30,9 +30,6 @@ public class QuotaFeeItemRespVO {
@Schema(description = "计算基数")
private Map<String, Object> calcBase;
@Schema(description = "费率代号(%", example = "15")
private String rateCode;
@Schema(description = "代号", example = "QYGLF")
private String code;
@@ -51,6 +48,9 @@ public class QuotaFeeItemRespVO {
@Schema(description = "是否为变量", example = "false")
private Boolean variable;
@Schema(description = "系统行标识ZHDJ=综合单价)", example = "ZHDJ")
private String systemCode;
@Schema(description = "创建时间")
private LocalDateTime createTime;

View File

@@ -30,9 +30,6 @@ public class QuotaFeeItemSaveReqVO {
@Schema(description = "计算基数", example = "{\"formula\":\"除税基价 + 含税基价\",\"variables\":{\"除税基价\":\"tax_excl_base_price\",\"含税基价\":\"tax_incl_base_price\"}}")
private Map<String, Object> calcBase;
@Schema(description = "费率代号(%", example = "15")
private String rateCode;
@Schema(description = "代号", example = "QYGLF")
private String code;

View File

@@ -1,6 +1,7 @@
package com.yhy.module.core.controller.admin.quota.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
@@ -81,6 +82,20 @@ public class QuotaFeeItemWithRateRespVO {
@Schema(description = "是否已配置取费项", example = "true")
private Boolean hasFeeItem;
@Schema(description = "系统行标识ZHDJ=综合单价)", example = "ZHDJ")
private String systemCode;
// ==================== 计算结果(虚拟字段) ====================
@Schema(description = "计算基数值(虚拟字段)", example = "100.00")
private BigDecimal calcBaseValue;
@Schema(description = "子单价(虚拟字段)", example = "15.00")
private BigDecimal subPrice;
@Schema(description = "费率实际值(虚拟字段,费率代号转换后的数值)", example = "15.00")
private BigDecimal rateValue;
// ==================== 时间信息 ====================
@Schema(description = "创建时间")

View File

@@ -1,19 +1,18 @@
package com.yhy.module.core.controller.admin.quota.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import lombok.Data;
/**
* 定额子目 Response VO
* 定额基价 Response VO
*
* @author yhy
*/
@Schema(description = "管理后台 - 定额子目 Response VO")
@Schema(description = "管理后台 - 定额基价 Response VO")
@Data
public class QuotaItemRespVO {
@@ -23,6 +22,12 @@ public class QuotaItemRespVO {
@Schema(description = "定额条目ID", example = "1")
private Long catalogItemId;
@Schema(description = "编码", example = "A001")
private String code;
@Schema(description = "名称", example = "平整场地")
private String name;
@Schema(description = "计量单位", example = "")
private String unit;
@@ -58,6 +63,18 @@ public class QuotaItemRespVO {
@Schema(description = "备注", example = "备注信息")
private String remark;
@Schema(description = "除税定额单价", example = "100.00")
private BigDecimal taxExclBasePrice;
@Schema(description = "含税定额单价", example = "113.00")
private BigDecimal taxInclBasePrice;
@Schema(description = "除税编制单价", example = "120.00")
private BigDecimal taxExclCompilePrice;
@Schema(description = "含税编制单价", example = "135.60")
private BigDecimal taxInclCompilePrice;
@Schema(description = "工料机组成列表")
private List<QuotaResourceRespVO> resources;

View File

@@ -1,19 +1,18 @@
package com.yhy.module.core.controller.admin.quota.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import javax.validation.constraints.NotNull;
import lombok.Data;
/**
* 定额子目保存 Request VO
* 定额基价保存 Request VO
*
* @author yhy
*/
@Schema(description = "管理后台 - 定额子目保存 Request VO")
@Schema(description = "管理后台 - 定额基价保存 Request VO")
@Data
public class QuotaItemSaveReqVO {
@@ -24,6 +23,12 @@ public class QuotaItemSaveReqVO {
@NotNull(message = "定额条目ID不能为空")
private Long catalogItemId;
@Schema(description = "编码", example = "A001")
private String code;
@Schema(description = "名称", example = "平整场地")
private String name;
@Schema(description = "计量单位", example = "")
private String unit;

View File

@@ -0,0 +1,185 @@
package com.yhy.module.core.controller.admin.quota.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import lombok.Data;
/**
* 定额市场主材设备 Response VO
*
* @author yhy
*/
@Schema(description = "管理后台 - 定额市场主材设备 Response VO")
@Data
public class QuotaMarketMaterialRespVO {
@Schema(description = "主键ID", example = "1")
private Long id;
@Schema(description = "定额基价ID", example = "1")
private Long quotaItemId;
@Schema(description = "资源项ID", example = "1")
private Long resourceItemId;
@Schema(description = "定额消耗量", example = "350.00")
private BigDecimal dosage;
@Schema(description = "调整消耗量", example = "700.00")
private BigDecimal adjustedDosage;
@Schema(description = "扩展属性", example = "{\"loss_rate\":0.02}")
private Map<String, Object> attributes;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "更新时间")
private LocalDateTime updateTime;
// ========== 扩展字段(从工料机库关联) ==========
@Schema(description = "损耗率", example = "0.02")
private BigDecimal lossRate;
@Schema(description = "价格快照", example = "50.00")
private BigDecimal price;
@Schema(description = "资源编码", example = "R001")
private String resourceCode;
@Schema(description = "资源名称", example = "水泥")
private String resourceName;
@Schema(description = "资源单位", example = "kg")
private String resourceUnit;
@Schema(description = "资源型号规格", example = "P.O 42.5")
private String resourceSpec;
@Schema(description = "资源类别ID", example = "1")
private Long resourceCategoryId;
@Schema(description = "资源类型", example = "material")
private String resourceType;
@Schema(description = "税率", example = "0.13")
private BigDecimal resourceTaxRate;
@Schema(description = "除税基价", example = "450.00")
private BigDecimal resourceTaxExclBasePrice;
@Schema(description = "含税基价", example = "508.50")
private BigDecimal resourceTaxInclBasePrice;
@Schema(description = "除税编制价", example = "460.00")
private BigDecimal resourceTaxExclCompilePrice;
@Schema(description = "含税编制价", example = "519.80")
private BigDecimal resourceTaxInclCompilePrice;
@Schema(description = "计算基数", example = "{\"formula\":\"人机 + 材\",\"variables\":{\"人机\":2,\"\":3}}")
private Map<String, Object> calcBase;
@Schema(description = "实际消耗量(含损耗)", example = "357.00")
private BigDecimal actualDosage;
@Schema(description = "金额", example = "17850.00")
private BigDecimal amount;
@Schema(description = "是否复合工料机", example = "false")
private Boolean isMerged;
@Schema(description = "复合工料机子数据列表")
private List<MergedResourceItemVO> mergedItems;
// ========== 虚拟字段(复合工料机合价) ==========
@Schema(description = "除税基价合价", example = "50.00")
private BigDecimal taxExclBaseTotalSum;
@Schema(description = "含税基价合价", example = "54.50")
private BigDecimal taxInclBaseTotalSum;
@Schema(description = "除税编制价合价", example = "55.00")
private BigDecimal taxExclCompileTotalSum;
@Schema(description = "含税编制价合价", example = "59.95")
private BigDecimal taxInclCompileTotalSum;
/**
* 复合工料机子数据 VO
*/
@Schema(description = "复合工料机子数据")
@Data
public static class MergedResourceItemVO {
@Schema(description = "子数据ID", example = "1")
private Long id;
@Schema(description = "源工料机ID", example = "100")
private Long resourceItemId;
@Schema(description = "源工料机编码", example = "C001")
private String resourceCode;
@Schema(description = "源工料机名称", example = "水泥")
private String resourceName;
@Schema(description = "源工料机单位", example = "t")
private String resourceUnit;
@Schema(description = "源工料机型号规格", example = "P.O 42.5")
private String resourceSpec;
@Schema(description = "源工料机类别ID", example = "1")
private Long resourceCategoryId;
@Schema(description = "源工料机类型", example = "material")
private String resourceType;
@Schema(description = "税率", example = "0.13")
private BigDecimal resourceTaxRate;
@Schema(description = "除税基价", example = "100.00")
private BigDecimal resourceTaxExclBasePrice;
@Schema(description = "含税基价", example = "113.00")
private BigDecimal resourceTaxInclBasePrice;
@Schema(description = "除税编制价", example = "120.00")
private BigDecimal resourceTaxExclCompilePrice;
@Schema(description = "含税编制价", example = "135.60")
private BigDecimal resourceTaxInclCompilePrice;
@Schema(description = "定额消耗量", example = "1.5")
private BigDecimal dosage;
@Schema(description = "除税市场价", example = "450.00")
private BigDecimal price;
@Schema(description = "实际消耗量(含损耗)", example = "1.53")
private BigDecimal actualDosage;
@Schema(description = "金额", example = "688.50")
private BigDecimal amount;
@Schema(description = "计算基数")
private Map<String, Object> calcBase;
@Schema(description = "除税基价合价", example = "50.00")
private BigDecimal taxExclBaseTotalSum;
@Schema(description = "含税基价合价", example = "54.50")
private BigDecimal taxInclBaseTotalSum;
@Schema(description = "除税编制价合价", example = "55.00")
private BigDecimal taxExclCompileTotalSum;
@Schema(description = "含税编制价合价", example = "59.95")
private BigDecimal taxInclCompileTotalSum;
}
}

View File

@@ -0,0 +1,39 @@
package com.yhy.module.core.controller.admin.quota.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.util.Map;
import javax.validation.constraints.NotNull;
import lombok.Data;
/**
* 定额市场主材设备保存 Request VO
*
* @author yhy
*/
@Schema(description = "管理后台 - 定额市场主材设备保存 Request VO")
@Data
public class QuotaMarketMaterialSaveReqVO {
@Schema(description = "主键ID更新时必填", example = "1")
private Long id;
@Schema(description = "定额基价ID", example = "1")
private Long quotaItemId;
@Schema(description = "资源项ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "资源项ID不能为空")
private Long resourceItemId;
@Schema(description = "定额消耗量", example = "350.00")
private BigDecimal dosage;
@Schema(description = "调整消耗量", example = "700.00")
private BigDecimal adjustedDosage;
@Schema(description = "扩展属性", example = "{\"loss_rate\":0.02}")
private Map<String, Object> attributes;
@Schema(description = "排序字段", example = "1")
private Integer sortOrder;
}

View File

@@ -53,6 +53,12 @@ public class QuotaRateItemSaveReqVO {
@Schema(description = "排序值")
private Integer sortOrder;
@Schema(description = "参考节点ID用于指定插入位置")
private Long referenceNodeId;
@Schema(description = "插入位置above-在参考节点上方below-在参考节点下方")
private String insertPosition;
/**
* 创建分组
*/

View File

@@ -19,7 +19,7 @@ public class QuotaResourceRespVO {
@Schema(description = "主键ID", example = "1")
private Long id;
@Schema(description = "定额子目ID", example = "1")
@Schema(description = "定额基价ID", example = "1")
private Long quotaItemId;
@Schema(description = "资源项ID", example = "1")
@@ -28,6 +28,9 @@ public class QuotaResourceRespVO {
@Schema(description = "定额消耗量", example = "350.00")
private BigDecimal dosage;
@Schema(description = "调整消耗量(应用调整设置后的消耗量)", example = "700.00")
private BigDecimal adjustedDosage;
@Schema(description = "扩展属性", example = "{\"loss_rate\":0.02}")
private Map<String, Object> attributes;
@@ -93,6 +96,23 @@ public class QuotaResourceRespVO {
@Schema(description = "复合工料机子数据列表")
private List<MergedResourceItemVO> mergedItems;
// ========== 虚拟字段(复合工料机合价) ==========
@Schema(description = "除税基价合价(虚拟字段,仅复合工料机)", example = "50.00")
private BigDecimal taxExclBaseTotalSum;
@Schema(description = "含税基价合价(虚拟字段,仅复合工料机)", example = "54.50")
private BigDecimal taxInclBaseTotalSum;
@Schema(description = "除税编制价合价(虚拟字段,仅复合工料机)", example = "55.00")
private BigDecimal taxExclCompileTotalSum;
@Schema(description = "含税编制价合价(虚拟字段,仅复合工料机)", example = "59.95")
private BigDecimal taxInclCompileTotalSum;
@Schema(description = "调整公式(虚拟字段,显示当前应用的定额调整设置计算公式)", example = "M×1+5=2")
private String adjustmentFormula;
/**
* 复合工料机子数据 VO
*/
@@ -126,6 +146,18 @@ public class QuotaResourceRespVO {
@Schema(description = "税率", example = "0.13")
private BigDecimal resourceTaxRate;
@Schema(description = "除税基价", example = "100.00")
private BigDecimal resourceTaxExclBasePrice;
@Schema(description = "含税基价", example = "113.00")
private BigDecimal resourceTaxInclBasePrice;
@Schema(description = "除税编制价", example = "120.00")
private BigDecimal resourceTaxExclCompilePrice;
@Schema(description = "含税编制价", example = "135.60")
private BigDecimal resourceTaxInclCompilePrice;
@Schema(description = "地区代码", example = "GD")
private String regionCode;
@@ -140,5 +172,22 @@ public class QuotaResourceRespVO {
@Schema(description = "金额", example = "688.50")
private BigDecimal amount;
@Schema(description = "计算基数", example = "{\"formula\":\"人机 + 材\",\"variables\":{\"人机\":2,\"\":3}}")
private Map<String, Object> calcBase;
// ========== 虚拟字段(子工料机合价) ==========
@Schema(description = "除税基价合价(虚拟字段)", example = "50.00")
private BigDecimal taxExclBaseTotalSum;
@Schema(description = "含税基价合价(虚拟字段)", example = "54.50")
private BigDecimal taxInclBaseTotalSum;
@Schema(description = "除税编制价合价(虚拟字段)", example = "55.00")
private BigDecimal taxExclCompileTotalSum;
@Schema(description = "含税编制价合价(虚拟字段)", example = "59.95")
private BigDecimal taxInclCompileTotalSum;
}
}

View File

@@ -1,11 +1,10 @@
package com.yhy.module.core.controller.admin.quota.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Map;
import javax.validation.constraints.NotNull;
import lombok.Data;
/**
* 定额工料机组成保存 Request VO
@@ -19,7 +18,7 @@ public class QuotaResourceSaveReqVO {
@Schema(description = "主键ID更新时必填", example = "1")
private Long id;
@Schema(description = "定额子目ID", example = "1")
@Schema(description = "定额基价ID", example = "1")
private Long quotaItemId;
@Schema(description = "资源项ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@@ -30,6 +29,12 @@ public class QuotaResourceSaveReqVO {
@NotNull(message = "定额消耗量不能为空")
private BigDecimal dosage;
@Schema(description = "调整消耗量(应用调整设置后的消耗量)", example = "700.00")
private BigDecimal adjustedDosage;
@Schema(description = "扩展属性", example = "{\"loss_rate\":0.02}")
private Map<String, Object> attributes;
@Schema(description = "排序字段", example = "1")
private Integer sortOrder;
}

View File

@@ -0,0 +1,156 @@
package com.yhy.module.core.controller.admin.quota.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import lombok.Data;
@Schema(description = "管理后台 - 统一取费子目工料机响应 VO")
@Data
public class QuotaUnifiedFeeResourceRespVO {
@Schema(description = "主键ID", example = "1")
private Long id;
@Schema(description = "关联子定额ID", example = "1001")
private Long unifiedFeeSettingId;
@Schema(description = "关联工料机IDyhy_resource_item", example = "2001")
private Long resourceItemId;
@Schema(description = "定额消耗量", example = "1.5")
private BigDecimal dosage;
@Schema(description = "调整消耗量", example = "1.8")
private BigDecimal adjustedDosage;
// ==================== 关联工料机信息从yhy_resource_item动态获取命名与QuotaResourceRespVO保持一致====================
@Schema(description = "资源编码", example = "RG001")
private String resourceCode;
@Schema(description = "资源名称", example = "普通工")
private String resourceName;
@Schema(description = "资源型号规格", example = "标准规格")
private String resourceSpec;
@Schema(description = "资源类型", example = "labor")
private String resourceType;
@Schema(description = "资源单位", example = "工日")
private String resourceUnit;
@Schema(description = "税率", example = "0.09")
private BigDecimal resourceTaxRate;
@Schema(description = "除税基价", example = "100.00")
private BigDecimal resourceTaxExclBasePrice;
@Schema(description = "含税基价", example = "109.00")
private BigDecimal resourceTaxInclBasePrice;
@Schema(description = "除税编制价", example = "120.00")
private BigDecimal resourceTaxExclCompilePrice;
@Schema(description = "含税编制价", example = "130.80")
private BigDecimal resourceTaxInclCompilePrice;
// ==================== 计算字段(合价 = 单价 × 消耗量)====================
@Schema(description = "除税基价合价", example = "150.00")
private BigDecimal taxExclBaseTotalSum;
@Schema(description = "含税基价合价", example = "163.50")
private BigDecimal taxInclBaseTotalSum;
@Schema(description = "除税编制价合价", example = "180.00")
private BigDecimal taxExclCompileTotalSum;
@Schema(description = "含税编制价合价", example = "196.20")
private BigDecimal taxInclCompileTotalSum;
@Schema(description = "扩展属性")
private Map<String, Object> attributes;
@Schema(description = "计算基数", example = "{\"formula\":\"人机 + 材\",\"variables\":{\"人机\":2,\"\":3}}")
private Map<String, Object> calcBase;
@Schema(description = "排序字段", example = "1")
private Integer sortOrder;
@Schema(description = "是否复合工料机", example = "false")
private Boolean isMerged;
@Schema(description = "复合工料机子数据列表")
private List<MergedResourceItemVO> mergedItems;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "更新时间")
private LocalDateTime updateTime;
/**
* 复合工料机子数据 VO
*/
@Schema(description = "复合工料机子数据")
@Data
public static class MergedResourceItemVO {
@Schema(description = "子数据ID", example = "1")
private Long id;
@Schema(description = "源工料机ID", example = "100")
private Long resourceItemId;
@Schema(description = "源工料机编码", example = "C001")
private String resourceCode;
@Schema(description = "源工料机名称", example = "水泥")
private String resourceName;
@Schema(description = "源工料机单位", example = "t")
private String resourceUnit;
@Schema(description = "源工料机型号规格", example = "P.O 42.5")
private String resourceSpec;
@Schema(description = "源工料机类型", example = "material")
private String resourceType;
@Schema(description = "税率", example = "0.13")
private BigDecimal resourceTaxRate;
@Schema(description = "除税基价", example = "100.00")
private BigDecimal resourceTaxExclBasePrice;
@Schema(description = "含税基价", example = "113.00")
private BigDecimal resourceTaxInclBasePrice;
@Schema(description = "除税编制价", example = "120.00")
private BigDecimal resourceTaxExclCompilePrice;
@Schema(description = "含税编制价", example = "135.60")
private BigDecimal resourceTaxInclCompilePrice;
@Schema(description = "定额消耗量", example = "1.5")
private BigDecimal dosage;
@Schema(description = "计算基数")
private Map<String, Object> calcBase;
@Schema(description = "除税基价合价", example = "50.00")
private BigDecimal taxExclBaseTotalSum;
@Schema(description = "含税基价合价", example = "54.50")
private BigDecimal taxInclBaseTotalSum;
@Schema(description = "除税编制价合价", example = "55.00")
private BigDecimal taxExclCompileTotalSum;
@Schema(description = "含税编制价合价", example = "59.95")
private BigDecimal taxInclCompileTotalSum;
}
}

View File

@@ -0,0 +1,35 @@
package com.yhy.module.core.controller.admin.quota.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.util.Map;
import javax.validation.constraints.NotNull;
import lombok.Data;
@Schema(description = "管理后台 - 统一取费子目工料机创建/更新 Request VO")
@Data
public class QuotaUnifiedFeeResourceSaveReqVO {
@Schema(description = "主键ID更新时必填", example = "1")
private Long id;
@Schema(description = "关联子定额ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1001")
@NotNull(message = "关联子定额ID不能为空")
private Long unifiedFeeSettingId;
@Schema(description = "关联工料机IDyhy_resource_item", requiredMode = Schema.RequiredMode.REQUIRED, example = "2001")
@NotNull(message = "关联工料机ID不能为空")
private Long resourceItemId;
@Schema(description = "定额消耗量", example = "1.5")
private BigDecimal dosage;
@Schema(description = "调整消耗量", example = "1.8")
private BigDecimal adjustedDosage;
@Schema(description = "扩展属性")
private Map<String, Object> attributes;
@Schema(description = "排序字段", example = "1")
private Integer sortOrder;
}

View File

@@ -0,0 +1,72 @@
package com.yhy.module.core.controller.admin.quota.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import lombok.Data;
@Schema(description = "管理后台 - 统一取费单价响应 VO")
@Data
public class QuotaUnifiedFeeRespVO {
@Schema(description = "主键ID", example = "1")
private Long id;
@Schema(description = "模式节点ID", example = "1002")
private Long catalogItemId;
@Schema(description = "关联定额取费项ID", example = "2001")
private Long feeItemId;
@Schema(description = "父节点ID", example = "1001")
private Long parentId;
@Schema(description = "自定义序号", example = "")
private String customCode;
@Schema(description = "名称", example = "统一取费单价1")
private String name;
@Schema(description = "计算基数")
private Map<String, Object> calcBase;
@Schema(description = "费率代号(%)", example = "A")
private String rateCode;
@Schema(description = "代号", example = "TYTQDJ001")
private String code;
@Schema(description = "默认费用归属", example = "间接费")
private String feeCategory;
@Schema(description = "基数说明", example = "按除税基价计算")
private String baseDescription;
@Schema(description = "是否隐藏", example = "false")
private Boolean hidden;
@Schema(description = "是否费用变量", example = "false")
private Boolean variable;
@Schema(description = "节点类型", example = "parent")
private String nodeType;
@Schema(description = "扩展属性")
private Map<String, Object> attributes;
@Schema(description = "排序字段", example = "1")
private Integer sortOrder;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "更新时间")
private LocalDateTime updateTime;
@Schema(description = "子节点列表")
private List<QuotaUnifiedFeeRespVO> children;
@Schema(description = "是否有子节点")
private Boolean hasChildren;
}

View File

@@ -0,0 +1,60 @@
package com.yhy.module.core.controller.admin.quota.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map;
import javax.validation.constraints.NotNull;
import lombok.Data;
@Schema(description = "管理后台 - 统一取费单价创建/更新 Request VO")
@Data
public class QuotaUnifiedFeeSaveReqVO {
@Schema(description = "主键ID更新时必填", example = "1")
private Long id;
@Schema(description = "关联的定额取费项ID用于统一取费单价更新", example = "1001")
private Long feeItemId;
@Schema(description = "模式节点ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1002")
@NotNull(message = "模式节点ID不能为空")
private Long catalogItemId;
@Schema(description = "父节点ID", example = "1001")
private Long parentId;
@Schema(description = "自定义序号", example = "")
private String customCode;
@Schema(description = "名称", example = "统一取费单价1")
private String name;
@Schema(description = "计算基数")
private Map<String, Object> calcBase;
@Schema(description = "费率代号(%)", example = "A")
private String rateCode;
@Schema(description = "代号", example = "TYTQDJ001")
private String code;
@Schema(description = "默认费用归属", example = "间接费")
private String feeCategory;
@Schema(description = "基数说明", example = "按除税基价计算")
private String baseDescription;
@Schema(description = "是否隐藏", example = "false")
private Boolean hidden;
@Schema(description = "是否费用变量", example = "false")
private Boolean variable;
@Schema(description = "节点类型", example = "parent")
private String nodeType;
@Schema(description = "扩展属性")
private Map<String, Object> attributes;
@Schema(description = "排序字段", example = "1")
private Integer sortOrder;
}

View File

@@ -0,0 +1,70 @@
package com.yhy.module.core.controller.admin.quota.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import lombok.Data;
@Schema(description = "管理后台 - 统一取费设置响应 VO")
@Data
public class QuotaUnifiedFeeSettingRespVO {
@Schema(description = "主键ID", example = "1")
private Long id;
@Schema(description = "模式节点ID", example = "1002")
private Long catalogItemId;
@Schema(description = "父节点ID", example = "1001")
private Long parentId;
@Schema(description = "自定义序号", example = "")
private String customCode;
@Schema(description = "编号", example = "TYTQ001")
private String code;
@Schema(description = "名称", example = "统一取费项目1")
private String name;
@Schema(description = "取费章节", example = "第一章")
private String feeChapter;
@Schema(description = "默认费用归属", example = "间接费")
private String feeCategory;
@Schema(description = "本清单比例%", example = "100.00")
private BigDecimal thisListPercentage;
@Schema(description = "指定清单比例%", example = "50.00")
private BigDecimal specifiedListPercentage;
@Schema(description = "指定清单编码", example = "QD001")
private String specifiedListCode;
@Schema(description = "节点类型", example = "parent")
private String nodeType;
@Schema(description = "单位", example = "")
private String unit;
@Schema(description = "扩展属性")
private Map<String, Object> attributes;
@Schema(description = "排序字段", example = "1")
private Integer sortOrder;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "更新时间")
private LocalDateTime updateTime;
@Schema(description = "子节点列表")
private List<QuotaUnifiedFeeSettingRespVO> children;
@Schema(description = "是否有子节点")
private Boolean hasChildren;
}

View File

@@ -0,0 +1,60 @@
package com.yhy.module.core.controller.admin.quota.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.util.Map;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.Data;
@Schema(description = "管理后台 - 统一取费设置创建/更新 Request VO")
@Data
public class QuotaUnifiedFeeSettingSaveReqVO {
@Schema(description = "主键ID更新时必填", example = "1")
private Long id;
@Schema(description = "模式节点ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1002")
@NotNull(message = "模式节点ID不能为空")
private Long catalogItemId;
@Schema(description = "父节点ID", example = "1001")
private Long parentId;
@Schema(description = "自定义序号", example = "")
private String customCode;
@Schema(description = "编号", example = "TYTQ001")
private String code;
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "统一取费项目1")
@NotBlank(message = "名称不能为空")
private String name;
@Schema(description = "取费章节", example = "第一章")
private String feeChapter;
@Schema(description = "默认费用归属", example = "间接费")
private String feeCategory;
@Schema(description = "本清单比例%", example = "100.00")
private BigDecimal thisListPercentage;
@Schema(description = "指定清单比例%", example = "50.00")
private BigDecimal specifiedListPercentage;
@Schema(description = "指定清单编码", example = "QD001")
private String specifiedListCode;
@Schema(description = "节点类型", example = "parent")
private String nodeType;
@Schema(description = "单位", example = "")
private String unit;
@Schema(description = "扩展属性")
private Map<String, Object> attributes;
@Schema(description = "排序字段", example = "1")
private Integer sortOrder;
}

View File

@@ -0,0 +1,47 @@
package com.yhy.module.core.controller.admin.quota.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.util.Map;
import lombok.Data;
@Schema(description = "管理后台 - 单位工程变量设置 Response VO")
@Data
public class QuotaVariableSettingRespVO {
@Schema(description = "主键ID", example = "1")
private Long id;
@Schema(description = "租户ID", example = "1")
private Long tenantId;
@Schema(description = "费率模式节点ID", example = "1002")
private Long catalogItemId;
@Schema(description = "类别division-分部分项/measure-措施项目/other-其他项目/unit_summary-单位汇总", example = "division")
private String category;
@Schema(description = "费用名称", example = "人工费")
private String name;
@Schema(description = "费用代号", example = "RGF")
private String code;
@Schema(description = "计算基数")
private Map<String, Object> calcBase;
@Schema(description = "排序字段", example = "1")
private Integer sortOrder;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "更新时间")
private LocalDateTime updateTime;
@Schema(description = "数据来源manual-手动配置fee_item-定额取费引用", example = "manual")
private String source;
@Schema(description = "汇总值(后端计算)", example = "12345.67")
private java.math.BigDecimal summaryValue;
}

View File

@@ -0,0 +1,41 @@
package com.yhy.module.core.controller.admin.quota.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.Data;
@Schema(description = "管理后台 - 单位工程变量设置创建/更新 Request VO")
@Data
public class QuotaVariableSettingSaveReqVO {
@Schema(description = "主键ID更新时必填", example = "1")
private Long id;
@Schema(description = "费率模式节点ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1002")
@NotNull(message = "费率模式节点ID不能为空")
private Long catalogItemId;
@Schema(description = "类别division-分部分项/measure-措施项目/other-其他项目/unit_summary-单位汇总", requiredMode = Schema.RequiredMode.REQUIRED, example = "division")
@NotBlank(message = "类别不能为空")
private String category;
@Schema(description = "费用名称", example = "人工费")
private String name;
@Schema(description = "费用代号", example = "RGF")
private String code;
@Schema(description = "计算基数", example = "{\"formula\":\"DRGF+CLF\",\"variables\":{\"DRGF\":{\"categoryId\":1,\"priceField\":\"tax_excl_base_price\"}}}")
private Map<String, Object> calcBase;
@Schema(description = "排序字段", example = "1")
private Integer sortOrder;
@Schema(description = "参考节点ID用于指定插入位置")
private Long referenceNodeId;
@Schema(description = "插入位置above-在参考节点上方below-在参考节点下方")
private String insertPosition;
}

View File

@@ -3,10 +3,10 @@ package com.yhy.module.core.controller.admin.resource;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.resource.vo.CatalogItemSaveReqVO;
import com.yhy.module.core.controller.admin.resource.vo.ResourceCatalogItemTreeNodeVO;
import com.yhy.module.core.controller.admin.resource.vo.ResourceCategorySimpleRespVO;
import com.yhy.module.core.controller.admin.resource.vo.SwapSortOrderReqVO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
import com.yhy.module.core.controller.admin.infoprice.vo.InfoPriceBookRespVO;
import com.yhy.module.core.controller.admin.resource.vo.*;
import com.yhy.module.core.dal.dataobject.resource.ResourceCatalogItemDO;
import com.yhy.module.core.service.resource.ResourceCatalogItemService;
import com.yhy.module.core.service.resource.ResourceCategoryTreeService;
@@ -49,6 +49,18 @@ public class ResourceCatalogItemController {
return success(itemService.listByCatalog(catalogId));
}
@GetMapping("/list-level")
@Operation(summary = "获取指定层级的分类/条目列表", description = "查询指定path长度的所有节点,默认为2(第二层),如path={1,10}")
public CommonResult<List<ResourceCatalogItemDO>> listByLevel(
@io.swagger.v3.oas.annotations.Parameter(description = "层级深度,默认为2")
@org.springframework.web.bind.annotation.RequestParam(value = "pathLength", required = false, defaultValue = "2") Integer pathLength) {
// 忽略租户过滤,查询所有租户数据,然后在 Service 层排除租户1
List<ResourceCatalogItemDO> result = TenantUtils.executeIgnore(() ->
itemService.listByPathLevel(pathLength)
);
return success(result);
}
@GetMapping("/{id}/allowed-categories")
@Operation(summary = "获取目录树节点允许的类别列表", description = "用于创建工料机项时,限制类别选择范围")
public CommonResult<List<ResourceCategorySimpleRespVO>> getAllowedCategories(@PathVariable("id") Long id) {
@@ -81,4 +93,12 @@ public class ResourceCatalogItemController {
itemService.swapSortOrder(reqVO.getNodeId1(), reqVO.getNodeId2());
return success(true);
}
@PutMapping("/drag")
@Operation(summary = "拖动节点到指定位置")
public CommonResult<Boolean> dragNode(@Valid @RequestBody DragNodeReqVO reqVO) {
itemService.dragNode(reqVO.getDragNodeId(), reqVO.getTargetNodeId(), reqVO.getPosition());
return success(true);
}
}

View File

@@ -1,6 +1,7 @@
package com.yhy.module.core.controller.admin.resource;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.controller.admin.resource.vo.DragNodeReqVO;
import com.yhy.module.core.controller.admin.resource.vo.ResourceCategorySimpleRespVO;
import com.yhy.module.core.controller.admin.resource.vo.ResourceCategoryTreeMappingSaveReqVO;
import com.yhy.module.core.controller.admin.resource.vo.ResourceCategoryTreeNodeVO;
@@ -86,4 +87,11 @@ public class ResourceCategoryTreeController {
categoryTreeService.swapSortOrder(reqVO.getNodeId1(), reqVO.getNodeId2());
return success(true);
}
@PutMapping("/drag")
@Operation(summary = "拖动节点到指定位置")
public CommonResult<Boolean> dragNode(@Valid @RequestBody DragNodeReqVO reqVO) {
categoryTreeService.dragNode(reqVO.getDragNodeId(), reqVO.getTargetNodeId(), reqVO.getPosition());
return success(true);
}
}

View File

@@ -0,0 +1,353 @@
package com.yhy.module.core.controller.admin.resource;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import com.yhy.module.core.dal.dataobject.resource.ResourceInfoPriceMappingDO;
import com.yhy.module.core.dal.mysql.resource.ResourceInfoPriceMappingMapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 工料机-信息价关联")
@RestController
@RequestMapping("/core/resource/info-price-mapping")
@Validated
public class ResourceInfoPriceMappingController {
@Resource
private ResourceInfoPriceMappingMapper mappingMapper;
@Resource
private com.yhy.module.core.dal.mysql.infoprice.InfoPriceResourcePriceMapper infoPriceResourcePriceMapper;
@PostMapping("/create")
@Operation(summary = "创建工料机-信息价关联")
@Parameters({
@Parameter(name = "resourceItemId", description = "工料机ID", required = true),
@Parameter(name = "infoPriceResourceId", description = "信息价工料机ID", required = true),
@Parameter(name = "projectId", description = "项目ID价格来源影响项目级别"),
@Parameter(name = "formula", description = "价格计算公式"),
@Parameter(name = "selectedPriceId", description = "选中的价格历史ID"),
@Parameter(name = "isCurrent", description = "是否为当前价格来源")
})
@PreAuthorize("@ss.hasPermission('core:resource:update')")
public CommonResult<Long> createMapping(@RequestParam("resourceItemId") Long resourceItemId,
@RequestParam("infoPriceResourceId") Long infoPriceResourceId,
@RequestParam(value = "projectId", required = false) Long projectId,
@RequestParam(value = "formula", required = false) String formula,
@RequestParam(value = "selectedPriceId", required = false) Long selectedPriceId,
@RequestParam(value = "isCurrent", required = false) Integer isCurrent) {
// 检查是否已存在(按 projectId + resourceItemId 检查)
if (projectId != null) {
List<ResourceInfoPriceMappingDO> existing = mappingMapper.selectListByProjectAndResourceItem(projectId, resourceItemId);
boolean exists = existing.stream().anyMatch(m -> m.getInfoPriceResourceId().equals(infoPriceResourceId));
if (exists) {
return success(0L); // 已存在返回0表示未新增
}
} else if (mappingMapper.existsByResourceAndInfoPrice(resourceItemId, infoPriceResourceId)) {
return success(0L); // 已存在返回0表示未新增
}
// 先物理删除已软删除的记录(避免唯一约束冲突)
mappingMapper.physicalDeleteByResourceAndInfoPrice(resourceItemId, infoPriceResourceId);
// 公式逻辑(项目级):如果公式为空,查询同租户下该工料机+信息价组合最后修改的公式
String finalFormula;
if (formula == null || formula.trim().isEmpty()) {
String lastFormula = mappingMapper.selectLastFormulaByResourceAndInfoPrice(resourceItemId, infoPriceResourceId);
finalFormula = (lastFormula != null && !lastFormula.trim().isEmpty()) ? lastFormula : "xxj";
} else {
finalFormula = formula;
}
ResourceInfoPriceMappingDO mapping = ResourceInfoPriceMappingDO.builder()
.resourceItemId(resourceItemId)
.infoPriceResourceId(infoPriceResourceId)
.projectId(projectId)
.formula(finalFormula)
.selectedPriceId(selectedPriceId)
.isCurrent(isCurrent != null ? isCurrent : 0)
.build();
mappingMapper.insert(mapping);
return success(mapping.getId());
}
@PutMapping("/set-current")
@Operation(summary = "设置当前价格来源")
@Parameters({
@Parameter(name = "resourceItemId", description = "工料机ID", required = true),
@Parameter(name = "projectId", description = "项目ID价格来源影响项目级别"),
@Parameter(name = "infoPriceResourceId", description = "信息价工料机ID", required = true),
@Parameter(name = "selectedPriceId", description = "选中的价格历史ID", required = true)
})
@PreAuthorize("@ss.hasPermission('core:resource:update')")
public CommonResult<Boolean> setCurrentPrice(@RequestParam("resourceItemId") Long resourceItemId,
@RequestParam(value = "projectId", required = false) Long projectId,
@RequestParam("infoPriceResourceId") Long infoPriceResourceId,
@RequestParam("selectedPriceId") Long selectedPriceId) {
// 优先使用 projectId
if (projectId != null) {
// 1. 先将该项目下该工料机的所有关联的 isCurrent 设为 0
mappingMapper.clearCurrentByProjectAndResourceItem(projectId, resourceItemId);
// 2. 设置指定关联为当前价
mappingMapper.setCurrentPriceByProject(projectId, resourceItemId, infoPriceResourceId, selectedPriceId);
} else {
// 兼容旧逻辑(租户级别)
mappingMapper.clearCurrentByResourceItemId(resourceItemId);
mappingMapper.setCurrentPrice(resourceItemId, infoPriceResourceId, selectedPriceId);
}
return success(true);
}
@PutMapping("/update-formula")
@Operation(summary = "更新公式")
@Parameters({
@Parameter(name = "resourceItemId", description = "工料机ID", required = true),
@Parameter(name = "infoPriceResourceId", description = "信息价工料机ID", required = true),
@Parameter(name = "projectId", description = "项目ID价格来源影响项目级别"),
@Parameter(name = "formula", description = "价格计算公式", required = true)
})
@PreAuthorize("@ss.hasPermission('core:resource:update')")
public CommonResult<Boolean> updateFormula(@RequestParam("resourceItemId") Long resourceItemId,
@RequestParam("infoPriceResourceId") Long infoPriceResourceId,
@RequestParam(value = "projectId", required = false) Long projectId,
@RequestParam("formula") String formula) {
// 公式不允许为空,默认为 xxj
String finalFormula = (formula == null || formula.trim().isEmpty()) ? "xxj" : formula;
if (projectId != null) {
mappingMapper.updateFormulaByProject(resourceItemId, infoPriceResourceId, projectId, finalFormula);
} else {
mappingMapper.updateFormula(resourceItemId, infoPriceResourceId, finalFormula);
}
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除工料机-信息价关联")
@Parameters({
@Parameter(name = "resourceItemId", description = "工料机ID", required = true),
@Parameter(name = "infoPriceResourceId", description = "信息价工料机ID", required = true)
})
@PreAuthorize("@ss.hasPermission('core:resource:update')")
public CommonResult<Boolean> deleteMapping(@RequestParam("resourceItemId") Long resourceItemId,
@RequestParam("infoPriceResourceId") Long infoPriceResourceId) {
mappingMapper.delete(new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<ResourceInfoPriceMappingDO>()
.eq(ResourceInfoPriceMappingDO::getResourceItemId, resourceItemId)
.eq(ResourceInfoPriceMappingDO::getInfoPriceResourceId, infoPriceResourceId));
return success(true);
}
@GetMapping("/list")
@Operation(summary = "获取工料机关联的信息价列表")
@Parameters({
@Parameter(name = "resourceItemId", description = "工料机ID", required = true),
@Parameter(name = "projectId", description = "项目ID价格来源影响项目级别")
})
@PreAuthorize("@ss.hasPermission('core:resource:query')")
public CommonResult<List<ResourceInfoPriceMappingDO>> getListByResourceItemId(
@RequestParam("resourceItemId") Long resourceItemId,
@RequestParam(value = "projectId", required = false) Long projectId) {
// 优先使用 projectId 查询
List<ResourceInfoPriceMappingDO> list;
if (projectId != null) {
list = mappingMapper.selectListByProjectAndResourceItem(projectId, resourceItemId);
} else {
list = mappingMapper.selectListByResourceItemId(resourceItemId);
}
return success(list);
}
@GetMapping("/list-with-detail")
@Operation(summary = "获取工料机关联的信息价列表(含详情)")
@Parameters({
@Parameter(name = "resourceItemId", description = "工料机ID", required = true),
@Parameter(name = "projectId", description = "项目ID价格来源影响项目级别")
})
@PreAuthorize("@ss.hasPermission('core:resource:query')")
public CommonResult<List<java.util.Map<String, Object>>> getListWithDetailByResourceItemId(
@RequestParam("resourceItemId") Long resourceItemId,
@RequestParam(value = "projectId", required = false) Long projectId) {
// 优先使用 projectId 查询
List<ResourceInfoPriceMappingDO> mappings;
if (projectId != null) {
mappings = mappingMapper.selectListByProjectAndResourceItem(projectId, resourceItemId);
} else {
mappings = mappingMapper.selectListByResourceItemId(resourceItemId);
}
if (mappings.isEmpty()) {
return success(java.util.Collections.emptyList());
}
// 获取信息价工料机详情
List<Long> infoPriceResourceIds = mappings.stream()
.map(ResourceInfoPriceMappingDO::getInfoPriceResourceId)
.collect(java.util.stream.Collectors.toList());
List<com.yhy.module.core.dal.dataobject.infoprice.InfoPriceResourceDO> resources =
infoPriceResourceMapper.selectBatchIds(infoPriceResourceIds);
java.util.Map<Long, com.yhy.module.core.dal.dataobject.infoprice.InfoPriceResourceDO> resourceMap =
resources.stream().collect(java.util.stream.Collectors.toMap(
com.yhy.module.core.dal.dataobject.infoprice.InfoPriceResourceDO::getId,
r -> r));
// 获取工料机基础信息(名称、规格、单位)
List<Long> sourceResourceItemIds = resources.stream()
.map(com.yhy.module.core.dal.dataobject.infoprice.InfoPriceResourceDO::getSourceResourceItemId)
.filter(java.util.Objects::nonNull)
.distinct()
.collect(java.util.stream.Collectors.toList());
java.util.Map<Long, com.yhy.module.core.dal.dataobject.resource.ResourceItemDO> resourceItemMap = new java.util.HashMap<>();
if (!sourceResourceItemIds.isEmpty()) {
List<com.yhy.module.core.dal.dataobject.resource.ResourceItemDO> resourceItems =
resourceItemMapper.selectBatchIds(sourceResourceItemIds);
resourceItemMap = resourceItems.stream().collect(java.util.stream.Collectors.toMap(
com.yhy.module.core.dal.dataobject.resource.ResourceItemDO::getId,
r -> r));
}
// 组装结果
List<java.util.Map<String, Object>> result = new java.util.ArrayList<>();
for (ResourceInfoPriceMappingDO mapping : mappings) {
java.util.Map<String, Object> item = new java.util.HashMap<>();
item.put("id", mapping.getId());
item.put("resourceItemId", mapping.getResourceItemId());
item.put("infoPriceResourceId", mapping.getInfoPriceResourceId());
item.put("formula", mapping.getFormula());
item.put("selectedPriceId", mapping.getSelectedPriceId());
item.put("isCurrent", mapping.getIsCurrent());
com.yhy.module.core.dal.dataobject.infoprice.InfoPriceResourceDO resource = resourceMap.get(mapping.getInfoPriceResourceId());
if (resource != null) {
item.put("code", resource.getCode());
// 优先使用selectedPriceId对应的价格历史记录的价格信息
if (mapping.getSelectedPriceId() != null) {
com.yhy.module.core.dal.dataobject.infoprice.InfoPriceResourcePriceDO selectedPrice =
infoPriceResourcePriceMapper.selectById(mapping.getSelectedPriceId());
if (selectedPrice != null) {
item.put("priceTaxExcl", selectedPrice.getPriceTaxExcl());
item.put("taxRate", selectedPrice.getTaxRate());
item.put("priceTaxIncl", selectedPrice.getPriceTaxIncl());
item.put("priceStartTime", selectedPrice.getStartTime());
item.put("priceEndTime", selectedPrice.getEndTime());
} else {
// selectedPriceId对应的记录不存在使用资源默认价格
item.put("priceTaxExcl", resource.getPriceTaxExcl());
item.put("taxRate", resource.getTaxRate());
item.put("priceTaxIncl", resource.getPriceTaxIncl());
}
} else {
// 没有selectedPriceId使用资源默认价格
item.put("priceTaxExcl", resource.getPriceTaxExcl());
item.put("taxRate", resource.getTaxRate());
item.put("priceTaxIncl", resource.getPriceTaxIncl());
}
// 从工料机基础表获取名称、规格、单位
if (resource.getSourceResourceItemId() != null) {
com.yhy.module.core.dal.dataobject.resource.ResourceItemDO resourceItem =
resourceItemMap.get(resource.getSourceResourceItemId());
if (resourceItem != null) {
item.put("name", resourceItem.getName());
item.put("spec", resourceItem.getSpec());
item.put("unit", resourceItem.getUnit());
}
}
// 获取信息价专业和地区
if (resource.getCategoryTreeId() != null) {
com.yhy.module.core.dal.dataobject.infoprice.InfoPriceCategoryTreeDO categoryTree =
infoPriceCategoryTreeMapper.selectById(resource.getCategoryTreeId());
if (categoryTree != null && categoryTree.getBookId() != null) {
com.yhy.module.core.dal.dataobject.infoprice.InfoPriceBookDO book =
infoPriceBookMapper.selectById(categoryTree.getBookId());
if (book != null && book.getTreeNodeId() != null) {
com.yhy.module.core.dal.dataobject.infoprice.InfoPriceTreeDO treeNode =
infoPriceTreeMapper.selectById(book.getTreeNodeId());
if (treeNode != null) {
// 信息价专业
item.put("professionType", treeNode.getEnumType());
// 完整地区路径
item.put("fullRegion", buildFullRegionPath(treeNode));
}
}
}
}
}
result.add(item);
}
return success(result);
}
/**
* 构建完整地区路径
*/
private String buildFullRegionPath(com.yhy.module.core.dal.dataobject.infoprice.InfoPriceTreeDO treeNode) {
if (treeNode == null) {
return "";
}
String[] pathIds = treeNode.getPath();
if (pathIds == null || pathIds.length == 0) {
return treeNode.getName();
}
StringBuilder pathBuilder = new StringBuilder();
for (String pathId : pathIds) {
try {
Long id = Long.parseLong(pathId);
com.yhy.module.core.dal.dataobject.infoprice.InfoPriceTreeDO pathNode = infoPriceTreeMapper.selectById(id);
if (pathNode != null && pathNode.getName() != null && !pathNode.getName().isEmpty()) {
if (pathBuilder.length() > 0) {
pathBuilder.append(" / ");
}
pathBuilder.append(pathNode.getName());
}
} catch (NumberFormatException e) {
// 忽略无效的ID
}
}
if (pathBuilder.length() > 0) {
pathBuilder.append(" / ");
}
pathBuilder.append(treeNode.getName());
return pathBuilder.toString();
}
@GetMapping("/tenant-associated-ids")
@Operation(summary = "获取租户级已关联的信息价ID列表用于弹窗置顶")
@Parameters({
@Parameter(name = "resourceItemId", description = "工料机ID", required = true)
})
@PreAuthorize("@ss.hasPermission('core:resource:query')")
public CommonResult<java.util.Set<Long>> getTenantAssociatedIds(
@RequestParam("resourceItemId") Long resourceItemId) {
java.util.Set<Long> ids = mappingMapper.selectAssociatedInfoPriceIdsByResourceItem(resourceItemId);
return success(ids);
}
@Resource
private com.yhy.module.core.dal.mysql.infoprice.InfoPriceResourceMapper infoPriceResourceMapper;
@Resource
private com.yhy.module.core.dal.mysql.resource.ResourceItemMapper resourceItemMapper;
@Resource
private com.yhy.module.core.dal.mysql.infoprice.InfoPriceCategoryTreeMapper infoPriceCategoryTreeMapper;
@Resource
private com.yhy.module.core.dal.mysql.infoprice.InfoPriceBookMapper infoPriceBookMapper;
@Resource
private com.yhy.module.core.dal.mysql.infoprice.InfoPriceTreeMapper infoPriceTreeMapper;
}

View File

@@ -9,6 +9,7 @@ import com.yhy.module.core.controller.admin.resource.vo.ResourceItemRespVO;
import com.yhy.module.core.controller.admin.resource.vo.ResourceItemSaveReqVO;
import com.yhy.module.core.controller.admin.resource.vo.ResourceItemWithPricesRespVO;
import com.yhy.module.core.controller.admin.resource.vo.ResourcePriceSaveReqVO;
import com.yhy.module.core.controller.admin.resource.vo.SwapSortOrderReqVO;
import com.yhy.module.core.dal.dataobject.resource.ResourcePriceDO;
import com.yhy.module.core.service.resource.ResourceItemService;
import io.swagger.v3.oas.annotations.Operation;
@@ -94,4 +95,17 @@ public class ResourceItemController {
resourceItemService.deletePrice(priceId);
return success(true);
}
@GetMapping("/by-code/{code}")
@Operation(summary = "根据编码查询工料机项")
public CommonResult<ResourceItemRespVO> getByCode(@PathVariable("code") String code) {
return success(resourceItemService.getItemByCode(code));
}
@PutMapping("/swap-sort")
@Operation(summary = "交换两个工料机项的排序")
public CommonResult<Boolean> swapSortOrder(@Valid @RequestBody SwapSortOrderReqVO reqVO) {
resourceItemService.swapSortOrder(reqVO.getNodeId1(), reqVO.getNodeId2());
return success(true);
}
}

View File

@@ -37,6 +37,12 @@ public class CatalogItemSaveReqVO {
@Schema(description = "排序号")
private Integer sortOrder;
@Schema(description = "参考节点ID用于指定插入位置")
private Long referenceNodeId;
@Schema(description = "插入位置above-在参考节点上方below-在参考节点下方")
private String insertPosition;
@Schema(description = "扩展属性")
private Map<String, Object> attributes;
}

View File

@@ -0,0 +1,24 @@
package com.yhy.module.core.controller.admin.resource.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Schema(description = "拖动节点请求")
@Data
public class DragNodeReqVO {
@Schema(description = "被拖动的节点ID", required = true, example = "1")
@NotNull(message = "被拖动的节点ID不能为空")
private Long dragNodeId;
@Schema(description = "目标节点ID", required = true, example = "2")
@NotNull(message = "目标节点ID不能为空")
private Long targetNodeId;
@Schema(description = "位置before(目标节点前), after(目标节点后)", required = true, example = "before")
@NotBlank(message = "位置不能为空")
private String position;
}

View File

@@ -31,6 +31,12 @@ public class ResourceCategoryTreeSaveReqVO {
@Schema(description = "排序", example = "1")
private Integer sortOrder;
@Schema(description = "参考节点ID用于上方/下方插入)", example = "1")
private Long referenceNodeId;
@Schema(description = "插入位置above(上方插入), below(下方插入)", example = "above")
private String insertPosition;
@Schema(description = "扩展属性")
private Map<String, Object> attributes;
}

Some files were not shown because too many files have changed in this diff Show More