mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
根据运营商id逻辑删除审核未通过的汇付会员账户
This commit is contained in:
@@ -40,7 +40,6 @@ import com.jsowell.pile.dto.PayOrderDTO;
|
||||
import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.vo.base.MerchantInfoVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.cglib.beans.BeanMap;
|
||||
@@ -209,12 +208,17 @@ public class AdapayService {
|
||||
if (config == null) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_ADAPAY_CONFIG_IS_NULL_ERROR);
|
||||
}
|
||||
|
||||
// 逻辑删除原来审核不通过的记录
|
||||
adapayMemberAccountService.deleteAuditFailed(dto.getMerchantId());
|
||||
|
||||
// 查询汇付会员关系
|
||||
AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.selectByMerchantId(dto.getMerchantId());
|
||||
if (adapayMemberAccount != null) {
|
||||
if (adapayMemberAccount != null && StringUtils.equals(adapayMemberAccount.getStatus(), Constants.ONE)) {
|
||||
log.error("通过merchantId:{}, 查询到结算账户配置:{}", dto.getMerchantId(), JSON.toJSONString(adapayMemberAccount));
|
||||
return;
|
||||
}
|
||||
|
||||
log.info("=======execute CreateMember begin=======");
|
||||
Map<String, Object> memberParams = Maps.newHashMap();
|
||||
String adapayMemberId = Constants.ADAPAY_MEMBER_PREFIX + IdUtils.getMemberId();
|
||||
@@ -628,13 +632,7 @@ public class AdapayService {
|
||||
}
|
||||
|
||||
// 逻辑删除原来审核不通过的记录
|
||||
List<AdapayMemberAccount> accountList = adapayMemberAccountService.selectAdapayMemberAccountList(dto.getMerchantId());
|
||||
if (CollectionUtils.isNotEmpty(accountList)) {
|
||||
List<String> ids = accountList.stream()
|
||||
.map(x -> x.getId() + "")
|
||||
.collect(Collectors.toList());
|
||||
adapayMemberAccountService.deleteAdapayMemberAccountByIds(ids);
|
||||
}
|
||||
adapayMemberAccountService.deleteAuditFailed(dto.getMerchantId());
|
||||
|
||||
// 创建企业用户参数
|
||||
Map<String, Object> memberParams = Maps.newHashMap();
|
||||
|
||||
@@ -68,4 +68,11 @@ public interface AdapayMemberAccountService {
|
||||
|
||||
AdapayMemberAccount getDefault();
|
||||
|
||||
/**
|
||||
* 根据运营商id逻辑删除审核未通过的汇付会员账户
|
||||
* @param merchantId
|
||||
* @return
|
||||
*/
|
||||
int deleteAuditFailed(String merchantId);
|
||||
|
||||
}
|
||||
|
||||
@@ -9,12 +9,13 @@ import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.AdapayMemberAccount;
|
||||
import com.jsowell.pile.mapper.AdapayMemberAccountMapper;
|
||||
import com.jsowell.pile.service.AdapayMemberAccountService;
|
||||
import com.jsowell.pile.service.PileStationInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
@@ -28,14 +29,9 @@ public class AdapayMemberAccountServiceImpl implements AdapayMemberAccountServic
|
||||
@Autowired
|
||||
private AdapayMemberAccountMapper adapayMemberAccountMapper;
|
||||
|
||||
@Autowired
|
||||
private PileStationInfoService pileStationInfoService;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
@@ -119,10 +115,6 @@ public class AdapayMemberAccountServiceImpl implements AdapayMemberAccountServic
|
||||
return adapayMemberAccountMapper.selectByMemberId(memberId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void updateAdapayMemberAccountByMemberId(AdapayMemberAccount adapayMemberAccount) {
|
||||
adapayMemberAccountMapper.updateAdapayMemberAccountByMemberId(adapayMemberAccount);
|
||||
@@ -136,6 +128,29 @@ public class AdapayMemberAccountServiceImpl implements AdapayMemberAccountServic
|
||||
return account;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据运营商id逻辑删除审核未通过的汇付会员账户
|
||||
* @param merchantId 运营商id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int deleteAuditFailed(String merchantId) {
|
||||
int result = 0;
|
||||
// 查询运营商所有的汇付会员账号配置信息
|
||||
List<AdapayMemberAccount> accountList = this.selectAdapayMemberAccountList(merchantId);
|
||||
if (CollectionUtils.isNotEmpty(accountList)) {
|
||||
List<String> ids = accountList.stream()
|
||||
.filter(x -> StringUtils.equals(x.getStatus(), Constants.TWO))
|
||||
.map(x -> x.getId() + "")
|
||||
.collect(Collectors.toList());
|
||||
result = this.deleteAdapayMemberAccountByIds(ids);
|
||||
// 清缓存
|
||||
String redisKey = CacheConstants.ADAPAY_MEMBER_ACCOUNT + merchantId;
|
||||
redisCache.deleteObject(redisKey);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int insert(AdapayMemberAccount record) {
|
||||
|
||||
Reference in New Issue
Block a user