提交 c5302c8c 作者: han

公众号提现以及飞手认证公众号提醒修改BUG

上级 514ec5e5
...@@ -111,4 +111,10 @@ public class WxController extends BaseController { ...@@ -111,4 +111,10 @@ public class WxController extends BaseController {
public ResultBody moveSubUserUnionIdToTest() { public ResultBody moveSubUserUnionIdToTest() {
return wxService.moveSubUserUnionIdToTest(); return wxService.moveSubUserUnionIdToTest();
} }
@ApiOperation(value = "同步微信公众号用户数据")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("moveSubUser")
public ResultBody moveSubUser() {
return wxService.moveSubUser();
}
} }
...@@ -109,6 +109,8 @@ public interface WxService { ...@@ -109,6 +109,8 @@ public interface WxService {
ResultBody moveSubUserUnionIdToTest(); ResultBody moveSubUserUnionIdToTest();
ResultBody moveSubUser();
ResultBody getUserPortrait(); ResultBody getUserPortrait();
} }
...@@ -316,11 +316,13 @@ public class PilotCertificationServiceImpl implements PilotCertificationService ...@@ -316,11 +316,13 @@ public class PilotCertificationServiceImpl implements PilotCertificationService
String unionId = userAccountDO.getUnionId(); String unionId = userAccountDO.getUnionId();
// 查询对应的openId(touser) // 查询对应的openId(touser)
String touser = userSubInfoDao.getUserOpenidByUnionId(unionId); String touser = userSubInfoDao.getUserOpenidByUnionId(unionId);
JSONObject jsonObject = spellMsg("飞手执照及能力认证","审核通过"); if(touser != null){
ws.setTouser(touser); JSONObject jsonObject = spellMsg("飞手执照及能力认证","审核通过");
ws.setTemplateId("9qvgBhfW9yoQJY91iMfhrog8y5eZUPSbo9PLvQzS_vk"); ws.setTouser(touser);
ws.setDataObject(jsonObject); ws.setTemplateId("9qvgBhfW9yoQJY91iMfhrog8y5eZUPSbo9PLvQzS_vk");
wxService.sendSubTemplateMsg(ws); ws.setDataObject(jsonObject);
wxService.sendSubTemplateMsg(ws);
}
} }
PilotCertificationLogDO pilotCertificationLog = new PilotCertificationLogDO(userAccountDO.getId(), userLoginInfoFromRedis.getUserAccountId(), CertificationMessage.match(param.getAuditStatus())); PilotCertificationLogDO pilotCertificationLog = new PilotCertificationLogDO(userAccountDO.getId(), userLoginInfoFromRedis.getUserAccountId(), CertificationMessage.match(param.getAuditStatus()));
......
...@@ -389,7 +389,7 @@ public class WxServiceImpl implements WxService { ...@@ -389,7 +389,7 @@ public class WxServiceImpl implements WxService {
@Override @Override
public ResultBody moveSubUserUnionIdToTest() { public ResultBody moveSubUserUnionIdToTest() {
String accessToken = this.getSubStableAccessToken(); String accessToken = this.getSubStableAccessToken();
String url = "https://api.weixin.qq.com/cgi-bin/user/get?access_token=" + accessToken + "&next_openid=" + "oB6kk6obNektxM62mjj9PJHPtcME"; String url = "https://api.weixin.qq.com/cgi-bin/user/get?access_token=" + accessToken;
String jsonStr = HttpsRequestUtil.httpsGet(url, null); String jsonStr = HttpsRequestUtil.httpsGet(url, null);
log.info("all users:{}", jsonStr); log.info("all users:{}", jsonStr);
JSONObject obj = JSONObject.parseObject(jsonStr); JSONObject obj = JSONObject.parseObject(jsonStr);
...@@ -397,7 +397,7 @@ public class WxServiceImpl implements WxService { ...@@ -397,7 +397,7 @@ public class WxServiceImpl implements WxService {
int count = 0; int count = 0;
for (String openid : lists) { for (String openid : lists) {
UserSubInfoDO userSubInfo = userSubInfoDao.getUserSubInfo(openid); UserSubInfoDO userSubInfo = userSubInfoDao.getUserSubInfo(openid);
if (userSubInfo != null) { if (userSubInfo != null && userSubInfo.getUnionId() == null ) {
String InfoUrl = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=" + accessToken + "&openid=" + openid String InfoUrl = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=" + accessToken + "&openid=" + openid
+ "&lang=zh_CN"; + "&lang=zh_CN";
String jsonStr1 = HttpsRequestUtil.httpsGet(InfoUrl, null); String jsonStr1 = HttpsRequestUtil.httpsGet(InfoUrl, null);
...@@ -410,7 +410,35 @@ public class WxServiceImpl implements WxService { ...@@ -410,7 +410,35 @@ public class WxServiceImpl implements WxService {
log.info("User count: {}", count); log.info("User count: {}", count);
return ResultBody.success(); return ResultBody.success();
} }
@Override
public ResultBody moveSubUser() {
String accessToken = this.getSubStableAccessToken();
String url = "https://api.weixin.qq.com/cgi-bin/user/get?access_token=" + accessToken;
String jsonStr = HttpsRequestUtil.httpsGet(url, null);
log.info("all users:{}", jsonStr);
JSONObject obj = JSONObject.parseObject(jsonStr);
List<String> lists = JSONArray.parseArray(obj.getJSONObject("data").get("openid").toString(), String.class);
int count = 0;
for (String openid : lists) {
Integer integer = userSubInfoDao.countUserSubInfo(openid);
if (integer == 0) {
count++;
UserSubInfoDO sub = new UserSubInfoDO();
sub.setOpenId(openid);
sub.setRegStatus(1);
sub.setDeleted(0);
sub.setCreateTime(new Date());
String InfoUrl = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=" + accessToken + "&openid=" + openid
+ "&lang=zh_CN";
String jsonStr1 = HttpsRequestUtil.httpsGet(InfoUrl, null);
JSONObject obj1 = JSONObject.parseObject(jsonStr1);
sub.setUnionId(obj1.getString("unionid"));
userSubInfoDao.insertUserSubInfo(sub);
}
}
log.info("User count: {}", count);
return ResultBody.success();
}
@Override @Override
public ResultBody getUserPortrait() { public ResultBody getUserPortrait() {
......
...@@ -255,12 +255,15 @@ public class WithdrawalServiceImpl implements WithdrawalService { ...@@ -255,12 +255,15 @@ public class WithdrawalServiceImpl implements WithdrawalService {
WxMsgVO ws = new WxMsgVO(); WxMsgVO ws = new WxMsgVO();
String unionId = userServiceDao.getUserAccountById(applyInfo.getUserAccountId()).getUnionId(); String unionId = userServiceDao.getUserAccountById(applyInfo.getUserAccountId()).getUnionId();
// 查询对应的openId(touser) // 查询对应的openId(touser)
String touser = userSubInfoDao.getUserSubInfoByUnionId(unionId).getOpenId(); UserSubInfoDO info = userSubInfoDao.getUserSubInfoByUnionId(unionId);
JSONObject jsonObject = spellMsg(applyInfo.getEmpName(), applyInfo.getPayAmount(), applyInfo.getPayAccount()); if(info != null && info.getOpenId() != null){
ws.setTouser(touser); String touser = info.getOpenId();
ws.setTemplateId("y6PHvZownxqR5hf4dSXaa2Lp1jeq3ccytd6G-kUQla4"); JSONObject jsonObject = spellMsg(applyInfo.getEmpName(), applyInfo.getPayAmount(), applyInfo.getPayAccount());
ws.setDataObject(jsonObject); ws.setTouser(touser);
wxService.sendSubTemplateMsg(ws); ws.setTemplateId("y6PHvZownxqR5hf4dSXaa2Lp1jeq3ccytd6G-kUQla4");
ws.setDataObject(jsonObject);
wxService.sendSubTemplateMsg(ws);
}
return ResultBody.success(); return ResultBody.success();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论