增加实体类,以及部分逻辑修改
This commit is contained in:
@@ -12,7 +12,9 @@ import cn.pluss.platform.dto.BankCardDTO;
|
||||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.klk.vo.CallBackVo;
|
||||
import cn.pluss.platform.klk.vo.FeesSetVo;
|
||||
import cn.pluss.platform.mapper.AccountMapper;
|
||||
import cn.pluss.platform.mapper.MerchantChannelFeeMapper;
|
||||
import cn.pluss.platform.mapper.UserAppMapper;
|
||||
import cn.pluss.platform.mcc.MccReflectService;
|
||||
import cn.pluss.platform.merchant.AccountService;
|
||||
@@ -39,6 +41,7 @@ import cn.pluss.platform.ys.impl.v20220527.entity.*;
|
||||
import cn.pluss.platform.ys.impl.v20220527.service.YsAuditServiceV3;
|
||||
import cn.pluss.platform.ysExtension.v20220615.YsConstantV3;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -118,6 +121,8 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
private SubMerchantService smService;
|
||||
@Resource
|
||||
private SxfMerAuditHandler handler;
|
||||
@Resource
|
||||
private MerchantChannelFeeMapper merchantChannelFeeMapper;
|
||||
// @Autowired
|
||||
// private MercChangeRecordService mcrService;
|
||||
|
||||
@@ -214,7 +219,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
rateFeeInfo.setBank1creditPayFee(new RateFeeDetail("0", "0.61", "1", "999900"));
|
||||
rateFeeInfo.setBank2debitPayFee(new RateFeeDetail("0", "0.60", "1", "999900"));
|
||||
rateFeeInfo.setBank2creditPayFee(new RateFeeDetail("0", "0.60", "1"));
|
||||
RateFeeDetail codeScanD0Fee = new RateFeeDetail("0", "0.48", "1");
|
||||
RateFeeDetail codeScanD0Fee = new RateFeeDetail("0", "0.10", "1");
|
||||
rateInfo.setCodeScanD0Fee(codeScanD0Fee);
|
||||
rateInfo.setCodeScanT1Fee(rateFeeInfo);
|
||||
|
||||
@@ -222,6 +227,8 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
if (!Objects.equals(respEntity.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
||||
throw new MsgException("银盛云商服3.0商户签约申请请求失败, {}", respEntity.getSubMsg());
|
||||
}
|
||||
//保存费率
|
||||
channelFee(0.48d,0.48d, channel, mcs.getMerchantCode());
|
||||
}else {
|
||||
RateInfoD1 rateInfoD1 = new RateInfoD1();
|
||||
rateInfoD1.setCustId(custId);
|
||||
@@ -243,6 +250,8 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
if (!Objects.equals(respEntity.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
||||
throw new MsgException("银盛云商服3.0商户签约申请请求失败, {}", respEntity.getSubMsg());
|
||||
}
|
||||
//保存费率
|
||||
channelFee(0.38d,0.38d, channel, mcs.getMerchantCode());
|
||||
}
|
||||
|
||||
JSONObject businessData = JSON.parseObject(respEntity.getBusinessData());
|
||||
@@ -746,7 +755,6 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
// bizContentMap.put("appletId", "wxc2bb94c0ddda1032");
|
||||
// ysServiceV3.req(ReqMethod.appIdAddOrUpdate, bizContentMap);
|
||||
break;
|
||||
//TODO 失败和错误时没有处理
|
||||
case YsConfigV3.STATUS_REFUSE:
|
||||
String note1 = authData.getNote();
|
||||
mcs.setRemark(note1);
|
||||
@@ -823,6 +831,8 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
JSONObject param = new JSONObject();
|
||||
param.put(YsConstant.MERC_ID, mcs.getMerchantId());
|
||||
param.put("option", "ON");
|
||||
param.put("rateFee", "0.38");
|
||||
param.put("rateBottom", "1");
|
||||
ysServiceV3.req(ReqMethod.openOnlinePay, param, mcs.getChannel());
|
||||
} catch (Exception e) {
|
||||
log.error("云商服3.0开通线上D0接口报错: {}", e.getMessage());
|
||||
@@ -1830,4 +1840,27 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
public void channelFee(Double WECHAT, Double ALIPAY, Integer channel, String merchantCode){
|
||||
JSONArray array = new JSONArray();
|
||||
Set<FeesSetVo> feesSet = new HashSet<>();
|
||||
FeesSetVo w = new FeesSetVo();
|
||||
w.setFeeCode("WECHAT");
|
||||
w.setFeeValue(WECHAT);
|
||||
array.add(w);
|
||||
|
||||
FeesSetVo a = new FeesSetVo();
|
||||
a.setFeeCode("ALIPAY");
|
||||
a.setFeeValue(ALIPAY);
|
||||
array.add(a);
|
||||
|
||||
feesSet.add(w);
|
||||
feesSet.add(a);
|
||||
MerchantChannelFee merchantChannelFee = new MerchantChannelFee();
|
||||
merchantChannelFee.setChannel(channel);
|
||||
merchantChannelFee.setMerchantCode(merchantCode);
|
||||
merchantChannelFee.setFeeStr(array.toJSONString());
|
||||
merchantChannelFee.setCreateTime(new Date());
|
||||
merchantChannelFeeMapper.insert(merchantChannelFee);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -350,38 +350,38 @@ public class MerchantBaseInfoServiceImpl extends ServiceImpl<MerchantBaseInfoMap
|
||||
merchantStore.setMerchantName(mbi.getAlias());
|
||||
merchantStoreService.updateMerchantStore(merchantStore);
|
||||
|
||||
MerchantChannelStatus merchantChannelStatus = new MerchantChannelStatus();
|
||||
merchantStore = merchantStoreMapper.selectOne(new QueryWrapper<>(merchantStore));
|
||||
MerchantBaseInfo merchantBaseInfo = getMerchantBaseInfoByMerchantCode(merchantChannelStatus.getMerchantCode());
|
||||
QueryWrapper<MerchantImage> queryWrapper = new QueryWrapper<MerchantImage>()
|
||||
.eq("merchantCode", merchantChannelStatus.getMerchantCode()).eq("photoType", "06");
|
||||
MerchantImage merchantImage = merchantImageMapper.selectOne(queryWrapper);
|
||||
//String baseUrl = "https://life.sxczgkj.cn/web/wmerchant.php?c=site&a=entry&ctrl=store&ac=oauth&op=add_merchan&do=web&m=we7_wmall&i=1";
|
||||
String baseUrl = "https://kysh.sxczgkj.cn/javaApi/java-api/add-store";
|
||||
StringBuilder sb = new StringBuilder(baseUrl);
|
||||
sb.append("?title=").append(mbi.getAlias());
|
||||
sb.append("&syb_m_id=").append(merchantStore.getId());
|
||||
sb.append("&addressNo=").append(merchantBaseInfo.getAddressNo());
|
||||
String address = merchantBaseInfo.getProvince() + merchantBaseInfo.getCity() + merchantBaseInfo.getDistrict() + merchantBaseInfo.getAddress();
|
||||
String area = merchantBaseInfo.getProvince() +"-"+ merchantBaseInfo.getCity() +"-"+ merchantBaseInfo.getDistrict();
|
||||
try {
|
||||
String decodeAddress = URLEncoder.encode(address, "UTF-8");
|
||||
sb.append("&address=").append(decodeAddress);
|
||||
String decodeArea = URLEncoder.encode(area, "UTF-8");
|
||||
sb.append("&area=").append(decodeArea);
|
||||
String logo = URLEncoder.encode(merchantImage.getPicUrl(), "GBK");
|
||||
sb.append("&logo=").append(logo);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Map<String, String> lnxMap = IpUtils.getLocationByAddress(address);
|
||||
if (lnxMap != null) {
|
||||
sb.append("&location_x=").append(lnxMap.get("x"));
|
||||
sb.append("&location_y=").append(lnxMap.get("y"));
|
||||
}
|
||||
// 请求生成店铺j
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
String result = restTemplate.getForObject(sb.toString(), String.class);
|
||||
// MerchantChannelStatus merchantChannelStatus = new MerchantChannelStatus();
|
||||
// merchantStore = merchantStoreMapper.selectOne(new QueryWrapper<>(merchantStore));
|
||||
// MerchantBaseInfo merchantBaseInfo = getMerchantBaseInfoByMerchantCode(merchantChannelStatus.getMerchantCode());
|
||||
// QueryWrapper<MerchantImage> queryWrapper = new QueryWrapper<MerchantImage>()
|
||||
// .eq("merchantCode", merchantChannelStatus.getMerchantCode()).eq("photoType", "06");
|
||||
// MerchantImage merchantImage = merchantImageMapper.selectOne(queryWrapper);
|
||||
// //String baseUrl = "https://life.sxczgkj.cn/web/wmerchant.php?c=site&a=entry&ctrl=store&ac=oauth&op=add_merchan&do=web&m=we7_wmall&i=1";
|
||||
// String baseUrl = "https://kysh.sxczgkj.cn/javaApi/java-api/add-store";
|
||||
// StringBuilder sb = new StringBuilder(baseUrl);
|
||||
// sb.append("?title=").append(mbi.getAlias());
|
||||
// sb.append("&syb_m_id=").append(merchantStore.getId());
|
||||
// sb.append("&addressNo=").append(merchantBaseInfo.getAddressNo());
|
||||
// String address = merchantBaseInfo.getProvince() + merchantBaseInfo.getCity() + merchantBaseInfo.getDistrict() + merchantBaseInfo.getAddress();
|
||||
// String area = merchantBaseInfo.getProvince() +"-"+ merchantBaseInfo.getCity() +"-"+ merchantBaseInfo.getDistrict();
|
||||
// try {
|
||||
// String decodeAddress = URLEncoder.encode(address, "UTF-8");
|
||||
// sb.append("&address=").append(decodeAddress);
|
||||
// String decodeArea = URLEncoder.encode(area, "UTF-8");
|
||||
// sb.append("&area=").append(decodeArea);
|
||||
// String logo = URLEncoder.encode(merchantImage.getPicUrl(), "GBK");
|
||||
// sb.append("&logo=").append(logo);
|
||||
// } catch (UnsupportedEncodingException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// Map<String, String> lnxMap = IpUtils.getLocationByAddress(address);
|
||||
// if (lnxMap != null) {
|
||||
// sb.append("&location_x=").append(lnxMap.get("x"));
|
||||
// sb.append("&location_y=").append(lnxMap.get("y"));
|
||||
// }
|
||||
// // 请求生成店铺j
|
||||
// RestTemplate restTemplate = new RestTemplate();
|
||||
// String result = restTemplate.getForObject(sb.toString(), String.class);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -429,8 +429,9 @@ public class MerchantServiceImpl implements MerchantService {
|
||||
}else if(channel.getChannel()==5){
|
||||
//拉卡拉的主扫接口
|
||||
result=lkLPayServiceImpl.tradePay(order,channel,merchant);
|
||||
}
|
||||
else {
|
||||
} else if (channel.getChannel() == 6) {
|
||||
|
||||
}else {
|
||||
MsgException.throwException("未知通道");
|
||||
}
|
||||
if (ResultCode.SUCCESS.code() != result.getInteger("code")) {
|
||||
|
||||
@@ -400,32 +400,32 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
// }
|
||||
|
||||
// 如果不存在D0的结算信息,则直接将D1的结算信息带过来
|
||||
LambdaQueryWrapper<Account> qWrapperAccountD1 = Wrappers.lambdaQuery();
|
||||
qWrapperAccountD1.eq(Account::getUserId, accountDTO.getUserId()).eq(Account::getChannelType, Account.CHANNEL_TYPE_D0);
|
||||
int count = baseMapper.selectCount(qWrapperAccountD1);
|
||||
if (count == 0) {
|
||||
account.setChannelType(Account.CHANNEL_TYPE_D0);
|
||||
save(account);
|
||||
}
|
||||
//TODO
|
||||
// 如果不存在D1的结算信息,则直接将D0的结算信息带过来
|
||||
LambdaQueryWrapper<Account> qWrapperAccountD0 = Wrappers.lambdaQuery();
|
||||
qWrapperAccountD0.eq(Account::getUserId, accountDTO.getUserId()).eq(Account::getChannelType, Account.CHANNEL_TYPE_D1);
|
||||
int countD0 = baseMapper.selectCount(qWrapperAccountD0);
|
||||
if (countD0 == 0) {
|
||||
account.setChannelType(Account.CHANNEL_TYPE_D1);
|
||||
save(account);
|
||||
}
|
||||
// LambdaQueryWrapper<Account> qWrapperAccountD1 = Wrappers.lambdaQuery();
|
||||
// qWrapperAccountD1.eq(Account::getUserId, accountDTO.getUserId()).eq(Account::getChannelType, Account.CHANNEL_TYPE_D0);
|
||||
// int count = baseMapper.selectCount(qWrapperAccountD1);
|
||||
// if (count == 0) {
|
||||
// account.setChannelType(Account.CHANNEL_TYPE_D0);
|
||||
// save(account);
|
||||
// }
|
||||
// //TODO
|
||||
// // 如果不存在D1的结算信息,则直接将D0的结算信息带过来
|
||||
// LambdaQueryWrapper<Account> qWrapperAccountD0 = Wrappers.lambdaQuery();
|
||||
// qWrapperAccountD0.eq(Account::getUserId, accountDTO.getUserId()).eq(Account::getChannelType, Account.CHANNEL_TYPE_D1);
|
||||
// int countD0 = baseMapper.selectCount(qWrapperAccountD0);
|
||||
// if (countD0 == 0) {
|
||||
// account.setChannelType(Account.CHANNEL_TYPE_D1);
|
||||
// save(account);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void realNameAudit(CertificationDTO certificationDTO) {
|
||||
//验证唯一性
|
||||
Integer countIdCard = idCardService.getCountIdCard(certificationDTO.getCertnum());
|
||||
if (countIdCard > 0){
|
||||
throw new MsgException("身份证已注册");
|
||||
}
|
||||
// Integer countIdCard = idCardService.getCountIdCard(certificationDTO.getCertnum());
|
||||
// if (countIdCard > 0){
|
||||
// throw new MsgException("身份证已注册");
|
||||
// }
|
||||
UserApp tokenUa = uaService.queryUserAppByToken();
|
||||
if ("agent".equals(tokenUa.getUserType()) && "ZY_BST".equals(tokenUa.getRoleCode())) {
|
||||
IdCard condition = new IdCard().setCertNo(certificationDTO.getCertnum());
|
||||
|
||||
@@ -7,7 +7,6 @@ import cn.pluss.platform.constants.CommonError;
|
||||
import cn.pluss.platform.dto.ChangePwdDTO;
|
||||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.ipLocation.IpLocationService;
|
||||
import cn.pluss.platform.mapper.*;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.merchant.MerchantRateNewRecordService;
|
||||
@@ -38,20 +37,13 @@ import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.StringHttpMessageConverter;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
|
||||
@@ -215,6 +207,9 @@ public abstract class BaseUserInfoService extends ServiceImpl<UserInfoMapper, Us
|
||||
} else {
|
||||
userApp.setParentId(parentApp.getUserId());
|
||||
}
|
||||
//查找代理
|
||||
// userPromotionService.getBaseMapper();
|
||||
// parentApp.set
|
||||
}
|
||||
return userApp;
|
||||
}
|
||||
|
||||
@@ -132,6 +132,8 @@ public class UserInfoServiceImpl extends BaseUserInfoService {
|
||||
|
||||
UserApp.setSort(parentApp, userApp);
|
||||
UserApp.setRoleInfo(parentApp, userApp,null);
|
||||
//查找代理
|
||||
|
||||
|
||||
// 保存信息
|
||||
userAppService.save(userApp);
|
||||
|
||||
@@ -8,6 +8,7 @@ import cn.pluss.platform.systemConfig.SystemConfigService;
|
||||
import cn.pluss.platform.user.UserIpRecordService;
|
||||
import cn.pluss.platform.userInfo.UserInfoService;
|
||||
import cn.pluss.platform.util.MD5Util;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -105,8 +106,10 @@ public class UserInfoServiceNewImpl extends BaseUserInfoService {
|
||||
RoleUserInfo role = new RoleUserInfo();
|
||||
role.setRoleId(roleId);
|
||||
role.setUserId(userInfo.getId());
|
||||
//如果没有邀请码默认是平台用户
|
||||
UserApp userApp = getSaveUserAppInfo(userInfo);
|
||||
userApp.setInviteNum(null);
|
||||
userApp.setParentId(new Long(244));
|
||||
userApp.setInviteNum(getRandomNum());
|
||||
// 保存信息
|
||||
userAppService.save(userApp);
|
||||
roleUserInfoService.saveRoleUserInfo(role);
|
||||
@@ -145,4 +148,17 @@ public class UserInfoServiceNewImpl extends BaseUserInfoService {
|
||||
|
||||
|
||||
}
|
||||
private String getRandomNum() {
|
||||
String inviteNum;
|
||||
UserApp condition = new UserApp();
|
||||
|
||||
do {
|
||||
inviteNum = StringUtil.genRandomNum(5);
|
||||
condition.setInviteNum(inviteNum);
|
||||
UserApp userApp = userAppService.queryUserApp(condition);
|
||||
if (userApp == null) {
|
||||
return inviteNum;
|
||||
}
|
||||
} while (true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user