获得上游关联的合同数据接口
获得下游关联的合同数据接口
This commit is contained in:
@@ -161,4 +161,18 @@ public class ContractController implements BusinessControllerMarker {
|
||||
public CommonResult<List<ContractRespVO>> getListNotRelation(@RequestParam("id") Long id) {
|
||||
return success(contractService.getListNotRelation(id));
|
||||
}
|
||||
|
||||
@GetMapping("/get/up-relation")
|
||||
@Operation(summary = "获得上游关联的合同数据")
|
||||
@PreAuthorize("@ss.hasPermission('base:contract:get')")
|
||||
public CommonResult<ContractRespVO> getUpRelation(@RequestParam("id") Long id) {
|
||||
return success(contractService.getUpRelation(id));
|
||||
}
|
||||
|
||||
@GetMapping("/get/down-relation")
|
||||
@Operation(summary = "获得下游关联的合同数据")
|
||||
@PreAuthorize("@ss.hasPermission('base:contract:get')")
|
||||
public CommonResult<ContractRespVO> getDownRelation(@RequestParam("id") Long id) {
|
||||
return success(contractService.getDownRelation(id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,4 +121,8 @@ public interface ContractService {
|
||||
ContractRespVO getBySystemContractNumber(String systemContractNumber);
|
||||
|
||||
List<ContractRespVO> getListNotRelation(Long id);
|
||||
|
||||
ContractRespVO getUpRelation(Long id);
|
||||
|
||||
ContractRespVO getDownRelation(Long id);
|
||||
}
|
||||
|
||||
@@ -527,6 +527,48 @@ public class ContractServiceImpl implements ContractService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContractRespVO getUpRelation(Long id) {
|
||||
|
||||
// 查询关联表
|
||||
SystemRelativityDO systemRelativityDO = systemRelativityMapper.selectOne(TableFieldConstants.BSE_SYS_REL_DOWN_ID, id);
|
||||
if (systemRelativityDO == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 上游合同ID
|
||||
Long upId = systemRelativityDO.getUpId();
|
||||
|
||||
// 获取上游合同信息
|
||||
ContractMainDO contractMainDO = contractMainMapper.selectById(upId);
|
||||
if (contractMainDO == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
return BeanUtils.toBean(contractMainDO, ContractRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContractRespVO getDownRelation(Long id) {
|
||||
|
||||
// 查询关联表
|
||||
SystemRelativityDO systemRelativityDO = systemRelativityMapper.selectOne(TableFieldConstants.BSE_SYS_REL_UP_ID, id);
|
||||
if (systemRelativityDO == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 下游合同ID
|
||||
Long upId = systemRelativityDO.getUpId();
|
||||
|
||||
// 获取下游合同信息
|
||||
ContractMainDO contractMainDO = contractMainMapper.selectById(upId);
|
||||
if (contractMainDO == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
return BeanUtils.toBean(contractMainDO, ContractRespVO.class);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Boolean update(ContractSaveReqVO reqVO) {
|
||||
|
||||
Reference in New Issue
Block a user