银盛D1相关,提现部分改动,注册逻辑更改,后台切换通道

This commit is contained in:
liuyingfang
2023-07-05 17:01:33 +08:00
parent 5beafd2970
commit dfa5c6670f
18 changed files with 194 additions and 40 deletions

View File

@@ -2,7 +2,9 @@ package cn.pluss.platform.cash.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.DesensitizedUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.json.JSONUtil;
import cn.pluss.platform.ali.AlipayService;
import cn.pluss.platform.cash.CashService;
import cn.pluss.platform.cashAccount.CashAccountService;
@@ -14,11 +16,13 @@ import cn.pluss.platform.fans.FansService;
import cn.pluss.platform.mapper.CashMapper;
import cn.pluss.platform.mapper.FansMapper;
import cn.pluss.platform.mapper.MerchantProfitMapper;
import cn.pluss.platform.mapper.UserPromotionMapper;
import cn.pluss.platform.merchantProfit.MerchantProfitService;
import cn.pluss.platform.userApp.UserAppService;
import cn.pluss.platform.userInfo.UserInfoService;
import cn.pluss.platform.user.impl.GeneralPushUtil;
import cn.pluss.platform.util.StringUtil;
import cn.pluss.platform.vo.CashStatusVO;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -351,10 +355,41 @@ public class CashServiceImpl extends ServiceImpl<CashMapper, Cash> implements Ca
if (StringUtil.isNotEmpty(tokenUa.getLogo())) {
cash.setLogo(tokenUa.getLogo());
}
//增加用户层级
LinkedList<CashStatusVO> cashMap = getCashMap(String.valueOf(cash.getUserId()), new LinkedList<>());
cash.setCashStatus(JSONUtil.toJsonStr(cashMap));
save(cash);
}
@Autowired
@Lazy
UserPromotionMapper userPromotionMapper;
public LinkedList<CashStatusVO> getCashMap(String userId, LinkedList<CashStatusVO> list){
UserPromotion promotion=userPromotionMapper.selectByUserId(userId);
if(ObjectUtil.isNotEmpty(promotion)&&"0".equals(promotion.getParentUserId())){
CashStatusVO cashStatus=new CashStatusVO();
cashStatus.setUserId(promotion.getUserId().toString());
cashStatus.setUserType(promotion.getTypeCode());
cashStatus.setStatus("0");
cashStatus.setLoginName(promotion.getLoginName());
list.add(cashStatus);
promotion.setCashStatusVOList(list);
return list;
}
if("AG".equals(promotion.getTypeCode())||"SO".equals(promotion.getTypeCode())||"FO".equals(promotion.getTypeCode())){
CashStatusVO cashStatus=new CashStatusVO();
cashStatus.setUserId(promotion.getUserId().toString());
cashStatus.setUserType(promotion.getTypeCode());
cashStatus.setStatus("0");
cashStatus.setLoginName(promotion.getLoginName());
list.add(cashStatus);
promotion.setCashStatusVOList(list);
}
getCashMap(promotion.getParentUserId(),list);
return list;
}
@Override
public Cash queryCash(Cash cash) {
return baseMapper.selectOne(new QueryWrapper<>(cash));

View File

@@ -340,7 +340,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
if (existD1 != null && !MerchantChannelStatus.AUDIT_STATUS_SUCCESS.equals(existD1.getStatus()) && !MerchantChannelStatus.AUDIT_STATUS_SIGNED.equals(existD1.getStatus()) && !MerchantChannelStatus.AUDIT_STATUS_WAITING_SIGN.equals(existD1.getStatus())) {
throw new MsgException("当前D1通道存在未进件完成的的进件数据不允许进件银盛");
}
//TODO 非营业执照商户同一结算人仅可申请两次实时到账
if (MERCH_TYPE_MICRO.equals(mbi.getMerchantType())) {
int ysCount = accountMapper.selectYSAuditSmallCount(mbi.getUserId());
if (ysCount >= 2) {
@@ -429,7 +429,11 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
CustInfo custInfo = new CustInfo();
mercInfo.setCustInfo(custInfo);
//商户基本信息
custInfo.setMercName(mbi.getMerchantName());
if ("1".equals(mbi.getMerchantType())) {
custInfo.setMercName(mbi.getAlias());
}else {
custInfo.setMercName(mbi.getMerchantName());
}
custInfo.setMercShortName(mbi.getAlias());
switch (mbi.getMerchantType()) {

View File

@@ -224,6 +224,15 @@ public class MerchantRateNewServiceImpl extends ServiceImpl<MerchantRateNewMappe
case 5:
result=lklChangeRateNewService.getDefaultRate();
break;
case 6:
MerchantRateNew merchantRateNew = new MerchantRateNew();
merchantRateNew.setChannel(6);
merchantRateNew.setWxRate(38);
merchantRateNew.setAliRate(38);
merchantRateNew.setBankRate(61);
merchantRateNew.setBankRateLarge(61);
result = ysChangeRateService.getDefaultRate();
break;
default:
MsgException.throwException("通道异常!");
}

View File

@@ -430,7 +430,7 @@ public class MerchantServiceImpl implements MerchantService {
//拉卡拉的主扫接口
result=lkLPayServiceImpl.tradePay(order,channel,merchant);
} else if (channel.getChannel() == 6) {
result = ysPayOldService.tradePay(order, channel,merchant);
}else {
MsgException.throwException("未知通道");
}

View File

@@ -1,5 +1,6 @@
package cn.pluss.platform.merchantChannelStatus;
import cn.hutool.core.util.ObjectUtil;
import cn.pluss.platform.entity.MerchantChannelStatus;
import cn.pluss.platform.mapper.MerchantChannelStatusMapper;
import cn.pluss.platform.vo.*;
@@ -239,15 +240,22 @@ public interface MerchantChannelStatusService extends IService<MerchantChannelSt
}
@Transactional(rollbackFor = Exception.class)
default void updateValid(String merchantCode){
//当前通道
MerchantChannelStatus validData = getValidData(merchantCode);
UpdateWrapper<MerchantChannelStatus> UpdateWrapper1 = new UpdateWrapper<MerchantChannelStatus>();
UpdateWrapper1.eq("id", validData.getId());
UpdateWrapper1.set("valid",0);
validData.setValid(0);
getBaseMapper().updateById(validData);
UpdateWrapper<MerchantChannelStatus> UpdateWrapper = new UpdateWrapper<MerchantChannelStatus>();
UpdateWrapper.eq("merchantCode", merchantCode)
.eq("valid",-1);
UpdateWrapper.set("valid",1);
QueryWrapper<MerchantChannelStatus> queryWrapper=new QueryWrapper<>();
queryWrapper.eq("merchantCode", merchantCode);
queryWrapper.ne("id",validData.getId());
MerchantChannelStatus status=getBaseMapper().selectOne(queryWrapper);
if(ObjectUtil.isNotEmpty(status)){
status.setValid(1);
getBaseMapper().update(status,queryWrapper);
}
}
}

View File

@@ -173,7 +173,7 @@ public class MerchantChannelStatusServiceImpl extends ServiceImpl<MerchantChanne
case MerchantChannelStatus.AUDIT_STATUS_SUCCESS:
// d1已进件通过, 此时说明需求进件的是银盛
MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByMerchantCode(merchantCode);
//TODO 非营业执照商户同一结算人仅可申请两次实时到账
int ysCount = accountMapper.selectYSAuditSmallCount(mbi.getUserId());
if (ysCount >= 2) {
throw new MsgException("非营业执照商户同一结算人仅可申请两次实时到账");

View File

@@ -913,7 +913,10 @@ public class MerchantOrderServiceImpl extends ServiceImpl<MerchantOrderMapper, M
}else if("5".equals(order.getAisleSwitch())){
JSONObject object=lkLPayServiceImpl.tradePay(dto,order);
return scanPay(object,order);
} else{
} else if("6".equals(order.getAisleSwitch())){
JSONObject object = ysPayOldService.tradePay(dto, order);
return scanPay(object, order);
}else{
throw new MsgException("未知通道!");
}
}
@@ -2387,6 +2390,34 @@ public class MerchantOrderServiceImpl extends ServiceImpl<MerchantOrderMapper, M
}
}
break;
case 6:
order.setAisleSwitch("6");
order.setSettlementType(SettleTypeEnum.D0.getValue());
order.setChannelRate(YsOldConstants.CHANNEL_WECHAT_ALIPAY_BANK_COST_RATE.multiply(new BigDecimal(10000)));
order.setChannelFee(new BigDecimal(order.getConsumeFee().toString()).multiply(YsOldConstants.CHANNEL_WECHAT_ALIPAY_BANK_COST_RATE).setScale(2,BigDecimal.ROUND_HALF_UP));
if(params.get("payWay") == null){
orderPrefix = "YS_";
}else{
if("WXZF".equalsIgnoreCase((String) params.get("payWay"))){
orderPrefix = "YS_W_";
order.setPayTypeCode(Constant.PAY_TYPE_WECHAT);
order.setPayTypeName(Constant.PAY_TYPE_NAME_WECHAT);
}else if("ZFBZF".equalsIgnoreCase((String)params.get("payWay"))){
orderPrefix = "YS_Z_";
order.setPayTypeCode(Constant.PAY_TYPE_ALIPAY);
order.setPayTypeName(Constant.PAY_TYPE_NAME_ALIPAY);
}else if("UNIONPAY".equalsIgnoreCase((String)params.get("payWay"))){
if(order.getConsumeFee() > 1000.0d){
order.setChannelRate(YsOldConstants.CREDIT_DEBIT_CARD_BANK_RATE_LARGE.multiply(new BigDecimal(10000)));
order.setChannelFee(new BigDecimal(order.getConsumeFee().toString()).multiply(YsOldConstants.CREDIT_DEBIT_CARD_BANK_RATE_LARGE).setScale(2,BigDecimal.ROUND_HALF_UP));
}
orderPrefix = "YS_Y_";
order.setPayTypeCode(Constant.PAY_TYPE_YSFPAY);
order.setPayTypeName(Constant.PAY_TYPE_NAME_YSFPAY);
}
}
break;
default:
throw new MsgException("无效的通道");
}

