通过合同编号获取对应的结算条款数据feign接口相关
This commit is contained in:
@@ -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<ContractFormulaRespDTO> getFormulas(@RequestParam("contractPaperNumber") String contractPaperNumber);
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -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<ContractCoefficientRespDTO> coefficients;
|
||||||
|
// 品位等级价配置
|
||||||
|
private List<ContractGradeRespDTO> grades;
|
||||||
|
// 调整价配置
|
||||||
|
private List<ContractDeductRespDTO> deducts;
|
||||||
|
// 市场价配置
|
||||||
|
private List<ContractPriceRespDTO> prices;
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -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<ContractFormulaRespDTO> getFormulas(String contractPaperNumber) {
|
||||||
|
System.out.println("contract feign" + contractPaperNumber);
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user