|
|
@@ -415,15 +415,15 @@ public class RemoteContractServiceImpl implements RemoteContractService {
|
|
|
public KwcContractLogisticsDto findLogContractByEntId(Long entId) {
|
|
|
//查询物流企业合同信息
|
|
|
List<KwcContractLogisticsUnit> contractLogisticsUnits = kwcContractLogisticsUnitRepository.queryByEntIdAndEntType(entId, EntTypeEnum.LOGISTICS4.getCode());
|
|
|
- if (contractLogisticsUnits == null) {
|
|
|
- return new KwcContractLogisticsDto();
|
|
|
+ if (CollectionUtils.isEmpty(contractLogisticsUnits)) {
|
|
|
+ return null;
|
|
|
}
|
|
|
List<Long> contractIds = contractLogisticsUnits.stream().map(KwcContractLogisticsUnit::getContractId).distinct().collect(Collectors.toList());
|
|
|
|
|
|
//查询自动派车且有效的物流合同
|
|
|
List<KwcContractLogistics> kwcContractLogistics = contractLogisticsRepository.queryByIdsAndDispatch(contractIds);
|
|
|
- if (kwcContractLogistics == null) {
|
|
|
- return new KwcContractLogisticsDto();
|
|
|
+ if (CollectionUtils.isEmpty(kwcContractLogistics)) {
|
|
|
+ return null;
|
|
|
}
|
|
|
if (kwcContractLogistics.size() > 1) {
|
|
|
throw new BusinessPlatfromException(ErrorCodeEnum.DATA_NOT_EXIST, "只能存在有且只有一条的自动派单有效的物流合同!");
|
|
|
@@ -459,7 +459,7 @@ public class RemoteContractServiceImpl implements RemoteContractService {
|
|
|
dto.setSupEntId(unit.getEntId());
|
|
|
}
|
|
|
return dto;
|
|
|
- }).orElse(new KwcContractLogisticsDto());
|
|
|
+ }).orElse(null);
|
|
|
}
|
|
|
|
|
|
|