增加角色相关,进件相关修改,后台增加用户默认通道,前台默认通道

This commit is contained in:
liuyingfang
2023-06-28 10:05:28 +08:00
parent e26d85f4c9
commit fe7e9f2074
11 changed files with 183 additions and 9 deletions

View File

@@ -122,6 +122,7 @@ public interface AccountService extends IService<Account> {
* @return
*/
AccountDTO getRealAccount(String userId);
AccountDTO getReaLAccountD0(String userId);
/**
* 获取用户指定结算通道类型下的结算信息

View File

@@ -395,8 +395,15 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
bankCardService.save(accountDTO.getBankCard());
account.setBankCardId(accountDTO.getBankCard().getId() + "");
save(account);
this.baseMapper.insert(account);
//如果注册了一个通道给他默认
LambdaQueryWrapper<Account> qWrapperAccountD1 = Wrappers.lambdaQuery();
qWrapperAccountD1.eq(Account::getUserId, accountDTO.getUserId());
int count = baseMapper.selectCount(qWrapperAccountD1);
if (count == 1) {
account.setValid(1);
this.baseMapper.updateById(account);
}
// if (!accountDTO.getChannelType().equals(Account.CHANNEL_TYPE_D1)) {
// return;
// }
@@ -565,8 +572,14 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
AccountDTO d0 = getRealAccount(userId, Account.CHANNEL_TYPE_D0);
storeSummaryVO.setD0(d0);
//现在只要进件一个通道就是已录入
if (d1 != null || d0 != null){
storeSummaryVO.setD0Status("1");
if ("1".equals(merchantType)) {
if (d1.getBankCard() != null || d0.getBankCard() != null) {
storeSummaryVO.setD0Status("1");
}
}else {
if (d1 != null || d0 != null) {
storeSummaryVO.setD0Status("1");
}
}
MerchantChannelStatus mcsCurrent = mcsService.getValidData(mbi.getMerchantCode());
@@ -1063,6 +1076,10 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
public AccountDTO getRealAccount(String userId) {
return getRealAccount(userId, Account.CHANNEL_TYPE_D1);
}
@Override
public AccountDTO getReaLAccountD0(String userId){
return getRealAccount(userId, Account.CHANNEL_TYPE_D0);
}
@Override
public void delAccount(String userId, String channelType) {

View File

@@ -52,6 +52,12 @@ public interface MerchantChannelStatusService extends IService<MerchantChannelSt
return getBaseMapper().selectOne(qWrapper);
}
default List<MerchantChannelStatus> getMerchantCodeByInfo(String merchantCode) {
QueryWrapper<MerchantChannelStatus> qWrapper = new QueryWrapper<>();
qWrapper.eq("merchantCode", merchantCode)
.eq("status",3);
return getBaseMapper().selectList(qWrapper);
}
/**
* 获取当前启用的渠道下商户的渠道信息

View File

@@ -248,14 +248,14 @@ public class UserAppServiceImpl extends ServiceImpl<UserAppMapper, UserApp> impl
return pageResult;
}
List<String> merchantCodeList = new ArrayList<>();
List<Integer> userIdList = new ArrayList<>();
for (UserInfoVO userInfoVO : result) {
merchantCodeList.add(userInfoVO.getMerchantCode() + "");
userIdList.add(Integer.valueOf(userInfoVO.getUserId() + ""));
}
List<MerchantChannelStatusVO> channelStatusList = mcsService.listByMerchantCodeList(merchantCodeList);
Map<String, Integer> mapMerchantId = new HashMap<>();
for (UserInfoVO userInfoVO : result) {
List<MerchantChannelStatus> statusList = userInfoVO.getChannelStatusList();
if (statusList == null) {
@@ -271,7 +271,6 @@ public class UserAppServiceImpl extends ServiceImpl<UserAppMapper, UserApp> impl
statusList.add(item);
mapMerchantId.put(item.getChannel() + item.getMerchantId() + item.getMerchantCode(), 1);
}
if (Objects.equals(4, item.getChannel())) {
if (userInfoVO.getWxMercNoD0() == null) {
userInfoVO.setWxMercNoD0(item.getWxMercNo());
@@ -823,7 +822,16 @@ public class UserAppServiceImpl extends ServiceImpl<UserAppMapper, UserApp> impl
UserApp userApp = queryUserAppByToken();
MsgException.checkBlank(userApp.getMerchantCode(), "请完善经营信息");
AccountDTO realAccount = accountService.getRealAccount(userApp.getUserId() + "");
QueryWrapper<Account> QueryWrapper = new QueryWrapper<Account>()
.eq("userId", userApp.getUserId())
.eq("valid", 1);
Account account = accountService.getOne(QueryWrapper);
AccountDTO realAccount = null;
if (Objects.equals(account.getChannelType(), "D1")) {
realAccount = accountService.getRealAccount(userApp.getUserId() + "");
}else {
realAccount = accountService.getReaLAccountD0(userApp.getUserId()+"");
}
MsgException.checkNull(realAccount, "请完善商户结算信息");