更新新逻辑
This commit is contained in:
@@ -2,18 +2,31 @@ package cn.pluss.platform.AppletStoreUser.impl;
|
||||
|
||||
import cn.pluss.platform.AppletStoreUser.AppletStoreUserService;
|
||||
import cn.pluss.platform.appletInfo.AppletInfoService;
|
||||
import cn.pluss.platform.entity.AppletInfo;
|
||||
import cn.pluss.platform.entity.AppletStore;
|
||||
import cn.pluss.platform.entity.AppletStoreUser;
|
||||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.enums.MccAndStore;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.mapper.AppletInfoMapper;
|
||||
import cn.pluss.platform.mapper.AppletStoreMapper;
|
||||
import cn.pluss.platform.mapper.AppletStoreUserMapper;
|
||||
import cn.pluss.platform.mapper.MerchantStoreMapper;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.userInfo.UserInfoService;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.reactive.function.client.WebClient;
|
||||
import org.springframework.web.reactive.function.BodyInserters;
|
||||
import cn.pluss.platform.enums.MccAndStore;
|
||||
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
@@ -27,6 +40,12 @@ public class AppletStoreUserServiceImpl extends ServiceImpl<AppletStoreUserMappe
|
||||
private AppletStoreUserMapper appletStoreUserMapper;
|
||||
@Resource
|
||||
private AppletStoreMapper appletStoreMapper;
|
||||
@Resource
|
||||
private MerchantBaseInfoService merchantBaseInfoService;
|
||||
@Resource
|
||||
private UserInfoService userInfoService;
|
||||
@Resource
|
||||
private MerchantStoreMapper merchantStoreMapper;
|
||||
@Override
|
||||
@Transactional(rollbackFor=Exception.class)
|
||||
public Integer addAppletStoreUser(AppletStoreUser appletStoreUser) {
|
||||
@@ -41,6 +60,89 @@ public class AppletStoreUserServiceImpl extends ServiceImpl<AppletStoreUserMappe
|
||||
throw new MsgException("未找到店铺号");
|
||||
}
|
||||
appletStoreUser.setCreateTime(new Date());
|
||||
return baseMapper.insert(appletStoreUser);
|
||||
|
||||
|
||||
|
||||
int insert = baseMapper.insert(appletStoreUser);
|
||||
if (insert>0){
|
||||
MerchantBaseInfo merchantBaseInfo = merchantBaseInfoService.getMerchantBaseInfoByUserId(String.valueOf(appletStoreUser.getUserId()));
|
||||
if (merchantBaseInfo == null){
|
||||
throw new MsgException("未找到商户");
|
||||
}
|
||||
// 设置请求地址
|
||||
String url = "https://door.sxczgkj.cn/api/javaapp/apple/registeredstore";
|
||||
|
||||
// 创建WebClient对象
|
||||
WebClient webClient = WebClient.builder().build();
|
||||
|
||||
// 构造请求头
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
||||
|
||||
// 构造请求参数
|
||||
StringBuilder params = new StringBuilder();
|
||||
|
||||
params.append("title=").append(merchantBaseInfo.getAlias());
|
||||
//判断mcc码
|
||||
params.append("&mcc=").append(MccAndStore.findValueByStoreId(appletStoreUser.getAppleStoreId()));
|
||||
|
||||
UserInfo userInfo = userInfoService.getMainUserInfo(Long.valueOf(merchantBaseInfo.getUserId()));
|
||||
params.append("&mobile=").append(userInfo.getPhone());
|
||||
|
||||
QueryWrapper storQueryWrapper= new QueryWrapper<>();
|
||||
storQueryWrapper.eq("merchantCode",merchantBaseInfo.getMerchantCode());
|
||||
MerchantStore merchantStore = merchantStoreMapper.selectOne(storQueryWrapper);
|
||||
params.append("&syb_m_id=").append(merchantStore.getId());
|
||||
params.append("&type=1");
|
||||
|
||||
|
||||
// 发送POST请求并获取响应
|
||||
Mono<String> response = webClient.post()
|
||||
.uri(url)
|
||||
.headers(httpHeaders -> httpHeaders.addAll(headers))
|
||||
.body(BodyInserters.fromObject(params.toString()))
|
||||
.retrieve()
|
||||
.bodyToMono(String.class);
|
||||
// 响应结果判断
|
||||
String responseMsg = response.block();
|
||||
if (responseMsg.contains("\"code\":1")) {
|
||||
// 返回1
|
||||
return 1;
|
||||
}else {
|
||||
throw new MsgException("添加失败");
|
||||
}
|
||||
}
|
||||
|
||||
throw new MsgException("店铺开通有误");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// 设置请求地址
|
||||
String url = "https://door.sxczgkj.cn/api/javaapp/apple/registeredstore";
|
||||
|
||||
// 创建WebClient对象
|
||||
WebClient webClient = WebClient.builder().build();
|
||||
|
||||
// 构造请求头
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
||||
|
||||
// 构造请求参数
|
||||
StringBuilder params = new StringBuilder();
|
||||
params.append("mobile=11111111111");
|
||||
params.append("&mcc=7997");
|
||||
params.append("&type=1");
|
||||
params.append("&title=测试测试");
|
||||
|
||||
// 发送POST请求并获取响应
|
||||
Mono<String> response = webClient.post()
|
||||
.uri(url)
|
||||
.body(BodyInserters.fromObject(params.toString()))
|
||||
.headers(httpHeaders -> httpHeaders.addAll(headers))
|
||||
.retrieve()
|
||||
.bodyToMono(String.class);
|
||||
|
||||
// 打印响应结果
|
||||
System.out.println(response.block());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,11 +95,6 @@ public class UserMakerQuotaServiceImpl extends ServiceImpl<UserMakerQuotaMapper,
|
||||
return;
|
||||
}
|
||||
|
||||
if(!"1".equals(merchantBaseInfoByMerchantCode.getMerchantType())){
|
||||
log.error("商户并非小微商户:{},{}",merchantBaseInfoByMerchantCode.getMerchantCode(),merchantBaseInfoByMerchantCode.getMerchantType());
|
||||
return;
|
||||
}
|
||||
|
||||
UserPromotion userInfo = userPromotionMapper.selectByPrimaryKey(Long.valueOf(merchantBaseInfoByMerchantCode.getUserId()));
|
||||
if(ObjectUtil.isEmpty(userInfo)){
|
||||
log.error("用户所属关系不存在");
|
||||
|
||||
@@ -46,9 +46,9 @@ public class AppletStoreServiceImpl extends ServiceImpl<AppletStoreMapper, Apple
|
||||
userApp.getMerchantCode();
|
||||
MerchantStore storeByMerchantCode = merchantStoreService.getStoreByMerchantCode(userApp.getMerchantCode());
|
||||
//组装数据
|
||||
return menuList(appletStores,userId, storeByMerchantCode.getId());
|
||||
return menuList(appletStores,userId, storeByMerchantCode.getId(),userApp.getPhone());
|
||||
}
|
||||
private List<AppletStoreVO> menuList(List<AppletStore> appletStores, Integer userId, Integer storeId){
|
||||
private List<AppletStoreVO> menuList(List<AppletStore> appletStores, Integer userId, Integer storeId,String phone){
|
||||
List<AppletStoreUser> appletStoreByUser = appletStoreUserMapper.getAppletStoreByUser(userId);
|
||||
ArrayList<AppletStoreVO> appletStoreVOList = new ArrayList<>();
|
||||
for (AppletStore appletStore : appletStores) {
|
||||
@@ -66,7 +66,7 @@ public class AppletStoreServiceImpl extends ServiceImpl<AppletStoreMapper, Apple
|
||||
appletStoreVO.setId(appletStore.getId());
|
||||
appletStoreVO.setStoreName(appletStore.getStoreName());
|
||||
appletStoreVO.setIcon(appletStore.getIcon());
|
||||
appletStoreVO.setPath(appletStore.getUrl());
|
||||
appletStoreVO.setPath(appletStore.getUrl()+"&syb_m_id="+storeId+"&mobile="+phone);
|
||||
appletStoreVO.setGhappId(appletStore.getAppId());
|
||||
appletStoreVO.setWxType(appletStore.getWxType() == null?0:appletStore.getWxType());
|
||||
appletStoreVOList.add(appletStoreVO);
|
||||
|
||||
@@ -410,7 +410,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
AccountDTO accountDTO = accountService.getRealAccount(userId, Account.CHANNEL_TYPE_D1);
|
||||
|
||||
IdCard legalIdCard = idCardService.getLegalIdCard(userId);
|
||||
//upstreamInfoService.save(mbi, legalIdCard, accountDTO.getIdcard(), accountDTO.getBankCard(), 4);
|
||||
|
||||
}
|
||||
|
||||
private MercInfo combineBaseInfo(String userId, Integer channel) {
|
||||
|
||||
@@ -333,6 +333,10 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
}
|
||||
}
|
||||
}
|
||||
//最后查询旧的信息
|
||||
Account accountOld = new Account();
|
||||
accountOld.setChannelType(accountDTO.getChannelType()).setUserId(accountDTO.getUserId());
|
||||
accountOld = getOne(new QueryWrapper<>(accountOld));
|
||||
|
||||
accountDTO.paramCheck();
|
||||
|
||||
@@ -344,14 +348,14 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
});
|
||||
|
||||
// 原则上这里不需要再做空判断
|
||||
if (accIdCard != null) {
|
||||
RiskBlacklist riskBlacklist = new RiskBlacklist();
|
||||
riskBlacklist.setIdcardNo(accIdCard.getCertNo());
|
||||
Integer count = riskBlacklistMapper.selectCount(Wrappers.query(riskBlacklist));
|
||||
if (count > 0) {
|
||||
throw new MsgException("当前结算人已在风控黑名单中,请更换结算信息");
|
||||
}
|
||||
}
|
||||
// if (accIdCard != null) {
|
||||
// RiskBlacklist riskBlacklist = new RiskBlacklist();
|
||||
// riskBlacklist.setIdcardNo(accIdCard.getCertNo());
|
||||
// Integer count = riskBlacklistMapper.selectCount(Wrappers.query(riskBlacklist));
|
||||
// if (count > 0) {
|
||||
// throw new MsgException("当前结算人已在风控黑名单中,请更换结算信息");
|
||||
// }
|
||||
// }
|
||||
|
||||
delAccount(accountDTO.getUserId(), accountDTO.getChannelType());
|
||||
|
||||
@@ -408,6 +412,13 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
|
||||
bankCardService.save(accountDTO.getBankCard());
|
||||
account.setBankCardId(accountDTO.getBankCard().getId() + "");
|
||||
//看一下之前默认
|
||||
if (accountOld.getValid() == 1) {
|
||||
account.setValid(1);
|
||||
} else {
|
||||
account.setValid(0);
|
||||
}
|
||||
|
||||
this.baseMapper.insert(account);
|
||||
//如果注册了一个通道给他默认
|
||||
LambdaQueryWrapper<Account> qWrapperAccountD1 = Wrappers.lambdaQuery();
|
||||
@@ -1066,7 +1077,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
});
|
||||
|
||||
|
||||
MerchantChannelStatus mcs = mcsService.getByMerchantCodeAndChannelType(mbi.getMerchantCode(), account.getChannelType());
|
||||
MerchantChannelStatus mcs = mcsService.getByMerchantCodeAndChannelTypeV1(mbi.getMerchantCode(), account.getChannelType());
|
||||
if (mcs == null || !MerchantChannelStatus.AUDIT_STATUS_DATA_EDIT.equals(mcs.getStatus())) {
|
||||
account.setBak(null);
|
||||
}
|
||||
|
||||
@@ -37,6 +37,12 @@ public interface MerchantChannelStatusService extends IService<MerchantChannelSt
|
||||
qWrapper.eq(MerchantChannelStatus::getAuthorizationStatus,1);
|
||||
return getOne(qWrapper);
|
||||
}
|
||||
default MerchantChannelStatus getByMerchantCodeAndChannelTypeV1(String merchantCode, String channelType) {
|
||||
LambdaQueryWrapper<MerchantChannelStatus> qWrapper = Wrappers.lambdaQuery();
|
||||
qWrapper.eq(MerchantChannelStatus::getVirChannelFlag, channelType);
|
||||
qWrapper.eq(MerchantChannelStatus::getMerchantCode, merchantCode);
|
||||
return getOne(qWrapper);
|
||||
}
|
||||
default MerchantChannelStatus getByMerchantCodeAndChannelTypeNew(String merchantCode, String channelType) {
|
||||
LambdaQueryWrapper<MerchantChannelStatus> qWrapper = Wrappers.lambdaQuery();
|
||||
qWrapper.eq(MerchantChannelStatus::getVirChannelFlag, channelType);
|
||||
|
||||
@@ -380,8 +380,8 @@ public class LklMerAuditHandler {
|
||||
StringBuilder sb = new StringBuilder(baseUrl);
|
||||
sb.append("?title=").append(merchantBaseInfo.getAlias());
|
||||
sb.append("&password=").append(userInfo.getPassword().toLowerCase());
|
||||
sb.append("?mcc=").append(merchantBaseInfo.getMcc());
|
||||
sb.append("?mccName=").append(merchantBaseInfo.getMccName());
|
||||
sb.append("&mcc=").append(merchantBaseInfo.getMcc());
|
||||
sb.append("&mccName=").append(merchantBaseInfo.getMccName());
|
||||
sb.append("&mobile=").append(userInfo.getLoginName());
|
||||
sb.append("&syb_m_id=").append(merchantStore.getId());
|
||||
sb.append("&addressNo=").append(merchantBaseInfo.getAddressNo());
|
||||
|
||||
@@ -370,8 +370,8 @@ public class SxfMerAuditHandler {
|
||||
String baseUrl = it.toString();
|
||||
StringBuilder sb = new StringBuilder(baseUrl);
|
||||
sb.append("?title=").append(merchantBaseInfo.getAlias());
|
||||
sb.append("?mcc=").append(merchantBaseInfo.getMcc());
|
||||
sb.append("?mccName=").append(merchantBaseInfo.getMccName());
|
||||
sb.append("&mcc=").append(merchantBaseInfo.getMcc());
|
||||
sb.append("&mccName=").append(merchantBaseInfo.getMccName());
|
||||
sb.append("&password=").append(userInfo.getPassword().toLowerCase());
|
||||
sb.append("&mobile=").append(userInfo.getLoginName());
|
||||
sb.append("&syb_m_id=").append(merchantStore.getId());
|
||||
|
||||
@@ -1934,7 +1934,7 @@ public class UserAppServiceImpl extends ServiceImpl<UserAppMapper, UserApp> impl
|
||||
userInfo.setId(userApp.getUserId());
|
||||
UserInfo userInfos = userInfoService.queryUserInfo(userInfo);
|
||||
if(ObjectUtil.isEmpty(userInfos)){
|
||||
MsgException.checkNull(null,"用户信息不存在");
|
||||
MsgException.checkNull(null,"商户信息不存在");
|
||||
}
|
||||
|
||||
PhoneValidateCode phoneValidateCode = new PhoneValidateCode();
|
||||
@@ -1956,14 +1956,9 @@ public class UserAppServiceImpl extends ServiceImpl<UserAppMapper, UserApp> impl
|
||||
|
||||
MerchantBaseInfo baseInfo= merchantBaseInfoService.getMerchantBaseInfoByUserId(userInfos.getId().toString());
|
||||
if(ObjectUtil.isEmpty(baseInfo)){
|
||||
MsgException.checkNull(null,"商户信息不存在");
|
||||
MsgException.checkNull(null,"请先进行商户认证");
|
||||
}
|
||||
|
||||
if(!"1".equals(baseInfo.getMerchantType())){
|
||||
MsgException.checkNull(null,"非小微不允许升级创客");
|
||||
}
|
||||
|
||||
|
||||
|
||||
UserMarker marker= userMarkerMapper.selectById(userApp.getUserId());
|
||||
if(ObjectUtil.isNotEmpty(marker)){
|
||||
|
||||
Reference in New Issue
Block a user