银盛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

@@ -6,10 +6,29 @@ import cn.pluss.platform.vo.MerchantChannelStatusVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface UserPromotionMapper extends BaseMapper<UserPromotion> {
List<UserPromotion> selectListByUserId(@Param("userIdList") List<Integer> userIdList);
@Select(value = "SELECT\n" +
"\tP.user_id AS userId,\n" +
"\tP.type_code AS typeCode,\n" +
"\tP.current_fee AS currentFee,\n" +
"\tP.parent_user_id AS parentUserId,\n" +
"\tP.is_extend AS isExtend,\n" +
"\tP.create_time AS createTime,\n" +
"\tP.update_time AS updateTime,\n" +
"\tu.loginName \n" +
"FROM\n" +
"\ttb_pluss_user_promotion P\n" +
"\tLEFT JOIN tb_pluss_user_info u ON P.user_id = u.id \n" +
"WHERE\n" +
"\tP.user_id = #{userId}")
UserPromotion selectByUserId(@Param("userId") String userId);
}

View File

@@ -37,7 +37,7 @@
</script>
<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
<a class="layui-btn layui-btn-xs" lay-event="edit">通过</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
@@ -94,7 +94,7 @@
return "银盛";
} else if (c.channel == 5){
return "拉卡拉"
}else if (c.channel == 5){
}else if (c.channel == 6){
return "银盛D1"
}else {
return "未知通道"
@@ -155,17 +155,24 @@
});
function toAdd(obj) {
var url = '${ctx}/appVersionInfo/add';
<%--if (obj != undefined) {--%>
<%-- url = "${ctx}/appVersionInfo/edit/" + obj.id--%>
<%--}--%>
var index = layer.open({
type: 2
, shade: 0.5
, maxmin: true
, content: url
, area: ['550px', '600px']
});
$.ajax({
url: '${ctx}/channel/update/'+obj.merchantCode,
type: 'get',
dataType: 'JSON',
contentType: "application/json",
success: function (res) {
if (res.code == 200) {
layer.msg(res.data, {
icon: 1
});
} else {
layer.msg(res.data, {
icon: 5
});
}
}
})
}
function del(obj) {

View File

@@ -3,16 +3,19 @@ package cn.pluss.platform.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @author DJH
*/
@Data
@TableName("tb_pluss_cash")
public class Cash {
/**
@@ -153,5 +156,8 @@ public class Cash {
*/
@TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
private BigDecimal virRealCashAmt;
@TableField("cashStatus")
private String cashStatus;
}

View File

@@ -95,12 +95,12 @@ public class UserInfo {
* 用户注册选择身份
*/
@TableField(exist = false)
private String typeCode;
private String typeCode = "MC";
/**
* 费率
*/
@TableField(exist = false)
private String currentFee;
private String currentFee = "0.38";
/**
* 生成一个新的用户对象

View File

@@ -1,5 +1,6 @@
package cn.pluss.platform.entity;
import cn.pluss.platform.vo.CashStatusVO;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
@@ -7,6 +8,7 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
/**
* 用户推广费率对照表
@@ -40,4 +42,11 @@ public class UserPromotion {
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
@TableField(exist = false)
private List<CashStatusVO> cashStatusVOList;
@TableField(exist = false)
private String loginName;
}

View File

@@ -0,0 +1,19 @@
package cn.pluss.platform.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class CashStatusVO implements Serializable {
private String userType;
private String userId;
private String loginName;
private String status;
}

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

View File

@@ -1709,6 +1709,8 @@ public class MerchantController {
unionInfo = ysPayOldService.getUnionInfo(userAuthCode, payMentApp, null);
} else if (channel.getChannel() == 5) {
unionInfo=lkLPayService.getUnionInfo(userAuthCode,payMentApp,channel.getMerchantCode());
} else if (channel.getChannel() == 6) {
unionInfo = ysPayOldService.getUnionInfo(userAuthCode, payMentApp, null);
} else {
view.addObject("error", "未知通道类型");
return view;