拉卡拉进件通知加入mcc
This commit is contained in:
@@ -20,6 +20,7 @@ import cn.pluss.platform.user.impl.GeneralPushUtil;
|
|||||||
import cn.pluss.platform.userApp.UserAppService;
|
import cn.pluss.platform.userApp.UserAppService;
|
||||||
import cn.pluss.platform.util.IpUtils;
|
import cn.pluss.platform.util.IpUtils;
|
||||||
import cn.pluss.platform.util.LogExceptionUtils;
|
import cn.pluss.platform.util.LogExceptionUtils;
|
||||||
|
import cn.pluss.platform.util.ParametersUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
@@ -39,10 +40,7 @@ import org.springframework.web.client.RestTemplate;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.Collections;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
@@ -364,14 +362,21 @@ public class LklMerAuditHandler {
|
|||||||
UserInfo userInfo = userInfoMapper.selectById(userApp.getUserId());
|
UserInfo userInfo = userInfoMapper.selectById(userApp.getUserId());
|
||||||
log.info("==============>当前需要同步的用户进件数据为::{}<===================", JSONObject.toJSONString(merchantChannelStatus));
|
log.info("==============>当前需要同步的用户进件数据为::{}<===================", JSONObject.toJSONString(merchantChannelStatus));
|
||||||
if (userInfo != null) {
|
if (userInfo != null) {
|
||||||
MerchantStore merchantStore = new MerchantStore().setMerchantCode(merchantChannelStatus.getMerchantCode());
|
QueryWrapper storQueryWrapper= new QueryWrapper<>();
|
||||||
merchantStore = merchantStoreMapper.selectOne(new QueryWrapper<>(merchantStore));
|
storQueryWrapper.eq("merchantCode",merchantChannelStatus.getMerchantCode());
|
||||||
|
MerchantStore merchantStore = merchantStoreMapper.selectOne(storQueryWrapper);
|
||||||
MerchantBaseInfo merchantBaseInfo = merchantBaseInfoService.getMerchantBaseInfoByMerchantCode(merchantChannelStatus.getMerchantCode());
|
MerchantBaseInfo merchantBaseInfo = merchantBaseInfoService.getMerchantBaseInfoByMerchantCode(merchantChannelStatus.getMerchantCode());
|
||||||
QueryWrapper<MerchantImage> queryWrapper = new QueryWrapper<MerchantImage>()
|
QueryWrapper<MerchantImage> queryWrapper = new QueryWrapper<MerchantImage>()
|
||||||
.eq("merchantCode", merchantChannelStatus.getMerchantCode()).eq("photoType", "06");
|
.eq("merchantCode", merchantChannelStatus.getMerchantCode()).eq("photoType", "06");
|
||||||
MerchantImage merchantImage = merchantImageMapper.selectOne(queryWrapper);
|
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://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";
|
List<String> mccList = ParametersUtil.url;
|
||||||
|
if(ObjectUtil.isEmpty(mccList)||mccList.size()<=0){
|
||||||
|
log.error("没有配置对应的通之地址");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mccList.stream().parallel().forEach(it->{
|
||||||
|
String baseUrl = it.toString();
|
||||||
StringBuilder sb = new StringBuilder(baseUrl);
|
StringBuilder sb = new StringBuilder(baseUrl);
|
||||||
sb.append("?title=").append(merchantBaseInfo.getAlias());
|
sb.append("?title=").append(merchantBaseInfo.getAlias());
|
||||||
sb.append("&password=").append(userInfo.getPassword().toLowerCase());
|
sb.append("&password=").append(userInfo.getPassword().toLowerCase());
|
||||||
@@ -402,6 +407,7 @@ public class LklMerAuditHandler {
|
|||||||
// 请求生成店铺j
|
// 请求生成店铺j
|
||||||
String result = restTemplate.getForObject(sb.toString(), String.class);
|
String result = restTemplate.getForObject(sb.toString(), String.class);
|
||||||
log.info("=============>请求生成店铺URL:{},请求响应返回的参数为:{}<===============", sb.toString(), result);
|
log.info("=============>请求生成店铺URL:{},请求响应返回的参数为:{}<===============", sb.toString(), result);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user