根据合同ID获得关联合同
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 合同关联 Response VO")
|
||||||
|
@Data
|
||||||
|
public class RelationRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "上游主键")
|
||||||
|
private Long upId;
|
||||||
|
|
||||||
|
@Schema(description = "下游主键")
|
||||||
|
private Long downId;
|
||||||
|
}
|
||||||
@@ -163,6 +163,14 @@ public interface ContractService {
|
|||||||
*/
|
*/
|
||||||
Boolean relation(RelationReqVo reqVo);
|
Boolean relation(RelationReqVo reqVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据合同ID获得关联合同
|
||||||
|
*
|
||||||
|
* @param id 上合同ID
|
||||||
|
* @return 上下游合同ID
|
||||||
|
*/
|
||||||
|
RelationRespVO getRelation(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下载文件
|
* 下载文件
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1386,6 +1386,32 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
return insert > 0;
|
return insert > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RelationRespVO getRelation(Long id) {
|
||||||
|
|
||||||
|
// 返回结果
|
||||||
|
RelationRespVO resp = new RelationRespVO();
|
||||||
|
|
||||||
|
// 获得上游合同关联
|
||||||
|
SystemRelativityDO upSystemRelativityDO = systemRelativityMapper
|
||||||
|
.selectOne(new LambdaQueryWrapperX<SystemRelativityDO>()
|
||||||
|
.eq(SystemRelativityDO::getDownId, id)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 获得下游合同关联
|
||||||
|
SystemRelativityDO downSystemRelativityDO = systemRelativityMapper
|
||||||
|
.selectOne(new LambdaQueryWrapperX<SystemRelativityDO>()
|
||||||
|
.eq(SystemRelativityDO::getUpId, id)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 上游合同ID
|
||||||
|
if (upSystemRelativityDO != null) resp.setUpId(upSystemRelativityDO.getId());
|
||||||
|
// 下游合同ID
|
||||||
|
if (downSystemRelativityDO != null) resp.setDownId(downSystemRelativityDO.getId());
|
||||||
|
|
||||||
|
return resp;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<ByteArrayResource> download(List<Long> ids) {
|
public ResponseEntity<ByteArrayResource> download(List<Long> ids) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user