fix:新增钱包开通流程及相关接口
This commit is contained in:
@@ -315,6 +315,7 @@ public enum ErrorCodeEnum {
|
||||
JOIN_MODE_NOT_ALLOW_OPERATE(1610012,"加盟部人员只能新建加盟店或联营店,请确认!",null),
|
||||
STORE_NOT_FIND(1610013,"门店不存在",null),
|
||||
|
||||
WALLET_OPEN_ACCOUNT_FAIL(1620001,"钱包开通失败",null),
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ public enum ShopSubStageEnum {
|
||||
SHOP_STAGE_3(ShopStageEnum.SHOP_STAGE_2, 30, "营业执照办理", 23),
|
||||
SHOP_STAGE_4(ShopStageEnum.SHOP_STAGE_2, 40, "食安许可证", 55),
|
||||
SHOP_STAGE_5(ShopStageEnum.SHOP_STAGE_2, 50, "员工招聘", 23),
|
||||
SHOP_STAGE_6(ShopStageEnum.SHOP_STAGE_2, 60, "开通门店平安钱包", 1),
|
||||
SHOP_STAGE_7(ShopStageEnum.SHOP_STAGE_2, 70, "缴纳加盟费/保证金", 1),
|
||||
SHOP_STAGE_8(ShopStageEnum.SHOP_STAGE_2, 80, "加盟合同签约", 4),
|
||||
SHOP_STAGE_8_5(ShopStageEnum.SHOP_STAGE_2, 85, "发票回传", 5),
|
||||
@@ -110,8 +111,9 @@ public enum ShopSubStageEnum {
|
||||
return ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_10;
|
||||
case SHOP_STAGE_5:
|
||||
return ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_50;
|
||||
case SHOP_STAGE_6:
|
||||
return ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_60;
|
||||
case SHOP_STAGE_7:
|
||||
return ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_70;
|
||||
case SHOP_STAGE_2:
|
||||
case SHOP_STAGE_3:
|
||||
case SHOP_STAGE_4:
|
||||
|
||||
@@ -36,6 +36,10 @@ public enum ShopSubStageStatusEnum {
|
||||
SHOP_SUB_STAGE_STATUS_50(ShopSubStageEnum.SHOP_STAGE_5, 500, "登记中", Boolean.FALSE),
|
||||
SHOP_SUB_STAGE_STATUS_51(ShopSubStageEnum.SHOP_STAGE_5, 510, "已完成", Boolean.TRUE),
|
||||
|
||||
//开通门店平安钱包
|
||||
SHOP_SUB_STAGE_STATUS_60(ShopSubStageEnum.SHOP_STAGE_6, 600, "未开通", Boolean.FALSE),
|
||||
SHOP_SUB_STAGE_STATUS_61(ShopSubStageEnum.SHOP_STAGE_6, 610, "已完成", Boolean.TRUE),
|
||||
|
||||
//缴纳加盟费/保证金
|
||||
SHOP_SUB_STAGE_STATUS_70(ShopSubStageEnum.SHOP_STAGE_7, 700, "待内勤发布账单", Boolean.FALSE),
|
||||
SHOP_SUB_STAGE_STATUS_71(ShopSubStageEnum.SHOP_STAGE_7, 710, "待加盟商缴费", Boolean.FALSE),
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.cool.store.enums.wallet;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 银行卡业务类型 枚举类
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/14
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BankAccountTypeEnum {
|
||||
|
||||
PUBLIC(1, "对公"),
|
||||
|
||||
PRIVATE(2, "对私"),
|
||||
;
|
||||
|
||||
private final Integer type;
|
||||
|
||||
private final String desc;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.cool.store.enums.wallet;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 银行开户类型 枚举类
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/14
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BankBusinessTypeEnum {
|
||||
|
||||
ENTERPRISE(1, "企业"),
|
||||
|
||||
INDIVIDUAL(2, "个体工商户"),
|
||||
|
||||
PERSONAL(3, "个人(小微商户)"),
|
||||
;
|
||||
|
||||
private final Integer type;
|
||||
|
||||
private final String desc;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.cool.store.enums.wallet;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 平安钱包账户开通状态
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/14
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum PingAnAccountStatusEnum {
|
||||
|
||||
UNCOMMITTED(1, "待提交"),
|
||||
UNAUTHORIZED(2, "带鉴权"),
|
||||
AUTHENTICATING(3, "鉴权中"),
|
||||
OPEN(4, "开通"),
|
||||
;
|
||||
|
||||
private final Integer status;
|
||||
|
||||
private final String desc;
|
||||
}
|
||||
@@ -2,9 +2,12 @@ package com.cool.store.request.wallet;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
|
||||
/**
|
||||
@@ -14,6 +17,9 @@ import javax.validation.constraints.Pattern;
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(description = "营业执照信息请求参数")
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class AccountAddTagRequest {
|
||||
|
||||
@ApiModelProperty(value = "外部门店唯一标识", required = true)
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.cool.store.request.wallet;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 平安钱包账户创建Request
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/13
|
||||
*/
|
||||
@Data
|
||||
public class AccountCreateRequest {
|
||||
@ApiModelProperty("门店id")
|
||||
@NotNull(message = "门店id不能为空")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("签约人姓名")
|
||||
@NotBlank(message = "签约人姓名不能为空")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("签约人手机号")
|
||||
@NotBlank(message = "签约人手机号不能为空")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty("签约人身份证号")
|
||||
@NotBlank(message = "签约人身份证号不能为空")
|
||||
private String idCardNo;
|
||||
|
||||
@ApiModelProperty("银行卡号")
|
||||
@NotBlank(message = "银行卡号不能为空")
|
||||
private String bankNumber;
|
||||
|
||||
@ApiModelProperty("银行开户支行")
|
||||
@NotBlank(message = "银行开户行不能为空")
|
||||
private String bankName;
|
||||
|
||||
@ApiModelProperty("银行开户支行编号")
|
||||
@NotBlank(message = "银行开户行编号不能为空")
|
||||
private String bankNo;
|
||||
|
||||
@ApiModelProperty("银行卡预留手机号")
|
||||
@NotBlank(message = "银行卡预留手机号不能为空")
|
||||
private String bankMobile;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.cool.store.request.wallet;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 平安钱包账户开通Request
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/13
|
||||
*/
|
||||
@Data
|
||||
public class AccountOpenRequest {
|
||||
@ApiModelProperty("shopId")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("短信验证码")
|
||||
private String code;
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.cool.store.request.wallet;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -8,6 +10,8 @@ import lombok.Data;
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AccountVerifyRequest {
|
||||
|
||||
private String outStoreId;
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.cool.store.request.wallet;
|
||||
|
||||
import com.cool.store.common.PageBasicInfo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 支行信息查询Request
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/14
|
||||
*/
|
||||
@Data
|
||||
public class BankListRequest extends PageBasicInfo {
|
||||
@ApiModelProperty("银行名称")
|
||||
private String headName;
|
||||
|
||||
@ApiModelProperty("关键字查询")
|
||||
private String keyword;
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.cool.store.request.wallet;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -9,6 +12,9 @@ import lombok.Data;
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class CreateStoreAndAccountRequest {
|
||||
|
||||
@ApiModelProperty(name = "CRM门店编号", required = true)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.cool.store.request.wallet;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -8,6 +10,8 @@ import lombok.Data;
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OutStoreIdRequest {
|
||||
|
||||
private String outStoreId;
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
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/14
|
||||
*/
|
||||
@Data
|
||||
public class WalletShopRequest {
|
||||
@ApiModelProperty("门店id")
|
||||
@NotNull(message = "门店id不能为空")
|
||||
private Long shopId;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.cool.store.vo.wallet;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 钱包账户鉴权VO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/14
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AccountAuthenticationVO {
|
||||
|
||||
@ApiModelProperty("1 待提交 2 待鉴权 3 鉴权中 4开通")
|
||||
private Integer accountStatus;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.cool.store.vo.wallet;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 银行VO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/14
|
||||
*/
|
||||
@Data
|
||||
public class BankVO {
|
||||
@ApiModelProperty("银行编号")
|
||||
private String headCode;
|
||||
@ApiModelProperty("银行名称")
|
||||
private String headName;
|
||||
@ApiModelProperty("支行号")
|
||||
private String branchCode;
|
||||
@ApiModelProperty("支行名称")
|
||||
private String branchName;
|
||||
}
|
||||
@@ -19,6 +19,7 @@ import com.cool.store.response.GetStoreInfoByCodeResponse;
|
||||
import com.cool.store.response.LicenseListResponse;
|
||||
import com.cool.store.response.SubmitLicenseResponse;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.service.wallet.WalletService;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
@@ -98,6 +99,9 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
||||
@Resource
|
||||
UserAuthMappingService userAuthMappingService;
|
||||
|
||||
@Resource
|
||||
WalletService walletService;
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean submitBusinessLicense(BusinessLicenseRequest request, PartnerUserInfoVO user) {
|
||||
@@ -144,9 +148,15 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
||||
preparationService.buildStoreAndDecorationComplete(request.getShopId());
|
||||
preparationService.selectSiteAndBuildStoreComplete(request.getShopId());
|
||||
}
|
||||
addTagIfUploadLicense(request.getShopId());
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
private void addTagIfUploadLicense(Long shopId) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
walletService.addTagIfUploadLicense(shopId, shopInfo.getStoreId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean submitFoodLicense(FoodLicenseRequest request, PartnerUserInfoVO user) {
|
||||
log.info("submitBusinessLicense request:{}", JSONObject.toJSONString(request));
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
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.BankVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 钱包 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/13
|
||||
*/
|
||||
public interface WalletService {
|
||||
|
||||
/**
|
||||
* 平安银行钱包账号创建
|
||||
* @param request 平安钱包账户创建Request
|
||||
* @return 是否成功
|
||||
*/
|
||||
Boolean accountCreate(AccountCreateRequest request);
|
||||
|
||||
/**
|
||||
* 鉴权申请
|
||||
* @param request 门店id
|
||||
* @return 是否成功
|
||||
*/
|
||||
AccountAuthenticationVO authentication(WalletShopRequest request);
|
||||
|
||||
/**
|
||||
* 账号开通
|
||||
* @param request 平安钱包账户开通Request
|
||||
* @return 是否成功
|
||||
*/
|
||||
Boolean openAccount(AccountOpenRequest request);
|
||||
|
||||
/**
|
||||
* 银行支行列表查询
|
||||
* @param request 支行信息查询Request
|
||||
* @return 银行支行信息列表
|
||||
*/
|
||||
PageInfo<BankVO> getBankList(BankListRequest request);
|
||||
|
||||
/**
|
||||
* 判断营业执照是否已经上传,已上传则调用打标接口
|
||||
* @param shopId 门店shopId
|
||||
* @param storeId 主数据门店id
|
||||
*/
|
||||
void addTagIfUploadLicense(Long shopId, String storeId);
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
package com.cool.store.service.wallet.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dao.RegionDao;
|
||||
import com.cool.store.dao.ShopInfoDAO;
|
||||
import com.cool.store.dao.ShopStageInfoDAO;
|
||||
import com.cool.store.dto.wallet.*;
|
||||
import com.cool.store.entity.LicenseTransactDO;
|
||||
import com.cool.store.entity.RegionDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.entity.ShopStageInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import com.cool.store.enums.wallet.BankAccountTypeEnum;
|
||||
import com.cool.store.enums.wallet.BankBusinessTypeEnum;
|
||||
import com.cool.store.enums.wallet.PingAnAccountStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.ApplyLicenseMapper;
|
||||
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.BankVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 钱包 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/13
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class WalletServiceImpl implements WalletService {
|
||||
private final ShopInfoDAO shopInfoDAO;
|
||||
private final ShopStageInfoDAO shopStageInfoDAO;
|
||||
private final ApplyLicenseMapper applyLicenseMapper;
|
||||
private final WalletApiService walletApiService;
|
||||
private final RegionDao regionDao;
|
||||
|
||||
@Override
|
||||
public Boolean accountCreate(AccountCreateRequest request) {
|
||||
ShopInfoDO shopInfo = getAndVerifyShopAndStage(request.getShopId());
|
||||
// 调用 创建门店签约人账户接口
|
||||
RegionDO regionDO = regionDao.getRegionById(shopInfo.getRegionId());
|
||||
if (Objects.isNull(regionDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.REGION_NOT_EXIST);
|
||||
}
|
||||
CreateStoreAndAccountRequest accountRequest = CreateStoreAndAccountRequest.builder()
|
||||
.outStoreId(shopInfo.getStoreId())
|
||||
.orgCode(String.valueOf(regionDO.getId()))
|
||||
.orgName(regionDO.getName())
|
||||
.phoneNumber(request.getMobile())
|
||||
.accountType(BankAccountTypeEnum.PRIVATE.getType())
|
||||
.businessType(BankBusinessTypeEnum.PERSONAL.getType())
|
||||
.legalName(request.getUserName())
|
||||
.legalNo(request.getIdCardNo())
|
||||
.accountAliasName(request.getUserName() + "_" + shopInfo.getStoreId())
|
||||
.accountCardno(request.getBankNumber())
|
||||
.accountPhone(request.getBankMobile())
|
||||
.bankNo(request.getBankNo())
|
||||
.bankName(request.getBankName())
|
||||
.build();
|
||||
StoreAccountDTO storeAndAccount = walletApiService.createStoreAndAccount(accountRequest);
|
||||
return StringUtils.isNotBlank(storeAndAccount.getAccountId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccountAuthenticationVO authentication(WalletShopRequest request) {
|
||||
ShopInfoDO shopInfo = getAndVerifyShopAndStage(request.getShopId());
|
||||
// 调用 门店签约人账户鉴权申请接口
|
||||
AccountAuthenticationDTO authentication = walletApiService.authentication(new OutStoreIdRequest(shopInfo.getStoreId()));
|
||||
if (Objects.nonNull(authentication)) {
|
||||
return new AccountAuthenticationVO(authentication.getAccountStatus());
|
||||
}
|
||||
throw new ServiceException(ErrorCodeEnum.WALLET_OPEN_ACCOUNT_FAIL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean openAccount(AccountOpenRequest request) {
|
||||
// 校验阶段是否合法
|
||||
ShopInfoDO shopInfo = getAndVerifyShopAndStage(request.getShopId());
|
||||
|
||||
// 调用 门店签约人账户开通接口
|
||||
log.info("开通账户");
|
||||
AccountVerifyDTO accountVerifyDTO = walletApiService.openAccount(new AccountVerifyRequest(shopInfo.getStoreId(), request.getCode()));
|
||||
if (!PingAnAccountStatusEnum.OPEN.getStatus().equals(accountVerifyDTO.getAccountStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.WALLET_OPEN_ACCOUNT_FAIL);
|
||||
}
|
||||
|
||||
// 更新钱包开通阶段状态
|
||||
List<ShopSubStageStatusEnum> updateSubStageList = new ArrayList<>();
|
||||
updateSubStageList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_61);
|
||||
// 判断一下缴费阶段是否开启,未开启则开启缴费阶段
|
||||
ShopStageInfoDO payStage = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_7);
|
||||
if (ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus().equals(payStage.getShopSubStageStatus())) {
|
||||
updateSubStageList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_70);
|
||||
}
|
||||
shopStageInfoDAO.batchUpdateShopStageStatus(request.getShopId(), updateSubStageList);
|
||||
|
||||
// 判断营业执照是否已经上传,已上传则调用打标接口
|
||||
addTagIfUploadLicense(request.getShopId(), shopInfo.getStoreId());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<BankVO> getBankList(BankListRequest request) {
|
||||
GetBankRequest getBankRequest = new GetBankRequest();
|
||||
WalletBasicPageInfo pageParam = new WalletBasicPageInfo();
|
||||
pageParam.setCurrentPage(request.getPageNum());
|
||||
pageParam.setPageSize(request.getPageSize());
|
||||
getBankRequest.setPage(pageParam);
|
||||
getBankRequest.setHeadName(request.getHeadName());
|
||||
getBankRequest.setKeyword(request.getKeyword());
|
||||
BankListDTO bankListDTO = walletApiService.getBankList(getBankRequest);
|
||||
PageInfo<BankVO> result = new PageInfo<>();
|
||||
result.setPageNum(request.getPageNum());
|
||||
result.setPageSize(request.getPageSize());
|
||||
if (Objects.nonNull(bankListDTO)) {
|
||||
WalletBasicPageInfo pageInfo = bankListDTO.getPage();
|
||||
result.setTotal(pageInfo.getTotal());
|
||||
result.setPages(pageInfo.getCount());
|
||||
result.setList(BeanUtil.toList(bankListDTO.getPageData(), BankVO.class));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTagIfUploadLicense(Long shopId, String storeId) {
|
||||
LicenseTransactDO licenseTransactDO = applyLicenseMapper.selectByShopId(shopId);
|
||||
// 营业执照已上传,调用打标接口
|
||||
if (Objects.nonNull(licenseTransactDO) && StringUtils.isNotBlank(licenseTransactDO.getCreditUrl())) {
|
||||
try {
|
||||
// 调用 签约人账户打标(升级)接口
|
||||
log.info("营业执照已上传,账户打标");
|
||||
AccountAddTagRequest tagRequest = AccountAddTagRequest.builder()
|
||||
.outStoreId(storeId)
|
||||
.licenseNo(licenseTransactDO.getCreditCode())
|
||||
.licenseName(licenseTransactDO.getBusinessLicense())
|
||||
// .licenseExpire(Objects.nonNull(licenseTransactDO.getValidity()) ? CoolDateUtils.DateFormat(licenseTransactDO.getValidity(), "yyyy-MM-dd") : "2999-12-31")
|
||||
.legalName(licenseTransactDO.getLicenseLegalPerson())
|
||||
.legalNo(licenseTransactDO.getLicenseLegalIdCardNo())
|
||||
.legalPhone(licenseTransactDO.getLicenseLegalMobile())
|
||||
.build();
|
||||
AddTagDTO addTagDTO = walletApiService.addTag(tagRequest);
|
||||
log.info("打标接口调用成功,response:{}", JSONObject.toJSONString(addTagDTO));
|
||||
} catch (Exception e) {
|
||||
log.error("营业执照已上传,打标失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询并校验门店是否存在以及阶段是否处于平安钱包未开通状态
|
||||
*/
|
||||
private ShopInfoDO getAndVerifyShopAndStage(Long shopId) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
if (Objects.isNull(shopInfo)) {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||
}
|
||||
ShopStageInfoDO stageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_6);
|
||||
if (!ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_60.getShopSubStageStatus().equals(stageInfo.getShopSubStageStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_NOT_OPERATE);
|
||||
}
|
||||
return shopInfo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.cool.store.controller.webc;
|
||||
|
||||
import com.cool.store.request.wallet.AccountCreateRequest;
|
||||
import com.cool.store.request.wallet.AccountOpenRequest;
|
||||
import com.cool.store.request.wallet.BankListRequest;
|
||||
import com.cool.store.request.wallet.WalletShopRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.wallet.WalletService;
|
||||
import com.cool.store.vo.wallet.AccountAuthenticationVO;
|
||||
import com.cool.store.vo.wallet.BankVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mini钱包 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/14
|
||||
*/
|
||||
@Api(tags = "Mini钱包")
|
||||
@RestController
|
||||
@RequestMapping("/mini/wallet")
|
||||
@RequiredArgsConstructor
|
||||
public class MiniWalletController {
|
||||
private final WalletService walletService;
|
||||
|
||||
@ApiOperation("步骤1:平安银行钱包账号创建")
|
||||
@PostMapping("/accountCreate")
|
||||
public ResponseResult<Boolean> accountCreate(@RequestBody @Validated AccountCreateRequest request) {
|
||||
return ResponseResult.success(walletService.accountCreate(request));
|
||||
}
|
||||
|
||||
@ApiOperation("步骤2:鉴权申请")
|
||||
@PostMapping("/authentication")
|
||||
public ResponseResult<AccountAuthenticationVO> authentication(@RequestBody @Validated WalletShopRequest request) {
|
||||
return ResponseResult.success(walletService.authentication(request));
|
||||
}
|
||||
|
||||
@ApiOperation("步骤3:账号开通(步骤2接口返回4时无需调用)")
|
||||
@PostMapping("/openAccount")
|
||||
public ResponseResult<Boolean> openAccount(@RequestBody @Validated AccountOpenRequest request) {
|
||||
return ResponseResult.success(walletService.openAccount(request));
|
||||
}
|
||||
|
||||
@ApiOperation("支行信息查询")
|
||||
@GetMapping("/bankList")
|
||||
public ResponseResult<PageInfo<BankVO>> getBankList(@RequestBody BankListRequest request) {
|
||||
return ResponseResult.success(walletService.getBankList(request));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user