Commit 75c7219f by 程裕兵

feat:remove vo enums

parent 0e80182f
package com.jiejing.fitness.finance.api.bank;
import com.jiejing.common.model.JsonResult;
import com.jiejing.common.model.PageVO;
import com.jiejing.fitness.finance.api.bank.request.PageBankRequest;
import com.jiejing.fitness.finance.api.bank.request.PageBranchBankRequest;
import com.jiejing.fitness.finance.api.bank.vo.BankVO;
import com.jiejing.fitness.finance.api.bank.vo.BranchBankVO;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
......@@ -12,6 +18,16 @@ public class BankApiFallback implements FallbackFactory<BankApi> {
@Override
public BankApi create(Throwable throwable) {
return null;
return new BankApi() {
@Override
public JsonResult<PageVO<BankVO>> pageBank(PageBankRequest request) {
return JsonResult.rpcError();
}
@Override
public JsonResult<PageVO<BranchBankVO>> pageBranchBank(PageBranchBankRequest request) {
return JsonResult.rpcError();
}
};
}
}
......@@ -2,6 +2,7 @@ package com.jiejing.fitness.finance.api.cashier.request;
import com.jiejing.fitness.enums.finance.BrandCashierTransStateEnum;
import com.jiejing.fitness.enums.finance.BrandCashierTransTypeEnum;
import com.jiejing.fitness.enums.finance.PayOrderTypeEnum;
import com.jiejing.paycenter.common.enums.merchant.SubChannelEnums;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -45,7 +46,7 @@ public class PageStudioCashierRequest {
private BrandCashierTransStateEnum transState;
@ApiModelProperty("业务订单类型(来源)")
private Integer orderType;
private PayOrderTypeEnum orderType;
@ApiModelProperty("交易类型:PAY-收款;REFUND-退款;")
private BrandCashierTransTypeEnum transType;
......
......@@ -16,7 +16,7 @@ import com.jiejing.fitness.finance.api.merchant.vo.StudioMerchantApplyVO;
import com.jiejing.fitness.finance.api.merchant.vo.StudioMerchantAuthSubChannelVO;
import com.jiejing.fitness.finance.api.merchant.vo.StudioMerchantBindXcxAppIdVO;
import com.jiejing.fitness.finance.api.merchant.vo.StudioMerchantVO;
import com.jiejing.paycenter.api.pay.vo.PayVO;
import com.jiejing.paycenter.common.model.vo.PayVO;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import org.springframework.cloud.openfeign.FeignClient;
......
......@@ -16,7 +16,7 @@ import com.jiejing.fitness.finance.api.merchant.vo.StudioMerchantApplyVO;
import com.jiejing.fitness.finance.api.merchant.vo.StudioMerchantAuthSubChannelVO;
import com.jiejing.fitness.finance.api.merchant.vo.StudioMerchantBindXcxAppIdVO;
import com.jiejing.fitness.finance.api.merchant.vo.StudioMerchantVO;
import com.jiejing.paycenter.api.pay.vo.PayVO;
import com.jiejing.paycenter.common.model.vo.PayVO;
import feign.hystrix.FallbackFactory;
import java.util.List;
import org.springframework.stereotype.Component;
......
package com.jiejing.fitness.finance.api.merchant.vo;
import com.jiejing.common.swagger.EnumMapping;
import com.jiejing.paycenter.api.merchant.vo.SubChannelConfigVO;
import com.jiejing.paycenter.common.enums.common.OpenStateEnums;
import com.jiejing.paycenter.common.enums.merchant.CompanyTypeEnums;
import com.jiejing.paycenter.common.model.vo.SubChannelConfigVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
......
......@@ -2,9 +2,9 @@ package com.jiejing.fitness.finance.api.merchant.vo;
import com.jiejing.common.swagger.EnumMapping;
import com.jiejing.fitness.finance.api.merchant.request.model.BrandResourceInfo;
import com.jiejing.paycenter.api.merchant.vo.SubChannelConfigVO;
import com.jiejing.paycenter.common.enums.common.OpenStateEnums;
import com.jiejing.paycenter.common.enums.merchant.CompanyTypeEnums;
import com.jiejing.paycenter.common.model.vo.SubChannelConfigVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
......
......@@ -23,7 +23,7 @@ import com.jiejing.fitness.finance.service.merchant.params.ApplyStudioMerchantPa
import com.jiejing.fitness.finance.service.merchant.params.PageStudioMerchantApplyParams;
import com.jiejing.fitness.finance.service.pay.PayService;
import com.jiejing.fitness.finance.service.pay.params.StudioMerchantPayParams;
import com.jiejing.paycenter.api.pay.vo.PayVO;
import com.jiejing.paycenter.common.model.vo.PayVO;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.annotation.Resource;
......
......@@ -66,8 +66,10 @@ public class StudioMerchantApply implements Serializable {
/**
* 申请类型:OPEN-进件;RE_OPEN-重进件;
*
* @see ApplyTypeEnum
*/
private ApplyTypeEnum applyType;
private String applyType;
/**
* 渠道号
......@@ -96,13 +98,17 @@ public class StudioMerchantApply implements Serializable {
/**
* 企业类型
*
* @see CompanyTypeEnums
*/
private CompanyTypeEnums companyType;
private String companyType;
/**
* 开通状态:I-初始态;P-处理中;S-成功;F-失败 默认值: I
*
* @see OpenStateEnums
*/
private OpenStateEnums openState;
private String openState;
/**
* 开通失败原因
......@@ -111,13 +117,17 @@ public class StudioMerchantApply implements Serializable {
/**
* 支付宝开通状态:I-初始态;S-成功;F-失败 默认值: I
*
* @see OpenStateEnums
*/
private OpenStateEnums aliOpenState;
private String aliOpenState;
/**
* 支付宝认证状态
*
* @see OpenStateEnums
*/
private OpenStateEnums aliAuthState;
private String aliAuthState;
/**
* 支付宝商户号
......@@ -131,13 +141,17 @@ public class StudioMerchantApply implements Serializable {
/**
* 微信线下通道开通状态:I-初始态;S-成功;F-失败 默认值: I
*
* @see OpenStateEnums
*/
private OpenStateEnums wxOfflineOpenState;
private String wxOfflineOpenState;
/**
* 微信线下通道认证状态:I-初始态;S-成功;F-失败 默认值: I
*
* @see OpenStateEnums
*/
private OpenStateEnums wxOfflineAuthState;
private String wxOfflineAuthState;
/**
* 微信线下通道商户号
......@@ -151,13 +165,17 @@ public class StudioMerchantApply implements Serializable {
/**
* 微信线上通道开通状态:I-初始态;S-成功;F-失败 默认值: I
*
* @see OpenStateEnums
*/
private OpenStateEnums wxOnlineOpenState;
private String wxOnlineOpenState;
/**
* 微信线上通道认证状态:I-初始态;S-成功;F-失败 默认值: I
*
* @see OpenStateEnums
*/
private OpenStateEnums wxOnlineAuthState;
private String wxOnlineAuthState;
/**
* 微信线上通道商户号
......
......@@ -2,6 +2,7 @@ package com.jiejing.fitness.finance.repository.query;
import com.jiejing.fitness.enums.finance.BrandCashierTransStateEnum;
import com.jiejing.fitness.enums.finance.BrandCashierTransTypeEnum;
import com.jiejing.fitness.enums.finance.PayOrderTypeEnum;
import com.jiejing.paycenter.common.enums.merchant.SubChannelEnums;
import java.util.Date;
import lombok.Data;
......@@ -53,7 +54,7 @@ public class PageBrandCashierRecordQuery {
/**
* 业务订单类型(来源)
*/
private Integer orderType;
private PayOrderTypeEnum orderType;
/**
* 交易类型:PAY-收款;REFUND-退款;
......
......@@ -67,7 +67,7 @@ public class StudioCashierRecordRpService extends
wrapper.eq(StudioCashierRecord.TRANS_STATE, query.getTransState());
}
if (null != query.getOrderType()) {
wrapper.eq(StudioCashierRecord.ORDER_TYPE, query.getOrderType());
wrapper.eq(StudioCashierRecord.ORDER_TYPE, query.getOrderType().getCode());
}
if (null != query.getTransType()) {
wrapper.eq(StudioCashierRecord.TRANS_TYPE, query.getTransType());
......
......@@ -2,6 +2,7 @@ package com.jiejing.fitness.finance.service.cashier.params;
import com.jiejing.fitness.enums.finance.BrandCashierTransStateEnum;
import com.jiejing.fitness.enums.finance.BrandCashierTransTypeEnum;
import com.jiejing.fitness.enums.finance.PayOrderTypeEnum;
import com.jiejing.paycenter.common.enums.merchant.SubChannelEnums;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -45,7 +46,7 @@ public class PageStudioCashierParams {
private BrandCashierTransStateEnum transState;
@ApiModelProperty("业务订单类型(来源)")
private Integer orderType;
private PayOrderTypeEnum orderType;
@ApiModelProperty("交易类型:PAY-收款;REFUND-退款;")
private BrandCashierTransTypeEnum transType;
......
package com.jiejing.fitness.finance.service.global.dto;
import com.jiejing.paycenter.common.model.SubChannelConfigInfo;
import com.jiejing.paycenter.common.model.SubChannelInfo;
import com.jiejing.paycenter.common.model.request.SubChannelConfigInfo;
import com.jiejing.paycenter.common.model.request.SubChannelInfo;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import lombok.Data;
......
package com.jiejing.fitness.finance.service.merchant.convert;
import static com.jiejing.paycenter.common.enums.merchant.ResourceTypeEnums.*;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.jiejing.common.utils.collection.CollectionUtil;
import com.jiejing.common.utils.convert.BeanUtil;
import com.jiejing.common.utils.crypt.AesUtil;
import com.jiejing.filecenter.api.resource.vo.ResourceInfoVO;
import com.jiejing.fitness.enums.finance.ApplyTypeEnum;
......@@ -16,7 +12,6 @@ import com.jiejing.fitness.finance.api.merchant.vo.BrandBankCardVO;
import com.jiejing.fitness.finance.api.merchant.vo.BrandLegalVO;
import com.jiejing.fitness.finance.api.merchant.vo.BrandLicenseVO;
import com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantVO;
import com.jiejing.fitness.finance.api.merchant.vo.BrandResourceVO;
import com.jiejing.fitness.finance.api.merchant.vo.StudioMerchantApplyVO;
import com.jiejing.fitness.finance.api.merchant.vo.StudioMerchantVO;
import com.jiejing.fitness.finance.repository.entity.PartyToMerchant;
......@@ -26,9 +21,12 @@ import com.jiejing.fitness.finance.service.merchant.params.ApplyStudioMerchantPa
import com.jiejing.fitness.finance.service.utils.JsonUtil;
import com.jiejing.paycenter.api.merchant.request.ApplyMerchantRequest;
import com.jiejing.paycenter.api.merchant.request.UploadRequest;
import com.jiejing.paycenter.api.merchant.vo.ContactVO;
import com.jiejing.paycenter.api.merchant.vo.LegalVO;
import com.jiejing.paycenter.api.merchant.vo.MerchantVO;
import com.jiejing.paycenter.common.enums.merchant.AuthPhaseEnums;
import com.jiejing.paycenter.common.enums.merchant.CompanyTypeEnums;
import com.jiejing.paycenter.common.enums.merchant.SubChannelEnums;
import com.jiejing.paycenter.common.model.vo.ContactVO;
import com.jiejing.paycenter.common.model.vo.LegalVO;
import com.jiejing.paycenter.common.model.vo.MerchantVO;
import com.jiejing.paycenter.common.enums.common.OpenStateEnums;
import com.jiejing.paycenter.common.enums.merchant.BusinessTypeEnums;
import com.jiejing.paycenter.common.enums.merchant.LicenseTypeEnums;
......@@ -38,15 +36,17 @@ import com.jiejing.paycenter.common.enums.merchant.SceneTypeEnums;
import com.jiejing.paycenter.common.enums.merchant.SubChannelAuthTypeEnums;
import com.jiejing.paycenter.common.enums.merchant.SubChannelOpenTypeEnums;
import com.jiejing.paycenter.common.event.MerchantEvent;
import com.jiejing.paycenter.common.model.Address;
import com.jiejing.paycenter.common.model.BankCard;
import com.jiejing.paycenter.common.model.BusinessInfo;
import com.jiejing.paycenter.common.model.Contact;
import com.jiejing.paycenter.common.model.Legal;
import com.jiejing.paycenter.common.model.License;
import com.jiejing.paycenter.common.model.ResourceInfo;
import com.jiejing.paycenter.common.model.SubChannelAuthInfo;
import com.jiejing.paycenter.common.model.SubChannelInfo;
import com.jiejing.paycenter.common.model.request.Address;
import com.jiejing.paycenter.common.model.request.BankCard;
import com.jiejing.paycenter.common.model.request.BusinessInfo;
import com.jiejing.paycenter.common.model.request.Contact;
import com.jiejing.paycenter.common.model.request.Legal;
import com.jiejing.paycenter.common.model.request.License;
import com.jiejing.paycenter.common.model.request.ResourceInfo;
import com.jiejing.paycenter.common.model.request.SubChannelAuthInfo;
import com.jiejing.paycenter.common.model.request.SubChannelInfo;
import com.jiejing.paycenter.common.model.vo.SubChannelAuthVO;
import com.jiejing.paycenter.common.model.vo.SubChannelVO;
import com.jiejing.studio.api.studio.vo.StudioVO;
import java.util.ArrayList;
import java.util.Date;
......@@ -69,7 +69,7 @@ public class MerchantConvert {
.bizCode(PartyTypeEnum.STUDIO.getCode())
.applyNo(apply.getApplyNo())
.channelNo(apply.getChannelNo())
.companyType(apply.getCompanyType())
.companyType(CompanyTypeEnums.getByCode(apply.getCompanyType()))
.merchantName(apply.getMerchantName())
.shortName(apply.getShortName())
.legal(convertLegal(params))
......@@ -182,12 +182,12 @@ public class MerchantConvert {
.applyNo(Long.toString(id))
.brandId(studio.getBrandId())
.studioId(encrypt.getStudioId())
.applyType(exist == null ? ApplyTypeEnum.OPEN : ApplyTypeEnum.RE_OPEN)
.applyType(exist == null ? ApplyTypeEnum.OPEN.getCode() : ApplyTypeEnum.RE_OPEN.getCode())
.channelNo(channel)
.merchantName(encrypt.getMerchantName())
.shortName(studio.getName())
.companyType(encrypt.getCompanyType())
.openState(OpenStateEnums.INIT)
.companyType(encrypt.getCompanyType().getCode())
.openState(OpenStateEnums.INIT.getCode())
.merchantInfo(convertMerchantInfo(encrypt))
.salt(salt)
.createTime(new Date())
......@@ -215,13 +215,28 @@ public class MerchantConvert {
.build();
}
private static List<SubChannelInfo> convertSubChannelInfos(List<SubChannelVO> list) {
return list.stream()
.map(e -> SubChannelInfo.builder()
.subChannel(SubChannelEnums.getByCode(e.getSubChannel()))
.openType(SubChannelOpenTypeEnums.getByCode(e.getOpenType()))
.feeRate(e.getFeeRate())
.state(OpenStateEnums.getByCode(e.getState()))
.merchantNos(e.getMerchantNos())
.failMessage(e.getFailMessage())
.openTime(e.getOpenTime())
.build()).collect(Collectors.toList());
}
public static StudioMerchantApply convertApply(StudioMerchantApply apply, MerchantEvent event,
List<SubChannelInfo> defaultSubChannels) {
// 品牌商户规则:微信线下公众号、微信线下小程序、支付宝线下通道全部开通成功才算成功
Map<SubChannelOpenTypeEnums, SubChannelInfo> channelMap = convertSubChannelMap(event.getSubChannels(),
List<SubChannelInfo> subChannels = convertSubChannelInfos(event.getSubChannels());
List<SubChannelAuthInfo> auths = convertSubChannelAuths(event.getSubChannelAuths());
Map<SubChannelOpenTypeEnums, SubChannelInfo> channelMap = convertSubChannelMap(subChannels,
defaultSubChannels);
OpenStateEnums state = convertOpenState(channelMap, defaultSubChannels);
String openFailMessage = OpenStateEnums.FAIL == state ? convertFailMessage(event.getSubChannels()) : null;
String openFailMessage = OpenStateEnums.FAIL == state ? convertFailMessage(subChannels) : null;
SubChannelInfo ali = channelMap.get(SubChannelOpenTypeEnums.ALI_OFFLINE);
SubChannelInfo wxGzhOffline = channelMap.get(SubChannelOpenTypeEnums.WX_GZH_OFFLINE);
OpenStateEnums wxOfflineState = convertWxOfflineState(channelMap);
......@@ -238,21 +253,35 @@ public class MerchantConvert {
.merchantName(event.getMerchantName())
.shortName(event.getShortName())
.companyType(event.getCompanyType())
.openState(state)
.openState(state.getCode())
.openFailMessage(openFailMessage)
.aliOpenState(ali.getState())
.aliAuthState(convertAliAuthState(event.getSubChannelAuths()))
.aliOpenState(ali.getState().getCode())
.aliAuthState(convertAliAuthState(auths))
.aliMerchantNo(JSON.toJSONString(ali.getMerchantNos()))
.aliOpenFailMessage(ali.getFailMessage())
.wxOfflineOpenState(wxOfflineState)
.wxOfflineOpenState(wxOfflineState.getCode())
.wxOfflineMerchantNo(JSON.toJSONString(wxGzhOffline.getMerchantNos()))
.wxOfflineAuthState(convertWxOfflineAuthState(event.getSubChannelAuths()))
.wxOfflineAuthState(convertWxOfflineAuthState(auths))
.wxOfflineOpenFailMessage(wxOfflineFailMessage)
.finishTime(OpenStateEnums.SUCCESS == state ? new Date() : null)
.updateTime(new Date())
.build();
}
private static List<SubChannelAuthInfo> convertSubChannelAuths(List<SubChannelAuthVO> auths) {
return auths.stream().map(e -> {
return SubChannelAuthInfo.builder()
.subChannel(SubChannelEnums.getByCode(e.getSubChannel()))
.authType(SubChannelAuthTypeEnums.getByCode(e.getAuthType()))
.state(OpenStateEnums.getByCode(e.getState()))
.phase(AuthPhaseEnums.getByCode(e.getPhase()))
.qrCode(e.getQrCode())
.authTime(e.getAuthTime())
.failMessage(e.getFailMessage())
.build();
}).collect(Collectors.toList());
}
private static BrandLegalVO convertLegal(LegalVO legal, ContactVO contact) {
BrandLegalVO legalInfo = JsonUtil.convertObject(legal, BrandLegalVO.class);
legalInfo.setLegalEmail(contact.getContactEmail());
......@@ -260,7 +289,7 @@ public class MerchantConvert {
}
private static Map<String, BrandResourceInfo> convertResourceMap(
Map<String, com.jiejing.paycenter.api.merchant.vo.ResourceInfoVO> resourceMap,
Map<String, com.jiejing.paycenter.common.model.vo.ResourceInfoVO> resourceMap,
Map<Long, String> urlMap) {
Map<String, BrandResourceInfo> map = new HashMap<>(resourceMap.size());
resourceMap.keySet().forEach(key -> {
......@@ -271,19 +300,19 @@ public class MerchantConvert {
return map;
}
private static OpenStateEnums convertWxOfflineAuthState(List<SubChannelAuthInfo> auths) {
private static String convertWxOfflineAuthState(List<SubChannelAuthInfo> auths) {
return auths.stream()
.filter(e -> e.getAuthType() == SubChannelAuthTypeEnums.WX_OFFLINE)
.findFirst()
.map(SubChannelAuthInfo::getState)
.map(e -> e.getState().getCode())
.orElse(null);
}
private static OpenStateEnums convertAliAuthState(List<SubChannelAuthInfo> auths) {
private static String convertAliAuthState(List<SubChannelAuthInfo> auths) {
return auths.stream()
.filter(e -> e.getAuthType() == SubChannelAuthTypeEnums.ALI_OFFLINE)
.findFirst()
.map(SubChannelAuthInfo::getState)
.map(e -> e.getState().getCode())
.orElse(null);
}
......@@ -388,9 +417,9 @@ public class MerchantConvert {
SubChannelInfo wxGzhOffline = channelMap.get(SubChannelOpenTypeEnums.WX_GZH_OFFLINE);
OpenStateEnums wxOfflineState = convertWxOfflineState(channelMap);
String wxOfflineFailMessage = convertWxOfflineFailMessage(channelMap);
OpenStateEnums aliAuthState = convertAliAuthState(
String aliAuthState = convertAliAuthState(
JsonUtil.convertList(merchant.getSubChannelAuths(), SubChannelAuthInfo.class));
OpenStateEnums wxOfflineAuthState = convertWxOfflineAuthState(
String wxOfflineAuthState = convertWxOfflineAuthState(
JsonUtil.convertList(merchant.getSubChannelAuths(), SubChannelAuthInfo.class));
return StudioMerchantVO.builder()
.studioId(relation.getPartyId())
......@@ -401,12 +430,12 @@ public class MerchantConvert {
.shortName(merchant.getShortName())
.companyType(merchant.getCompanyType())
.aliOpenState(Optional.ofNullable(ali.getState()).map(Enum::name).orElse(null))
.aliAuthState(Optional.ofNullable(aliAuthState).map(Enum::name).orElse(null))
.aliAuthState(aliAuthState)
.aliMerchantNo(JSON.toJSONString(ali.getMerchantNos()))
.aliOpenFailMessage(ali.getFailMessage())
.wxOfflineOpenState(Optional.ofNullable(wxOfflineState).map(Enum::name).orElse(null))
.wxOfflineMerchantNo(JSON.toJSONString(wxGzhOffline.getMerchantNos()))
.wxOfflineAuthState(Optional.ofNullable(wxOfflineAuthState).map(Enum::name).orElse(null))
.wxOfflineAuthState(wxOfflineAuthState)
.wxOfflineOpenFailMessage(wxOfflineFailMessage)
.license(JsonUtil.convertObject(merchant.getLicense(), BrandLicenseVO.class))
.legal(convertLegal(merchant.getLegal(), merchant.getContact()))
......@@ -424,25 +453,25 @@ public class MerchantConvert {
.brandId(apply.getBrandId())
.studioId(apply.getStudioId())
.applyNo(apply.getApplyNo())
.applyType(apply.getApplyType().name())
.applyType(apply.getApplyType())
.channelNo(apply.getChannelNo())
.merchantId(apply.getMerchantId())
.merchantNo(apply.getMerchantNo())
.merchantName(apply.getMerchantName())
.shortName(apply.getShortName())
.companyType(apply.getCompanyType().name())
.openState(apply.getOpenState().name())
.companyType(apply.getCompanyType())
.openState(apply.getOpenState())
.openFailMessage(apply.getOpenFailMessage())
.aliOpenState(apply.getAliOpenState().name())
.aliAuthState(apply.getAliAuthState().name())
.aliOpenState(apply.getAliOpenState())
.aliAuthState(apply.getAliAuthState())
.aliMerchantNo(apply.getAliMerchantNo())
.aliOpenFailMessage(apply.getAliOpenFailMessage())
.wxOfflineOpenState(apply.getWxOfflineOpenState().name())
.wxOfflineAuthState(apply.getWxOfflineAuthState().name())
.wxOfflineOpenState(apply.getWxOfflineOpenState())
.wxOfflineAuthState(apply.getWxOfflineAuthState())
.wxOfflineMerchantNo(apply.getWxOfflineMerchantNo())
.wxOfflineOpenFailMessage(apply.getWxOfflineOpenFailMessage())
.wxOnlineOpenState(apply.getWxOnlineOpenState().name())
.wxOnlineAuthState(apply.getWxOnlineAuthState().name())
.wxOnlineOpenState(apply.getWxOnlineOpenState())
.wxOnlineAuthState(apply.getWxOnlineAuthState())
.wxOnlineMerchantNo(apply.getWxOnlineMerchantNo())
.wxOnlineOpenFailMessage(apply.getWxOnlineOpenFailMessage())
.license(info.getLicense())
......@@ -494,9 +523,9 @@ public class MerchantConvert {
SubChannelInfo wxGzhOffline = channelMap.get(SubChannelOpenTypeEnums.WX_GZH_OFFLINE);
OpenStateEnums wxOfflineState = convertWxOfflineState(channelMap);
String wxOfflineFailMessage = convertWxOfflineFailMessage(channelMap);
OpenStateEnums aliAuthState = convertAliAuthState(
String aliAuthState = convertAliAuthState(
JsonUtil.convertList(merchant.getSubChannelAuths(), SubChannelAuthInfo.class));
OpenStateEnums wxOfflineAuthState = convertWxOfflineAuthState(
String wxOfflineAuthState = convertWxOfflineAuthState(
JsonUtil.convertList(merchant.getSubChannelAuths(), SubChannelAuthInfo.class));
return BrandMerchantVO.builder()
.brandId(brandId)
......@@ -508,12 +537,12 @@ public class MerchantConvert {
.shortName(merchant.getShortName())
.companyType(merchant.getCompanyType())
.aliOpenState(Optional.ofNullable(ali.getState()).map(Enum::name).orElse(null))
.aliAuthState(Optional.ofNullable(aliAuthState).map(Enum::name).orElse(null))
.aliAuthState(aliAuthState)
.aliMerchantNo(JSON.toJSONString(ali.getMerchantNos()))
.aliOpenFailMessage(ali.getFailMessage())
.wxOfflineOpenState(Optional.ofNullable(wxOfflineState).map(Enum::name).orElse(null))
.wxOfflineMerchantNo(JSON.toJSONString(wxGzhOffline.getMerchantNos()))
.wxOfflineAuthState(Optional.ofNullable(wxOfflineAuthState).map(Enum::name).orElse(null))
.wxOfflineAuthState(wxOfflineAuthState)
.wxOfflineOpenFailMessage(wxOfflineFailMessage)
.license(JsonUtil.convertObject(merchant.getLicense(), BrandLicenseVO.class))
.legal(convertLegal(merchant.getLegal(), merchant.getContact()))
......
......@@ -11,7 +11,7 @@ import com.jiejing.fitness.finance.service.merchant.BrandMerchantService;
import com.jiejing.fitness.finance.service.merchant.convert.MerchantConvert;
import com.jiejing.fitness.finance.service.rpc.MerchantRpcService;
import com.jiejing.fitness.finance.service.rpc.StudioRpcService;
import com.jiejing.paycenter.api.merchant.vo.MerchantVO;
import com.jiejing.paycenter.common.model.vo.MerchantVO;
import com.jiejing.studio.api.studio.vo.StudioVO;
import java.util.List;
import java.util.Map;
......
......@@ -29,17 +29,17 @@ import com.jiejing.fitness.finance.service.rpc.MessageRpcService;
import com.jiejing.fitness.finance.service.rpc.ResourceRpcService;
import com.jiejing.fitness.finance.service.rpc.StudioRpcService;
import com.jiejing.paycenter.api.merchant.request.ApplyMerchantRequest;
import com.jiejing.paycenter.api.merchant.vo.AuthSubChannelVO;
import com.jiejing.paycenter.api.merchant.vo.ConfigSubChannelVO;
import com.jiejing.paycenter.api.merchant.vo.MerchantVO;
import com.jiejing.paycenter.api.merchant.vo.SubChannelAuthVO;
import com.jiejing.paycenter.common.model.vo.AuthSubChannelVO;
import com.jiejing.paycenter.common.model.vo.ConfigSubChannelVO;
import com.jiejing.paycenter.common.model.vo.MerchantVO;
import com.jiejing.paycenter.common.model.vo.SubChannelAuthVO;
import com.jiejing.paycenter.common.enums.common.OpenStateEnums;
import com.jiejing.paycenter.common.enums.merchant.ResourceTypeEnums;
import com.jiejing.paycenter.common.enums.merchant.SubChannelAuthTypeEnums;
import com.jiejing.paycenter.common.enums.merchant.SubChannelConfigTypeEnums;
import com.jiejing.paycenter.common.enums.merchant.SubChannelEnums;
import com.jiejing.paycenter.common.event.MerchantEvent;
import com.jiejing.paycenter.common.model.ResourceInfo;
import com.jiejing.paycenter.common.model.request.ResourceInfo;
import com.jiejing.studio.api.studio.vo.StudioVO;
import java.util.ArrayList;
import java.util.List;
......@@ -153,7 +153,7 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
@Override
public void callback(MerchantEvent event) {
switch (event.getState()) {
switch (OpenStateEnums.getByCode(event.getState())) {
case PROCESS:
this.doOpenMerchantProcess(Long.parseLong(event.getApplyNo()));
break;
......@@ -250,7 +250,7 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
StudioMerchantApply toModify = MerchantConvert.convertApply(apply, event,
configService.getDefaultBrandSubChannelInfo().getSubChannels());
studioMerchantApplyRpService.updateById(toModify);
if (OpenStateEnums.SUCCESS != toModify.getOpenState()) {
if (!OpenStateEnums.SUCCESS.getCode().equals(toModify.getOpenState())) {
return;
}
// 所有子通道全部开通成功
......@@ -312,7 +312,7 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
private List<Long> getResourceIds(MerchantVO merchant) {
return merchant.getResourceMap().values().stream()
.map(com.jiejing.paycenter.api.merchant.vo.ResourceInfoVO::getResourceId)
.map(com.jiejing.paycenter.common.model.vo.ResourceInfoVO::getResourceId)
.filter(Objects::nonNull)
.distinct()
.collect(Collectors.toList());
......@@ -320,13 +320,13 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
private void doOpenMerchantFail(Long id, String failMessage) {
studioMerchantApplyRpService.updateById(
StudioMerchantApply.builder().id(id).openState(OpenStateEnums.FAIL)
StudioMerchantApply.builder().id(id).openState(OpenStateEnums.FAIL.getCode())
.openFailMessage(failMessage).build());
}
private void doOpenMerchantProcess(Long id) {
studioMerchantApplyRpService.updateById(
StudioMerchantApply.builder().id(id).openState(OpenStateEnums.PROCESS).build());
StudioMerchantApply.builder().id(id).openState(OpenStateEnums.PROCESS.getCode()).build());
}
private void validSmsCode(String phone, String smsCode) {
......
......@@ -2,7 +2,7 @@ package com.jiejing.fitness.finance.service.pay;
import com.jiejing.fitness.finance.service.pay.params.StudioMerchantPayParams;
import com.jiejing.fitness.finance.service.pay.params.BrandMerchantRefundParams;
import com.jiejing.paycenter.api.pay.vo.PayVO;
import com.jiejing.paycenter.common.model.vo.PayVO;
import com.jiejing.paycenter.api.pay.vo.RefundVO;
import com.jiejing.paycenter.common.event.PayEvent;
import com.jiejing.paycenter.common.event.RefundEvent;
......
......@@ -14,8 +14,8 @@ import com.jiejing.fitness.finance.service.pay.params.BrandMerchantRefundParams;
import com.jiejing.fitness.finance.service.pay.params.StudioMerchantPayParams;
import com.jiejing.fitness.finance.service.utils.FeeUtil;
import com.jiejing.fitness.finance.service.utils.MoneyUtil;
import com.jiejing.paycenter.api.merchant.vo.MerchantVO;
import com.jiejing.paycenter.api.merchant.vo.SubChannelVO;
import com.jiejing.paycenter.common.model.vo.MerchantVO;
import com.jiejing.paycenter.common.model.vo.SubChannelVO;
import com.jiejing.paycenter.api.pay.request.PayRequest;
import com.jiejing.paycenter.api.pay.request.RefundPayRequest;
import com.jiejing.paycenter.api.pay.vo.RefundVO;
......@@ -145,7 +145,7 @@ public class PayConvert {
.id(record.getId())
.successTime(event.getFinishTime())
.channelNo(event.getChannelNo())
.transState(convertTransState(event.getPayState()))
.transState(convertTransState(PayStateEnums.getByCode(event.getPayState())))
.failMessage(event.getFailMsg())
.thirdTransNo(event.getThirdTransNo())
.updateTime(new Date())
......@@ -218,7 +218,7 @@ public class PayConvert {
public static StudioCashierRecord convertRefund(StudioCashierRecord record, RefundEvent event) {
return StudioCashierRecord.builder()
.id(record.getId())
.transState(convertTransState(event.getRefundState()))
.transState(convertTransState(TransStateEnums.getByCode(event.getRefundState())))
.failMessage(event.getFailMessage())
.successTime(event.getSuccessTime())
.updateTime(new Date())
......
......@@ -13,10 +13,10 @@ import com.jiejing.fitness.finance.service.pay.params.StudioMerchantPayParams;
import com.jiejing.fitness.finance.service.rpc.MerchantRpcService;
import com.jiejing.fitness.finance.service.rpc.PayRpcService;
import com.jiejing.fitness.finance.service.rpc.StudioRpcService;
import com.jiejing.paycenter.api.merchant.vo.MerchantVO;
import com.jiejing.paycenter.common.model.vo.MerchantVO;
import com.jiejing.paycenter.api.pay.request.PayRequest;
import com.jiejing.paycenter.api.pay.request.RefundPayRequest;
import com.jiejing.paycenter.api.pay.vo.PayVO;
import com.jiejing.paycenter.common.model.vo.PayVO;
import com.jiejing.paycenter.api.pay.vo.RefundVO;
import com.jiejing.paycenter.common.event.PayEvent;
import com.jiejing.paycenter.common.event.RefundEvent;
......
......@@ -10,11 +10,11 @@ import com.jiejing.paycenter.api.merchant.request.ConfigSubChannelRequest;
import com.jiejing.paycenter.api.merchant.request.GetMerchantByIdRequest;
import com.jiejing.paycenter.api.merchant.request.ListMerchantByIdsRequest;
import com.jiejing.paycenter.api.merchant.request.UploadRequest;
import com.jiejing.paycenter.api.merchant.vo.ApplyMerchantResultVO;
import com.jiejing.paycenter.api.merchant.vo.AuthSubChannelVO;
import com.jiejing.paycenter.api.merchant.vo.ConfigSubChannelVO;
import com.jiejing.paycenter.api.merchant.vo.MerchantVO;
import com.jiejing.paycenter.api.merchant.vo.UploadVO;
import com.jiejing.paycenter.common.model.vo.ApplyMerchantResultVO;
import com.jiejing.paycenter.common.model.vo.AuthSubChannelVO;
import com.jiejing.paycenter.common.model.vo.ConfigSubChannelVO;
import com.jiejing.paycenter.common.model.vo.MerchantVO;
import com.jiejing.paycenter.common.model.vo.UploadVO;
import com.jiejing.paycenter.common.enums.common.OpenStateEnums;
import com.jiejing.paycenter.common.enums.merchant.AuthPhaseEnums;
import com.jiejing.paycenter.common.enums.merchant.SubChannelAuthTypeEnums;
......
......@@ -4,7 +4,7 @@ import com.jiejing.common.model.JsonResult;
import com.jiejing.paycenter.api.pay.PayApi;
import com.jiejing.paycenter.api.pay.request.PayRequest;
import com.jiejing.paycenter.api.pay.request.RefundPayRequest;
import com.jiejing.paycenter.api.pay.vo.PayVO;
import com.jiejing.paycenter.common.model.vo.PayVO;
import com.jiejing.paycenter.api.pay.vo.RefundVO;
import com.jiejing.paycenter.common.enums.common.TransStateEnums;
import com.jiejing.paycenter.common.enums.pay.PayStateEnums;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment