数据结构调整,通过合同编号获取对应的结算条款数据feign接口完善
This commit is contained in:
@@ -19,7 +19,6 @@ public class ContractApiImpl implements ContractApi {
|
||||
|
||||
@Override
|
||||
public List<ContractFormulaRespDTO> getFormulas(String contractPaperNumber) {
|
||||
System.out.println("contract feign" + contractPaperNumber);
|
||||
return List.of();
|
||||
return contractService.getFormulasByPaperNumber(contractPaperNumber);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -12,7 +11,6 @@ import java.time.LocalDateTime;
|
||||
public class GradeRespVO {
|
||||
|
||||
@Schema(description = "主键")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "条款主键")
|
||||
|
||||
@@ -12,9 +12,6 @@ public class PriceRespVO {
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "配置主键")
|
||||
private Long parameterId;
|
||||
|
||||
@Schema(description = "条款主键")
|
||||
private Long formulaId;
|
||||
|
||||
|
||||
@@ -12,9 +12,6 @@ public class PriceSaveReqVO {
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "13654")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "配置主键", example = "1590")
|
||||
private Long parameterId;
|
||||
|
||||
@Schema(description = "条款主键", example = "24677")
|
||||
private Long formulaId;
|
||||
|
||||
|
||||
@@ -30,11 +30,6 @@ public class ContractPriceDO extends BusinessBaseDO {
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 配置主键
|
||||
*/
|
||||
@TableField("PRM_ID")
|
||||
private Long parameterId;
|
||||
/**
|
||||
* 条款主键
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.zt.plat.module.contractorder.service.contract;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.module.contractorder.api.dto.ContractFormulaRespDTO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.*;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractMainDO;
|
||||
import jakarta.validation.Valid;
|
||||
@@ -85,4 +86,12 @@ public interface ContractService {
|
||||
* @return 结算公式列表
|
||||
*/
|
||||
List<FormulaRespVO> getFormulas(FormulasQueryReqVO queryReqVO);
|
||||
|
||||
/**
|
||||
* 通过合同编号获取对应的结算条款数据
|
||||
*
|
||||
* @param contractPaperNumber 合同编号
|
||||
* @return 结算条款数据
|
||||
*/
|
||||
List<ContractFormulaRespDTO> getFormulasByPaperNumber(String contractPaperNumber);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi;
|
||||
import com.zt.plat.module.bpm.api.task.BpmTaskApi;
|
||||
import com.zt.plat.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.zt.plat.module.bpm.api.task.dto.BpmTaskRespDTO;
|
||||
import com.zt.plat.module.contractorder.api.dto.*;
|
||||
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.*;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.*;
|
||||
import com.zt.plat.module.contractorder.dal.mysql.contract.*;
|
||||
@@ -727,6 +728,60 @@ public class ContractServiceImpl implements ContractService {
|
||||
return contractFormulaMapper.selectFormulas(contractIds, queryReqVO.getMaterialName(), queryReqVO.getElementName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ContractFormulaRespDTO> getFormulasByPaperNumber(String contractPaperNumber) {
|
||||
|
||||
// 通过合同编号查询合同信息
|
||||
ContractMainDO contractMainDO = contractMainMapper
|
||||
.selectOne(TableFieldConstants.BSE_CTRT_MAIN_CTRT_PPR_NUM, contractPaperNumber);
|
||||
|
||||
// 合同不存在
|
||||
if (contractMainDO == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
// 合同ID
|
||||
Long contractId = contractMainDO.getId();
|
||||
|
||||
// 查询并设置价款结算条款
|
||||
List<ContractFormulaRespDTO> formulas = new ArrayList<>();
|
||||
List<ContractFormulaDO> formulaDOS = contractFormulaMapper
|
||||
.selectList(TableFieldConstants.BSE_CTRT_FMU_CTRT_ID, contractId);
|
||||
if (formulaDOS != null && !formulaDOS.isEmpty()) {
|
||||
formulas = BeanUtils.toBean(formulaDOS, ContractFormulaRespDTO.class);
|
||||
|
||||
formulas.forEach(formula -> {
|
||||
|
||||
// 查询并设置基础系数配置
|
||||
List<ContractCoefficientDO> coefficientDOS = contractCoefficientMapper
|
||||
.selectList(TableFieldConstants.BSE_CTRT_COEF_FMU_ID, formula.getId());
|
||||
if (coefficientDOS != null && !coefficientDOS.isEmpty()) {
|
||||
formula.setCoefficients(BeanUtils.toBean(coefficientDOS, ContractCoefficientRespDTO.class));
|
||||
}
|
||||
// 查询并设置品位等级价配置
|
||||
List<ContractGradeDO> gradeDOS = contractGradeMapper
|
||||
.selectList(TableFieldConstants.BSE_CTRT_GRD_FMU_ID, formula.getId());
|
||||
if (gradeDOS != null && !gradeDOS.isEmpty()) {
|
||||
formula.setGrades(BeanUtils.toBean(gradeDOS, ContractGradeRespDTO.class));
|
||||
}
|
||||
// 查询并设置调整价配置
|
||||
List<ContractDeductDO> deductDOS = contractDeductMapper
|
||||
.selectList(TableFieldConstants.BSE_CTRT_DDCT_FMU_ID, formula.getId());
|
||||
if (deductDOS != null && !deductDOS.isEmpty()) {
|
||||
formula.setDeducts(BeanUtils.toBean(deductDOS, ContractDeductRespDTO.class));
|
||||
}
|
||||
// 查询并设置市场价配置
|
||||
List<ContractPriceDO> priceDOS = contractPriceMapper
|
||||
.selectList(TableFieldConstants.BSE_CTRT_PRC_FMU_ID, formula.getId());
|
||||
if (priceDOS != null && !priceDOS.isEmpty()) {
|
||||
formula.setPrices(BeanUtils.toBean(priceDOS, ContractPriceRespDTO.class));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return formulas;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验合同内容
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user