From 601baccadadd76966b14795738ee2286e6291fd1 Mon Sep 17 00:00:00 2001 From: lzxry <39932950+lzxry@users.noreply.github.com> Date: Wed, 21 Jul 2021 19:11:41 +0800 Subject: [PATCH] bugfix --- src/main/java/common/repository/ContractRepository.java | 3 +++ src/main/java/common/service/impl/ShareIncomeServiceImpl.java | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/common/repository/ContractRepository.java b/src/main/java/common/repository/ContractRepository.java index 222cf83..e6e819d 100644 --- a/src/main/java/common/repository/ContractRepository.java +++ b/src/main/java/common/repository/ContractRepository.java @@ -147,4 +147,7 @@ public interface ContractRepository extends JpaRepository<Contract, Long> { @Query(value = "select * from contract where contract_code = ?1 and status != 'del'", nativeQuery = true) Contract findByCodeAndNotDel(String contractCode); + + @Query(value = "select * from contract where relation_code = ?1 and status != 'del'", nativeQuery = true) + List<Contract> findByRelationCode(String contractCode); } diff --git a/src/main/java/common/service/impl/ShareIncomeServiceImpl.java b/src/main/java/common/service/impl/ShareIncomeServiceImpl.java index 929035b..6841bd0 100644 --- a/src/main/java/common/service/impl/ShareIncomeServiceImpl.java +++ b/src/main/java/common/service/impl/ShareIncomeServiceImpl.java @@ -535,10 +535,21 @@ public class ShareIncomeServiceImpl implements ShareIncomeService { //if(contract==null){ List<Contract> contractList = contractRepository.findByCreateTimeAndCodeNotOwn(groupContract.getRelationCode(), DateUtil.format(groupContract.getCreateTime(), DateUtil.C_TIME_PATTON_DEFAULT), groupContract.getId()); for (Contract contract1 : contractList) { - map.put(contract1.getContractCode(), contract1); + if(StringUtils.isEmpty(map.get(contract1.getContractCode()))){ + map.put(contract1.getContractCode(), contract1); + } } groupContracts = map.values();//只要不加入传进来的那个list里面就不会影响查询的列表 break; + }else if((groupContracts.size()==1&&!StringUtils.isEmpty(groupContract.getNextSignedDate()))||(!"2".equals(groupContract.getContractType()) && map.get(groupContract.getNextSignedContractCode())==null)){ + List<Contract> contractList = contractRepository.findByRelationCode(groupContract.getContractCode()); + for (Contract contract1 : contractList) { + if(StringUtils.isEmpty(map.get(contract1.getContractCode()))){ + map.put(contract1.getContractCode(), contract1); + } + } + groupContracts = map.values(); + break; } } -- libgit2 0.27.1