View File

@@ -440,6 +440,9 @@ public class ApiPayServiceImpl implements ApiPayService {
}else if(channel.getChannel()==5){
JSONObject res = lklPayService.tradePay(order,channel,merchant);
return assemblePayRresultParam(res, order);
}else if (channel.getChannel() == 6){
JSONObject res = ysPayOldService.tradePay(order, channel,merchant);
return assemblePayRresultParam(res, order);
}
return ResultGenerator.genFailJsonResult("未知的通道!");
} catch (Exception e) {

View File

@@ -217,7 +217,9 @@ public class UserInfoServiceImpl extends BaseUserInfoService {
if(ObjectUtil.isNotEmpty(promotion)){
if("MG".equals(promotion.getTypeCode())||"FB".equals(promotion.getTypeCode())||
"SB".equals(promotion.getTypeCode())||"1".equals(promotion.getIsExtend())){
"SB".equals(promotion.getTypeCode())||"1".equals(promotion.getIsExtend())||
"2".equals(promotion.getIsExtend())){
return promotion;
}

View File

@@ -114,12 +114,6 @@ public class UserInfoServiceNewImpl extends BaseUserInfoService {
userApp.setParentId(new Long(244));
userApp.setInviteNum(getRandomNum());
//查找代理
if (userInfo.getTypeCode() == null){
userInfo.setTypeCode("MG");
}
if (userInfo.getCurrentFee() == null){
userInfo.setCurrentFee("0.38");
}
UserPromotion promotion= getUserPromotionByUserId(String.valueOf(244));
String parenId=promotion.getUserId().toString();
UserPromotion promotionNew = new UserPromotion();
@@ -206,11 +200,10 @@ public class UserInfoServiceNewImpl extends BaseUserInfoService {
if(ObjectUtil.isNotEmpty(promotion)){
if("MG".equals(promotion.getTypeCode())||"FB".equals(promotion.getTypeCode())||
"SB".equals(promotion.getTypeCode())||"1".equals(promotion.getIsExtend())){
"SB".equals(promotion.getTypeCode())||"1".equals(promotion.getIsExtend())||
"2".equals(promotion.getIsExtend())){
return promotion;
}
}
getUserPromotionByUserId(promotion.getParentUserId());
return null;

View File

@@ -154,7 +154,12 @@ public class YsPayOldServiceImpl extends YsPayServiceImpl{
if(StringUtil.isNotEmpty(channel.getMercName())){
//reqData.put("seller_name",channel.getMercName());
}
reqData.put("business_code",YsBusinessCodeEnum.getCodeValue(channel.getSettlementType()));
if (channel.getChannel() == 4) {
reqData.put("business_code", YsBusinessCodeEnum.getCodeValue(channel.getSettlementType()));
}else {
reqData.put("business_code", YsBusinessCodeEnum.D1.getCode());
}
merchant.setChannelLimitPay(reqData,channel.getChannel());
YsEnum ysEnum = null;
if(StringUtil.isNotEmpty(order.getScanType()) && "01".equals(order.getScanType())){
@@ -208,7 +213,7 @@ public class YsPayOldServiceImpl extends YsPayServiceImpl{
String sub_code = respData.getString("sub_code");
String sub_msg = respData.getString("sub_msg");
if("4335".equals(sub_code) && StringUtil.isNotEmpty(sub_msg) && sub_msg.contains("商户需补齐相关资料")){
MsgException.throwException("D0实时到账商户未在银收客APP-商户认证-微信认证(支付宝认证)内完成授权,暂时无法收款");
MsgException.throwException("商户未在银收客APP-商户认证-微信认证(支付宝认证)内完成授权,暂时无法收款");
}else if("4335".equals(sub_code) && StringUtil.isNotEmpty(sub_msg) && sub_msg.contains("金额超限")){
MsgException.throwException("单笔交易金额超限");
}else{
@@ -251,6 +256,8 @@ public class YsPayOldServiceImpl extends YsPayServiceImpl{
return object;
}
/**
* 反扫
* @param merchantOrderDTO