feat: 结算账户

pull/1121/head
梁宇奇 2025-04-23 16:06:29 +08:00
parent 0c9922ce94
commit 7f8d71b9a8
4 changed files with 51 additions and 15 deletions

View File

@ -0,0 +1,35 @@
package com.ruoyi.xkt.dto.account;
import lombok.Data;
/**
* @author liangyq
* @date 2025-04-23 15:03
*/
@Data
public class ExternalAccountUpdateDTO {
/**
* ID
*/
private Long id;
/**
*
*/
private String accountOwnerNumber;
/**
*
*/
private String accountOwnerName;
/**
*
*/
private String accountOwnerPhoneNumber;
/**
*
*/
private Boolean accountAuthAccess;
/**
*
*/
private String remark;
}

View File

@ -2,6 +2,7 @@ package com.ruoyi.xkt.service;
import com.ruoyi.xkt.domain.ExternalAccount;
import com.ruoyi.xkt.dto.account.ExternalAccountAddDTO;
import com.ruoyi.xkt.dto.account.ExternalAccountUpdateDTO;
import com.ruoyi.xkt.dto.finance.TransInfo;
import com.ruoyi.xkt.enums.*;
@ -68,8 +69,8 @@ public interface IExternalAccountService {
/**
*
*
* @param externalAccount
* @param update
* @return
*/
int modifyAccount(ExternalAccount externalAccount);
int modifyAccount(ExternalAccountUpdateDTO update);
}

View File

@ -121,11 +121,13 @@ public class AccountServiceImpl implements IAccountService {
EAccountOwnerType.STORE, EAccountType.ALI_PAY);
if (alipayExternalAccount != null) {
//修改
alipayExternalAccount.setAccountOwnerName(alipayBind.getAccountOwnerName());
alipayExternalAccount.setAccountOwnerNumber(alipayBind.getAccountOwnerNumber());
alipayExternalAccount.setAccountOwnerPhoneNumber(alipayBind.getAccountOwnerPhoneNumber());
alipayExternalAccount.setAccountAuthAccess(true);
externalAccountService.modifyAccount(alipayExternalAccount);
ExternalAccountUpdateDTO updateDTO = new ExternalAccountUpdateDTO();
updateDTO.setId(alipayExternalAccount.getId());
updateDTO.setAccountOwnerName(alipayBind.getAccountOwnerName());
updateDTO.setAccountOwnerNumber(alipayBind.getAccountOwnerNumber());
updateDTO.setAccountOwnerPhoneNumber(alipayBind.getAccountOwnerPhoneNumber());
updateDTO.setAccountAuthAccess(true);
externalAccountService.modifyAccount(updateDTO);
} else {
//新增
ExternalAccountAddDTO addDTO = new ExternalAccountAddDTO();

View File

@ -12,6 +12,7 @@ import com.ruoyi.common.utils.bean.BeanValidators;
import com.ruoyi.xkt.domain.ExternalAccount;
import com.ruoyi.xkt.domain.ExternalAccountTransDetail;
import com.ruoyi.xkt.dto.account.ExternalAccountAddDTO;
import com.ruoyi.xkt.dto.account.ExternalAccountUpdateDTO;
import com.ruoyi.xkt.dto.finance.TransInfo;
import com.ruoyi.xkt.enums.*;
import com.ruoyi.xkt.mapper.ExternalAccountMapper;
@ -153,14 +154,11 @@ public class ExternalAccountServiceImpl implements IExternalAccountService {
@Transactional(rollbackFor = Exception.class)
@Override
public int modifyAccount(ExternalAccount externalAccount) {
Assert.notNull(externalAccount);
Assert.notNull(externalAccount.getId());
int r = externalAccountMapper.updateById(externalAccount);
if (r == 0) {
throw new ServiceException(Constants.VERSION_LOCK_ERROR_COMMON_MSG);
}
return r;
public int modifyAccount(ExternalAccountUpdateDTO update) {
Assert.notNull(update);
Assert.notNull(update.getId());
ExternalAccount updateParams = BeanUtil.toBean(update, ExternalAccount.class);
return externalAccountMapper.updateById(updateParams);
}
/**