Commit d6902187 by zhouhaibao

fix(store): 解决商户上级商户信息获取异常

- 添加 parentId 空值检查避免解析异常
- 当上级商户不存在时抛出业务异常
- 提供更明确的错误信息提示
1 parent 51713250
...@@ -1061,8 +1061,12 @@ public class StoreApproveServiceImpl implements StoreApproveService { ...@@ -1061,8 +1061,12 @@ public class StoreApproveServiceImpl implements StoreApproveService {
Collectors.toList()); Collectors.toList());
if (CollectionUtils.isNotEmpty(collect)) { if (CollectionUtils.isNotEmpty(collect)) {
MerchantRopResponse merchantRopResponse = collect.get(0); MerchantRopResponse merchantRopResponse = collect.get(0);
merchantRef.setParentMerchantId(Integer.parseInt(merchantRopResponse.getParentId())); if (merchantRopResponse.getParentId() != null) {
merchantRef.setParentMerchantName(merchantRopResponse.getParentMerchant()); merchantRef.setParentMerchantId(Integer.parseInt(merchantRopResponse.getParentId()));
merchantRef.setParentMerchantName(merchantRopResponse.getParentMerchant());
}else{
throw new BusinessException(merchantRef.getMerchantName()+"上级商户不存在");
}
} }
merchantRef.setContractingMerchantId(dto.getSigningEntityId()); merchantRef.setContractingMerchantId(dto.getSigningEntityId());
merchantRef.setContractingMerchantName(dto.getSigningEntity()); merchantRef.setContractingMerchantName(dto.getSigningEntity());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!