fix:账户列表、密码更新接口
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package com.cool.store.dao.wallet;
|
||||
|
||||
import com.cool.store.mapper.wallet.WalletLargePaymentMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 钱包大额支付DAO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/18
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class WalletLargePaymentDAO {
|
||||
private final WalletLargePaymentMapper walletLargePaymentMapper;
|
||||
|
||||
|
||||
}
|
||||
@@ -16,7 +16,7 @@ import lombok.Data;
|
||||
public class AccountInfoDTO {
|
||||
|
||||
@ApiModelProperty(value = "结算卡业务类型 枚举值:1:对公 2:对私", required = true)
|
||||
private String accountType;
|
||||
private Integer accountType;
|
||||
|
||||
@ApiModelProperty(value = "营业执照号码")
|
||||
private String licenseNo;
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.cool.store.request.wallet;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 账户密码维护Request
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/17
|
||||
*/
|
||||
@Data
|
||||
public class AccountPasswordRequest extends StoreShopRequest {
|
||||
|
||||
@ApiModelProperty("维护类型 1.设置密码 2.修改密码")
|
||||
@NotNull(message = "维护类型不能为空")
|
||||
private Integer upholdType;
|
||||
|
||||
@ApiModelProperty("新支付密码(sm3加密后字符串)")
|
||||
@NotNull(message = "新支付密码不能为空")
|
||||
private String newPayPwd;
|
||||
|
||||
@ApiModelProperty("确认新支付密码(sm3加密后字符串)")
|
||||
@NotNull(message = "确认新支付密码不能为空")
|
||||
private String confirmPayPwd;
|
||||
|
||||
@ApiModelProperty("当前使用的支付密码(sm3加密后字符串),维护类型为修改密码时必填")
|
||||
@NotNull(message = "当前使用的支付密码不能为空")
|
||||
private String currentPayPwd;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.cool.store.request.wallet;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 账户充值Request
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/17
|
||||
*/
|
||||
@Data
|
||||
public class AccountPaymentRequest extends StoreShopRequest {
|
||||
@ApiModelProperty(value = "支付金额")
|
||||
@Pattern(regexp = "^\\d+(\\.\\d{1,2})?$", message = "金额格式不正确")
|
||||
private String amount;
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.cool.store.request.wallet;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -9,6 +11,8 @@ import lombok.Data;
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class LargePaymentRequest {
|
||||
|
||||
@ApiModelProperty(value = "商户门店编号",required = true)
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.cool.store.request.wallet;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 门店idRequest
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/17
|
||||
*/
|
||||
@Data
|
||||
public class StoreShopRequest {
|
||||
@ApiModelProperty("门店id")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("门店id,两者取一")
|
||||
private String storeId;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.cool.store.vo.wallet;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 账户充值VO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/17
|
||||
*/
|
||||
@Data
|
||||
public class AccountPaymentVO {
|
||||
|
||||
@ApiModelProperty(value = "收款账号", required = true)
|
||||
private String payeeAccNo;
|
||||
|
||||
@ApiModelProperty(value = "收款账户名称", required = true)
|
||||
private String payeeAccName;
|
||||
|
||||
@ApiModelProperty(value = "收款银行名称", required = true)
|
||||
private String payeeBankName;
|
||||
|
||||
@ApiModelProperty(value = "账号过期时间")
|
||||
private String expireTime;
|
||||
|
||||
@ApiModelProperty("过期倒计时(秒)")
|
||||
private Long expiryCountdown;
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
package com.cool.store.service.wallet;
|
||||
|
||||
import com.cool.store.request.wallet.*;
|
||||
import com.cool.store.vo.wallet.AccountAuthenticationVO;
|
||||
import com.cool.store.vo.wallet.AccountBillListVO;
|
||||
import com.cool.store.vo.wallet.AccountInfoVO;
|
||||
import com.cool.store.vo.wallet.BankVO;
|
||||
import com.cool.store.vo.wallet.*;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
@@ -63,10 +60,10 @@ public interface WalletService {
|
||||
|
||||
/**
|
||||
* 查询账户列表
|
||||
* @param request 钱包门店Request
|
||||
* @param request 门店idRequest
|
||||
* @return 账户信息VO列表
|
||||
*/
|
||||
List<AccountInfoVO> getAccountList(WalletShopRequest request);
|
||||
List<AccountInfoVO> getAccountList(StoreShopRequest request);
|
||||
|
||||
/**
|
||||
* 交易流水
|
||||
@@ -74,4 +71,18 @@ public interface WalletService {
|
||||
* @return 账户交易列表VO列表
|
||||
*/
|
||||
PageInfo<AccountBillListVO> getBillPage(AccountBillQueryRequest request);
|
||||
|
||||
/**
|
||||
* 密码维护
|
||||
* @param request 账户密码维护Request
|
||||
* @return 是否成功
|
||||
*/
|
||||
Boolean passwordUpdate(AccountPasswordRequest request);
|
||||
|
||||
/**
|
||||
* 账户充值
|
||||
* @param request 账户充值Request
|
||||
* @return 账户充值VO
|
||||
*/
|
||||
AccountPaymentVO payment(AccountPaymentRequest request);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.RegionDao;
|
||||
import com.cool.store.dao.ShopInfoDAO;
|
||||
import com.cool.store.dao.ShopStageInfoDAO;
|
||||
import com.cool.store.dao.wallet.WalletLargePaymentDAO;
|
||||
import com.cool.store.dto.wallet.*;
|
||||
import com.cool.store.entity.LicenseTransactDO;
|
||||
import com.cool.store.entity.RegionDO;
|
||||
@@ -22,10 +23,8 @@ import com.cool.store.request.wallet.*;
|
||||
import com.cool.store.service.wallet.WalletApiService;
|
||||
import com.cool.store.service.wallet.WalletService;
|
||||
import com.cool.store.utils.BeanUtil;
|
||||
import com.cool.store.vo.wallet.AccountAuthenticationVO;
|
||||
import com.cool.store.vo.wallet.AccountBillListVO;
|
||||
import com.cool.store.vo.wallet.AccountInfoVO;
|
||||
import com.cool.store.vo.wallet.BankVO;
|
||||
import com.cool.store.utils.UUIDUtils;
|
||||
import com.cool.store.vo.wallet.*;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -57,6 +56,7 @@ public class WalletServiceImpl implements WalletService {
|
||||
private final ApplyLicenseMapper applyLicenseMapper;
|
||||
private final WalletApiService walletApiService;
|
||||
private final RegionDao regionDao;
|
||||
private final WalletLargePaymentDAO walletLargePaymentDAO;
|
||||
|
||||
@Override
|
||||
public Boolean accountCreate(AccountCreateRequest request) {
|
||||
@@ -192,12 +192,9 @@ public class WalletServiceImpl implements WalletService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AccountInfoVO> getAccountList(WalletShopRequest request) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||
if (Objects.isNull(shopInfo)) {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||
}
|
||||
List<AccountInfoDTO> accountInfo = walletApiService.getAccountInfo(new OutStoreIdRequest(shopInfo.getStoreId()));
|
||||
public List<AccountInfoVO> getAccountList(StoreShopRequest request) {
|
||||
String storeId = getStoreId(request);
|
||||
List<AccountInfoDTO> accountInfo = walletApiService.getAccountInfo(new OutStoreIdRequest(storeId));
|
||||
return BeanUtil.toList(accountInfo, AccountInfoVO.class);
|
||||
}
|
||||
|
||||
@@ -226,6 +223,36 @@ public class WalletServiceImpl implements WalletService {
|
||||
return toPageInfo(billPage.getData(), AccountBillListVO.class, billPage.getPage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean passwordUpdate(AccountPasswordRequest request) {
|
||||
String storeId = getStoreId(request);
|
||||
UpdatePasswordRequest passwordRequest = BeanUtil.toBean(request, UpdatePasswordRequest.class);
|
||||
passwordRequest.setOutStoreId(storeId);
|
||||
walletApiService.upholdPwd(passwordRequest);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccountPaymentVO payment(AccountPaymentRequest request) {
|
||||
String storeId = getStoreId(request);
|
||||
String paymentId = UUIDUtils.get32UUID();
|
||||
// new LargePaymentRequest(storeId, paymentId, "", request.getAmount());
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getStoreId(StoreShopRequest request) {
|
||||
String storeId = request.getStoreId();
|
||||
if (StringUtils.isBlank(storeId) && Objects.nonNull(request.getShopId())) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||
storeId = Objects.nonNull(shopInfo) ? shopInfo.getStoreId() : null;
|
||||
}
|
||||
if (StringUtils.isBlank(storeId)) {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||
}
|
||||
return storeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询并校验门店是否存在以及阶段是否处于平安钱包未开通状态
|
||||
*/
|
||||
|
||||
@@ -57,7 +57,7 @@ public class MiniWalletController {
|
||||
|
||||
@ApiOperation("账户列表")
|
||||
@GetMapping("/accountList")
|
||||
public ResponseResult<List<AccountInfoVO>> getAccountList(@RequestBody WalletShopRequest request) {
|
||||
public ResponseResult<List<AccountInfoVO>> getAccountList(@RequestBody StoreShopRequest request) {
|
||||
return ResponseResult.success(walletService.getAccountList(request));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user