计划相关Feign接口

This commit is contained in:
潘荣晟
2026-02-10 18:01:58 +08:00
parent 70634dbb6d
commit 5a38bca0da
9 changed files with 160 additions and 10 deletions

View File

@@ -40,4 +40,12 @@ public class ContractPageReqVO extends PageParam {
@Schema(description = "合同分类(字典SPLY_BSN_TP)") @Schema(description = "合同分类(字典SPLY_BSN_TP)")
private String businessType; private String businessType;
@Schema(description = "合同主键")
private Long id;
@Schema(description = "甲方公司编号;与ERP(YQGHD)对应")
private String erpPurchaseCompanyNumber;
@Schema(description = "乙方公司编号;与ERP(YQGHD)对应")
private String erpSalesCompanyNumber;
} }

View File

@@ -0,0 +1,20 @@
package com.zt.plat.module.contractorder.api.vo.contract;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.validation.annotation.Validated;
@Data
@Schema(description = "绑定合同VO")
@Validated
public class RelationContractVO {
@Schema(description = "合同ID")
@NotNull(message = "合同ID不能为空")
private Long contractId;
@Schema(description = "被绑定的合同ID")
@NotNull(message = "被绑定的合同ID不能为空")
private Long relationContractId;
}

View File

@@ -35,5 +35,6 @@ public interface ErrorCodeConstants {
ErrorCode CONTRACT_STATUS_NOT_CANCEL = new ErrorCode(1_027_000_020, "{}状态合同不允许作废"); ErrorCode CONTRACT_STATUS_NOT_CANCEL = new ErrorCode(1_027_000_020, "{}状态合同不允许作废");
ErrorCode AMOUNT_DISMANTLE_NOT_EXISTS = new ErrorCode(1_027_000_022, "资金拆分不存在"); ErrorCode AMOUNT_DISMANTLE_NOT_EXISTS = new ErrorCode(1_027_000_022, "资金拆分不存在");
ErrorCode CONTRACT_RECEIVE_SEND_NOT_EXISTS = new ErrorCode(1_027_000_021, "收发货规则不存在"); ErrorCode CONTRACT_RECEIVE_SEND_NOT_EXISTS = new ErrorCode(1_027_000_021, "收发货规则不存在");
ErrorCode PARAMETER_ID_EMPTY = new ErrorCode(1_027_000_023, "绑定的合同ID不能空");
ErrorCode PARAMETER_BUSINESS_TYPE_INVALID = new ErrorCode(1_027_000_024, "合同业务类型无效请参考字典(SPLY_BSN_TP)");
} }

View File

@@ -81,7 +81,7 @@ public class OrderApiImpl implements OrderApi {
if ("SALE".equals(f.getSplyBsnTp())) { if ("SALE".equals(f.getSplyBsnTp())) {
// 销售订单 // 销售订单
salesOrdNoS.add(f.getId()); salesOrdNoS.add(f.getId());
} else { } else if ("PUR".equals(f.getSplyBsnTp())) {
// 非销售订单(采购订单) // 非销售订单(采购订单)
purchaseOrderNoS.add(f.getId()); purchaseOrderNoS.add(f.getId());
} }

View File

@@ -14,6 +14,7 @@ import com.zt.plat.module.contractorder.api.vo.contract.international.IntPushCon
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractMainDO; import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractMainDO;
import com.zt.plat.module.contractorder.service.contract.ContractService; import com.zt.plat.module.contractorder.service.contract.ContractService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import jakarta.validation.Valid; import jakarta.validation.Valid;
@@ -223,4 +224,22 @@ public class ContractController implements BusinessControllerMarker {
) { ) {
return success(contractService.transactionInfoByPaperNumber(contractPaperNumber)); return success(contractService.transactionInfoByPaperNumber(contractPaperNumber));
} }
@PostMapping("/relationContract")
@Operation(summary = "关联合同-新")
// @PreAuthorize("@ss.hasAnyPermissions({'base:contract:get','purchaseContract:detail'})")
public CommonResult<Boolean> relationContract(@RequestBody RelationContractVO reqVo) {
contractService.relationContract(reqVo);
return success(true);
}
@GetMapping("/page-no-permission")
@Operation(summary = "获得合同分页列表-没有权限")
@PreAuthorize("@ss.hasAnyPermissions({'base:contract:get','purchaseContract:detail'})")
public CommonResult<PageResult<ContractRespVO>> getPageNoPermission(@Valid ContractPageReqVO pageReqVO) {
PageResult<ContractMainDO> pageResult = contractService.getPageNoPermission(pageReqVO);
return success(BeanUtils.toBean(pageResult, ContractRespVO.class));
}
} }

