Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner
This commit is contained in:
@@ -208,10 +208,10 @@
|
||||
update hy_partner_base_info
|
||||
<set>
|
||||
<if test="userName != null and userName!=''">
|
||||
username = #{record.username},
|
||||
username = #{userName},
|
||||
</if>
|
||||
<if test="mobile != null and mobile!=''">
|
||||
mobile = #{record.mobile},
|
||||
mobile = #{mobile},
|
||||
</if>
|
||||
where partner_id = #{partnerId}
|
||||
</set>
|
||||
|
||||
@@ -246,7 +246,7 @@
|
||||
</select>
|
||||
|
||||
<select id="getInterviewList" resultType="com.cool.store.vo.interview.InterviewVO">
|
||||
select hpip.id as interviewId,
|
||||
select hpip.id as interviewPlanId,
|
||||
hpui.username as partnerName,
|
||||
hpui.mobile as partnerMobile,
|
||||
hpip.room_id as roomId,
|
||||
|
||||
@@ -1,23 +1,18 @@
|
||||
package com.cool.store.http;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dto.response.ResultDTO;
|
||||
import com.cool.store.dto.wx.CodeSessionDTO;
|
||||
import com.cool.store.dto.wx.PhoneInfoDTO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mq.util.HttpRestTemplateService;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.utils.RestTemplateUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
@@ -46,20 +41,19 @@ public class WechatRest {
|
||||
|
||||
|
||||
public CodeSessionDTO miniProgramJsCodeSession(String appId, String secret, String jsCode){
|
||||
log.info("WechatRest#miniProgramJsCodeSession, jsCode:{}", jsCode);
|
||||
String url = "https://api.weixin.qq.com/sns/jscode2session";
|
||||
HashMap requestMap = new HashMap();
|
||||
requestMap.put("appid", appId);
|
||||
requestMap.put("secret", secret);
|
||||
requestMap.put("js_code", jsCode);
|
||||
requestMap.put("grant_type","authorization_code");
|
||||
ResponseEntity<CodeSessionDTO> responseEntity = null;
|
||||
try {
|
||||
responseEntity = RestTemplateUtil.loadGet(url, CodeSessionDTO.class);
|
||||
log.info("WechatRest#miniProgramJsCodeSession, url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||
if(Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()){
|
||||
return responseEntity.getBody();
|
||||
String responseStr = httpRestTemplateService.getForObject(url, String.class ,requestMap);
|
||||
log.info("WechatRest#miniProgramJsCodeSession, url:{}, response:{}", url, responseStr);
|
||||
if(StringUtils.isNotBlank(responseStr)){
|
||||
return JSONObject.parseObject(responseStr, CodeSessionDTO.class);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.info("调用微信服务异常{}", e);
|
||||
throw new ServiceException(ErrorCodeEnum.WX_SERVICE_ERROR);
|
||||
@@ -76,13 +70,12 @@ public class WechatRest {
|
||||
String reqUrl = String.format(ACCESS_TOKEN, appId, secret);
|
||||
JSONObject jsonObject = null;
|
||||
try {
|
||||
jsonObject = httpRestTemplateService.getForObject(reqUrl, JSONObject.class, null);
|
||||
jsonObject = httpRestTemplateService.getForObject(reqUrl, JSONObject.class, new HashMap());
|
||||
log.info("WechatRest#getAccessToken, reqUrl:{}, response:{}", reqUrl, JSONObject.toJSONString(jsonObject));
|
||||
String token = jsonObject.getString("access_token");
|
||||
if (StringUtils.isBlank(token)) {
|
||||
throw new ServiceException(ErrorCodeEnum.GET_ACCESSTOKEN_ERROR);
|
||||
}
|
||||
|
||||
redisUtilPool.setString(cacheAccessToken, token, 7000);
|
||||
accessToken = token;
|
||||
} catch (Exception e) {
|
||||
@@ -96,14 +89,17 @@ public class WechatRest {
|
||||
String reqUrl = String.format(GET_USERPHONENUMBER, accessToken);
|
||||
HashMap requestMap = new HashMap();
|
||||
requestMap.put("code", code);
|
||||
PhoneInfoDTO phoneInfoDTO = null;
|
||||
String responseStr = null;
|
||||
try {
|
||||
phoneInfoDTO = httpRestTemplateService.postForObject(reqUrl, requestMap, PhoneInfoDTO.class);
|
||||
log.info("WechatRest#getUserPhoneNumber, reqUrl:{}, response:{}", reqUrl, JSONObject.toJSONString(phoneInfoDTO));
|
||||
responseStr = httpRestTemplateService.postForObject(reqUrl, requestMap, String.class);
|
||||
log.info("WechatRest#getUserPhoneNumber, reqUrl:{}, response:{}", reqUrl, responseStr);
|
||||
if(StringUtils.isNotBlank(responseStr)){
|
||||
return JSONObject.parseObject(responseStr, PhoneInfoDTO.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("获取手机号异常", e);
|
||||
}
|
||||
return phoneInfoDTO;
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.HyPartnerLineInfoDAO;
|
||||
@@ -62,6 +63,7 @@ public class WechatMiniAppServiceImpl implements WechatMiniAppService {
|
||||
|
||||
@Override
|
||||
public PartnerUserInfoVO miniProgramLogin(MiniProgramLoginDTO param) {
|
||||
log.info("miniProgramLogin #param {}", JSONObject.toJSONString(param));
|
||||
PartnerUserInfoVO userInfoVO = new PartnerUserInfoVO();
|
||||
String jsCode = param.getJsCode();
|
||||
String lockKey = "codeSession:" + wxAppId + CommonConstants.MOSAICS + jsCode;
|
||||
@@ -76,12 +78,12 @@ public class WechatMiniAppServiceImpl implements WechatMiniAppService {
|
||||
String unionId = codeSession.getUnionId();
|
||||
log.info("小程序登录:{}", unionId);
|
||||
log.info("sessionKey {}", codeSession.getSessionKey());
|
||||
String decryptUser = AesUtil.decryptWechat(codeSession.getSessionKey(), param.getEncryptedData(), param.getIvStr());
|
||||
/* String decryptUser = AesUtil.decryptWechat(codeSession.getSessionKey(), param.getEncryptedData(), param.getIvStr());
|
||||
log.info("解密用户信息:{}", decryptUser);
|
||||
MiniProgramUserVO miniProgramUser = JSON.parseObject(decryptUser, MiniProgramUserVO.class);
|
||||
if (Objects.isNull(miniProgramUser)) {
|
||||
throw new ServiceException(ErrorCodeEnum.GET_WECHAT_USER_INFO_FAIL);
|
||||
}
|
||||
}*/
|
||||
// 获取小程序token
|
||||
String accessToken = wechatRest.getAccessToken(wxAppId, wxAppSecret);
|
||||
// 获取手机号码
|
||||
@@ -91,8 +93,10 @@ public class WechatMiniAppServiceImpl implements WechatMiniAppService {
|
||||
if(hyPartnerUserInfoDO == null){
|
||||
hyPartnerUserInfoDO = new HyPartnerUserInfoDO();
|
||||
hyPartnerUserInfoDO.setMobile(phoneInfoDTO.getPhoneInfo().getPhoneNumber());
|
||||
hyPartnerUserInfoDO.setUsername(miniProgramUser.getNickName());
|
||||
// hyPartnerUserInfoDO.setUsername(phoneInfoDTO.getPhoneInfo().getPhoneNumber());
|
||||
hyPartnerUserInfoDO.setPartnerId(UUIDUtils.get32UUID());
|
||||
hyPartnerUserInfoDO.setAcceptAdjustType(0);
|
||||
hyPartnerUserInfoDO.setIsWritePartnerKnow(0);
|
||||
hyPartnerUserInfoDAO.insertSelective(hyPartnerUserInfoDO);
|
||||
// 生成一条线索 也可在提交加盟信息时插入
|
||||
HyPartnerLineInfoDO hyPartnerLineInfoDO = new HyPartnerLineInfoDO();
|
||||
|
||||
@@ -29,4 +29,11 @@ public class FlowController {
|
||||
flowService.createQualifyVerify(request);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("/qualificationReview/callback")
|
||||
@ApiOperation("流程信息回调接口")
|
||||
public ResponseResult qualificationCallback() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -49,7 +49,6 @@ public class SignValidateFilter implements Filter {
|
||||
|
||||
private static List<String> patternList =
|
||||
Lists.newArrayList("/web/check/ok","/check/ok",
|
||||
"/partner/mini/program/v1/partnerManage/miniProgram/login",
|
||||
"/partner/mini/program/doc.html","/partner/mini/program/v2/api-docs","/**/test/**",
|
||||
"/partner/mini/program/oss/getUploadFileConfig",
|
||||
"/partner/mini/program/v1/partnerManage/partner/getIdentityCardInfo",
|
||||
@@ -87,7 +86,7 @@ public class SignValidateFilter implements Filter {
|
||||
String userStr = "";
|
||||
boolean isInWhiteList = excludePath(uri);
|
||||
log.info("url:{}", uri);
|
||||
if ( !isInWhiteList && !method.equals("OPTIONS")) {
|
||||
/* if ( !isInWhiteList && !method.equals("OPTIONS")) {
|
||||
Map<String, String[]> parameterMap = request.getParameterMap();
|
||||
String jsonStr = JSONObject.toJSONString(parameterMap);
|
||||
JSONObject obj = JSONObject.parseObject(jsonStr);
|
||||
@@ -116,7 +115,7 @@ public class SignValidateFilter implements Filter {
|
||||
userStr = JSONObject.toJSONString(partnerUserInfoVO);
|
||||
log.info("url:{}, userStr:{}", uri, userStr);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
try {
|
||||
PartnerUserHolder.setUser(userStr);
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
|
||||
@@ -56,7 +56,7 @@ cdn.url=https://testhsaypic.coolstore.cn
|
||||
trtc.sdkAppId=1400811820
|
||||
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
|
||||
|
||||
weixin.appId=wx6f984e535e571818
|
||||
weixin.appSecret=245a483747e6e9f8762d3e8539cf0318
|
||||
weixin.appId=wxb2a0addf956ad4b7
|
||||
weixin.appSecret=77abdcae754add92889566b543e5ad79
|
||||
|
||||
signKey=77fea013c3a6459685b83c21a2fc3411
|
||||
@@ -53,7 +53,7 @@ corp.id = 171cddee76471740
|
||||
trtc.sdkAppId=1400811820
|
||||
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
|
||||
|
||||
weixin.appId=wx6f984e535e571818
|
||||
weixin.appSecret=245a483747e6e9f8762d3e8539cf0318
|
||||
weixin.appId=wxb2a0addf956ad4b7
|
||||
weixin.appSecret=77abdcae754add92889566b543e5ad79
|
||||
|
||||
signKey=77fea013c3a6459685b83c21a2fc3411
|
||||
@@ -51,7 +51,7 @@ corp.id = 171cddee76471740
|
||||
trtc.sdkAppId=1400811820
|
||||
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
|
||||
|
||||
weixin.appId=wx6f984e535e571818
|
||||
weixin.appSecret=245a483747e6e9f8762d3e8539cf0318
|
||||
weixin.appId=wxb2a0addf956ad4b7
|
||||
weixin.appSecret=77abdcae754add92889566b543e5ad79
|
||||
|
||||
signKey=d851f2a9ac90474abecdc2fbb148d4d7
|
||||
@@ -60,7 +60,7 @@ cdn.url=https://testhsaypic.coolstore.cn
|
||||
trtc.sdkAppId=1400811820
|
||||
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
|
||||
|
||||
weixin.appId=wx6f984e535e571818
|
||||
weixin.appSecret=245a483747e6e9f8762d3e8539cf0318
|
||||
weixin.appId=wxb2a0addf956ad4b7
|
||||
weixin.appSecret=77abdcae754add92889566b543e5ad79
|
||||
|
||||
signKey=77fea013c3a6459685b83c21a2fc3411
|
||||
@@ -51,7 +51,7 @@ corp.id = 171cddee76471740
|
||||
trtc.sdkAppId=1400811820
|
||||
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
|
||||
|
||||
weixin.appId=wx6f984e535e571818
|
||||
weixin.appSecret=245a483747e6e9f8762d3e8539cf0318
|
||||
weixin.appId=wxb2a0addf956ad4b7
|
||||
weixin.appSecret=77abdcae754add92889566b543e5ad79
|
||||
|
||||
signKey=d851f2a9ac90474abecdc2fbb148d4d7
|
||||
@@ -51,7 +51,7 @@ corp.id = 171cddee76471740
|
||||
trtc.sdkAppId=1400811820
|
||||
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
|
||||
|
||||
weixin.appId=wx6f984e535e571818
|
||||
weixin.appSecret=245a483747e6e9f8762d3e8539cf0318
|
||||
weixin.appId=wxb2a0addf956ad4b7
|
||||
weixin.appSecret=77abdcae754add92889566b543e5ad79
|
||||
|
||||
signKey=d851f2a9ac90474abecdc2fbb148d4d7
|
||||
@@ -51,7 +51,7 @@ corp.id = 171cddee76471740
|
||||
trtc.sdkAppId=1400811820
|
||||
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
|
||||
|
||||
weixin.appId=wx6f984e535e571818
|
||||
weixin.appSecret=245a483747e6e9f8762d3e8539cf0318
|
||||
weixin.appId=wxb2a0addf956ad4b7
|
||||
weixin.appSecret=77abdcae754add92889566b543e5ad79
|
||||
|
||||
signKey=77fea013c3a6459685b83c21a2fc3411
|
||||
Binary file not shown.
Reference in New Issue
Block a user