update:
1. change payout account
This commit is contained in:
42
doc/sql/pending/20260429.sql
Normal file
42
doc/sql/pending/20260429.sql
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
alter table merchant_application
|
||||||
|
drop column alipay_account;
|
||||||
|
alter table merchant_application
|
||||||
|
drop column wechat_account;
|
||||||
|
|
||||||
|
|
||||||
|
drop table if exists merchant_payout_account;
|
||||||
|
create table merchant_payout_account
|
||||||
|
(
|
||||||
|
id int8 not null primary key,
|
||||||
|
user_id int8 not null default -1,
|
||||||
|
account_type int4 not null default -1,
|
||||||
|
holder_name varchar(255) default '' not null,
|
||||||
|
account_number varchar(255) not null default '',
|
||||||
|
account_url text not null default '',
|
||||||
|
remark varchar(255) not null default '',
|
||||||
|
create_user int8,
|
||||||
|
create_dept int8,
|
||||||
|
create_time timestamp(6),
|
||||||
|
update_user int8,
|
||||||
|
update_time timestamp(6),
|
||||||
|
status int4,
|
||||||
|
is_deleted int4 default 0
|
||||||
|
);
|
||||||
|
create index idx_merchant_payout_account_user_id on merchant_payout_account (user_id) where is_deleted = 0;
|
||||||
|
|
||||||
|
|
||||||
|
comment on table merchant_payout_account is '商家收款资料表';
|
||||||
|
comment on column merchant_payout_account.id is '主键';
|
||||||
|
comment on column merchant_payout_account.user_id is '用户id';
|
||||||
|
comment on column merchant_payout_account.account_type is '账号类型 1:支付宝 2:微信';
|
||||||
|
comment on column merchant_payout_account.holder_name is '账户所有人';
|
||||||
|
comment on column merchant_payout_account.account_number is '银行卡号';
|
||||||
|
comment on column merchant_payout_account.account_url is '收款码图片';
|
||||||
|
comment on column merchant_payout_account.remark is '备注';
|
||||||
|
comment on column merchant_payout_account.create_user is '创建人';
|
||||||
|
comment on column merchant_payout_account.create_dept is '创建部门';
|
||||||
|
comment on column merchant_payout_account.create_time is '创建时间';
|
||||||
|
comment on column merchant_payout_account.update_user is '修改人';
|
||||||
|
comment on column merchant_payout_account.update_time is '修改时间';
|
||||||
|
comment on column merchant_payout_account.status is '状态';
|
||||||
|
comment on column merchant_payout_account.is_deleted is '是否已删除';
|
||||||
@@ -42,7 +42,7 @@ public class MarketMerchantController {
|
|||||||
@ApiOperationSupport(order = 1)
|
@ApiOperationSupport(order = 1)
|
||||||
@Operation(summary = "自营商家认证提交")
|
@Operation(summary = "自营商家认证提交")
|
||||||
public R verifyMerchant(@RequestBody @Valid VerifyMerchantRequest request) {
|
public R verifyMerchant(@RequestBody @Valid VerifyMerchantRequest request) {
|
||||||
return R.status(applicationService.applyMerchant(AuthUtil.getUserId(), request.getType(), request.getStoreName(), request.getAlipayAccount(), request.getWechatAccount(), request.getCompanyName(), request.getBusinessLicense(), request.getBusinessLicenseUrl(), request.getLegalPerson()));
|
return R.status(applicationService.applyMerchant(AuthUtil.getUserId(), request.getType(), request.getStoreName(), request.getCompanyName(), request.getBusinessLicense(), request.getBusinessLicenseUrl(), request.getLegalPerson()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/merchant-audit-status")
|
@GetMapping("/merchant-audit-status")
|
||||||
@@ -98,7 +98,7 @@ public class MarketMerchantController {
|
|||||||
@ApiOperationSupport(order = 9)
|
@ApiOperationSupport(order = 9)
|
||||||
@Operation(summary = "新增收款资料")
|
@Operation(summary = "新增收款资料")
|
||||||
public R addPayoutAccount(@RequestBody @Valid SubmitPayoutAccountRequest request) {
|
public R addPayoutAccount(@RequestBody @Valid SubmitPayoutAccountRequest request) {
|
||||||
return R.status(payoutAccountService.submitPayoutAccount(AuthUtil.getUserId(), request.getType(), request.getUrl()));
|
return R.status(payoutAccountService.submitPayoutAccount(AuthUtil.getUserId(), request.getType(), request.getUrl(), request.getNumber(), request.getHolder()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/payout-account-list")
|
@GetMapping("/payout-account-list")
|
||||||
|
|||||||
@@ -16,7 +16,11 @@ public class SubmitPayoutAccountRequest implements Serializable {
|
|||||||
@NotNull(message = "请选择类型")
|
@NotNull(message = "请选择类型")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
@NotEmpty(message = "无效地址")
|
|
||||||
private String url;
|
private String url;
|
||||||
|
|
||||||
|
private String number;
|
||||||
|
|
||||||
|
@NotEmpty(message = "请填写所有人")
|
||||||
|
private String holder;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,6 @@ public class VerifyMerchantRequest implements Serializable {
|
|||||||
@NotEmpty(message = "无效参数")
|
@NotEmpty(message = "无效参数")
|
||||||
private String storeName;
|
private String storeName;
|
||||||
|
|
||||||
private String alipayAccount;
|
|
||||||
|
|
||||||
private String wechatAccount;
|
|
||||||
|
|
||||||
private String companyName;
|
private String companyName;
|
||||||
|
|
||||||
private String businessLicense;
|
private String businessLicense;
|
||||||
|
|||||||
@@ -15,10 +15,6 @@ public class MerchantStatusResponse implements Serializable {
|
|||||||
|
|
||||||
private String storeName;
|
private String storeName;
|
||||||
|
|
||||||
private String alipayAccount;
|
|
||||||
|
|
||||||
private String wechatAccount;
|
|
||||||
|
|
||||||
private String companyName;
|
private String companyName;
|
||||||
|
|
||||||
private String businessLicense;
|
private String businessLicense;
|
||||||
|
|||||||
@@ -15,4 +15,6 @@ public class MerchantPayoutAccountApiVO implements Serializable {
|
|||||||
|
|
||||||
private String accountUrl;
|
private String accountUrl;
|
||||||
|
|
||||||
|
private String holderName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,13 +8,7 @@ import org.mapstruct.factory.Mappers;
|
|||||||
import org.springblade.core.tool.sensitive.SensitiveUtil;
|
import org.springblade.core.tool.sensitive.SensitiveUtil;
|
||||||
import org.springblade.modules.api.response.remote.BankCardInfoData;
|
import org.springblade.modules.api.response.remote.BankCardInfoData;
|
||||||
import org.springblade.modules.api.vo.*;
|
import org.springblade.modules.api.vo.*;
|
||||||
import org.springblade.modules.market.pojo.dto.MarketBenefitPointApiDTO;
|
|
||||||
import org.springblade.modules.market.pojo.dto.MarketCashCouponApiDTO;
|
|
||||||
import org.springblade.modules.market.pojo.entity.MarketBankCardEntity;
|
import org.springblade.modules.market.pojo.entity.MarketBankCardEntity;
|
||||||
import org.springblade.modules.market.pojo.entity.MarketBenefitPointLogEntity;
|
|
||||||
import org.springblade.modules.market.pojo.entity.MarketCashCouponLogEntity;
|
|
||||||
import org.springblade.modules.market.pojo.entity.MarketUserCommissionLogEntity;
|
|
||||||
import org.springblade.modules.system.pojo.entity.User;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
@@ -22,5 +22,4 @@ public interface MarketMerchantConvert {
|
|||||||
|
|
||||||
List<MerchantPayoutAccountApiVO> convertMerchantPayoutAccountEntityToApiVOList(List<MerchantPayoutAccountEntity> merchantPayoutAccountEntityList);
|
List<MerchantPayoutAccountApiVO> convertMerchantPayoutAccountEntityToApiVOList(List<MerchantPayoutAccountEntity> merchantPayoutAccountEntityList);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import lombok.Getter;
|
|||||||
public enum PayoutAccountType {
|
public enum PayoutAccountType {
|
||||||
|
|
||||||
ALI(1, "支付宝"),
|
ALI(1, "支付宝"),
|
||||||
WECHAT(2, "微信");
|
WECHAT(2, "微信"),
|
||||||
|
BANK_ACCOUNT(3, "银行账号")
|
||||||
|
;
|
||||||
|
|
||||||
private final int code;
|
private final int code;
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,6 @@
|
|||||||
<result column="user_account" property="userAccount"/>
|
<result column="user_account" property="userAccount"/>
|
||||||
<result column="type" property="type"/>
|
<result column="type" property="type"/>
|
||||||
<result column="store_name" property="storeName"/>
|
<result column="store_name" property="storeName"/>
|
||||||
<result column="alipay_account" property="alipayAccount"/>
|
|
||||||
<result column="wechat_account" property="wechatAccount"/>
|
|
||||||
<result column="company_name" property="companyName"/>
|
<result column="company_name" property="companyName"/>
|
||||||
<result column="business_license" property="businessLicense"/>
|
<result column="business_license" property="businessLicense"/>
|
||||||
<result column="business_license_url" property="businessLicenseUrl"/>
|
<result column="business_license_url" property="businessLicenseUrl"/>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
<result column="user_id" property="userId"/>
|
<result column="user_id" property="userId"/>
|
||||||
<result column="account_type" property="accountType"/>
|
<result column="account_type" property="accountType"/>
|
||||||
<result column="account_number" property="accountNumber"/>
|
<result column="account_number" property="accountNumber"/>
|
||||||
|
<result column="holder_name" property="holderNumber"/>
|
||||||
<result column="account_url" property="accountUrl"/>
|
<result column="account_url" property="accountUrl"/>
|
||||||
<result column="remark" property="remark"/>
|
<result column="remark" property="remark"/>
|
||||||
<result column="create_user" property="createUser"/>
|
<result column="create_user" property="createUser"/>
|
||||||
|
|||||||
@@ -68,16 +68,6 @@ public class MarketMerchantApplicationEntity extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
@Schema(description = "店铺名称")
|
@Schema(description = "店铺名称")
|
||||||
private String storeName;
|
private String storeName;
|
||||||
/**
|
|
||||||
* 支付宝账号
|
|
||||||
*/
|
|
||||||
@Schema(description = "支付宝账号")
|
|
||||||
private String alipayAccount;
|
|
||||||
/**
|
|
||||||
* 微信账号
|
|
||||||
*/
|
|
||||||
@Schema(description = "微信账号")
|
|
||||||
private String wechatAccount;
|
|
||||||
/**
|
/**
|
||||||
* 公司名称(企业商家时必填)
|
* 公司名称(企业商家时必填)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -64,6 +64,11 @@ public class MerchantPayoutAccountEntity extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
@Schema(description = "银行卡号")
|
@Schema(description = "银行卡号")
|
||||||
private String accountNumber;
|
private String accountNumber;
|
||||||
|
/**
|
||||||
|
* 账号所有人
|
||||||
|
*/
|
||||||
|
@Schema(description = "账号所有人")
|
||||||
|
private String holderName;
|
||||||
/**
|
/**
|
||||||
* 收款码图片
|
* 收款码图片
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public interface IMarketMerchantApplicationService extends BaseService<MarketMer
|
|||||||
|
|
||||||
boolean reject(Long id, String reason);
|
boolean reject(Long id, String reason);
|
||||||
|
|
||||||
boolean applyMerchant(Long userId, Integer type, String storeName, String alipayAccount, String wechatAccount, String companyName, String businessLicense, String businessLicenseUrl, String legalPerson);
|
boolean applyMerchant(Long userId, Integer type, String storeName, String companyName, String businessLicense, String businessLicenseUrl, String legalPerson);
|
||||||
|
|
||||||
int checkMerchantType(Long userId);
|
int checkMerchantType(Long userId);
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public interface IMerchantPayoutAccountService extends BaseService<MerchantPayou
|
|||||||
*/
|
*/
|
||||||
IPage<MerchantPayoutAccountVO> selectPayoutAccountPage(IPage<MerchantPayoutAccountVO> page, MerchantPayoutAccountVO payoutAccount);
|
IPage<MerchantPayoutAccountVO> selectPayoutAccountPage(IPage<MerchantPayoutAccountVO> page, MerchantPayoutAccountVO payoutAccount);
|
||||||
|
|
||||||
boolean submitPayoutAccount(Long userId, Integer type, String url);
|
boolean submitPayoutAccount(Long userId, Integer type, String url, String number, String holder);
|
||||||
|
|
||||||
List<MerchantPayoutAccountApiVO> accountListByUserId(Long userId);
|
List<MerchantPayoutAccountApiVO> accountListByUserId(Long userId);
|
||||||
|
|
||||||
|
|||||||
@@ -34,16 +34,13 @@ import org.springblade.core.tool.utils.StringPool;
|
|||||||
import org.springblade.core.tool.utils.StringUtil;
|
import org.springblade.core.tool.utils.StringUtil;
|
||||||
import org.springblade.modules.api.response.MerchantStatusResponse;
|
import org.springblade.modules.api.response.MerchantStatusResponse;
|
||||||
import org.springblade.modules.market.eums.MerchantAuditStatus;
|
import org.springblade.modules.market.eums.MerchantAuditStatus;
|
||||||
import org.springblade.modules.market.eums.PayoutAccountType;
|
|
||||||
import org.springblade.modules.market.eums.MerchantType;
|
import org.springblade.modules.market.eums.MerchantType;
|
||||||
import org.springblade.modules.market.pojo.entity.MarketInfoEntity;
|
import org.springblade.modules.market.pojo.entity.MarketInfoEntity;
|
||||||
import org.springblade.modules.market.pojo.entity.MarketMerchantApplicationEntity;
|
import org.springblade.modules.market.pojo.entity.MarketMerchantApplicationEntity;
|
||||||
import org.springblade.modules.market.pojo.entity.MerchantPayoutAccountEntity;
|
|
||||||
import org.springblade.modules.market.pojo.vo.MarketMerchantApplicationVO;
|
import org.springblade.modules.market.pojo.vo.MarketMerchantApplicationVO;
|
||||||
import org.springblade.modules.market.mapper.MarketMerchantApplicationMapper;
|
import org.springblade.modules.market.mapper.MarketMerchantApplicationMapper;
|
||||||
import org.springblade.modules.market.service.IMarketInfoService;
|
import org.springblade.modules.market.service.IMarketInfoService;
|
||||||
import org.springblade.modules.market.service.IMarketMerchantApplicationService;
|
import org.springblade.modules.market.service.IMarketMerchantApplicationService;
|
||||||
import org.springblade.modules.market.service.IMerchantPayoutAccountService;
|
|
||||||
import org.springblade.modules.system.service.IUserService;
|
import org.springblade.modules.system.service.IUserService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@@ -69,8 +66,6 @@ public class MarketMerchantApplicationServiceImpl extends BaseServiceImpl<Market
|
|||||||
|
|
||||||
private final IMarketInfoService marketInfoService;
|
private final IMarketInfoService marketInfoService;
|
||||||
|
|
||||||
private final IMerchantPayoutAccountService payoutAccountService;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<MarketMerchantApplicationVO> selectApplicationPage(IPage<MarketMerchantApplicationVO> page, MarketMerchantApplicationVO application) {
|
public IPage<MarketMerchantApplicationVO> selectApplicationPage(IPage<MarketMerchantApplicationVO> page, MarketMerchantApplicationVO application) {
|
||||||
return page.setRecords(baseMapper.selectApplicationPage(page, application));
|
return page.setRecords(baseMapper.selectApplicationPage(page, application));
|
||||||
@@ -112,26 +107,6 @@ public class MarketMerchantApplicationServiceImpl extends BaseServiceImpl<Market
|
|||||||
throw new ServiceException("商户类型更新失败");
|
throw new ServiceException("商户类型更新失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StringUtil.isNotBlank(application.getAlipayAccount())) {
|
|
||||||
MerchantPayoutAccountEntity alipayAccount = new MerchantPayoutAccountEntity();
|
|
||||||
alipayAccount.setUserId(application.getUserId());
|
|
||||||
alipayAccount.setAccountType(PayoutAccountType.ALI.getCode());
|
|
||||||
alipayAccount.setAccountUrl(application.getAlipayAccount());
|
|
||||||
if (!payoutAccountService.save(alipayAccount)){
|
|
||||||
throw new ServiceException("保存支付宝收款码失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StringUtil.isNotBlank(application.getWechatAccount())){
|
|
||||||
MerchantPayoutAccountEntity wechatAccount = new MerchantPayoutAccountEntity();
|
|
||||||
wechatAccount.setUserId(application.getUserId());
|
|
||||||
wechatAccount.setAccountType(PayoutAccountType.WECHAT.getCode());
|
|
||||||
wechatAccount.setAccountUrl(application.getAlipayAccount());
|
|
||||||
if (!payoutAccountService.save(wechatAccount)){
|
|
||||||
throw new ServiceException("保存支付宝收款码失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
CacheUtil.evict(MARKET_INFO_CONFIG_CACHE, MERCHANT, application.getUserId());
|
CacheUtil.evict(MARKET_INFO_CONFIG_CACHE, MERCHANT, application.getUserId());
|
||||||
|
|
||||||
@@ -149,7 +124,7 @@ public class MarketMerchantApplicationServiceImpl extends BaseServiceImpl<Market
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applyMerchant(Long userId, Integer type, String storeName, String alipayAccount, String wechatAccount, String companyName, String businessLicense, String businessLicenseUrl, String legalPerson) {
|
public boolean applyMerchant(Long userId, Integer type, String storeName, String companyName, String businessLicense, String businessLicenseUrl, String legalPerson) {
|
||||||
if (Objects.isNull(userId) || Objects.isNull(type)) {
|
if (Objects.isNull(userId) || Objects.isNull(type)) {
|
||||||
throw new ServiceException("无效参数");
|
throw new ServiceException("无效参数");
|
||||||
}
|
}
|
||||||
@@ -165,12 +140,6 @@ public class MarketMerchantApplicationServiceImpl extends BaseServiceImpl<Market
|
|||||||
MarketMerchantApplicationEntity application = new MarketMerchantApplicationEntity();
|
MarketMerchantApplicationEntity application = new MarketMerchantApplicationEntity();
|
||||||
MarketMerchantApplicationEntity userApplication = getByUserId(userId);
|
MarketMerchantApplicationEntity userApplication = getByUserId(userId);
|
||||||
application.setStoreName(storeName);
|
application.setStoreName(storeName);
|
||||||
if (StringUtil.isNotBlank(alipayAccount)) {
|
|
||||||
application.setAlipayAccount(alipayAccount);
|
|
||||||
}
|
|
||||||
if (StringUtil.isNotBlank(wechatAccount)) {
|
|
||||||
application.setWechatAccount(wechatAccount);
|
|
||||||
}
|
|
||||||
if (userApplication != null) {
|
if (userApplication != null) {
|
||||||
if (userApplication.getStatus() != MerchantAuditStatus.REJECTED.getCode()) {
|
if (userApplication.getStatus() != MerchantAuditStatus.REJECTED.getCode()) {
|
||||||
throw new ServiceException("请勿重复提交申请");
|
throw new ServiceException("请勿重复提交申请");
|
||||||
@@ -224,8 +193,6 @@ public class MarketMerchantApplicationServiceImpl extends BaseServiceImpl<Market
|
|||||||
if (Objects.nonNull(application)) {
|
if (Objects.nonNull(application)) {
|
||||||
response.setType(application.getType());
|
response.setType(application.getType());
|
||||||
response.setStoreName(application.getStoreName());
|
response.setStoreName(application.getStoreName());
|
||||||
response.setAlipayAccount(application.getAlipayAccount());
|
|
||||||
response.setWechatAccount(application.getWechatAccount());
|
|
||||||
response.setCompanyName(application.getCompanyName());
|
response.setCompanyName(application.getCompanyName());
|
||||||
response.setBusinessLicense(application.getBusinessLicense());
|
response.setBusinessLicense(application.getBusinessLicense());
|
||||||
response.setBusinessLicenseUrl(application.getBusinessLicenseUrl());
|
response.setBusinessLicenseUrl(application.getBusinessLicenseUrl());
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import org.springblade.modules.market.pojo.dto.MarketCashCouponApiDTO;
|
|||||||
import org.springblade.modules.market.pojo.entity.MarketInfoEntity;
|
import org.springblade.modules.market.pojo.entity.MarketInfoEntity;
|
||||||
import org.springblade.modules.market.pojo.entity.MerchantInventoryEntity;
|
import org.springblade.modules.market.pojo.entity.MerchantInventoryEntity;
|
||||||
import org.springblade.modules.market.pojo.entity.MerchantCatalogEntity;
|
import org.springblade.modules.market.pojo.entity.MerchantCatalogEntity;
|
||||||
|
import org.springblade.modules.market.pojo.entity.MerchantPayoutAccountEntity;
|
||||||
import org.springblade.modules.market.pojo.vo.MerchantInventoryVO;
|
import org.springblade.modules.market.pojo.vo.MerchantInventoryVO;
|
||||||
import org.springblade.modules.market.service.*;
|
import org.springblade.modules.market.service.*;
|
||||||
import org.springblade.modules.system.pojo.entity.User;
|
import org.springblade.modules.system.pojo.entity.User;
|
||||||
@@ -73,6 +74,8 @@ public class MerchantInventoryServiceImpl extends BaseServiceImpl<MerchantInvent
|
|||||||
|
|
||||||
private final IMarketBenefitPointService benefitPointService;
|
private final IMarketBenefitPointService benefitPointService;
|
||||||
|
|
||||||
|
private final IMerchantPayoutAccountService payoutAccountService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<MerchantInventoryVO> selectProductInventoryPage(IPage<MerchantInventoryVO> page, MerchantInventoryVO inventory) {
|
public IPage<MerchantInventoryVO> selectProductInventoryPage(IPage<MerchantInventoryVO> page, MerchantInventoryVO inventory) {
|
||||||
return page.setRecords(baseMapper.selectProductInventoryPage(page, inventory));
|
return page.setRecords(baseMapper.selectProductInventoryPage(page, inventory));
|
||||||
@@ -223,6 +226,11 @@ public class MerchantInventoryServiceImpl extends BaseServiceImpl<MerchantInvent
|
|||||||
throw new ServiceException("用户没有该操作权限");
|
throw new ServiceException("用户没有该操作权限");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean exists = payoutAccountService.exists(Wrappers.lambdaQuery(MerchantPayoutAccountEntity.class).eq(MerchantPayoutAccountEntity::getUserId, userId).eq(MerchantPayoutAccountEntity::getIsDeleted, 0));
|
||||||
|
if (!exists){
|
||||||
|
throw new ServiceException("请先绑定收款方式");
|
||||||
|
}
|
||||||
|
|
||||||
MerchantProductType currentType = MerchantProductType.fromCode(catalog.getType());
|
MerchantProductType currentType = MerchantProductType.fromCode(catalog.getType());
|
||||||
switch (currentType) {
|
switch (currentType) {
|
||||||
case PLATFORM -> {
|
case PLATFORM -> {
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ public class MerchantPayoutAccountServiceImpl extends BaseServiceImpl<MerchantPa
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean submitPayoutAccount(Long userId, Integer type, String url) {
|
public boolean submitPayoutAccount(Long userId, Integer type, String url, String number, String holder) {
|
||||||
if (Objects.isNull(url) || Objects.isNull(type) || StringUtil.isBlank(url)) {
|
if (Objects.isNull(url) || Objects.isNull(type) || StringUtil.isBlank(holder)) {
|
||||||
throw new ServiceException("无效参数");
|
throw new ServiceException("无效参数");
|
||||||
}
|
}
|
||||||
Integer merchantType = MarketInfoCache.checkMerchantType(userId);
|
Integer merchantType = MarketInfoCache.checkMerchantType(userId);
|
||||||
@@ -72,6 +72,15 @@ public class MerchantPayoutAccountServiceImpl extends BaseServiceImpl<MerchantPa
|
|||||||
throw new ServiceException("无效商家");
|
throw new ServiceException("无效商家");
|
||||||
}
|
}
|
||||||
PayoutAccountType currentType = PayoutAccountType.fromCode(type);
|
PayoutAccountType currentType = PayoutAccountType.fromCode(type);
|
||||||
|
if (currentType == PayoutAccountType.BANK_ACCOUNT){
|
||||||
|
if (StringUtil.isBlank(number)){
|
||||||
|
throw new ServiceException("请填写卡号");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
if (StringUtil.isBlank(url)){
|
||||||
|
throw new ServiceException("请上传收款码");
|
||||||
|
}
|
||||||
|
}
|
||||||
LambdaUpdateWrapper<MerchantPayoutAccountEntity> wrapper = Wrappers.lambdaUpdate(MerchantPayoutAccountEntity.class).eq(MerchantPayoutAccountEntity::getUserId, userId).eq(MerchantPayoutAccountEntity::getAccountType, currentType.getCode());
|
LambdaUpdateWrapper<MerchantPayoutAccountEntity> wrapper = Wrappers.lambdaUpdate(MerchantPayoutAccountEntity.class).eq(MerchantPayoutAccountEntity::getUserId, userId).eq(MerchantPayoutAccountEntity::getAccountType, currentType.getCode());
|
||||||
if (exists(wrapper)) {
|
if (exists(wrapper)) {
|
||||||
boolean updated = update(wrapper.set(MerchantPayoutAccountEntity::getIsDeleted, 1));
|
boolean updated = update(wrapper.set(MerchantPayoutAccountEntity::getIsDeleted, 1));
|
||||||
@@ -83,6 +92,8 @@ public class MerchantPayoutAccountServiceImpl extends BaseServiceImpl<MerchantPa
|
|||||||
account.setUserId(userId);
|
account.setUserId(userId);
|
||||||
account.setAccountType(currentType.getCode());
|
account.setAccountType(currentType.getCode());
|
||||||
account.setAccountUrl(url);
|
account.setAccountUrl(url);
|
||||||
|
account.setAccountNumber(number);
|
||||||
|
account.setHolderName(holder);
|
||||||
boolean saved = save(account);
|
boolean saved = save(account);
|
||||||
if (!saved) {
|
if (!saved) {
|
||||||
throw new ServiceException("操作失败");
|
throw new ServiceException("操作失败");
|
||||||
|
|||||||
Reference in New Issue
Block a user