From bd625566404411aa67efdc40bb5bf066f01d4918 Mon Sep 17 00:00:00 2001 From: guojunyun Date: Fri, 10 Oct 2025 17:53:02 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E8=BF=87=E5=90=88=E5=90=8C=E7=BC=96?= =?UTF-8?q?=E5=8F=B7=E8=8E=B7=E5=8F=96=E5=AF=B9=E5=BA=94=E7=9A=84=E7=BB=93?= =?UTF-8?q?=E7=AE=97=E6=9D=A1=E6=AC=BE=E6=95=B0=E6=8D=AEfeign=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/contractorder/api/ContractApi.java | 22 +++++++ .../api/dto/ContractCoefficientRespDTO.java | 52 ++++++++++++++++ .../api/dto/ContractDeductRespDTO.java | 50 +++++++++++++++ .../api/dto/ContractFormulaRespDTO.java | 56 +++++++++++++++++ .../api/dto/ContractGradeRespDTO.java | 62 +++++++++++++++++++ .../api/dto/ContractPriceRespDTO.java | 54 ++++++++++++++++ .../contractorder/api/ContractApiImpl.java | 25 ++++++++ 7 files changed, 321 insertions(+) create mode 100644 zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/ContractApi.java create mode 100644 zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractCoefficientRespDTO.java create mode 100644 zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractDeductRespDTO.java create mode 100644 zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractFormulaRespDTO.java create mode 100644 zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractGradeRespDTO.java create mode 100644 zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractPriceRespDTO.java create mode 100644 zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/api/ContractApiImpl.java diff --git a/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/ContractApi.java b/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/ContractApi.java new file mode 100644 index 0000000..8856ccf --- /dev/null +++ b/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/ContractApi.java @@ -0,0 +1,22 @@ +package com.zt.plat.module.contractorder.api; + + +import com.zt.plat.module.contractorder.api.dto.ContractFormulaRespDTO; +import com.zt.plat.module.contractorder.enums.ApiConstants; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; + +@FeignClient(name = ApiConstants.NAME) +@Tag(name = "RPC 服务 - 合同") +public interface ContractApi { + String PREFIX = ApiConstants.PREFIX + "/contract"; + + @GetMapping(PREFIX + "/formulas") + @Operation(summary = "通过合同编号获取对应的结算条款数据") + List getFormulas(@RequestParam("contractPaperNumber") String contractPaperNumber); +} diff --git a/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractCoefficientRespDTO.java b/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractCoefficientRespDTO.java new file mode 100644 index 0000000..6a5b9c6 --- /dev/null +++ b/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractCoefficientRespDTO.java @@ -0,0 +1,52 @@ +package com.zt.plat.module.contractorder.api.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotEmpty; +import lombok.Data; + +import java.math.BigDecimal; + +@Schema(description = "RPC 服务 - 基础系数配置 Response DTO") +@Data +public class ContractCoefficientRespDTO { + + @Schema(description = "主键") + private Long id; + + @Schema(description = "配置主键") + private Long parameterId; + + @Schema(description = "条款主键") + private Long formulaId; + + @Schema(description = "金属元素编码") + private String elementNumber; + + @Schema(description = "金属元素缩写") + private String elementAbbreviation; + + @Schema(description = "金属元素名称") + private String elementName; + + @Schema(description = "系数值") + private String settlementCoefficient; + + @Schema(description = "系数上限") + private BigDecimal coefficientUp; + + @Schema(description = "系数下限") + private BigDecimal coefficientDown; + + @Schema(description = "是否包含上限") + private String isInUp; + + @Schema(description = "是否包含下限") + private String isInDown; + + @Schema(description = "是否省内") + @NotEmpty(message = "是否省内不能为空") + private String inState; + + @Schema(description = "类型") + private String type; +} \ No newline at end of file diff --git a/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractDeductRespDTO.java b/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractDeductRespDTO.java new file mode 100644 index 0000000..eb3c09d --- /dev/null +++ b/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractDeductRespDTO.java @@ -0,0 +1,50 @@ +package com.zt.plat.module.contractorder.api.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; + +@Schema(description = "RPC 服务 - 调整价配置 Response DTO") +@Data +public class ContractDeductRespDTO { + + @Schema(description = "主键") + private Long id; + + @Schema(description = "配置主键") + private Long parameterId; + + @Schema(description = "条款主键") + private Long formulaId; + + @Schema(description = "物料编码;推送ERP") + private String materialNumber; + + @Schema(description = "物料名称") + private String materialName; + + @Schema(description = "上限") + private BigDecimal gradeUp; + + @Schema(description = "下限") + private BigDecimal gradeDown; + + @Schema(description = "是否包含上限") + private String isInUp; + + @Schema(description = "是否包含下限") + private String isInDown; + + @Schema(description = "方式") + private String way; + + @Schema(description = "类型") + private String type; + + @Schema(description = "是否省内") + private String inState; + + @Schema(description = "调整价") + private BigDecimal gradeAmount; +} \ No newline at end of file diff --git a/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractFormulaRespDTO.java b/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractFormulaRespDTO.java new file mode 100644 index 0000000..1d47fa1 --- /dev/null +++ b/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractFormulaRespDTO.java @@ -0,0 +1,56 @@ +package com.zt.plat.module.contractorder.api.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Schema(description = "RPC 服务 - 价款结算条款 Response DTO") +@Data +public class ContractFormulaRespDTO { + + @Schema(description = "主键") + private Long id; + + @Schema(description = "合同主键") + private Long contractId; + + @Schema(description = "公式类型;单价/总价/水扣款/加工费") + private String formulaType; + + @Schema(description = "公式") + private String formulaCalculate; + + @Schema(description = "编码公式") + private String numberFormula; + + @Schema(description = "物料名称") + private String materialName; + + @Schema(description = "物料编码") + private String materialNumber; + + @Schema(description = "计算小数位") + private Long decimalPoint; + + @Schema(description = "金属元素编码") + private String elementNumber; + + @Schema(description = "金属元素缩写") + private String elementAbbreviation; + + @Schema(description = "金属元素名称") + private String elementName; + + @Schema(description = "结算类型,多条使用逗号分隔(字典:PRCH_STLM_TP)") + private String settlementType; + + // 基础系数配置 + private List coefficients; + // 品位等级价配置 + private List grades; + // 调整价配置 + private List deducts; + // 市场价配置 + private List prices; +} diff --git a/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractGradeRespDTO.java b/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractGradeRespDTO.java new file mode 100644 index 0000000..ea97fde --- /dev/null +++ b/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractGradeRespDTO.java @@ -0,0 +1,62 @@ +package com.zt.plat.module.contractorder.api.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; + +@Schema(description = "RPC 服务 - 品位等级价配置 Response DTO") +@Data +public class ContractGradeRespDTO { + + @Schema(description = "主键") + private Long id; + + @Schema(description = "配置主键") + private Long parameterId; + + @Schema(description = "条款主键") + private Long formulaId; + + @Schema(description = "金属元素编码") + private String elementNumber; + + @Schema(description = "金属元素缩写") + private String elementAbbreviation; + + @Schema(description = "金属元素名称") + private String elementName; + + @Schema(description = "品位单位") + private String gradeUnit; + + @Schema(description = "品位上限") + private BigDecimal gradeUp; + + @Schema(description = "品位下限") + private BigDecimal gradeDown; + + @Schema(description = "是否包含上限;包含则是大于等于,不包含则是大于") + private String isInUp; + + @Schema(description = "是否包含下限;包含则是小于等于,不包含则是小于") + private String isInDown; + + @Schema(description = "默认计价品位;计价方式为加时,默认为为下限,计价方式为减时,默认为为上限,可手动填写") + private BigDecimal gradeDefault; + + @Schema(description = "系数;计价类型为阶梯价使用,标识没上升多少系数进行加款还是减款") + private BigDecimal settlementCoefficient; + + @Schema(description = "不足系数值按比例计算") + private String useCoefficient; + + @Schema(description = "计价类型") + private String priceType; + + @Schema(description = "是否省内") + private String inState; + + @Schema(description = "等级单价") + private BigDecimal unitPrice; +} \ No newline at end of file diff --git a/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractPriceRespDTO.java b/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractPriceRespDTO.java new file mode 100644 index 0000000..40f3469 --- /dev/null +++ b/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/api/dto/ContractPriceRespDTO.java @@ -0,0 +1,54 @@ +package com.zt.plat.module.contractorder.api.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Schema(description = "RPC 服务 - 市场价配置 Response DTO") +@Data +public class ContractPriceRespDTO { + + @Schema(description = "主键") + private Long id; + + @Schema(description = "配置主键") + private Long parameterId; + + @Schema(description = "条款主键") + private Long formulaId; + + @Schema(description = "市场价") + private BigDecimal value; + + @Schema(description = "计算方式;均价/高位价/地位价") + private String calculateWay; + + @Schema(description = "数据来源网价代码;数据字典") + private String dataOrigin; + + @Schema(description = "计价开始日期") + private LocalDateTime calculateStartDate; + + @Schema(description = "计价截止日期") + private LocalDateTime calculateEndDate; + + @Schema(description = "包含开始日期") + private String inStartDate; + + @Schema(description = "包含结束日期") + private String inEndDate; + + @Schema(description = "价格品种元素的明细分类") + private String priceGrade; + + @Schema(description = "品种分类") + private String gradeType; + + @Schema(description = "取价方式;区间价/固定价") + private String averageType; + + @Schema(description = "网价小数位") + private BigDecimal decimalPoint; +} \ No newline at end of file diff --git a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/api/ContractApiImpl.java b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/api/ContractApiImpl.java new file mode 100644 index 0000000..9bdaccd --- /dev/null +++ b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/api/ContractApiImpl.java @@ -0,0 +1,25 @@ +package com.zt.plat.module.contractorder.api; + +import com.zt.plat.module.contractorder.api.dto.ContractFormulaRespDTO; +import com.zt.plat.module.contractorder.service.contract.ContractService; +import jakarta.annotation.Resource; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +@Validated +@Slf4j +public class ContractApiImpl implements ContractApi { + + @Resource + private ContractService contractService; + + @Override + public List getFormulas(String contractPaperNumber) { + System.out.println("contract feign" + contractPaperNumber); + return List.of(); + } +}