init
This commit is contained in:
54
.gitignore
vendored
Normal file
54
.gitignore
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
######################################################################
|
||||
# Build Tools
|
||||
|
||||
.gradle
|
||||
/build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
.flattened-pom.xml
|
||||
|
||||
######################################################################
|
||||
# IDE
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
nbproject/private/
|
||||
build/*
|
||||
nbbuild/
|
||||
dist/
|
||||
nbdist/
|
||||
.nb-gradle/
|
||||
|
||||
######################################################################
|
||||
# Others
|
||||
*.log
|
||||
*.xml.versionsBackup
|
||||
*.swp
|
||||
|
||||
!*/build/*.java
|
||||
!*/build/*.html
|
||||
!*/build/*.xml
|
||||
|
||||
### JRebel ###
|
||||
rebel.xml
|
||||
|
||||
application-my.yaml
|
||||
|
||||
/yudao-ui-app/unpackage/
|
||||
**/.DS_Store
|
||||
47
README.md
Normal file
47
README.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# 工程计价重构方案总结(PG + 快照模型)
|
||||
|
||||
## 核心概念
|
||||
- 标准库(只读/版本化):清单、定额、资源、信息价、费率、取费,表前缀 `yhy_catalog*`、`yhy_quota*`、`yhy_resource*`、`yhy_info_price*`、`yhy_rate*`、`yhy_fee*`。
|
||||
- 工程实例(可编辑):单位工程、清单册/行、工料机用量、费率设定,表前缀 `yhy_boq*`、`yhy_unit*`。
|
||||
- 快照/基线:工程创建时,将库条目/价格的“当时值”写入工程侧字段(如 `feature_json` 的 snapshot/base_*,`price_override`),后续库变更不影响已建工程;当前值存在业务字段,基线可对比/升级。
|
||||
|
||||
## PG 表关系(简化)
|
||||
- 库与条目:`yhy_catalog`(type=inventory/quota/resource/info/rate/fee) → `yhy_catalog_item`(code/name/unit/path)。
|
||||
- 定额:`yhy_quota_item`(base_price/amount) → `yhy_quota_resource`(resource_item_id,dosage)。
|
||||
- 资源/工料机:`yhy_resource_item`(type=material/labor/machine);价格:`yhy_resource_price`(tstzrange price_period, EXCLUDE 防重叠);信息价:`yhy_info_price_book/item`。
|
||||
- 清单/工程:`yhy_boq_book` → `yhy_boq_item`(qty,unit_price,amount,feature_json,path) → `yhy_boq_item_resource`(consume_qty,price_override)。
|
||||
- 费率/取费:`yhy_rate_template`(base,eval_way) ↔ `yhy_fee_template`;工程覆写:`yhy_unit_rate_setting`。
|
||||
- 电子标书:`yhy_bid_attr_mapping`(标准字段↔XML↔来源表),`yhy_bid_export_task`(导出任务/快照)。
|
||||
|
||||
## 核心实体与表(简要)
|
||||
|
||||
- `proj_project`:项目主档,含 region_code、valuation_model、tax_model、attributes(jsonb)。
|
||||
|
||||
- `proj_section`:标段/子项目,关联项目。
|
||||
|
||||
- `proj_unit`:单位工程,绑定清单库版本、定额库版本、取费模板、税率模式等。
|
||||
|
||||
- `boq_book`:单位工程清单册(可多版本),含税率、价格模式。
|
||||
|
||||
- `boq_item`:清单行,引用 `catalog_item`(清单)并关联单位工程。`amount` 为 generated(qty*unit_price)。GIN 索引支持模糊与 jsonb 扩展字段。
|
||||
|
||||
- `boq_item_resource`:清单行用量,引用资源项(材料/设备/人工)。支持“项目覆写用量/价格”。
|
||||
|
||||
- `catalog` / `catalog_item`:统一版库(type: inventory/quota/resource/info_price/rate),`path` 用 `ltree` 或 `text[]` 表示树。
|
||||
|
||||
- `quota_item`:定额子目(来自 catalog),含合价与单位消耗。
|
||||
|
||||
- `quota_resource`:定额子目工料机组成(引用资源)。
|
||||
|
||||
- `resource_item`:工料机基础项;`resource_price`:价格,使用 `tstzrange` + exclusion 保证同资源同地区同时间不重叠。
|
||||
|
||||
- `info_price_book` / `info_price_item`:信息价主表与条目,条目也关联资源项以便套价。
|
||||
|
||||
- `rate_template` / `fee_template`:费率与取费模板(继承于 catalog type=rate/fee),用于跨项目复用。
|
||||
|
||||
- `unit_rate_setting`:单位工程费率实际取值,基于模板可覆写。
|
||||
|
||||
- `bid_export_task`:电子标书导出任务,存储生成的 XML、校验日志、映射版本。
|
||||
|
||||
- `bid_attr_mapping`:标准字段 → XML 节点/Code 的映射表,驱动导出。
|
||||
|
||||
4
lombok.config
Normal file
4
lombok.config
Normal file
@@ -0,0 +1,4 @@
|
||||
config.stopBubbling = true
|
||||
lombok.tostring.callsuper=CALL
|
||||
lombok.equalsandhashcode.callsuper=CALL
|
||||
lombok.accessors.chain=true
|
||||
175
pom.xml
Normal file
175
pom.xml
Normal file
@@ -0,0 +1,175 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao</artifactId>
|
||||
<version>${revision}</version>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>yudao-dependencies</module>
|
||||
<module>yudao-framework</module>
|
||||
<!-- Server 主项目 -->
|
||||
<module>yudao-server</module>
|
||||
<!-- 各种 module 拓展 -->
|
||||
<module>yudao-module-system</module>
|
||||
<module>yudao-module-infra</module>
|
||||
<module>yhy-module-core</module>
|
||||
<!-- <module>yudao-module-member</module>-->
|
||||
<!-- <module>yudao-module-bpm</module>-->
|
||||
<!-- <module>yudao-module-report</module>-->
|
||||
<!-- <module>yudao-module-mp</module>-->
|
||||
<!-- <module>yudao-module-pay</module>-->
|
||||
<!-- <module>yudao-module-mall</module>-->
|
||||
<!-- <module>yudao-module-crm</module>-->
|
||||
<!-- <module>yudao-module-erp</module>-->
|
||||
<!-- <module>yudao-module-iot</module>-->
|
||||
<!-- AI 大模型的开启,请参考 https://doc.iocoder.cn/ai/build/ 文档,对 JDK 版本要要求! -->
|
||||
<!-- <module>yudao-module-ai</module>-->
|
||||
</modules>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>芋道项目基础脚手架</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
<properties>
|
||||
<revision>2025.10-jdk8-SNAPSHOT</revision>
|
||||
<!-- Maven 相关 -->
|
||||
<java.version>1.8</java.version>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<maven-surefire-plugin.version>3.5.3</maven-surefire-plugin.version>
|
||||
<maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
|
||||
<flatten-maven-plugin.version>1.7.2</flatten-maven-plugin.version>
|
||||
<!-- maven-surefire-plugin 暂时无法通过 bom 的依赖读取(兼容老版本 IDEA 2024 及以前版本) -->
|
||||
<lombok.version>1.18.42</lombok.version>
|
||||
<spring.boot.version>2.7.18</spring.boot.version>
|
||||
<mapstruct.version>1.6.3</mapstruct.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-dependencies</artifactId>
|
||||
<version>${revision}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<!-- maven-surefire-plugin 插件,用于运行单元测试。 -->
|
||||
<!-- 注意,需要使用 3.0.X+,因为要支持 Junit 5 版本 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven-surefire-plugin.version}</version>
|
||||
</plugin>
|
||||
<!-- maven-compiler-plugin 插件,解决 spring-boot-configuration-processor + Lombok + MapStruct 组合 -->
|
||||
<!-- https://stackoverflow.com/questions/33483697/re-run-spring-boot-configuration-annotation-processor-to-update-generated-metada -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven-compiler-plugin.version}</version>
|
||||
<configuration>
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
</path>
|
||||
<path>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>${lombok.version}</version>
|
||||
</path>
|
||||
<path>
|
||||
<!-- 确保 Lombok 生成的 getter/setter 方法能被 MapStruct 正确识别,
|
||||
避免出现 No property named “xxx" exists 的编译错误 -->
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok-mapstruct-binding</artifactId>
|
||||
<version>0.2.0</version>
|
||||
</path>
|
||||
<path>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-processor</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>flatten-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
||||
<plugins>
|
||||
<!-- 统一 revision 版本 -->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>flatten-maven-plugin</artifactId>
|
||||
<version>${flatten-maven-plugin.version}</version>
|
||||
<configuration>
|
||||
<flattenMode>oss</flattenMode>
|
||||
<updatePomFile>true</updatePomFile>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>flatten</goal>
|
||||
</goals>
|
||||
<id>flatten</id>
|
||||
<phase>process-resources</phase>
|
||||
</execution>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>clean</goal>
|
||||
</goals>
|
||||
<id>flatten.clean</id>
|
||||
<phase>clean</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<!-- 使用 huawei / aliyun 的 Maven 源,提升下载速度 -->
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>huaweicloud</id>
|
||||
<name>huawei</name>
|
||||
<url>https://mirrors.huaweicloud.com/repository/maven/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>aliyunmaven</id>
|
||||
<name>aliyun</name>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
</repository>
|
||||
|
||||
<repository>
|
||||
<id>spring-milestones</id>
|
||||
<name>Spring Milestones</name>
|
||||
<url>https://repo.spring.io/milestone</url>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/snapshot</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
</project>
|
||||
69
yhy-module-core/pom.xml
Normal file
69
yhy-module-core/pom.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>yhy-module-core</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>计价/标书重构核心域模块</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- 依赖系统与基础设施能力 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-system</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-infra</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 业务与 Web 基础 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-data-permission</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 数据访问 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Test -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,87 @@
|
||||
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.*;
|
||||
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 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/catalog-item")
|
||||
@Validated
|
||||
public class BoqCatalogItemController {
|
||||
|
||||
@Resource
|
||||
private BoqCatalogItemService boqCatalogItemService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建清单配置目录树节点")
|
||||
@PreAuthorize("@ss.hasPermission('core:boq-catalog-item:create')")
|
||||
public CommonResult<Long> createBoqCatalogItem(@Valid @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) {
|
||||
boqCatalogItemService.updateBoqCatalogItem(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除清单配置目录树节点")
|
||||
@Parameter(name = "id", description = "节点ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:boq-catalog-item:delete')")
|
||||
public CommonResult<Boolean> deleteBoqCatalogItem(@RequestParam("id") Long id) {
|
||||
boqCatalogItemService.deleteBoqCatalogItem(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获取清单配置目录树节点")
|
||||
@Parameter(name = "id", description = "节点ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:boq-catalog-item:query')")
|
||||
public CommonResult<BoqCatalogItemRespVO> getBoqCatalogItem(@RequestParam("id") Long id) {
|
||||
return success(boqCatalogItemService.getBoqCatalogItem(id));
|
||||
}
|
||||
|
||||
@GetMapping("/tree")
|
||||
@Operation(summary = "获取清单配置目录树(树形结构)")
|
||||
@PreAuthorize("@ss.hasPermission('core:boq-catalog-item:query')")
|
||||
public CommonResult<List<BoqCatalogItemRespVO>> getBoqCatalogItemTree() {
|
||||
return success(boqCatalogItemService.getBoqCatalogItemTree());
|
||||
}
|
||||
|
||||
@PostMapping("/bind-quota")
|
||||
@Operation(summary = "绑定定额基价节点")
|
||||
@PreAuthorize("@ss.hasPermission('core:boq-catalog-item:bind')")
|
||||
public CommonResult<Boolean> bindQuotaCatalogItem(@Valid @RequestBody BoqCatalogItemBindQuotaReqVO bindReqVO) {
|
||||
boqCatalogItemService.bindQuotaCatalogItem(bindReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/swap-sort")
|
||||
@Operation(summary = "交换排序")
|
||||
@PreAuthorize("@ss.hasPermission('core:boq-catalog-item:update')")
|
||||
public CommonResult<Boolean> swapSort(@Valid @RequestBody BoqCatalogItemSwapSortReqVO swapReqVO) {
|
||||
boqCatalogItemService.swapSort(swapReqVO);
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
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.BoqItemTreeRespVO;
|
||||
import com.yhy.module.core.controller.admin.boq.vo.BoqItemTreeSaveReqVO;
|
||||
import com.yhy.module.core.controller.admin.boq.vo.BoqItemTreeSwapSortReqVO;
|
||||
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 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/item-tree")
|
||||
@Validated
|
||||
public class BoqItemTreeController {
|
||||
|
||||
@Resource
|
||||
private BoqItemTreeService boqItemTreeService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建清单项树节点")
|
||||
@PreAuthorize("@ss.hasPermission('core:boq:item-tree:create')")
|
||||
public CommonResult<Long> createBoqItemTree(@Valid @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) {
|
||||
boqItemTreeService.updateBoqItemTree(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除清单项树节点")
|
||||
@Parameter(name = "id", description = "节点ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:boq:item-tree:delete')")
|
||||
public CommonResult<Boolean> deleteBoqItemTree(@RequestParam("id") Long id) {
|
||||
boqItemTreeService.deleteBoqItemTree(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获取清单项树节点")
|
||||
@Parameter(name = "id", description = "节点ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:boq:item-tree:query')")
|
||||
public CommonResult<BoqItemTreeRespVO> getBoqItemTree(@RequestParam("id") Long id) {
|
||||
return success(boqItemTreeService.getBoqItemTree(id));
|
||||
}
|
||||
|
||||
@GetMapping("/tree")
|
||||
@Operation(summary = "获取清单项树(树形结构)")
|
||||
@Parameter(name = "boqCatalogItemId", description = "清单专业ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:boq:item-tree:query')")
|
||||
public CommonResult<List<BoqItemTreeRespVO>> getBoqItemTreeTree(@RequestParam("boqCatalogItemId") Long boqCatalogItemId) {
|
||||
return success(boqItemTreeService.getBoqItemTreeTree(boqCatalogItemId));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获取清单项树列表")
|
||||
@Parameter(name = "boqCatalogItemId", description = "清单专业ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:boq:item-tree:query')")
|
||||
public CommonResult<List<BoqItemTreeRespVO>> getBoqItemTreeList(@RequestParam("boqCatalogItemId") Long boqCatalogItemId) {
|
||||
return success(boqItemTreeService.getBoqItemTreeList(boqCatalogItemId));
|
||||
}
|
||||
|
||||
@PostMapping("/swap-sort")
|
||||
@Operation(summary = "交换排序")
|
||||
@PreAuthorize("@ss.hasPermission('core:boq:item-tree:update')")
|
||||
public CommonResult<Boolean> swapSort(@Valid @RequestBody BoqItemTreeSwapSortReqVO swapReqVO) {
|
||||
boqItemTreeService.swapSort(swapReqVO);
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
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.BoqSubItemRespVO;
|
||||
import com.yhy.module.core.controller.admin.boq.vo.BoqSubItemSaveReqVO;
|
||||
import com.yhy.module.core.controller.admin.boq.vo.BoqSubItemSwapSortReqVO;
|
||||
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 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/sub-item")
|
||||
@Validated
|
||||
public class BoqSubItemController {
|
||||
|
||||
@Resource
|
||||
private BoqSubItemService boqSubItemService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建清单子项")
|
||||
@PreAuthorize("@ss.hasPermission('core:boq:sub-item:create')")
|
||||
public CommonResult<Long> createBoqSubItem(@Valid @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) {
|
||||
boqSubItemService.updateBoqSubItem(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除清单子项")
|
||||
@Parameter(name = "id", description = "子项ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:boq:sub-item:delete')")
|
||||
public CommonResult<Boolean> deleteBoqSubItem(@RequestParam("id") Long id) {
|
||||
boqSubItemService.deleteBoqSubItem(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获取清单子项")
|
||||
@Parameter(name = "id", description = "子项ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:boq:sub-item:query')")
|
||||
public CommonResult<BoqSubItemRespVO> getBoqSubItem(@RequestParam("id") Long id) {
|
||||
return success(boqSubItemService.getBoqSubItem(id));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获取清单子项列表")
|
||||
@Parameter(name = "boqItemTreeId", description = "清单项树ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:boq:sub-item:query')")
|
||||
public CommonResult<List<BoqSubItemRespVO>> getBoqSubItemList(@RequestParam("boqItemTreeId") Long boqItemTreeId) {
|
||||
return success(boqSubItemService.getBoqSubItemList(boqItemTreeId));
|
||||
}
|
||||
|
||||
@PostMapping("/swap-sort")
|
||||
@Operation(summary = "交换排序")
|
||||
@PreAuthorize("@ss.hasPermission('core:boq:sub-item:update')")
|
||||
public CommonResult<Boolean> swapSort(@Valid @RequestBody BoqSubItemSwapSortReqVO swapReqVO) {
|
||||
boqSubItemService.swapSort(swapReqVO);
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.yhy.module.core.controller.admin.boq.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 清单配置目录树绑定定额基价 Request VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 清单配置目录树绑定定额基价 Request VO")
|
||||
@Data
|
||||
public class BoqCatalogItemBindQuotaReqVO {
|
||||
|
||||
@Schema(description = "清单专业节点ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "清单专业节点ID不能为空")
|
||||
private Long boqCatalogItemId;
|
||||
|
||||
@Schema(description = "定额基价第一层节点ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||
@NotNull(message = "定额基价节点ID不能为空")
|
||||
private Long quotaCatalogItemId;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
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.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 清单配置目录树 Response VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 清单配置目录树 Response VO")
|
||||
@Data
|
||||
public class BoqCatalogItemRespVO {
|
||||
|
||||
@Schema(description = "主键ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "父节点ID", example = "1")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "编码", example = "BOQ_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 = "绑定的定额基价节点ID", example = "100")
|
||||
private Long quotaCatalogItemId;
|
||||
|
||||
@Schema(description = "专业绑定锁定标识", example = "false")
|
||||
private Boolean specialtyLocked;
|
||||
|
||||
@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<BoqCatalogItemRespVO> children;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
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 lombok.Data;
|
||||
|
||||
/**
|
||||
* 清单配置目录树保存 Request VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 清单配置目录树保存 Request VO")
|
||||
@Data
|
||||
public class BoqCatalogItemSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "父节点ID", example = "1")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "BOQ_GD")
|
||||
@NotBlank(message = "编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "广东")
|
||||
@NotBlank(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "节点类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "province")
|
||||
@NotBlank(message = "节点类型不能为空")
|
||||
private String nodeType;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "扩展属性")
|
||||
private Map<String, Object> attributes;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.yhy.module.core.controller.admin.boq.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 清单配置目录树交换排序 Request VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 清单配置目录树交换排序 Request VO")
|
||||
@Data
|
||||
public class BoqCatalogItemSwapSortReqVO {
|
||||
|
||||
@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;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
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.List;
|
||||
|
||||
/**
|
||||
* 清单明细树 - Response VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 清单明细树 Response VO")
|
||||
@Data
|
||||
public class BoqDetailTreeRespVO {
|
||||
|
||||
@Schema(description = "节点ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "清单子项ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long boqSubItemId;
|
||||
|
||||
@Schema(description = "父节点ID", example = "1")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "01")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "土石方工程")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "单位", example = "m³")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "节点类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "directory")
|
||||
private String nodeType;
|
||||
|
||||
@Schema(description = "定额基价【第三层】节点ID", example = "1003")
|
||||
private Long quotaCatalogItemId;
|
||||
|
||||
@Schema(description = "定额编码", example = "CONT_001")
|
||||
private String quotaCode;
|
||||
|
||||
@Schema(description = "定额名称", example = "平整场地")
|
||||
private String quotaName;
|
||||
|
||||
@Schema(description = "定额单位", example = "m²")
|
||||
private String quotaUnit;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "层级路径", example = "[\"1\", \"2\"]")
|
||||
private String[] path;
|
||||
|
||||
@Schema(description = "层级", example = "1")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "子节点列表")
|
||||
private List<BoqDetailTreeRespVO> children;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 清单明细树 - 创建/更新 Request VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 清单明细树创建/更新 Request VO")
|
||||
@Data
|
||||
public class BoqDetailTreeSaveReqVO {
|
||||
|
||||
@Schema(description = "节点ID(更新时必填)", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "清单子项ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "清单子项ID不能为空")
|
||||
private Long boqSubItemId;
|
||||
|
||||
@Schema(description = "父节点ID", example = "1")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "01")
|
||||
@NotBlank(message = "编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "土石方工程")
|
||||
@NotBlank(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "单位", example = "m³")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "节点类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "directory")
|
||||
@NotBlank(message = "节点类型不能为空")
|
||||
private String nodeType;
|
||||
|
||||
@Schema(description = "定额基价【第三层】节点ID(仅content类型需要)", example = "1003")
|
||||
private Long quotaCatalogItemId;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sortOrder;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.yhy.module.core.controller.admin.boq.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 清单明细树 - 交换排序 Request VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 清单明细树交换排序 Request VO")
|
||||
@Data
|
||||
public class BoqDetailTreeSwapSortReqVO {
|
||||
|
||||
@Schema(description = "节点ID1", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "节点ID1不能为空")
|
||||
private Long nodeId1;
|
||||
|
||||
@Schema(description = "节点ID2", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "节点ID2不能为空")
|
||||
private Long nodeId2;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
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.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 清单项树 Response VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 清单项树 Response VO")
|
||||
@Data
|
||||
public class BoqItemTreeRespVO {
|
||||
|
||||
@Schema(description = "节点ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "清单专业ID", example = "1")
|
||||
private Long boqCatalogItemId;
|
||||
|
||||
@Schema(description = "父节点ID", example = "1")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "编码", example = "01")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", example = "土石方工程")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "单位", example = "m³")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "树路径", example = "[\"1\", \"2\"]")
|
||||
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<BoqItemTreeRespVO> children;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
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 java.util.Map;
|
||||
|
||||
/**
|
||||
* 清单项树保存 Request VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 清单项树保存 Request VO")
|
||||
@Data
|
||||
public class BoqItemTreeSaveReqVO {
|
||||
|
||||
@Schema(description = "节点ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "清单专业ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "清单专业ID不能为空")
|
||||
private Long boqCatalogItemId;
|
||||
|
||||
@Schema(description = "父节点ID", example = "1")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "01")
|
||||
@NotBlank(message = "编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "土石方工程")
|
||||
@NotBlank(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "单位", example = "m³")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "扩展属性")
|
||||
private Map<String, Object> attributes;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.yhy.module.core.controller.admin.boq.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 清单项树交换排序 Request VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 清单项树交换排序 Request VO")
|
||||
@Data
|
||||
public class BoqItemTreeSwapSortReqVO {
|
||||
|
||||
@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;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 清单子项 Response VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 清单子项 Response VO")
|
||||
@Data
|
||||
public class BoqSubItemRespVO {
|
||||
|
||||
@Schema(description = "子项ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "清单项树ID", example = "1")
|
||||
private Long boqItemTreeId;
|
||||
|
||||
@Schema(description = "编码", example = "010101001")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", example = "平整场地(人工)")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "单位", example = "m²")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "清单说明(富文本)", example = "<p>适用于建筑场地的平整工程</p>")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "扩展属性")
|
||||
private Map<String, Object> attributes;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
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 java.util.Map;
|
||||
|
||||
/**
|
||||
* 清单子项保存 Request VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 清单子项保存 Request VO")
|
||||
@Data
|
||||
public class BoqSubItemSaveReqVO {
|
||||
|
||||
@Schema(description = "子项ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "清单项树ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "清单项树ID不能为空")
|
||||
private Long boqItemTreeId;
|
||||
|
||||
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "010101001")
|
||||
@NotBlank(message = "编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "平整场地(人工)")
|
||||
@NotBlank(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "单位", example = "m²")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "清单说明(富文本)", example = "<p>适用于建筑场地的平整工程</p>")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "扩展属性")
|
||||
private Map<String, Object> attributes;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.yhy.module.core.controller.admin.boq.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 清单子项交换排序 Request VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 清单子项交换排序 Request VO")
|
||||
@Data
|
||||
public class BoqSubItemSwapSortReqVO {
|
||||
|
||||
@Schema(description = "子项1 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "子项1 ID不能为空")
|
||||
private Long itemId1;
|
||||
|
||||
@Schema(description = "子项2 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "子项2 ID不能为空")
|
||||
private Long itemId2;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
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 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.service.infoprice.InfoPriceBookService;
|
||||
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 static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 信息价册")
|
||||
@RestController
|
||||
@RequestMapping("/core/info-price/book")
|
||||
@Validated
|
||||
public class InfoPriceBookController {
|
||||
|
||||
@Resource
|
||||
private InfoPriceBookService infoPriceBookService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建信息价册")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:create')")
|
||||
public CommonResult<Long> createInfoPriceBook(@Valid @RequestBody InfoPriceBookSaveReqVO createReqVO) {
|
||||
return success(infoPriceBookService.createInfoPriceBook(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新信息价册")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:update')")
|
||||
public CommonResult<Boolean> updateInfoPriceBook(@Valid @RequestBody InfoPriceBookSaveReqVO updateReqVO) {
|
||||
infoPriceBookService.updateInfoPriceBook(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除信息价册")
|
||||
@Parameter(name = "id", description = "信息价册ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:delete')")
|
||||
public CommonResult<Boolean> deleteInfoPriceBook(@RequestParam("id") Long id) {
|
||||
infoPriceBookService.deleteInfoPriceBook(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获取信息价册")
|
||||
@Parameter(name = "id", description = "信息价册ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:query')")
|
||||
public CommonResult<InfoPriceBookRespVO> getInfoPriceBook(@RequestParam("id") Long id) {
|
||||
return success(infoPriceBookService.getInfoPriceBook(id));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "分页查询信息价册")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:query')")
|
||||
public CommonResult<PageResult<InfoPriceBookRespVO>> getInfoPriceBookPage(@Valid InfoPriceBookPageReqVO pageReqVO) {
|
||||
return success(infoPriceBookService.getInfoPriceBookPage(pageReqVO));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.yhy.module.core.controller.admin.infoprice;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import com.yhy.module.core.controller.admin.infoprice.vo.InfoPriceCategoryTreeRespVO;
|
||||
import com.yhy.module.core.controller.admin.infoprice.vo.InfoPriceCategoryTreeSaveReqVO;
|
||||
import com.yhy.module.core.controller.admin.infoprice.vo.InfoPriceCategoryTreeSwapSortReqVO;
|
||||
import com.yhy.module.core.service.infoprice.InfoPriceCategoryTreeService;
|
||||
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;
|
||||
|
||||
@Tag(name = "管理后台 - 信息价分类树")
|
||||
@RestController
|
||||
@RequestMapping("/core/info-price/category-tree")
|
||||
@Validated
|
||||
public class InfoPriceCategoryTreeController {
|
||||
|
||||
@Resource
|
||||
private InfoPriceCategoryTreeService categoryTreeService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建信息价分类树节点")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:create')")
|
||||
public CommonResult<Long> createCategoryTree(@Valid @RequestBody InfoPriceCategoryTreeSaveReqVO createReqVO) {
|
||||
return success(categoryTreeService.createCategoryTree(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新信息价分类树节点")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:update')")
|
||||
public CommonResult<Boolean> updateCategoryTree(@Valid @RequestBody InfoPriceCategoryTreeSaveReqVO updateReqVO) {
|
||||
categoryTreeService.updateCategoryTree(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除信息价分类树节点")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:delete')")
|
||||
public CommonResult<Boolean> deleteCategoryTree(@RequestParam("id") Long id) {
|
||||
categoryTreeService.deleteCategoryTree(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得信息价分类树节点")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:query')")
|
||||
public CommonResult<InfoPriceCategoryTreeRespVO> getCategoryTree(@RequestParam("id") Long id) {
|
||||
InfoPriceCategoryTreeRespVO categoryTree = categoryTreeService.getCategoryTree(id);
|
||||
return success(categoryTree);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得信息价分类树列表")
|
||||
@Parameter(name = "bookId", description = "信息价册ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:query')")
|
||||
public CommonResult<List<InfoPriceCategoryTreeRespVO>> getCategoryTreeList(@RequestParam("bookId") Long bookId) {
|
||||
List<InfoPriceCategoryTreeRespVO> list = categoryTreeService.getCategoryTreeList(bookId);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@GetMapping("/tree")
|
||||
@Operation(summary = "获得信息价分类树(树形结构)")
|
||||
@Parameter(name = "bookId", description = "信息价册ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:query')")
|
||||
public CommonResult<List<InfoPriceCategoryTreeRespVO>> getCategoryTreeTree(@RequestParam("bookId") Long bookId) {
|
||||
List<InfoPriceCategoryTreeRespVO> tree = categoryTreeService.getCategoryTreeTree(bookId);
|
||||
return success(tree);
|
||||
}
|
||||
|
||||
@PostMapping("/swap-sort")
|
||||
@Operation(summary = "交换排序")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:update')")
|
||||
public CommonResult<Boolean> swapSort(@Valid @RequestBody InfoPriceCategoryTreeSwapSortReqVO reqVO) {
|
||||
categoryTreeService.swapSort(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
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 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.service.infoprice.InfoPriceResourceService;
|
||||
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;
|
||||
|
||||
@Tag(name = "管理后台 - 信息价工料机信息")
|
||||
@RestController
|
||||
@RequestMapping("/core/info-price/resource")
|
||||
@Validated
|
||||
public class InfoPriceResourceController {
|
||||
|
||||
@Resource
|
||||
private InfoPriceResourceService resourceService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建信息价工料机信息")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:create')")
|
||||
public CommonResult<Long> createResource(@Valid @RequestBody InfoPriceResourceSaveReqVO createReqVO) {
|
||||
return success(resourceService.createResource(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新信息价工料机信息")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:update')")
|
||||
public CommonResult<Boolean> updateResource(@Valid @RequestBody InfoPriceResourceSaveReqVO updateReqVO) {
|
||||
resourceService.updateResource(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除信息价工料机信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:delete')")
|
||||
public CommonResult<Boolean> deleteResource(@RequestParam("id") Long id) {
|
||||
resourceService.deleteResource(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得信息价工料机信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:query')")
|
||||
public CommonResult<InfoPriceResourceRespVO> getResource(@RequestParam("id") Long id) {
|
||||
InfoPriceResourceRespVO resource = resourceService.getResource(id);
|
||||
return success(resource);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得信息价工料机信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:query')")
|
||||
public CommonResult<PageResult<InfoPriceResourceRespVO>> getResourcePage(@Valid InfoPriceResourcePageReqVO pageReqVO) {
|
||||
PageResult<InfoPriceResourceRespVO> pageResult = resourceService.getResourcePage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得信息价工料机信息列表")
|
||||
@Parameter(name = "categoryTreeId", description = "分类树节点ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:query')")
|
||||
public CommonResult<List<InfoPriceResourceRespVO>> getResourceList(@RequestParam("categoryTreeId") Long categoryTreeId) {
|
||||
List<InfoPriceResourceRespVO> list = resourceService.getResourceList(categoryTreeId);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
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 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.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;
|
||||
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;
|
||||
|
||||
@Tag(name = "管理后台 - 信息价工料机价格历史")
|
||||
@RestController
|
||||
@RequestMapping("/core/info-price/resource-price")
|
||||
@Validated
|
||||
public class InfoPriceResourcePriceController {
|
||||
|
||||
@Resource
|
||||
private InfoPriceResourcePriceService resourcePriceService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建信息价工料机价格历史")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:create')")
|
||||
public CommonResult<Long> createResourcePrice(@Valid @RequestBody InfoPriceResourcePriceSaveReqVO createReqVO) {
|
||||
return success(resourcePriceService.createResourcePrice(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新信息价工料机价格历史")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:update')")
|
||||
public CommonResult<Boolean> updateResourcePrice(@Valid @RequestBody InfoPriceResourcePriceSaveReqVO updateReqVO) {
|
||||
resourcePriceService.updateResourcePrice(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除信息价工料机价格历史")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:delete')")
|
||||
public CommonResult<Boolean> deleteResourcePrice(@RequestParam("id") Long id) {
|
||||
resourcePriceService.deleteResourcePrice(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得信息价工料机价格历史")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:query')")
|
||||
public CommonResult<InfoPriceResourcePriceRespVO> getResourcePrice(@RequestParam("id") Long id) {
|
||||
InfoPriceResourcePriceRespVO resourcePrice = resourcePriceService.getResourcePrice(id);
|
||||
return success(resourcePrice);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得信息价工料机价格历史分页")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:query')")
|
||||
public CommonResult<PageResult<InfoPriceResourcePriceRespVO>> getResourcePricePage(@Valid InfoPriceResourcePricePageReqVO pageReqVO) {
|
||||
PageResult<InfoPriceResourcePriceRespVO> pageResult = resourcePriceService.getResourcePricePage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得信息价工料机价格历史列表")
|
||||
@Parameter(name = "resourceId", description = "工料机信息ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:query')")
|
||||
public CommonResult<List<InfoPriceResourcePriceRespVO>> getResourcePriceList(@RequestParam("resourceId") Long resourceId) {
|
||||
List<InfoPriceResourcePriceRespVO> list = resourcePriceService.getResourcePriceList(resourceId);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.yhy.module.core.controller.admin.infoprice;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
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;
|
||||
import com.yhy.module.core.service.infoprice.InfoPriceTreeService;
|
||||
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;
|
||||
|
||||
@Tag(name = "管理后台 - 信息价树结构")
|
||||
@RestController
|
||||
@RequestMapping("/core/info-price/tree")
|
||||
@Validated
|
||||
public class InfoPriceTreeController {
|
||||
|
||||
@Resource
|
||||
private InfoPriceTreeService infoPriceTreeService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建信息价树节点")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:create')")
|
||||
public CommonResult<Long> createInfoPriceTree(@Valid @RequestBody InfoPriceTreeSaveReqVO createReqVO) {
|
||||
return success(infoPriceTreeService.createInfoPriceTree(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新信息价树节点")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:update')")
|
||||
public CommonResult<Boolean> updateInfoPriceTree(@Valid @RequestBody InfoPriceTreeSaveReqVO updateReqVO) {
|
||||
infoPriceTreeService.updateInfoPriceTree(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除信息价树节点")
|
||||
@Parameter(name = "id", description = "节点ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:delete')")
|
||||
public CommonResult<Boolean> deleteInfoPriceTree(@RequestParam("id") Long id) {
|
||||
infoPriceTreeService.deleteInfoPriceTree(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获取信息价树节点")
|
||||
@Parameter(name = "id", description = "节点ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:query')")
|
||||
public CommonResult<InfoPriceTreeRespVO> getInfoPriceTree(@RequestParam("id") Long id) {
|
||||
return success(infoPriceTreeService.getInfoPriceTree(id));
|
||||
}
|
||||
|
||||
@GetMapping("/tree")
|
||||
@Operation(summary = "获取信息价树结构")
|
||||
@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));
|
||||
}
|
||||
|
||||
@PostMapping("/swap-sort")
|
||||
@Operation(summary = "交换排序")
|
||||
@PreAuthorize("@ss.hasPermission('core:info-price:update')")
|
||||
public CommonResult<Boolean> swapSort(@Valid @RequestBody InfoPriceTreeSwapSortReqVO reqVO) {
|
||||
infoPriceTreeService.swapSort(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.yhy.module.core.controller.admin.infoprice.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||
|
||||
@Schema(description = "管理后台 - 信息价册分页查询 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class InfoPriceBookPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "树节点ID", example = "1")
|
||||
private Long treeNodeId;
|
||||
|
||||
@Schema(description = "信息价册名称", example = "2024年1月信息价")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "发布状态", example = "published")
|
||||
private String publishStatus;
|
||||
|
||||
@Schema(description = "开始时间-开始", example = "2024-01-01")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate startTimeBegin;
|
||||
|
||||
@Schema(description = "开始时间-结束", example = "2024-01-31")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate startTimeEnd;
|
||||
|
||||
@Schema(description = "结束时间-开始", example = "2024-01-01")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate endTimeBegin;
|
||||
|
||||
@Schema(description = "结束时间-结束", example = "2024-01-31")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate endTimeEnd;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.yhy.module.core.controller.admin.infoprice.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 信息价册 Response VO")
|
||||
@Data
|
||||
public class InfoPriceBookRespVO {
|
||||
|
||||
@Schema(description = "主键", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "租户ID", example = "1")
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description = "树节点ID", example = "1")
|
||||
private Long treeNodeId;
|
||||
|
||||
@Schema(description = "信息价库版本号", example = "2024-v1.0")
|
||||
private String catalogVersion;
|
||||
|
||||
@Schema(description = "信息价册名称", example = "2024年1月信息价")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "开始时间", example = "2024-01-01")
|
||||
private LocalDate startTime;
|
||||
|
||||
@Schema(description = "结束时间", example = "2024-01-31")
|
||||
private LocalDate endTime;
|
||||
|
||||
@Schema(description = "发布状态", example = "published")
|
||||
private String publishStatus;
|
||||
|
||||
@Schema(description = "发布时间", example = "2024-01-01 10:00:00")
|
||||
private LocalDateTime publishTime;
|
||||
|
||||
@Schema(description = "附件", example = "http://example.com/file.pdf")
|
||||
private String attachment;
|
||||
|
||||
@Schema(description = "地区(虚拟字段)", example = "广东*深圳*建筑工程")
|
||||
private String region;
|
||||
|
||||
@Schema(description = "创建者", example = "admin")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新者", example = "admin")
|
||||
private String updater;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.yhy.module.core.controller.admin.infoprice.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||
|
||||
@Schema(description = "管理后台 - 信息价册创建/更新 Request VO")
|
||||
@Data
|
||||
public class InfoPriceBookSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "树节点ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "树节点ID不能为空")
|
||||
private Long treeNodeId;
|
||||
|
||||
@Schema(description = "信息价库版本号", example = "2024-v1.0")
|
||||
private String catalogVersion;
|
||||
|
||||
@Schema(description = "信息价册名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024年1月信息价")
|
||||
@NotBlank(message = "信息价册名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "开始时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-01-01")
|
||||
@NotNull(message = "开始时间不能为空")
|
||||
@DateTimeFormat(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)
|
||||
private LocalDate endTime;
|
||||
|
||||
@Schema(description = "发布状态", example = "published")
|
||||
private String publishStatus;
|
||||
|
||||
@Schema(description = "发布时间", example = "2024-01-01 10:00:00")
|
||||
private LocalDateTime publishTime;
|
||||
|
||||
@Schema(description = "附件", example = "http://example.com/file.pdf")
|
||||
private String attachment;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.yhy.module.core.controller.admin.infoprice.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "管理后台 - 信息价分类树 Response VO")
|
||||
@Data
|
||||
public class InfoPriceCategoryTreeRespVO {
|
||||
|
||||
@Schema(description = "主键", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "租户ID", example = "1")
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description = "信息价册ID", example = "1")
|
||||
private Long bookId;
|
||||
|
||||
@Schema(description = "父节点ID", example = "1")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "编码", example = "CAT001")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", example = "土石方工程")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "节点类型:1-目录 2-内容", example = "1")
|
||||
private Integer nodeType;
|
||||
|
||||
@Schema(description = "节点类型名称", example = "目录")
|
||||
private String nodeTypeName;
|
||||
|
||||
@Schema(description = "树路径", example = "[\"1\",\"2\"]")
|
||||
private String[] path;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "扩展属性", example = "{}")
|
||||
private Map<String, Object> attributes;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "子节点列表")
|
||||
private List<InfoPriceCategoryTreeRespVO> children;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.yhy.module.core.controller.admin.infoprice.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "管理后台 - 信息价分类树创建/更新 Request VO")
|
||||
@Data
|
||||
public class InfoPriceCategoryTreeSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "信息价册ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "信息价册ID不能为空")
|
||||
private Long bookId;
|
||||
|
||||
@Schema(description = "父节点ID", example = "1")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "CAT001")
|
||||
@NotBlank(message = "编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "土石方工程")
|
||||
@NotBlank(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "节点类型:1-目录 2-内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "节点类型不能为空")
|
||||
private Integer nodeType;
|
||||
|
||||
@Schema(description = "扩展属性", example = "{}")
|
||||
private Map<String, Object> attributes;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.yhy.module.core.controller.admin.infoprice.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "管理后台 - 信息价分类树交换排序 Request VO")
|
||||
@Data
|
||||
public class InfoPriceCategoryTreeSwapSortReqVO {
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.yhy.module.core.controller.admin.infoprice.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
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不能为空")
|
||||
private Long categoryTreeId;
|
||||
|
||||
@Schema(description = "编码(模糊查询)", example = "RES001")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称(模糊查询)", example = "水泥")
|
||||
private String name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.yhy.module.core.controller.admin.infoprice.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
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 InfoPriceResourcePricePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "工料机信息ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "工料机信息ID不能为空")
|
||||
private Long resourceId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.yhy.module.core.controller.admin.infoprice.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "管理后台 - 信息价工料机价格历史 Response VO")
|
||||
@Data
|
||||
public class InfoPriceResourcePriceRespVO {
|
||||
|
||||
@Schema(description = "主键", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "租户ID", example = "1")
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description = "工料机信息ID", example = "1")
|
||||
private Long resourceId;
|
||||
|
||||
@Schema(description = "开始时间", example = "2024-01-01")
|
||||
private LocalDate startTime;
|
||||
|
||||
@Schema(description = "结束时间", example = "2024-01-31")
|
||||
private LocalDate endTime;
|
||||
|
||||
@Schema(description = "除税单价", example = "450.00")
|
||||
private BigDecimal priceTaxExcl;
|
||||
|
||||
@Schema(description = "税率", example = "0.09")
|
||||
private BigDecimal taxRate;
|
||||
|
||||
@Schema(description = "含税单价", example = "490.50")
|
||||
private BigDecimal priceTaxIncl;
|
||||
|
||||
@Schema(description = "扩展属性", example = "{}")
|
||||
private Map<String, Object> attributes;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.yhy.module.core.controller.admin.infoprice.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||
|
||||
@Schema(description = "管理后台 - 信息价工料机价格历史创建/更新 Request VO")
|
||||
@Data
|
||||
public class InfoPriceResourcePriceSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工料机信息ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "工料机信息ID不能为空")
|
||||
private Long resourceId;
|
||||
|
||||
@Schema(description = "开始时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-01-01")
|
||||
@NotNull(message = "开始时间不能为空")
|
||||
@DateTimeFormat(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)
|
||||
private LocalDate endTime;
|
||||
|
||||
@Schema(description = "除税单价", requiredMode = Schema.RequiredMode.REQUIRED, example = "450.00")
|
||||
@NotNull(message = "除税单价不能为空")
|
||||
private BigDecimal priceTaxExcl;
|
||||
|
||||
@Schema(description = "税率", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.09")
|
||||
@NotNull(message = "税率不能为空")
|
||||
private BigDecimal taxRate;
|
||||
|
||||
@Schema(description = "含税单价", requiredMode = Schema.RequiredMode.REQUIRED, example = "490.50")
|
||||
@NotNull(message = "含税单价不能为空")
|
||||
private BigDecimal priceTaxIncl;
|
||||
|
||||
@Schema(description = "扩展属性", example = "{}")
|
||||
private Map<String, Object> attributes;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.yhy.module.core.controller.admin.infoprice.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "管理后台 - 信息价工料机信息 Response VO")
|
||||
@Data
|
||||
public class InfoPriceResourceRespVO {
|
||||
|
||||
@Schema(description = "主键", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "租户ID", example = "1")
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description = "分类树节点ID", example = "1")
|
||||
private Long categoryTreeId;
|
||||
|
||||
@Schema(description = "编码", example = "RES001")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", example = "水泥")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "型号规格", example = "P.O 42.5")
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "单位", example = "t")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "除税编制价", example = "450.00")
|
||||
private BigDecimal priceTaxExcl;
|
||||
|
||||
@Schema(description = "税率", example = "0.09")
|
||||
private BigDecimal taxRate;
|
||||
|
||||
@Schema(description = "含税编制价", example = "490.50")
|
||||
private BigDecimal priceTaxIncl;
|
||||
|
||||
@Schema(description = "图样(文件地址)", example = "http://example.com/drawing.pdf")
|
||||
private String drawingUrl;
|
||||
|
||||
@Schema(description = "分类ID", example = "1")
|
||||
private Long categoryId;
|
||||
|
||||
@Schema(description = "备注", example = "备注信息")
|
||||
private String remark;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.yhy.module.core.controller.admin.infoprice.vo;
|
||||
|
||||
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;
|
||||
|
||||
@Schema(description = "管理后台 - 信息价工料机信息创建/更新 Request VO")
|
||||
@Data
|
||||
public class InfoPriceResourceSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "分类树节点ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "分类树节点ID不能为空")
|
||||
private Long categoryTreeId;
|
||||
|
||||
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "RES001")
|
||||
@NotBlank(message = "编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "水泥")
|
||||
@NotBlank(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "型号规格", example = "P.O 42.5")
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "t")
|
||||
@NotBlank(message = "单位不能为空")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "除税编制价", example = "450.00")
|
||||
private BigDecimal priceTaxExcl;
|
||||
|
||||
@Schema(description = "税率", example = "0.09")
|
||||
private BigDecimal taxRate;
|
||||
|
||||
@Schema(description = "含税编制价", example = "490.50")
|
||||
private BigDecimal priceTaxIncl;
|
||||
|
||||
@Schema(description = "图样(文件地址)", example = "http://example.com/drawing.pdf")
|
||||
private String drawingUrl;
|
||||
|
||||
@Schema(description = "分类ID", example = "1")
|
||||
private Long categoryId;
|
||||
|
||||
@Schema(description = "备注", example = "备注信息")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "资源项ID(可选,关联标准库)", example = "1")
|
||||
private Long resourceItemId;
|
||||
|
||||
@Schema(description = "扩展属性", example = "{}")
|
||||
private Map<String, Object> attributes;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.yhy.module.core.controller.admin.infoprice.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "管理后台 - 信息价树结构 Response VO")
|
||||
@Data
|
||||
public class InfoPriceTreeRespVO {
|
||||
|
||||
@Schema(description = "主键", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "租户ID", example = "1")
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description = "枚举类型", example = "region_a")
|
||||
private String enumType;
|
||||
|
||||
@Schema(description = "父节点ID", example = "1")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "编码", example = "GD")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", example = "广东")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "树路径", example = "[\"1\", \"2\"]")
|
||||
private String[] path;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "扩展属性")
|
||||
private Map<String, Object> attributes;
|
||||
|
||||
@Schema(description = "创建者", example = "admin")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新者", example = "admin")
|
||||
private String updater;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "子节点列表")
|
||||
private List<InfoPriceTreeRespVO> children;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.yhy.module.core.controller.admin.infoprice.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.util.Map;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 信息价树结构创建/更新 Request VO")
|
||||
@Data
|
||||
public class InfoPriceTreeSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "枚举类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "region_a")
|
||||
@NotBlank(message = "枚举类型不能为空")
|
||||
private String enumType;
|
||||
|
||||
@Schema(description = "父节点ID", example = "1")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "GD")
|
||||
@NotBlank(message = "编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "广东")
|
||||
@NotBlank(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "扩展属性")
|
||||
private Map<String, Object> attributes;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.yhy.module.core.controller.admin.infoprice.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "管理后台 - 信息价树结构交换排序 Request VO")
|
||||
@Data
|
||||
public class InfoPriceTreeSwapSortReqVO {
|
||||
|
||||
@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;
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
package com.yhy.module.core.controller.admin.quota;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import com.yhy.module.core.controller.admin.quota.vo.*;
|
||||
import com.yhy.module.core.convert.quota.QuotaAdjustmentConvert;
|
||||
import com.yhy.module.core.dal.dataobject.quota.QuotaAdjustmentDO;
|
||||
import com.yhy.module.core.service.quota.QuotaAdjustmentService;
|
||||
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.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 定额调整设置")
|
||||
@RestController
|
||||
@RequestMapping("/core/quota/adjustment")
|
||||
@Validated
|
||||
public class QuotaAdjustmentController {
|
||||
|
||||
@Resource
|
||||
private QuotaAdjustmentService quotaAdjustmentService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建定额调整设置")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:adjustment:create')")
|
||||
public CommonResult<Long> createQuotaAdjustment(@Valid @RequestBody QuotaAdjustmentSaveReqVO createReqVO) {
|
||||
return success(quotaAdjustmentService.createQuotaAdjustment(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新定额调整设置")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:adjustment:update')")
|
||||
public CommonResult<Boolean> updateQuotaAdjustment(@Valid @RequestBody QuotaAdjustmentSaveReqVO updateReqVO) {
|
||||
quotaAdjustmentService.updateQuotaAdjustment(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除定额调整设置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:adjustment:delete')")
|
||||
public CommonResult<Boolean> deleteQuotaAdjustment(@RequestParam("id") Long id) {
|
||||
quotaAdjustmentService.deleteQuotaAdjustment(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得定额调整设置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:adjustment:query')")
|
||||
public CommonResult<QuotaAdjustmentRespVO> getQuotaAdjustment(@RequestParam("id") Long id) {
|
||||
QuotaAdjustmentDO adjustment = quotaAdjustmentService.getQuotaAdjustment(id);
|
||||
return success(QuotaAdjustmentConvert.INSTANCE.convert(adjustment));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得定额调整设置列表")
|
||||
@Parameter(name = "quotaItemId", description = "定额子目ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:adjustment:query')")
|
||||
public CommonResult<List<QuotaAdjustmentRespVO>> getQuotaAdjustmentList(@RequestParam("quotaItemId") Long quotaItemId) {
|
||||
List<QuotaAdjustmentDO> list = quotaAdjustmentService.getQuotaAdjustmentList(quotaItemId);
|
||||
return success(QuotaAdjustmentConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@PostMapping("/swap-sort")
|
||||
@Operation(summary = "交换排序")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:adjustment:update')")
|
||||
public CommonResult<Boolean> swapSort(@Valid @RequestBody QuotaAdjustmentSwapSortReqVO reqVO) {
|
||||
quotaAdjustmentService.swapSort(reqVO.getId1(), reqVO.getId2());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/save-material-items")
|
||||
@Operation(summary = "保存材料调整明细")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:adjustment:update')")
|
||||
public CommonResult<Boolean> saveMaterialItems(@Valid @RequestBody QuotaAdjustmentMaterialItemsReqVO reqVO) {
|
||||
List<Map<String, Object>> items = new java.util.ArrayList<>();
|
||||
for (QuotaAdjustmentMaterialItemVO item : reqVO.getItems()) {
|
||||
Map<String, Object> itemMap = new java.util.HashMap<>();
|
||||
itemMap.put("sortOrder", item.getSortOrder());
|
||||
itemMap.put("resourceCode", item.getResourceCode());
|
||||
itemMap.put("resourceName", item.getResourceName());
|
||||
itemMap.put("adjustValue", item.getAdjustValue());
|
||||
itemMap.put("remark", item.getRemark());
|
||||
items.add(itemMap);
|
||||
}
|
||||
quotaAdjustmentService.saveMaterialItems(reqVO.getAdjustmentId(), items);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get-material-items")
|
||||
@Operation(summary = "获取材料调整明细")
|
||||
@Parameter(name = "adjustmentId", description = "调整设置ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:adjustment:query')")
|
||||
public CommonResult<List<Map<String, Object>>> getMaterialItems(@RequestParam("adjustmentId") Long adjustmentId) {
|
||||
return success(quotaAdjustmentService.getMaterialItems(adjustmentId));
|
||||
}
|
||||
|
||||
@GetMapping("/get-available-categories")
|
||||
@Operation(summary = "获取可配置的类别列表")
|
||||
@Parameter(name = "quotaItemId", description = "定额子目ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:adjustment:query')")
|
||||
public CommonResult<List<Map<String, Object>>> getAvailableCategories(@RequestParam("quotaItemId") Long quotaItemId) {
|
||||
return success(quotaAdjustmentService.getAvailableCategories(quotaItemId));
|
||||
}
|
||||
|
||||
@PostMapping("/save-dynamic-config")
|
||||
@Operation(summary = "保存动态调整配置")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:adjustment:update')")
|
||||
public CommonResult<Boolean> saveDynamicConfig(@Valid @RequestBody QuotaAdjustmentDynamicConfigReqVO reqVO) {
|
||||
List<Map<String, Object>> categories = new java.util.ArrayList<>();
|
||||
for (QuotaAdjustmentDynamicCategoryVO category : reqVO.getCategories()) {
|
||||
Map<String, Object> categoryMap = new java.util.HashMap<>();
|
||||
categoryMap.put("categoryId", category.getCategoryId());
|
||||
categoryMap.put("categoryName", category.getCategoryName());
|
||||
categoryMap.put("categoryType", category.getCategoryType());
|
||||
categoryMap.put("coefficient", category.getCoefficient());
|
||||
categoryMap.put("minValue", category.getMinValue());
|
||||
categoryMap.put("maxValue", category.getMaxValue());
|
||||
categoryMap.put("denominator", category.getDenominator());
|
||||
categoryMap.put("baseValue", category.getBaseValue());
|
||||
categoryMap.put("roundingRule", category.getRoundingRule());
|
||||
categories.add(categoryMap);
|
||||
}
|
||||
quotaAdjustmentService.saveDynamicConfig(reqVO.getAdjustmentId(), categories);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get-dynamic-config")
|
||||
@Operation(summary = "获取动态调整配置")
|
||||
@Parameter(name = "adjustmentId", description = "调整设置ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:adjustment:query')")
|
||||
public CommonResult<List<Map<String, Object>>> getDynamicConfig(@RequestParam("adjustmentId") Long adjustmentId) {
|
||||
return success(quotaAdjustmentService.getDynamicConfig(adjustmentId));
|
||||
}
|
||||
|
||||
@PostMapping("/calculate-dynamic")
|
||||
@Operation(summary = "计算动态调整结果")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:adjustment:query')")
|
||||
public CommonResult<Map<String, BigDecimal>> calculateDynamic(@Valid @RequestBody QuotaAdjustmentDynamicCalculateReqVO reqVO) {
|
||||
return success(quotaAdjustmentService.calculateDynamic(reqVO.getAdjustmentId(), reqVO.getInputValues()));
|
||||
}
|
||||
|
||||
@PostMapping("/save-coefficient-config")
|
||||
@Operation(summary = "保存系数调整配置")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:adjustment:update')")
|
||||
public CommonResult<Boolean> saveCoefficientConfig(@Valid @RequestBody QuotaAdjustmentCoefficientConfigReqVO reqVO) {
|
||||
List<Map<String, Object>> categories = new java.util.ArrayList<>();
|
||||
for (QuotaAdjustmentCoefficientCategoryVO category : reqVO.getCategories()) {
|
||||
Map<String, Object> categoryMap = new java.util.HashMap<>();
|
||||
categoryMap.put("categoryId", category.getCategoryId());
|
||||
categoryMap.put("categoryName", category.getCategoryName());
|
||||
categoryMap.put("categoryType", category.getCategoryType());
|
||||
categoryMap.put("coefficient", category.getCoefficient());
|
||||
categories.add(categoryMap);
|
||||
}
|
||||
quotaAdjustmentService.saveCoefficientConfig(reqVO.getAdjustmentId(), categories);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get-coefficient-config")
|
||||
@Operation(summary = "获取系数调整配置")
|
||||
@Parameter(name = "adjustmentId", description = "调整设置ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:adjustment:query')")
|
||||
public CommonResult<List<Map<String, Object>>> getCoefficientConfig(@RequestParam("adjustmentId") Long adjustmentId) {
|
||||
return success(quotaAdjustmentService.getCoefficientConfig(adjustmentId));
|
||||
}
|
||||
|
||||
@GetMapping("/get-available-resources")
|
||||
@Operation(summary = "获取可选的工料机列表")
|
||||
@Parameter(name = "quotaItemId", description = "定额子目ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:adjustment:query')")
|
||||
public CommonResult<List<Map<String, Object>>> getAvailableResources(@RequestParam("quotaItemId") Long quotaItemId) {
|
||||
return success(quotaAdjustmentService.getAvailableResources(quotaItemId));
|
||||
}
|
||||
|
||||
@PostMapping("/save-merge-config")
|
||||
@Operation(summary = "保存动态合并配置")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:adjustment:update')")
|
||||
public CommonResult<Boolean> saveMergeConfig(@Valid @RequestBody QuotaAdjustmentMergeConfigReqVO reqVO) {
|
||||
List<Map<String, Object>> resources = new java.util.ArrayList<>();
|
||||
for (QuotaAdjustmentMergeResourceVO resource : reqVO.getResources()) {
|
||||
Map<String, Object> resourceMap = new java.util.HashMap<>();
|
||||
resourceMap.put("resourceId", resource.getResourceId());
|
||||
resourceMap.put("resourceCode", resource.getResourceCode());
|
||||
resourceMap.put("resourceName", resource.getResourceName());
|
||||
resourceMap.put("coefficient", resource.getCoefficient());
|
||||
resourceMap.put("minValue", resource.getMinValue());
|
||||
resourceMap.put("maxValue", resource.getMaxValue());
|
||||
resourceMap.put("denominator", resource.getDenominator());
|
||||
resourceMap.put("baseValue", resource.getBaseValue());
|
||||
resourceMap.put("roundingRule", resource.getRoundingRule());
|
||||
resources.add(resourceMap);
|
||||
}
|
||||
quotaAdjustmentService.saveMergeConfig(reqVO.getAdjustmentId(), resources);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get-merge-config")
|
||||
@Operation(summary = "获取动态合并配置")
|
||||
@Parameter(name = "adjustmentId", description = "调整设置ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:adjustment:query')")
|
||||
public CommonResult<List<Map<String, Object>>> getMergeConfig(@RequestParam("adjustmentId") Long adjustmentId) {
|
||||
return success(quotaAdjustmentService.getMergeConfig(adjustmentId));
|
||||
}
|
||||
|
||||
@PostMapping("/calculate-merge")
|
||||
@Operation(summary = "计算动态合并结果")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:adjustment:query')")
|
||||
public CommonResult<Map<String, BigDecimal>> calculateMerge(@Valid @RequestBody QuotaAdjustmentMergeCalculateReqVO reqVO) {
|
||||
return success(quotaAdjustmentService.calculateMerge(reqVO.getAdjustmentId(), reqVO.getInputValues()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.yhy.module.core.controller.admin.quota;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import com.yhy.module.core.controller.admin.quota.vo.*;
|
||||
import com.yhy.module.core.service.quota.QuotaCatalogItemService;
|
||||
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/quota/catalog-item")
|
||||
@Validated
|
||||
public class QuotaCatalogItemController {
|
||||
|
||||
@Resource
|
||||
private QuotaCatalogItemService quotaCatalogItemService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建定额目录条目")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:create')")
|
||||
public CommonResult<Long> createQuotaCatalogItem(@Valid @RequestBody QuotaCatalogItemSaveReqVO createReqVO) {
|
||||
return success(quotaCatalogItemService.createQuotaCatalogItem(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新定额目录条目")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:update')")
|
||||
public CommonResult<Boolean> updateQuotaCatalogItem(@Valid @RequestBody QuotaCatalogItemSaveReqVO updateReqVO) {
|
||||
quotaCatalogItemService.updateQuotaCatalogItem(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除定额目录条目")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:delete')")
|
||||
public CommonResult<Boolean> deleteQuotaCatalogItem(@RequestParam("id") Long id) {
|
||||
quotaCatalogItemService.deleteQuotaCatalogItem(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得定额目录条目")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:query')")
|
||||
public CommonResult<QuotaCatalogItemRespVO> getQuotaCatalogItem(@RequestParam("id") Long id) {
|
||||
return success(quotaCatalogItemService.getQuotaCatalogItemList(id).stream().findFirst().orElse(null));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得定额目录条目列表")
|
||||
@Parameter(name = "parentId", description = "父节点ID", example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:query')")
|
||||
public CommonResult<List<QuotaCatalogItemRespVO>> getQuotaCatalogItemList(@RequestParam(value = "parentId", required = false) Long parentId) {
|
||||
return success(quotaCatalogItemService.getQuotaCatalogItemList(parentId));
|
||||
}
|
||||
|
||||
@GetMapping("/tree")
|
||||
@Operation(summary = "获得定额目录树")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:query')")
|
||||
public CommonResult<List<QuotaCatalogItemRespVO>> getQuotaCatalogItemTree() {
|
||||
return success(quotaCatalogItemService.getQuotaCatalogItemTree());
|
||||
}
|
||||
|
||||
@PostMapping("/bind-specialty")
|
||||
@Operation(summary = "绑定工料机专业")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:update')")
|
||||
public CommonResult<Boolean> bindResourceSpecialty(@Valid @RequestBody QuotaCatalogItemBindSpecialtyReqVO reqVO) {
|
||||
quotaCatalogItemService.bindResourceSpecialty(reqVO.getCatalogItemId(), reqVO.getCategoryTreeId());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/add-directory")
|
||||
@Operation(summary = "添加目录节点")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:create')")
|
||||
public CommonResult<Long> addDirectory(@Valid @RequestBody QuotaCatalogItemSaveReqVO createReqVO) {
|
||||
return success(quotaCatalogItemService.addDirectory(createReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/add-content")
|
||||
@Operation(summary = "添加内容节点")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:create')")
|
||||
public CommonResult<Long> addContent(@Valid @RequestBody QuotaCatalogItemSaveReqVO createReqVO) {
|
||||
return success(quotaCatalogItemService.addContent(createReqVO));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.yhy.module.core.controller.admin.quota;
|
||||
|
||||
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.QuotaFeeItemRespVO;
|
||||
import com.yhy.module.core.controller.admin.quota.vo.QuotaFeeItemSaveReqVO;
|
||||
import com.yhy.module.core.controller.admin.quota.vo.QuotaFeeItemSwapSortReqVO;
|
||||
import com.yhy.module.core.dal.dataobject.quota.QuotaFeeItemDO;
|
||||
import com.yhy.module.core.service.quota.QuotaFeeItemService;
|
||||
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;
|
||||
|
||||
@Tag(name = "管理后台 - 定额取费项")
|
||||
@RestController
|
||||
@RequestMapping("/core/quota/fee/item")
|
||||
@Validated
|
||||
public class QuotaFeeItemController {
|
||||
|
||||
@Resource
|
||||
private QuotaFeeItemService quotaFeeItemService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建取费项")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:fee:create')")
|
||||
public CommonResult<Long> createFeeItem(@Valid @RequestBody QuotaFeeItemSaveReqVO createReqVO) {
|
||||
return success(quotaFeeItemService.createFeeItem(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新取费项")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:fee:update')")
|
||||
public CommonResult<Boolean> updateFeeItem(@Valid @RequestBody QuotaFeeItemSaveReqVO updateReqVO) {
|
||||
quotaFeeItemService.updateFeeItem(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除取费项")
|
||||
@Parameter(name = "id", description = "取费项ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:fee:delete')")
|
||||
public CommonResult<Boolean> deleteFeeItem(@RequestParam("id") Long id) {
|
||||
quotaFeeItemService.deleteFeeItem(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获取取费项详情")
|
||||
@Parameter(name = "id", description = "取费项ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:fee:query')")
|
||||
public CommonResult<QuotaFeeItemRespVO> getFeeItem(@RequestParam("id") Long id) {
|
||||
QuotaFeeItemDO feeItem = quotaFeeItemService.getFeeItem(id);
|
||||
return success(BeanUtils.toBean(feeItem, QuotaFeeItemRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获取取费项列表")
|
||||
@Parameter(name = "catalogItemId", description = "模式节点ID", required = true, example = "1002")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:fee:query')")
|
||||
public CommonResult<List<QuotaFeeItemRespVO>> getFeeItemList(@RequestParam("catalogItemId") Long catalogItemId) {
|
||||
List<QuotaFeeItemDO> list = quotaFeeItemService.getFeeItemList(catalogItemId);
|
||||
return success(BeanUtils.toBean(list, QuotaFeeItemRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/swap-sort")
|
||||
@Operation(summary = "交换排序")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:fee:update')")
|
||||
public CommonResult<Boolean> swapSort(@Valid @RequestBody QuotaFeeItemSwapSortReqVO reqVO) {
|
||||
quotaFeeItemService.swapSort(reqVO.getNodeId1(), reqVO.getNodeId2());
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.yhy.module.core.controller.admin.quota;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import com.yhy.module.core.controller.admin.quota.vo.QuotaItemRespVO;
|
||||
import com.yhy.module.core.controller.admin.quota.vo.QuotaItemSaveReqVO;
|
||||
import com.yhy.module.core.service.quota.QuotaItemService;
|
||||
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/quota/item")
|
||||
@Validated
|
||||
public class QuotaItemController {
|
||||
|
||||
@Resource
|
||||
private QuotaItemService quotaItemService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@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 = "更新定额子目")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:update')")
|
||||
public CommonResult<Boolean> updateQuotaItem(@Valid @RequestBody QuotaItemSaveReqVO updateReqVO) {
|
||||
quotaItemService.updateQuotaItem(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除定额子目")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:delete')")
|
||||
public CommonResult<Boolean> deleteQuotaItem(@RequestParam("id") Long id) {
|
||||
quotaItemService.deleteQuotaItem(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得定额子目详情")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:query')")
|
||||
public CommonResult<QuotaItemRespVO> getQuotaItem(@RequestParam("id") Long id) {
|
||||
return success(quotaItemService.getQuotaItemDetail(id));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得定额子目列表")
|
||||
@Parameter(name = "catalogItemId", description = "定额条目ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:query')")
|
||||
public CommonResult<List<QuotaItemRespVO>> getQuotaItemList(@RequestParam("catalogItemId") Long catalogItemId) {
|
||||
return success(quotaItemService.getQuotaItemList(catalogItemId));
|
||||
}
|
||||
|
||||
@PostMapping("/calculate-price")
|
||||
@Operation(summary = "计算定额基价")
|
||||
@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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.yhy.module.core.controller.admin.quota;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import com.yhy.module.core.controller.admin.quota.vo.QuotaRateFieldRespVO;
|
||||
import com.yhy.module.core.controller.admin.quota.vo.QuotaRateFieldSaveReqVO;
|
||||
import com.yhy.module.core.service.quota.QuotaRateFieldService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 定额费率字段绑定 Controller
|
||||
*/
|
||||
@Tag(name = "管理后台 - 定额费率字段绑定")
|
||||
@RestController
|
||||
@RequestMapping("/core/quota/rate/field")
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
public class QuotaRateFieldController {
|
||||
|
||||
private final QuotaRateFieldService rateFieldService;
|
||||
|
||||
@PostMapping("/save")
|
||||
@Operation(summary = "保存字段绑定(创建或更新)")
|
||||
public CommonResult<Long> saveRateField(@Valid @RequestBody QuotaRateFieldSaveReqVO saveReqVO) {
|
||||
return success(rateFieldService.saveRateField(saveReqVO));
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除字段绑定")
|
||||
@Parameter(name = "id", description = "字段绑定ID", required = true)
|
||||
public CommonResult<Boolean> deleteRateField(@RequestParam("id") Long id) {
|
||||
rateFieldService.deleteRateField(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获取费率项的字段绑定列表")
|
||||
@Parameter(name = "rateItemId", description = "费率项ID", required = true)
|
||||
public CommonResult<List<QuotaRateFieldRespVO>> getRateFieldList(
|
||||
@RequestParam("rateItemId") Long rateItemId) {
|
||||
return success(rateFieldService.getRateFieldList(rateItemId));
|
||||
}
|
||||
|
||||
@PostMapping("/update-binding")
|
||||
@Operation(summary = "更新字段绑定")
|
||||
@Parameter(name = "rateItemId", description = "费率项ID", required = true)
|
||||
@Parameter(name = "fieldIndex", description = "字段索引", required = true)
|
||||
public CommonResult<Boolean> updateBinding(
|
||||
@RequestParam("rateItemId") Long rateItemId,
|
||||
@RequestParam("fieldIndex") Integer fieldIndex,
|
||||
@RequestBody Long[] bindingIds) {
|
||||
rateFieldService.updateBinding(rateItemId, fieldIndex, bindingIds);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/batch-save")
|
||||
@Operation(summary = "批量保存字段绑定")
|
||||
@Parameter(name = "rateItemId", description = "费率项ID", required = true)
|
||||
public CommonResult<Boolean> batchSaveRateFields(
|
||||
@RequestParam("rateItemId") Long rateItemId,
|
||||
@RequestBody List<QuotaRateFieldSaveReqVO> fields) {
|
||||
rateFieldService.batchSaveRateFields(rateItemId, fields);
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.yhy.module.core.controller.admin.quota;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import com.yhy.module.core.controller.admin.quota.vo.QuotaRateItemRespVO;
|
||||
import com.yhy.module.core.controller.admin.quota.vo.QuotaRateItemSaveReqVO;
|
||||
import com.yhy.module.core.controller.admin.quota.vo.QuotaRateValueRulesReqVO;
|
||||
import com.yhy.module.core.service.quota.QuotaRateItemService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 定额费率项 Controller
|
||||
*/
|
||||
@Tag(name = "管理后台 - 定额费率项")
|
||||
@RestController
|
||||
@RequestMapping("/core/quota/rate/item")
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
public class QuotaRateItemController {
|
||||
|
||||
private final QuotaRateItemService rateItemService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建费率项")
|
||||
public CommonResult<Long> createRateItem(@Valid @RequestBody QuotaRateItemSaveReqVO createReqVO) {
|
||||
return success(rateItemService.createRateItem(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新费率项")
|
||||
public CommonResult<Boolean> updateRateItem(@Valid @RequestBody QuotaRateItemSaveReqVO updateReqVO) {
|
||||
rateItemService.updateRateItem(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除费率项")
|
||||
@Parameter(name = "id", description = "费率项ID", required = true)
|
||||
public CommonResult<Boolean> deleteRateItem(@RequestParam("id") Long id) {
|
||||
rateItemService.deleteRateItem(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获取费率项详情")
|
||||
@Parameter(name = "id", description = "费率项ID", required = true)
|
||||
public CommonResult<QuotaRateItemRespVO> getRateItem(@RequestParam("id") Long id) {
|
||||
return success(rateItemService.getRateItemDetail(id));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获取费率项列表")
|
||||
@Parameter(name = "catalogItemId", description = "模式节点ID", required = true)
|
||||
@Parameter(name = "parentId", description = "父节点ID")
|
||||
public CommonResult<List<QuotaRateItemRespVO>> getRateItemList(
|
||||
@RequestParam("catalogItemId") Long catalogItemId,
|
||||
@RequestParam(value = "parentId", required = false) Long parentId) {
|
||||
return success(rateItemService.getRateItemList(catalogItemId, parentId));
|
||||
}
|
||||
|
||||
@GetMapping("/tree")
|
||||
@Operation(summary = "获取费率项树")
|
||||
@Parameter(name = "catalogItemId", description = "模式节点ID", required = true)
|
||||
public CommonResult<List<QuotaRateItemRespVO>> getRateItemTree(
|
||||
@RequestParam("catalogItemId") Long catalogItemId) {
|
||||
return success(rateItemService.getRateItemTree(catalogItemId));
|
||||
}
|
||||
|
||||
@PostMapping("/swap-sort")
|
||||
@Operation(summary = "同级交换排序")
|
||||
@Parameter(name = "nodeId1", description = "节点1 ID", required = true)
|
||||
@Parameter(name = "nodeId2", description = "节点2 ID", required = true)
|
||||
public CommonResult<Boolean> swapSort(
|
||||
@RequestParam("nodeId1") Long nodeId1,
|
||||
@RequestParam("nodeId2") Long nodeId2) {
|
||||
rateItemService.swapSort(nodeId1, nodeId2);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/config-value-rules")
|
||||
@Operation(summary = "配置动态取值规则")
|
||||
public CommonResult<Boolean> configValueRules(@Valid @RequestBody QuotaRateValueRulesReqVO reqVO) {
|
||||
rateItemService.configValueRules(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/calculate-fields")
|
||||
@Operation(summary = "计算动态字段值")
|
||||
@Parameter(name = "rateItemId", description = "费率项ID", required = true)
|
||||
@Parameter(name = "baseValue", description = "基数值", required = true)
|
||||
public CommonResult<Map<Integer, BigDecimal>> calculateDynamicFields(
|
||||
@RequestParam("rateItemId") Long rateItemId,
|
||||
@RequestParam("baseValue") BigDecimal baseValue) {
|
||||
return success(rateItemService.calculateDynamicFields(rateItemId, baseValue));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.yhy.module.core.controller.admin.quota;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import com.yhy.module.core.controller.admin.quota.vo.QuotaResourceRespVO;
|
||||
import com.yhy.module.core.controller.admin.quota.vo.QuotaResourceSaveReqVO;
|
||||
import com.yhy.module.core.controller.admin.resource.vo.ResourceItemRespVO;
|
||||
import com.yhy.module.core.service.quota.QuotaResourceService;
|
||||
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/quota/resource")
|
||||
@Validated
|
||||
public class QuotaResourceController {
|
||||
|
||||
@Resource
|
||||
private QuotaResourceService quotaResourceService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "添加定额工料机组成")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:create')")
|
||||
public CommonResult<Long> createQuotaResource(@Valid @RequestBody QuotaResourceSaveReqVO createReqVO) {
|
||||
return success(quotaResourceService.createQuotaResource(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新定额工料机组成")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:update')")
|
||||
public CommonResult<Boolean> updateQuotaResource(@Valid @RequestBody QuotaResourceSaveReqVO updateReqVO) {
|
||||
quotaResourceService.updateQuotaResource(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除定额工料机组成")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:delete')")
|
||||
public CommonResult<Boolean> deleteQuotaResource(@RequestParam("id") Long id) {
|
||||
quotaResourceService.deleteQuotaResource(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得定额工料机组成")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:query')")
|
||||
public CommonResult<QuotaResourceRespVO> getQuotaResource(@RequestParam("id") Long id) {
|
||||
return success(quotaResourceService.getQuotaResourceList(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<QuotaResourceRespVO>> getQuotaResourceList(@RequestParam("quotaItemId") Long quotaItemId) {
|
||||
return success(quotaResourceService.getQuotaResourceList(quotaItemId));
|
||||
}
|
||||
|
||||
@GetMapping("/available-list")
|
||||
@Operation(summary = "获取可选的工料机列表(已过滤范围)")
|
||||
@Parameter(name = "quotaItemId", description = "定额子目ID", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('core:quota:query')")
|
||||
public CommonResult<List<ResourceItemRespVO>> getAvailableResourceItems(@RequestParam("quotaItemId") Long quotaItemId) {
|
||||
return success(quotaResourceService.getAvailableResourceItems(quotaItemId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.yhy.module.core.controller.admin.quota.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 可配置的类别 VO")
|
||||
@Data
|
||||
public class QuotaAdjustmentAvailableCategoryVO {
|
||||
|
||||
@Schema(description = "类别ID", example = "1")
|
||||
private Long categoryId;
|
||||
|
||||
@Schema(description = "类别名称", example = "人工")
|
||||
private String categoryName;
|
||||
|
||||
@Schema(description = "类别类型", example = "labor")
|
||||
private String categoryType;
|
||||
|
||||
@Schema(description = "类别编码", example = "RG")
|
||||
private String categoryCode;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
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;
|
||||
|
||||
@Schema(description = "管理后台 - 系数调整类别配置 VO")
|
||||
@Data
|
||||
public class QuotaAdjustmentCoefficientCategoryVO {
|
||||
|
||||
@Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "类别ID不能为空")
|
||||
private Long categoryId;
|
||||
|
||||
@Schema(description = "类别名称", example = "人工")
|
||||
private String categoryName;
|
||||
|
||||
@Schema(description = "类别类型", example = "labor")
|
||||
private String categoryType;
|
||||
|
||||
@Schema(description = "系数", requiredMode = Schema.RequiredMode.REQUIRED, example = "1.2")
|
||||
@NotNull(message = "系数不能为空")
|
||||
private BigDecimal coefficient;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.yhy.module.core.controller.admin.quota.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 保存系数调整配置 Request VO")
|
||||
@Data
|
||||
public class QuotaAdjustmentCoefficientConfigReqVO {
|
||||
|
||||
@Schema(description = "调整设置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "调整设置ID不能为空")
|
||||
private Long adjustmentId;
|
||||
|
||||
@Schema(description = "类别配置列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "类别配置列表不能为空")
|
||||
@Valid
|
||||
private List<QuotaAdjustmentCoefficientCategoryVO> categories;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.yhy.module.core.controller.admin.quota.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "管理后台 - 计算动态调整结果 Request VO")
|
||||
@Data
|
||||
public class QuotaAdjustmentDynamicCalculateReqVO {
|
||||
|
||||
@Schema(description = "调整设置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "调整设置ID不能为空")
|
||||
private Long adjustmentId;
|
||||
|
||||
@Schema(description = "输入值映射(类别ID: 输入值)", requiredMode = Schema.RequiredMode.REQUIRED,
|
||||
example = "{\"1\": 250, \"2\": 150}")
|
||||
@NotEmpty(message = "输入值映射不能为空")
|
||||
private Map<String, BigDecimal> inputValues;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
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;
|
||||
|
||||
@Schema(description = "管理后台 - 动态调整类别配置 VO")
|
||||
@Data
|
||||
public class QuotaAdjustmentDynamicCategoryVO {
|
||||
|
||||
@Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "类别ID不能为空")
|
||||
private Long categoryId;
|
||||
|
||||
@Schema(description = "类别名称", example = "人工")
|
||||
private String categoryName;
|
||||
|
||||
@Schema(description = "类别类型", example = "labor")
|
||||
private String categoryType;
|
||||
|
||||
@Schema(description = "系数", requiredMode = Schema.RequiredMode.REQUIRED, example = "1.2")
|
||||
@NotNull(message = "系数不能为空")
|
||||
private BigDecimal coefficient;
|
||||
|
||||
@Schema(description = "最小值", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
|
||||
@NotNull(message = "最小值不能为空")
|
||||
private BigDecimal minValue;
|
||||
|
||||
@Schema(description = "最大值", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000")
|
||||
@NotNull(message = "最大值不能为空")
|
||||
private BigDecimal maxValue;
|
||||
|
||||
@Schema(description = "分母值", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||
@NotNull(message = "分母值不能为空")
|
||||
private BigDecimal denominator;
|
||||
|
||||
@Schema(description = "基础值", requiredMode = Schema.RequiredMode.REQUIRED, example = "50")
|
||||
@NotNull(message = "基础值不能为空")
|
||||
private BigDecimal baseValue;
|
||||
|
||||
@Schema(description = "取值规则", requiredMode = Schema.RequiredMode.REQUIRED, example = "round_up")
|
||||
@NotNull(message = "取值规则不能为空")
|
||||
private String roundingRule;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.yhy.module.core.controller.admin.quota.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 保存动态调整配置 Request VO")
|
||||
@Data
|
||||
public class QuotaAdjustmentDynamicConfigReqVO {
|
||||
|
||||
@Schema(description = "调整设置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "调整设置ID不能为空")
|
||||
private Long adjustmentId;
|
||||
|
||||
@Schema(description = "类别配置列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "类别配置列表不能为空")
|
||||
@Valid
|
||||
private List<QuotaAdjustmentDynamicCategoryVO> categories;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.yhy.module.core.controller.admin.quota.vo;
|
||||
|
||||
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;
|
||||
|
||||
@Schema(description = "管理后台 - 定额调整材料明细 VO")
|
||||
@Data
|
||||
public class QuotaAdjustmentMaterialItemVO {
|
||||
|
||||
@Schema(description = "序号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "序号不能为空")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "工料机编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "C001")
|
||||
@NotBlank(message = "工料机编码不能为空")
|
||||
private String resourceCode;
|
||||
|
||||
@Schema(description = "工料机名称", example = "水泥 P.O 42.5")
|
||||
private String resourceName;
|
||||
|
||||
@Schema(description = "增减定额消耗量数值", requiredMode = Schema.RequiredMode.REQUIRED, example = "2.5")
|
||||
@NotNull(message = "增减定额消耗量数值不能为空")
|
||||
private BigDecimal adjustValue;
|
||||
|
||||
@Schema(description = "备注", example = "增加损耗")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.yhy.module.core.controller.admin.quota.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 保存定额调整材料明细 Request VO")
|
||||
@Data
|
||||
public class QuotaAdjustmentMaterialItemsReqVO {
|
||||
|
||||
@Schema(description = "调整设置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "调整设置ID不能为空")
|
||||
private Long adjustmentId;
|
||||
|
||||
@Schema(description = "材料明细列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "材料明细列表不能为空")
|
||||
@Valid
|
||||
private List<QuotaAdjustmentMaterialItemVO> items;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.yhy.module.core.controller.admin.quota.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "管理后台 - 计算动态合并结果 Request VO")
|
||||
@Data
|
||||
public class QuotaAdjustmentMergeCalculateReqVO {
|
||||
|
||||
@Schema(description = "调整设置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "调整设置ID不能为空")
|
||||
private Long adjustmentId;
|
||||
|
||||
@Schema(description = "输入值映射(工料机ID: 输入值)", requiredMode = Schema.RequiredMode.REQUIRED,
|
||||
example = "{\"100\": 250, \"101\": 150}")
|
||||
@NotEmpty(message = "输入值映射不能为空")
|
||||
private Map<String, BigDecimal> inputValues;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.yhy.module.core.controller.admin.quota.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 保存动态合并配置 Request VO")
|
||||
@Data
|
||||
public class QuotaAdjustmentMergeConfigReqVO {
|
||||
|
||||
@Schema(description = "调整设置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "调整设置ID不能为空")
|
||||
private Long adjustmentId;
|
||||
|
||||
@Schema(description = "工料机配置列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "工料机配置列表不能为空")
|
||||
@Valid
|
||||
private List<QuotaAdjustmentMergeResourceVO> resources;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
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;
|
||||
|
||||
@Schema(description = "管理后台 - 动态合并工料机配置 VO")
|
||||
@Data
|
||||
public class QuotaAdjustmentMergeResourceVO {
|
||||
|
||||
@Schema(description = "工料机ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||
@NotNull(message = "工料机ID不能为空")
|
||||
private Long resourceId;
|
||||
|
||||
@Schema(description = "工料机编码", example = "C001")
|
||||
private String resourceCode;
|
||||
|
||||
@Schema(description = "工料机名称", example = "水泥 P.O 42.5")
|
||||
private String resourceName;
|
||||
|
||||
@Schema(description = "系数", requiredMode = Schema.RequiredMode.REQUIRED, example = "1.2")
|
||||
@NotNull(message = "系数不能为空")
|
||||
private BigDecimal coefficient;
|
||||
|
||||
@Schema(description = "最小值", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
|
||||
@NotNull(message = "最小值不能为空")
|
||||
private BigDecimal minValue;
|
||||
|
||||
@Schema(description = "最大值", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000")
|
||||
@NotNull(message = "最大值不能为空")
|
||||
private BigDecimal maxValue;
|
||||
|
||||
@Schema(description = "分母值", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||
@NotNull(message = "分母值不能为空")
|
||||
private BigDecimal denominator;
|
||||
|
||||
@Schema(description = "基础值", requiredMode = Schema.RequiredMode.REQUIRED, example = "50")
|
||||
@NotNull(message = "基础值不能为空")
|
||||
private BigDecimal baseValue;
|
||||
|
||||
@Schema(description = "取值规则", requiredMode = Schema.RequiredMode.REQUIRED, example = "round_up")
|
||||
@NotNull(message = "取值规则不能为空")
|
||||
private String roundingRule;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.yhy.module.core.controller.admin.quota.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "管理后台 - 定额调整设置 Response VO")
|
||||
@Data
|
||||
public class QuotaAdjustmentRespVO {
|
||||
|
||||
@Schema(description = "主键ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "定额子目ID", example = "1")
|
||||
private Long quotaItemId;
|
||||
|
||||
@Schema(description = "调整名称", example = "高温季节调整")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "调整内容", example = "夏季高温施工增加人工费用")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "调整类型", example = "percentage")
|
||||
private String adjustmentType;
|
||||
|
||||
@Schema(description = "调整类型名称", example = "百分比调整")
|
||||
private String adjustmentTypeName;
|
||||
|
||||
@Schema(description = "调整规则", example = "{\"value\": 10, \"operator\": \"increase\"}")
|
||||
private Map<String, Object> adjustmentRules;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.yhy.module.core.controller.admin.quota.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "管理后台 - 定额调整设置创建/更新 Request VO")
|
||||
@Data
|
||||
public class QuotaAdjustmentSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "定额子目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "定额子目ID不能为空")
|
||||
private Long quotaItemId;
|
||||
|
||||
@Schema(description = "调整名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "高温季节调整")
|
||||
@NotBlank(message = "调整名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "调整内容", example = "夏季高温施工增加人工费用")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "调整类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "percentage")
|
||||
@NotBlank(message = "调整类型不能为空")
|
||||
private String adjustmentType;
|
||||
|
||||
@Schema(description = "调整规则", example = "{\"value\": 10, \"operator\": \"increase\"}")
|
||||
private Map<String, Object> adjustmentRules;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sortOrder;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
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;
|
||||
|
||||
@Schema(description = "管理后台 - 定额调整设置交换排序 Request VO")
|
||||
@Data
|
||||
public class QuotaAdjustmentSwapSortReqVO {
|
||||
|
||||
@Schema(description = "调整设置ID1", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "调整设置ID1不能为空")
|
||||
private Long id1;
|
||||
|
||||
@Schema(description = "调整设置ID2", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "调整设置ID2不能为空")
|
||||
private Long id2;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 定额专业绑定工料机专业 Request VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 定额专业绑定工料机专业 Request VO")
|
||||
@Data
|
||||
public class QuotaCatalogItemBindSpecialtyReqVO {
|
||||
|
||||
@Schema(description = "定额专业节点ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "定额专业节点ID不能为空")
|
||||
private Long catalogItemId;
|
||||
|
||||
@Schema(description = "工料机专业节点ID(机类树节点)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "工料机专业节点ID不能为空")
|
||||
private Long categoryTreeId;
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.yhy.module.core.controller.admin.quota.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 定额目录条目 Response VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 定额目录条目 Response VO")
|
||||
@Data
|
||||
public class QuotaCatalogItemRespVO {
|
||||
|
||||
@Schema(description = "主键ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "父节点ID", example = "1")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "工料机机类树节点ID", example = "1")
|
||||
private Long categoryTreeId;
|
||||
|
||||
@Schema(description = "条目编码", example = "DE001")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "条目名称", example = "土石方工程")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "计量单位", example = "m³")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "层级路径", example = "[\"1\", \"2\", \"3\"]")
|
||||
private String[] path;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "扩展属性", example = "{\"node_type\":\"specialty\"}")
|
||||
private Map<String, Object> attributes;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
// ========== 扩展字段 ==========
|
||||
|
||||
@Schema(description = "节点类型(第一层)", example = "specialty")
|
||||
private String nodeType;
|
||||
|
||||
@Schema(description = "是否已绑定工料机专业", example = "true")
|
||||
private Boolean specialtyLocked;
|
||||
|
||||
@Schema(description = "内容类型(第三层)", example = "directory")
|
||||
private String contentType;
|
||||
|
||||
@Schema(description = "是否允许添加子节点", example = "true")
|
||||
private Boolean allowChildren;
|
||||
|
||||
@Schema(description = "是否有子节点", example = "true")
|
||||
private Boolean hasChildren;
|
||||
|
||||
@Schema(description = "子节点列表(树形结构时使用)")
|
||||
private List<QuotaCatalogItemRespVO> children;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
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 lombok.Data;
|
||||
|
||||
/**
|
||||
* 定额目录条目保存 Request VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 定额目录条目保存 Request VO")
|
||||
@Data
|
||||
public class QuotaCatalogItemSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID(更新时必填)", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "父节点ID", example = "1")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "工料机机类树节点ID(定额专业绑定时使用)", example = "1")
|
||||
private Long categoryTreeId;
|
||||
|
||||
@Schema(description = "条目编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "DE001")
|
||||
@NotBlank(message = "条目编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "条目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "土石方工程")
|
||||
@NotBlank(message = "条目名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "计量单位", example = "m³")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "扩展属性", example = "{\"node_type\":\"specialty\"}")
|
||||
private Map<String, Object> attributes;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.yhy.module.core.controller.admin.quota.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "管理后台 - 定额取费项 Response VO")
|
||||
@Data
|
||||
public class QuotaFeeItemRespVO {
|
||||
|
||||
@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 = "自定义序号", example = "一")
|
||||
private String customCode;
|
||||
|
||||
@Schema(description = "名称", example = "企业管理费")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "计算基数")
|
||||
private Map<String, Object> calcBase;
|
||||
|
||||
@Schema(description = "费率代号(%)", example = "15")
|
||||
private String rateCode;
|
||||
|
||||
@Schema(description = "代号", example = "QYGLF")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "费用归属", example = "间接费")
|
||||
private String feeCategory;
|
||||
|
||||
@Schema(description = "基数说明", example = "按除税基价和含税基价之和计算")
|
||||
private String baseDescription;
|
||||
|
||||
@Schema(description = "排序字段", example = "1")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.yhy.module.core.controller.admin.quota.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "管理后台 - 定额取费项创建/更新 Request VO")
|
||||
@Data
|
||||
public class QuotaFeeItemSaveReqVO {
|
||||
|
||||
@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 = "自定义序号", example = "一")
|
||||
private String customCode;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "企业管理费")
|
||||
@NotBlank(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
@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;
|
||||
|
||||
@Schema(description = "费用归属", example = "间接费")
|
||||
private String feeCategory;
|
||||
|
||||
@Schema(description = "基数说明", example = "按除税基价和含税基价之和计算")
|
||||
private String baseDescription;
|
||||
|
||||
@Schema(description = "排序字段", example = "1")
|
||||
private Integer sortOrder;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
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;
|
||||
|
||||
@Schema(description = "管理后台 - 定额取费项交换排序 Request VO")
|
||||
@Data
|
||||
public class QuotaFeeItemSwapSortReqVO {
|
||||
|
||||
@Schema(description = "取费项ID1", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "取费项ID1不能为空")
|
||||
private Long nodeId1;
|
||||
|
||||
@Schema(description = "取费项ID2", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "取费项ID2不能为空")
|
||||
private Long nodeId2;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 定额子目 Response VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 定额子目 Response VO")
|
||||
@Data
|
||||
public class QuotaItemRespVO {
|
||||
|
||||
@Schema(description = "主键ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "定额条目ID", example = "1")
|
||||
private Long catalogItemId;
|
||||
|
||||
@Schema(description = "计量单位", example = "m³")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "定额基价", example = "123.45")
|
||||
private BigDecimal basePrice;
|
||||
|
||||
@Schema(description = "合价/金额", example = "1234.50")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "扩展属性", example = "{\"labor_cost\":50.00}")
|
||||
private Map<String, Object> attributes;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
// ========== 扩展字段 ==========
|
||||
|
||||
@Schema(description = "人工费", example = "50.00")
|
||||
private BigDecimal laborCost;
|
||||
|
||||
@Schema(description = "材料费", example = "60.00")
|
||||
private BigDecimal materialCost;
|
||||
|
||||
@Schema(description = "机械费", example = "13.45")
|
||||
private BigDecimal machineCost;
|
||||
|
||||
@Schema(description = "版本号", example = "2020-v1.0")
|
||||
private String versionNo;
|
||||
|
||||
@Schema(description = "备注", example = "备注信息")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "工料机组成列表")
|
||||
private List<QuotaResourceRespVO> resources;
|
||||
|
||||
@Schema(description = "定额条目信息")
|
||||
private QuotaCatalogItemRespVO catalogItem;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 定额子目保存 Request VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 定额子目保存 Request VO")
|
||||
@Data
|
||||
public class QuotaItemSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID(更新时必填)", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "定额条目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "定额条目ID不能为空")
|
||||
private Long catalogItemId;
|
||||
|
||||
@Schema(description = "计量单位", example = "m³")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "定额基价", example = "123.45")
|
||||
private BigDecimal basePrice;
|
||||
|
||||
@Schema(description = "合价/金额", example = "1234.50")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "扩展属性", example = "{\"labor_cost\":50.00}")
|
||||
private Map<String, Object> attributes;
|
||||
|
||||
@Schema(description = "工料机组成列表")
|
||||
private List<QuotaResourceSaveReqVO> resources;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.yhy.module.core.controller.admin.quota.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 定额费率字段响应 VO
|
||||
*/
|
||||
@Schema(description = "管理后台 - 定额费率字段响应")
|
||||
@Data
|
||||
public class QuotaRateFieldRespVO {
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联费率项ID")
|
||||
private Long rateItemId;
|
||||
|
||||
@Schema(description = "字段索引")
|
||||
private Integer fieldIndex;
|
||||
|
||||
@Schema(description = "字段值")
|
||||
private Integer fieldValue;
|
||||
|
||||
@Schema(description = "字段标签")
|
||||
private String fieldLabel;
|
||||
|
||||
@Schema(description = "绑定的节点ID数组")
|
||||
private Long[] bindingIds;
|
||||
|
||||
@Schema(description = "绑定详情(快照时使用)")
|
||||
private List<Map<String, Object>> bindingDetails;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 定额费率字段保存请求 VO
|
||||
*/
|
||||
@Schema(description = "管理后台 - 定额费率字段保存请求")
|
||||
@Data
|
||||
public class QuotaRateFieldSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID(更新时必填)")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联费率项ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "费率项ID不能为空")
|
||||
private Long rateItemId;
|
||||
|
||||
@Schema(description = "字段索引", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "字段索引不能为空")
|
||||
private Integer fieldIndex;
|
||||
|
||||
@Schema(description = "字段值", example = "1")
|
||||
private Integer fieldValue;
|
||||
|
||||
@Schema(description = "字段标签", example = "1区")
|
||||
private String fieldLabel;
|
||||
|
||||
@Schema(description = "绑定的节点ID数组")
|
||||
private Long[] bindingIds;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 定额费率项响应 VO
|
||||
*/
|
||||
@Schema(description = "管理后台 - 定额费率项响应")
|
||||
@Data
|
||||
public class QuotaRateItemRespVO {
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联模式节点ID")
|
||||
private Long catalogItemId;
|
||||
|
||||
@Schema(description = "父节点ID")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "自定义序号")
|
||||
private String customCode;
|
||||
|
||||
@Schema(description = "费率项名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "费率代号")
|
||||
private String rateCode;
|
||||
|
||||
@Schema(description = "是否填写")
|
||||
private Boolean isEditable;
|
||||
|
||||
@Schema(description = "默认值")
|
||||
private BigDecimal defaultValue;
|
||||
|
||||
@Schema(description = "取值模式")
|
||||
private String valueMode;
|
||||
|
||||
@Schema(description = "扩展设置")
|
||||
private Map<String, Object> settings;
|
||||
|
||||
@Schema(description = "节点类型")
|
||||
private String nodeType;
|
||||
|
||||
@Schema(description = "层级")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "排序值")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
// ==================== 扩展字段 ====================
|
||||
|
||||
@Schema(description = "字段绑定列表")
|
||||
private List<QuotaRateFieldRespVO> fields;
|
||||
|
||||
@Schema(description = "子节点列表")
|
||||
private List<QuotaRateItemRespVO> children;
|
||||
|
||||
@Schema(description = "是否有子节点")
|
||||
private Boolean hasChildren;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.yhy.module.core.controller.admin.quota.vo;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 定额费率项保存请求 VO
|
||||
*/
|
||||
@Schema(description = "管理后台 - 定额费率项保存请求")
|
||||
@Data
|
||||
public class QuotaRateItemSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID(更新时必填)")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联模式节点ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "模式节点ID不能为空")
|
||||
private Long catalogItemId;
|
||||
|
||||
@Schema(description = "父节点ID")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "自定义序号", example = "1.1")
|
||||
private String customCode;
|
||||
|
||||
@Schema(description = "费率项名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "人工费")
|
||||
@NotBlank(message = "费率项名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "费率代号", example = "A")
|
||||
private String rateCode;
|
||||
|
||||
@Schema(description = "是否填写", example = "false")
|
||||
private Boolean isEditable;
|
||||
|
||||
@Schema(description = "默认值", example = "10.5")
|
||||
private BigDecimal defaultValue;
|
||||
|
||||
@Schema(description = "取值模式:static-静态绑定,dynamic-动态规则", example = "static")
|
||||
private String valueMode;
|
||||
|
||||
@Schema(description = "扩展设置")
|
||||
private Map<String, Object> settings;
|
||||
|
||||
@Schema(description = "节点类型:directory-目录,value-数值", requiredMode = Schema.RequiredMode.REQUIRED, example = "value")
|
||||
@NotBlank(message = "节点类型不能为空")
|
||||
private String nodeType;
|
||||
|
||||
@Schema(description = "排序值")
|
||||
private Integer sortOrder;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 定额费率动态取值规则请求 VO
|
||||
*/
|
||||
@Schema(description = "管理后台 - 定额费率动态取值规则请求")
|
||||
@Data
|
||||
public class QuotaRateValueRulesReqVO {
|
||||
|
||||
@Schema(description = "费率项ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "费率项ID不能为空")
|
||||
private Long rateItemId;
|
||||
|
||||
@Schema(description = "阶梯规则列表")
|
||||
private List<TierRule> tiers;
|
||||
|
||||
@Schema(description = "增量规则列表")
|
||||
private List<IncrementRule> increments;
|
||||
|
||||
/**
|
||||
* 阶梯规则
|
||||
*/
|
||||
@Data
|
||||
public static class TierRule {
|
||||
@Schema(description = "序号")
|
||||
private Integer seq;
|
||||
|
||||
@Schema(description = "基数阈值", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "基数阈值不能为空")
|
||||
private BigDecimal threshold;
|
||||
|
||||
@Schema(description = "比较方式:lte-小于等于,lt-小于,gte-大于等于,gt-大于", example = "lte")
|
||||
private String compareType;
|
||||
|
||||
@Schema(description = "字段值映射,key为字段索引,value为字段值")
|
||||
private Map<String, BigDecimal> fieldValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* 增量规则
|
||||
*/
|
||||
@Data
|
||||
public static class IncrementRule {
|
||||
@Schema(description = "序号")
|
||||
private Integer seq;
|
||||
|
||||
@Schema(description = "步长(每增加多少)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "步长不能为空")
|
||||
private BigDecimal step;
|
||||
|
||||
@Schema(description = "基础阈值(从哪个阈值开始计算增量)")
|
||||
private BigDecimal baseThreshold;
|
||||
|
||||
@Schema(description = "字段增量映射,key为字段索引,value为增量值")
|
||||
private Map<String, BigDecimal> fieldIncrements;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
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.Map;
|
||||
|
||||
/**
|
||||
* 定额工料机组成 Response VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 定额工料机组成 Response VO")
|
||||
@Data
|
||||
public class QuotaResourceRespVO {
|
||||
|
||||
@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 = "{\"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 = "357.00")
|
||||
private BigDecimal actualDosage;
|
||||
|
||||
@Schema(description = "金额", example = "17850.00")
|
||||
private BigDecimal amount;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 定额工料机组成保存 Request VO
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@Schema(description = "管理后台 - 定额工料机组成保存 Request VO")
|
||||
@Data
|
||||
public class QuotaResourceSaveReqVO {
|
||||
|
||||
@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 = "定额消耗量", requiredMode = Schema.RequiredMode.REQUIRED, example = "350.00")
|
||||
@NotNull(message = "定额消耗量不能为空")
|
||||
private BigDecimal dosage;
|
||||
|
||||
@Schema(description = "扩展属性", example = "{\"loss_rate\":0.02}")
|
||||
private Map<String, Object> attributes;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
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.CatalogCreateReqVO;
|
||||
import com.yhy.module.core.controller.admin.resource.vo.CatalogListReqVO;
|
||||
import com.yhy.module.core.dal.dataobject.resource.ResourceCatalogDO;
|
||||
import com.yhy.module.core.service.resource.ResourceCatalogService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
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;
|
||||
|
||||
@Tag(name = "管理后台 - 工料机资源库")
|
||||
@RestController
|
||||
@RequestMapping("/core/resource/catalogs")
|
||||
@Validated
|
||||
public class ResourceCatalogController {
|
||||
|
||||
@Resource
|
||||
private ResourceCatalogService catalogService;
|
||||
|
||||
@PostMapping
|
||||
@Operation(summary = "创建资源库版本")
|
||||
public CommonResult<Long> create(@Valid @RequestBody CatalogCreateReqVO reqVO) {
|
||||
return success(catalogService.createCatalog(reqVO));
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@Operation(summary = "查询资源库列表")
|
||||
public CommonResult<List<ResourceCatalogDO>> list(@Valid CatalogListReqVO reqVO) {
|
||||
return success(catalogService.list(reqVO));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
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.CatalogItemSaveReqVO;
|
||||
import com.yhy.module.core.controller.admin.resource.vo.ResourceCategorySimpleRespVO;
|
||||
import com.yhy.module.core.controller.admin.resource.vo.SwapSortOrderReqVO;
|
||||
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;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
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;
|
||||
|
||||
@Tag(name = "管理后台 - 工料机分类/条目")
|
||||
@RestController
|
||||
@RequestMapping("/core/resource/catalog-items")
|
||||
@Validated
|
||||
public class ResourceCatalogItemController {
|
||||
|
||||
@Resource
|
||||
private ResourceCatalogItemService itemService;
|
||||
|
||||
@Resource
|
||||
private ResourceCategoryTreeService categoryTreeService;
|
||||
|
||||
@GetMapping("/{catalogId}/tree")
|
||||
@Operation(summary = "获取分类/条目树")
|
||||
public CommonResult<List<ResourceCatalogItemDO>> tree(@PathVariable("catalogId") Long catalogId) {
|
||||
return success(itemService.listByCatalog(catalogId));
|
||||
}
|
||||
|
||||
@GetMapping("/{id}/allowed-categories")
|
||||
@Operation(summary = "获取目录树节点允许的类别列表", description = "用于创建工料机项时,限制类别选择范围")
|
||||
public CommonResult<List<ResourceCategorySimpleRespVO>> getAllowedCategories(@PathVariable("id") Long id) {
|
||||
return success(itemService.getAllowedCategories(id));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Operation(summary = "创建分类/条目")
|
||||
public CommonResult<Long> create(@Valid @RequestBody CatalogItemSaveReqVO reqVO) {
|
||||
return success(itemService.create(reqVO));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Operation(summary = "更新分类/条目")
|
||||
public CommonResult<Boolean> update(@Valid @RequestBody CatalogItemSaveReqVO reqVO) {
|
||||
itemService.update(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
@Operation(summary = "删除分类/条目")
|
||||
public CommonResult<Boolean> delete(@PathVariable("id") Long id) {
|
||||
itemService.delete(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/swap-sort")
|
||||
@Operation(summary = "交换两个节点的排序")
|
||||
public CommonResult<Boolean> swapSortOrder(@Valid @RequestBody SwapSortOrderReqVO reqVO) {
|
||||
itemService.swapSortOrder(reqVO.getNodeId1(), reqVO.getNodeId2());
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
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.ResourceCategorySaveReqVO;
|
||||
import com.yhy.module.core.controller.admin.resource.vo.SwapSortOrderReqVO;
|
||||
import com.yhy.module.core.dal.dataobject.resource.ResourceCategoryDO;
|
||||
import com.yhy.module.core.service.resource.ResourceCategoryService;
|
||||
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.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;
|
||||
|
||||
@Tag(name = "管理后台 - 工料机类别字典")
|
||||
@RestController
|
||||
@RequestMapping("/core/resource/categories")
|
||||
@Validated
|
||||
public class ResourceCategoryController {
|
||||
|
||||
@Resource
|
||||
private ResourceCategoryService categoryService;
|
||||
|
||||
@PostMapping
|
||||
@Operation(summary = "创建工料机类别")
|
||||
public CommonResult<Long> create(@Valid @RequestBody ResourceCategorySaveReqVO reqVO) {
|
||||
return success(categoryService.create(reqVO));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Operation(summary = "更新工料机类别")
|
||||
public CommonResult<Boolean> update(@Valid @RequestBody ResourceCategorySaveReqVO reqVO) {
|
||||
categoryService.update(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
@Operation(summary = "删除工料机类别")
|
||||
@Parameter(name = "id", description = "类别ID", required = true, example = "1")
|
||||
public CommonResult<Boolean> delete(@PathVariable("id") Long id) {
|
||||
categoryService.delete(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
@Operation(summary = "获取工料机类别详情")
|
||||
@Parameter(name = "id", description = "类别ID", required = true, example = "1")
|
||||
public CommonResult<ResourceCategoryDO> get(@PathVariable("id") Long id) {
|
||||
return success(categoryService.get(id));
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@Operation(summary = "获取工料机类别列表")
|
||||
public CommonResult<List<ResourceCategoryDO>> list() {
|
||||
return success(categoryService.list());
|
||||
}
|
||||
|
||||
@PutMapping("/swap-sort")
|
||||
@Operation(summary = "交换两个类别的排序")
|
||||
public CommonResult<Boolean> swapSortOrder(@Valid @RequestBody SwapSortOrderReqVO reqVO) {
|
||||
categoryService.swapSortOrder(reqVO.getNodeId1(), reqVO.getNodeId2());
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
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.ResourceCategorySimpleRespVO;
|
||||
import com.yhy.module.core.controller.admin.resource.vo.ResourceCategoryTreeMappingSaveReqVO;
|
||||
import com.yhy.module.core.controller.admin.resource.vo.ResourceCategoryTreeNodeVO;
|
||||
import com.yhy.module.core.controller.admin.resource.vo.ResourceCategoryTreeSaveReqVO;
|
||||
import com.yhy.module.core.controller.admin.resource.vo.SwapSortOrderReqVO;
|
||||
import com.yhy.module.core.service.resource.ResourceCategoryTreeService;
|
||||
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.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;
|
||||
|
||||
@Tag(name = "管理后台 - 工料机机类树")
|
||||
@RestController
|
||||
@RequestMapping("/core/resource/category-tree")
|
||||
@Validated
|
||||
public class ResourceCategoryTreeController {
|
||||
|
||||
@Resource
|
||||
private ResourceCategoryTreeService categoryTreeService;
|
||||
|
||||
@PostMapping
|
||||
@Operation(summary = "创建工料机机类树节点")
|
||||
public CommonResult<Long> createNode(@Valid @RequestBody ResourceCategoryTreeSaveReqVO reqVO) {
|
||||
return success(categoryTreeService.createNode(reqVO));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Operation(summary = "更新工料机机类树节点")
|
||||
public CommonResult<Boolean> updateNode(@Valid @RequestBody ResourceCategoryTreeSaveReqVO reqVO) {
|
||||
categoryTreeService.updateNode(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
@Operation(summary = "删除工料机机类树节点")
|
||||
@Parameter(name = "id", description = "节点ID", required = true)
|
||||
public CommonResult<Boolean> deleteNode(@PathVariable("id") Long id) {
|
||||
categoryTreeService.deleteNode(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/tree")
|
||||
@Operation(summary = "获取工料机机类树")
|
||||
public CommonResult<List<ResourceCategoryTreeNodeVO>> getTree() {
|
||||
return success(categoryTreeService.getTree());
|
||||
}
|
||||
|
||||
@GetMapping("/{treeNodeId}/categories")
|
||||
@Operation(summary = "获取指定节点下的类别列表(简化版)")
|
||||
@Parameter(name = "treeNodeId", description = "树节点ID", required = true)
|
||||
public CommonResult<List<ResourceCategorySimpleRespVO>> getCategoriesByTreeNode(@PathVariable("treeNodeId") Long treeNodeId) {
|
||||
return success(categoryTreeService.getCategoriesByTreeNode(treeNodeId));
|
||||
}
|
||||
|
||||
@PostMapping("/mapping")
|
||||
@Operation(summary = "添加树节点与类别的关联")
|
||||
public CommonResult<Boolean> addCategoryMapping(@Valid @RequestBody ResourceCategoryTreeMappingSaveReqVO reqVO) {
|
||||
categoryTreeService.addCategoryMapping(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/mapping/{treeNodeId}/{categoryId}")
|
||||
@Operation(summary = "删除树节点与类别的关联")
|
||||
@Parameter(name = "treeNodeId", description = "树节点ID", required = true)
|
||||
@Parameter(name = "categoryId", description = "类别ID", required = true)
|
||||
public CommonResult<Boolean> removeCategoryMapping(
|
||||
@PathVariable("treeNodeId") Long treeNodeId,
|
||||
@PathVariable("categoryId") Long categoryId) {
|
||||
categoryTreeService.removeCategoryMapping(treeNodeId, categoryId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/swap-sort")
|
||||
@Operation(summary = "交换两个节点的排序")
|
||||
public CommonResult<Boolean> swapSortOrder(@Valid @RequestBody SwapSortOrderReqVO reqVO) {
|
||||
categoryTreeService.swapSortOrder(reqVO.getNodeId1(), reqVO.getNodeId2());
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.yhy.module.core.controller.admin.resource;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import com.yhy.module.core.controller.admin.resource.vo.ResourceItemQueryReqVO;
|
||||
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.ResourcePriceSaveReqVO;
|
||||
import com.yhy.module.core.dal.dataobject.resource.ResourcePriceDO;
|
||||
import com.yhy.module.core.service.resource.ResourceItemService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
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;
|
||||
|
||||
@Tag(name = "管理后台 - 工料机项与价格")
|
||||
@RestController
|
||||
@RequestMapping("/core/resource/items")
|
||||
@Validated
|
||||
public class ResourceItemController {
|
||||
|
||||
@Resource
|
||||
private ResourceItemService resourceItemService;
|
||||
|
||||
@GetMapping
|
||||
@Operation(summary = "分页查询工料机项")
|
||||
public CommonResult<PageResult<ResourceItemRespVO>> page(@Valid ResourceItemQueryReqVO reqVO) {
|
||||
return success(resourceItemService.pageItems(reqVO));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Operation(summary = "创建工料机项")
|
||||
public CommonResult<Long> create(@Valid @RequestBody ResourceItemSaveReqVO reqVO) {
|
||||
return success(resourceItemService.createItem(reqVO));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Operation(summary = "更新工料机项")
|
||||
public CommonResult<Boolean> update(@Valid @RequestBody ResourceItemSaveReqVO reqVO) {
|
||||
resourceItemService.updateItem(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
@Operation(summary = "删除工料机项")
|
||||
public CommonResult<Boolean> delete(@PathVariable("id") Long id) {
|
||||
resourceItemService.deleteItem(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
// 价格相关
|
||||
@GetMapping("/{id}/prices")
|
||||
@Operation(summary = "查询工料机价格列表")
|
||||
public CommonResult<List<ResourcePriceDO>> listPrices(@PathVariable("id") Long id) {
|
||||
return success(resourceItemService.listPrices(id));
|
||||
}
|
||||
|
||||
@PostMapping("/{id}/prices")
|
||||
@Operation(summary = "新增工料机价格")
|
||||
public CommonResult<Long> createPrice(@PathVariable("id") Long id, @Valid @RequestBody ResourcePriceSaveReqVO reqVO) {
|
||||
reqVO.setResourceId(id);
|
||||
return success(resourceItemService.createPrice(reqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/prices")
|
||||
@Operation(summary = "更新工料机价格")
|
||||
public CommonResult<Boolean> updatePrice(@Valid @RequestBody ResourcePriceSaveReqVO reqVO) {
|
||||
resourceItemService.updatePrice(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/prices/{priceId}")
|
||||
@Operation(summary = "删除工料机价格")
|
||||
public CommonResult<Boolean> deletePrice(@PathVariable("priceId") Long priceId) {
|
||||
resourceItemService.deletePrice(priceId);
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
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;
|
||||
|
||||
@Data
|
||||
public class CatalogCreateReqVO {
|
||||
|
||||
@Schema(description = "库类型,默认 resource")
|
||||
private String type = "resource";
|
||||
|
||||
@Schema(description = "版本号", requiredMode = Schema.RequiredMode.REQUIRED, example = "RES-2025Q1")
|
||||
@NotBlank
|
||||
private String versionNo;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "资源库 2025Q1")
|
||||
@NotBlank
|
||||
private String name;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
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;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class CatalogItemSaveReqVO {
|
||||
|
||||
@Schema(description = "条目ID,创建时为空,更新时必填")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工料机机类树节点ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull
|
||||
private Long categoryTreeId;
|
||||
|
||||
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotBlank
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotBlank
|
||||
private String name;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "父路径(不含自身编码),如 ['RM','Concrete']")
|
||||
private List<String> parentPath;
|
||||
|
||||
@Schema(description = "扩展属性")
|
||||
private Map<String, Object> attributes;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.yhy.module.core.controller.admin.resource.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CatalogListReqVO {
|
||||
|
||||
@Schema(description = "库类型", example = "resource")
|
||||
private String type = "resource";
|
||||
|
||||
@Schema(description = "版本号精确匹配", example = "RES-2025Q1")
|
||||
private String versionNo;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
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 java.util.Map;
|
||||
|
||||
@Schema(description = "工料机类别保存请求")
|
||||
@Data
|
||||
public class ResourceCategorySaveReqVO {
|
||||
|
||||
@Schema(description = "主键(更新时必填)", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "类别代码", required = true, example = "材")
|
||||
@NotBlank(message = "类别代码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "类别名称", required = true, example = "材料费")
|
||||
@NotBlank(message = "类别名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "除税基价代码", example = "DCLF")
|
||||
private String taxExclBaseCode;
|
||||
|
||||
@Schema(description = "含税基价代码", example = "HDCLF")
|
||||
private String taxInclBaseCode;
|
||||
|
||||
@Schema(description = "除税编制代码", example = "CLF")
|
||||
private String taxExclCompileCode;
|
||||
|
||||
@Schema(description = "含税编制代码", example = "HCLF")
|
||||
private String taxInclCompileCode;
|
||||
|
||||
@Schema(description = "扩展属性")
|
||||
private Map<String, Object> attributes;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yhy.module.core.controller.admin.resource.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 工料机类别简化响应VO(用于树节点下的类别列表)
|
||||
*
|
||||
* @author yihuiyong
|
||||
*/
|
||||
@Schema(description = "工料机类别简化响应")
|
||||
@Data
|
||||
public class ResourceCategorySimpleRespVO {
|
||||
|
||||
@Schema(description = "类别ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "类别代码", example = "人")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "类别名称", example = "人工费")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sortOrder;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.yhy.module.core.controller.admin.resource.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "工料机机类树与类别关联保存请求")
|
||||
@Data
|
||||
public class ResourceCategoryTreeMappingSaveReqVO {
|
||||
|
||||
@Schema(description = "工料机机类树节点ID", required = true, example = "5")
|
||||
@NotNull(message = "工料机机类树节点ID不能为空")
|
||||
private Long categoryTreeId;
|
||||
|
||||
@Schema(description = "类别字典ID", required = true, example = "1")
|
||||
@NotNull(message = "类别字典ID不能为空")
|
||||
private Long categoryId;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sortOrder;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.yhy.module.core.controller.admin.resource.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "工料机机类树节点")
|
||||
@Data
|
||||
public class ResourceCategoryTreeNodeVO {
|
||||
|
||||
@Schema(description = "节点ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "父节点ID", example = "1")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "节点编码", example = "GD-GMJ")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "节点名称", example = "广东工民建工料机")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "节点类型(region=地区, specialty=工料机专业)", example = "specialty")
|
||||
private String nodeType;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "扩展属性")
|
||||
private Map<String, Object> attributes;
|
||||
|
||||
@Schema(description = "子节点")
|
||||
private List<ResourceCategoryTreeNodeVO> children;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
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 java.util.Map;
|
||||
|
||||
@Schema(description = "工料机机类树保存请求")
|
||||
@Data
|
||||
public class ResourceCategoryTreeSaveReqVO {
|
||||
|
||||
@Schema(description = "主键(更新时必填)", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "父节点ID", example = "1")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "节点编码", required = true, example = "GD-GMJ")
|
||||
@NotBlank(message = "节点编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "节点名称", required = true, example = "广东工民建工料机")
|
||||
@NotBlank(message = "节点名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "节点类型(region=地区, specialty=工料机专业)", requiredMode = Schema.RequiredMode.REQUIRED, example = "specialty")
|
||||
@NotBlank(message = "节点类型不能为空")
|
||||
private String nodeType;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sortOrder;
|
||||
|
||||
@Schema(description = "扩展属性")
|
||||
private Map<String, Object> attributes;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.yhy.module.core.controller.admin.resource.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Schema(description = "工料机项分页查询")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ResourceItemQueryReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "工料机机类树节点ID", example = "101")
|
||||
private Long categoryTreeId;
|
||||
|
||||
@Schema(description = "分类节点ID(查询该节点及其子节点下的工料机)", example = "2")
|
||||
private Long catalogItemId;
|
||||
|
||||
@Schema(description = "类型 labor/material/machine")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "关键词模糊搜索(搜索范围:工料机名称、工料机单位、目录树名称、目录树编码)")
|
||||
private String keyword;
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.yhy.module.core.controller.admin.resource.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "工料机项响应")
|
||||
@Data
|
||||
public class ResourceItemRespVO {
|
||||
|
||||
@Schema(description = "资源项ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "库条目ID")
|
||||
private Long catalogItemId;
|
||||
|
||||
@Schema(description = "工料机名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "类别ID")
|
||||
private Long categoryId;
|
||||
|
||||
@Schema(description = "类别名称")
|
||||
private String categoryName;
|
||||
|
||||
@Schema(description = "类型 labor/material/machine")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "税率")
|
||||
private java.math.BigDecimal taxRate;
|
||||
|
||||
@Schema(description = "除税基价")
|
||||
private java.math.BigDecimal taxExclBasePrice;
|
||||
|
||||
@Schema(description = "含税基价")
|
||||
private java.math.BigDecimal taxInclBasePrice;
|
||||
|
||||
@Schema(description = "除税编制价")
|
||||
private java.math.BigDecimal taxExclCompilePrice;
|
||||
|
||||
@Schema(description = "含税编制价")
|
||||
private java.math.BigDecimal taxInclCompilePrice;
|
||||
|
||||
@Schema(description = "计算基数")
|
||||
private Map<String, Object> calcBase;
|
||||
|
||||
@Schema(description = "复合数据标识符")
|
||||
private Integer isMerged;
|
||||
|
||||
@Schema(description = "扩展属性")
|
||||
private Map<String, Object> attributes;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "工料机机类树节点ID")
|
||||
private Long categoryTreeId;
|
||||
|
||||
@Schema(description = "工料机机类树节点名称")
|
||||
private String categoryTreeName;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
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;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class ResourceItemSaveReqVO {
|
||||
|
||||
@Schema(description = "资源项ID,创建为空,更新必填")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "库条目ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull
|
||||
private Long catalogItemId;
|
||||
|
||||
@Schema(description = "工料机名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotBlank
|
||||
private String name;
|
||||
|
||||
@Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull
|
||||
private Long categoryId;
|
||||
|
||||
@Schema(description = "类型 labor/material/machine", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotBlank
|
||||
private String type;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "税率(默认0.09)")
|
||||
private java.math.BigDecimal taxRate;
|
||||
|
||||
@Schema(description = "除税基价")
|
||||
private java.math.BigDecimal taxExclBasePrice;
|
||||
|
||||
@Schema(description = "含税基价")
|
||||
private java.math.BigDecimal taxInclBasePrice;
|
||||
|
||||
@Schema(description = "除税编制价")
|
||||
private java.math.BigDecimal taxExclCompilePrice;
|
||||
|
||||
@Schema(description = "含税编制价")
|
||||
private java.math.BigDecimal taxInclCompilePrice;
|
||||
|
||||
@Schema(description = "计算基数(当单位为%时使用)", example = "{\"formula\":\"人机 + 材\",\"variables\":{\"人机\":2,\"材\":3}}")
|
||||
private Map<String, Object> calcBase;
|
||||
|
||||
@Schema(description = "复合数据标识符(0=普通,1=复合)")
|
||||
private Integer isMerged;
|
||||
|
||||
@Schema(description = "扩展属性")
|
||||
private Map<String, Object> attributes;
|
||||
|
||||
@Schema(description = "工料机机类树节点ID")
|
||||
private Long categoryTreeId;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.yhy.module.core.controller.admin.resource.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class ResourcePriceSaveReqVO {
|
||||
|
||||
@Schema(description = "价格ID,创建为空,更新时必填")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "资源项ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull
|
||||
private Long resourceId;
|
||||
|
||||
@Schema(description = "地区码", example = "CN-4401")
|
||||
private String regionCode;
|
||||
|
||||
@Schema(description = "价格区间开始", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull
|
||||
private LocalDateTime periodStart;
|
||||
|
||||
@Schema(description = "价格区间结束", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull
|
||||
private LocalDateTime periodEnd;
|
||||
|
||||
@Schema(description = "不含税价")
|
||||
private BigDecimal priceTaxExcl;
|
||||
|
||||
@Schema(description = "含税价")
|
||||
private BigDecimal priceTaxIncl;
|
||||
|
||||
@Schema(description = "来源")
|
||||
private String source;
|
||||
}
|
||||
@@ -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.NotNull;
|
||||
|
||||
/**
|
||||
* 交换排序请求 VO
|
||||
*
|
||||
* @author yihuiyong
|
||||
*/
|
||||
@Schema(description = "管理后台 - 交换排序请求 VO")
|
||||
@Data
|
||||
public class SwapSortOrderReqVO {
|
||||
|
||||
@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;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.yhy.module.core.convert.quota;
|
||||
|
||||
import com.yhy.module.core.controller.admin.quota.vo.QuotaAdjustmentRespVO;
|
||||
import com.yhy.module.core.dal.dataobject.quota.QuotaAdjustmentDO;
|
||||
import com.yhy.module.core.enums.quota.QuotaAdjustmentTypeEnum;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface QuotaAdjustmentConvert {
|
||||
|
||||
QuotaAdjustmentConvert INSTANCE = Mappers.getMapper(QuotaAdjustmentConvert.class);
|
||||
|
||||
default QuotaAdjustmentRespVO convert(QuotaAdjustmentDO bean) {
|
||||
if (bean == null) {
|
||||
return null;
|
||||
}
|
||||
QuotaAdjustmentRespVO vo = new QuotaAdjustmentRespVO();
|
||||
vo.setId(bean.getId());
|
||||
vo.setQuotaItemId(bean.getQuotaItemId());
|
||||
vo.setName(bean.getName());
|
||||
vo.setContent(bean.getContent());
|
||||
vo.setAdjustmentType(bean.getAdjustmentType());
|
||||
vo.setAdjustmentRules(bean.getAdjustmentRules());
|
||||
vo.setSortOrder(bean.getSortOrder());
|
||||
vo.setCreateTime(bean.getCreateTime());
|
||||
vo.setUpdateTime(bean.getUpdateTime());
|
||||
|
||||
// 设置调整类型名称
|
||||
QuotaAdjustmentTypeEnum typeEnum = QuotaAdjustmentTypeEnum.valueOfCode(bean.getAdjustmentType());
|
||||
if (typeEnum != null) {
|
||||
vo.setAdjustmentTypeName(typeEnum.getName());
|
||||
}
|
||||
|
||||
return vo;
|
||||
}
|
||||
|
||||
List<QuotaAdjustmentRespVO> convertList(List<QuotaAdjustmentDO> list);
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.yhy.module.core.dal.dataobject.boq;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yhy.module.core.dal.typehandler.PostgreSQLJsonbTypeHandler;
|
||||
import com.yhy.module.core.dal.typehandler.PostgreSQLTextArrayTypeHandler;
|
||||
import java.util.Map;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 清单配置目录树 DO
|
||||
* 第一层:省市/清单专业
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@TableName(value = "yhy_boq_catalog_item", autoResultMap = true)
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BoqCatalogItemDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键(标准库,使用自增ID)
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 父节点ID
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 节点类型:province(省市)/specialty(清单专业)
|
||||
*/
|
||||
private String nodeType;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sortOrder;
|
||||
|
||||
/**
|
||||
* 绑定的定额基价第一层节点ID
|
||||
*/
|
||||
private Long quotaCatalogItemId;
|
||||
|
||||
/**
|
||||
* 专业绑定锁定标识
|
||||
*/
|
||||
private Boolean specialtyLocked;
|
||||
|
||||
/**
|
||||
* 树路径
|
||||
*/
|
||||
@TableField(typeHandler = PostgreSQLTextArrayTypeHandler.class)
|
||||
private String[] path;
|
||||
|
||||
/**
|
||||
* 层级
|
||||
*/
|
||||
private Integer level;
|
||||
|
||||
/**
|
||||
* 扩展属性
|
||||
*/
|
||||
@TableField(typeHandler = PostgreSQLJsonbTypeHandler.class)
|
||||
private Map<String, Object> attributes;
|
||||
|
||||
// 节点类型常量
|
||||
public static final String NODE_TYPE_PROVINCE = "province";
|
||||
public static final String NODE_TYPE_SPECIALTY = "specialty";
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.yhy.module.core.dal.dataobject.boq;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.yhy.module.core.dal.typehandler.PostgreSQLJsonbTypeHandler;
|
||||
import com.yhy.module.core.framework.mybatis.typehandler.StringArrayTypeHandler;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 清单明细树 DO
|
||||
* 第四层:树结构,分为目录和内容
|
||||
* - 目录节点:可以无限创建子目录
|
||||
* - 内容节点:关联定额基价【第三层】的ID,不能添加子节点
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@TableName(value = "yhy_boq_detail_tree", autoResultMap = true)
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BoqDetailTreeDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 关联清单子项ID(第三层)
|
||||
*/
|
||||
private Long boqSubItemId;
|
||||
|
||||
/**
|
||||
* 父节点ID
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 节点类型:directory-目录,content-内容
|
||||
*/
|
||||
private String nodeType;
|
||||
|
||||
/**
|
||||
* 定额基价【第三层】节点ID(仅content类型使用)
|
||||
*/
|
||||
private Long quotaCatalogItemId;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sortOrder;
|
||||
|
||||
/**
|
||||
* 层级路径
|
||||
*/
|
||||
@TableField(typeHandler = StringArrayTypeHandler.class)
|
||||
private String[] path;
|
||||
|
||||
/**
|
||||
* 层级
|
||||
*/
|
||||
private Integer level;
|
||||
|
||||
/**
|
||||
* 扩展属性
|
||||
*/
|
||||
@TableField(typeHandler = PostgreSQLJsonbTypeHandler.class)
|
||||
private Map<String, Object> attributes;
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.yhy.module.core.dal.dataobject.boq;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.yhy.module.core.dal.typehandler.PostgreSQLJsonbTypeHandler;
|
||||
import com.yhy.module.core.dal.typehandler.PostgreSQLTextArrayTypeHandler;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 清单项树 DO
|
||||
* 第二层:树结构
|
||||
*
|
||||
* @author yhy
|
||||
*/
|
||||
@TableName(value = "yhy_boq_item_tree", autoResultMap = true)
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BoqItemTreeDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 关联清单专业节点ID
|
||||
*/
|
||||
private Long boqCatalogItemId;
|
||||
|
||||
/**
|
||||
* 父节点ID
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 编码(自定义)
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sortOrder;
|
||||
|
||||
/**
|
||||
* 树路径
|
||||
*/
|
||||
@TableField(typeHandler = PostgreSQLTextArrayTypeHandler.class)
|
||||
private String[] path;
|
||||
|
||||
/**
|
||||
* 层级
|
||||
*/
|
||||
private Integer level;
|
||||
|
||||
/**
|
||||
* 扩展属性
|
||||
*/
|
||||
@TableField(typeHandler = PostgreSQLJsonbTypeHandler.class)
|
||||
private Map<String, Object> attributes;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user