View File

@@ -455,4 +455,10 @@ public class ContractMainDO extends BusinessBaseDO {
*/ */
@TableField("HS_CRDT") @TableField("HS_CRDT")
private String hasCredit; private String hasCredit;
/**
* 关联合同ID
*/
@TableField(value = "REL_CTRT_ID")
private Long relatedContractId;
} }

View File

@@ -1,6 +1,9 @@
package com.zt.plat.module.contractorder.dal.mysql.contract; package com.zt.plat.module.contractorder.dal.mysql.contract;
import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.datapermission.core.annotation.CompanyDataPermissionIgnore;
import com.zt.plat.framework.datapermission.core.annotation.DataPermission;
import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.contractorder.api.vo.contract.ContractPageReqVO; import com.zt.plat.module.contractorder.api.vo.contract.ContractPageReqVO;
@@ -27,4 +30,23 @@ public interface ContractMainMapper extends BaseMapperX<ContractMainDO> {
.eqIfPresent(ContractMainDO::getBusinessType, reqVO.getBusinessType()) .eqIfPresent(ContractMainDO::getBusinessType, reqVO.getBusinessType())
.orderByDesc(ContractMainDO::getCreateTime)); .orderByDesc(ContractMainDO::getCreateTime));
} }
@CompanyDataPermissionIgnore
@DeptDataPermissionIgnore
default PageResult<ContractMainDO> selectContractPageNoPermission(ContractPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ContractMainDO>()
.eq(ContractMainDO::getId, reqVO.getId())
.likeIfPresent(ContractMainDO::getContractName, reqVO.getContractName())
.likeIfPresent(ContractMainDO::getContractPaperNumber, reqVO.getContractPaperNumber())
.eqIfPresent(ContractMainDO::getDirection, reqVO.getDirection())
.betweenIfPresent(ContractMainDO::getSignDate, reqVO.getSignDate())
.likeIfPresent(ContractMainDO::getPurchaseCompanyName, reqVO.getPurchaseCompanyName())
.likeIfPresent(ContractMainDO::getSalesCompanyName, reqVO.getSalesCompanyName())
.eqIfPresent(ContractMainDO::getBasicAmount, reqVO.getBasicAmount())
.eqIfPresent(ContractMainDO::getStatus, reqVO.getStatus())
.eqIfPresent(ContractMainDO::getBusinessType, reqVO.getBusinessType())
.eqIfPresent(ContractMainDO::getErpSalesCompanyNumber, reqVO.getErpSalesCompanyNumber())
.eqIfPresent(ContractMainDO::getErpPurchaseCompanyNumber, reqVO.getErpPurchaseCompanyNumber())
.orderByDesc(ContractMainDO::getCreateTime));
}
} }

View File

@@ -26,6 +26,14 @@ public interface ContractService {
* @return 分页列表 * @return 分页列表
*/ */
PageResult<ContractMainDO> getContractPage(@Valid ContractPageReqVO pageReqVO); PageResult<ContractMainDO> getContractPage(@Valid ContractPageReqVO pageReqVO);
/**
* 获得合同分页列表--无权限
*
* @param pageReqVO 分页条件
* @return 分页列表
*/
PageResult<ContractMainDO> getPageNoPermission(@Valid ContractPageReqVO pageReqVO);
/** /**
* 新增合同 * 新增合同
@@ -247,4 +255,10 @@ public interface ContractService {
* @return 交易信息 * @return 交易信息
*/ */
TransactionInfoRespVO transactionInfoByPaperNumber(String contractPaperNumber); TransactionInfoRespVO transactionInfoByPaperNumber(String contractPaperNumber);
/**
* 关联合同
*
* @param relationContractVO 关联合同信息
*/
void relationContract(RelationContractVO relationContractVO);
} }