|
@@ -107,9 +107,7 @@ public class WechatController {
|
|
|
JsonNode jsonNode = mapper.readTree(response);
|
|
JsonNode jsonNode = mapper.readTree(response);
|
|
|
String openid = jsonNode.get("openid").asText();
|
|
String openid = jsonNode.get("openid").asText();
|
|
|
|
|
|
|
|
- // System.out.println("redirect:" + wechatConfig.getFontendUrl() + "/#/pages/Pay/pay/?openId=" + openid);
|
|
|
|
|
return "redirect:" + wechatConfig.getFontendUrl() + "/#/" + state + "/?openId=" + openid;
|
|
return "redirect:" + wechatConfig.getFontendUrl() + "/#/" + state + "/?openId=" + openid;
|
|
|
- // return "redirect:" + "http://192.168.161.182:8080/jiaofei/jiaofeiH5/" + state + "/?openId=" + openid;
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
return "redirect:" + wechatConfig.getFontendUrl() + "/error/?errorMsg=获取用户openId失败";
|
|
return "redirect:" + wechatConfig.getFontendUrl() + "/error/?errorMsg=获取用户openId失败";
|
|
|
}
|
|
}
|
|
@@ -198,10 +196,49 @@ public class WechatController {
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 通过学生姓名 身份证查找用户的cardNumber
|
|
|
|
|
+ * @param studentName
|
|
|
|
|
+ * @param idCard
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("getWeiXiaoToken1")
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public String getCardNumber(String studentName, String idCard) {
|
|
|
|
|
+ String card_number = "";
|
|
|
|
|
+ try {
|
|
|
|
|
+ RestTemplate client = new RestTemplate();
|
|
|
|
|
+ ObjectMapper mapper = new ObjectMapper();
|
|
|
|
|
+ String userInfoUrl ="https://open.wecard.qq.com/cgi-bin/user/search";
|
|
|
|
|
+ Map<String, String> userInfoParam = new HashMap<>();
|
|
|
|
|
+ userInfoParam.put("access_token", accessTokenPublic);
|
|
|
|
|
+ userInfoParam.put("keywords", studentName);
|
|
|
|
|
+ ResponseEntity<String> userInfoResponse = client.postForEntity(userInfoUrl, userInfoParam, String.class);
|
|
|
|
|
+ JSONObject jsonObj = JSON.parseObject(userInfoResponse.getBody());
|
|
|
|
|
+ JSONArray userlist = jsonObj.getJSONArray("userlist");
|
|
|
|
|
|
|
|
|
|
+ Map<String, Object> userInfoMap = mapper.readValue(userlist.get(0).toString(), new TypeReference<Map<String, Object>>() {
|
|
|
|
|
+ });
|
|
|
|
|
+ String id_card = "";
|
|
|
|
|
+ if (userInfoMap.get("card_number") != null) {
|
|
|
|
|
+ card_number = userInfoMap.get("card_number").toString();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (userInfoMap.get("id_card") != null) {
|
|
|
|
|
+ id_card = userInfoMap.get("id_card").toString();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (idCard.equals(id_card)) {
|
|
|
|
|
+ return card_number;
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ return card_number;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
public PayableInfoStudentResultVO queryStudent() {
|
|
public PayableInfoStudentResultVO queryStudent() {
|
|
|
PayableInfoStudentResultVO payableInfoStudentResultVO = new PayableInfoStudentResultVO();
|
|
PayableInfoStudentResultVO payableInfoStudentResultVO = new PayableInfoStudentResultVO();
|
|
|
try {
|
|
try {
|
|
@@ -266,7 +303,7 @@ public class WechatController {
|
|
|
weixiaoVO.setCardNumberList(cardNumberList);
|
|
weixiaoVO.setCardNumberList(cardNumberList);
|
|
|
weixiaoVO.setTitle(itemName + "缴纳通知");
|
|
weixiaoVO.setTitle(itemName + "缴纳通知");
|
|
|
weixiaoVO.setSender("财务办公室");
|
|
weixiaoVO.setSender("财务办公室");
|
|
|
- weixiaoVO.setContent("同学你好," + weixiaoVO.getTitle() + "缴费已经开始,请尽快查看缴费详情完成缴费,谢谢合作!");
|
|
|
|
|
|
|
+ weixiaoVO.setContent("同学你好," + itemName + "缴费已经开始,请尽快查看缴费详情完成缴费,谢谢合作!");
|
|
|
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(weixiaoVO);
|
|
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(weixiaoVO);
|
|
|
return notice(jsonObject);
|
|
return notice(jsonObject);
|
|
|
}
|
|
}
|
|
@@ -309,7 +346,7 @@ public class WechatController {
|
|
|
weixiaoVO.setCardNumberList(cardNumberList);
|
|
weixiaoVO.setCardNumberList(cardNumberList);
|
|
|
weixiaoVO.setTitle(itemName + "催缴通知");
|
|
weixiaoVO.setTitle(itemName + "催缴通知");
|
|
|
weixiaoVO.setSender("财务办公室");
|
|
weixiaoVO.setSender("财务办公室");
|
|
|
- weixiaoVO.setContent("同学你好," + weixiaoVO.getTitle() + "缴费已经开始,请尽快查看缴费详情完成缴费,谢谢合作!");
|
|
|
|
|
|
|
+ weixiaoVO.setContent("同学你好," + itemName + "缴费已经开始,请尽快查看缴费详情完成缴费,谢谢合作!");
|
|
|
JSONObject json = (JSONObject) JSONObject.toJSON(weixiaoVO);
|
|
JSONObject json = (JSONObject) JSONObject.toJSON(weixiaoVO);
|
|
|
return notice(json);
|
|
return notice(json);
|
|
|
|
|
|
|
@@ -374,7 +411,7 @@ public class WechatController {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
weixiaoVO.setCardNumberList(cardNumberList);
|
|
weixiaoVO.setCardNumberList(cardNumberList);
|
|
|
- weixiaoVO.setContent("同学你好,你的" + weixiaoVO.getTitle() + "缴费订单异常缴费失败,请尽快查看缴费详情,并再次缴费。若为系统原因,请及时反馈!");
|
|
|
|
|
|
|
+ weixiaoVO.setContent("同学你好,你的" + itemName + "缴费订单异常缴费失败,请尽快查看缴费详情,并再次缴费。若为系统原因,请及时反馈!");
|
|
|
weixiaoVO.setSender("财务办公室");
|
|
weixiaoVO.setSender("财务办公室");
|
|
|
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(weixiaoVO);
|
|
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(weixiaoVO);
|
|
|
notice(jsonObject);
|
|
notice(jsonObject);
|
|
@@ -388,8 +425,8 @@ public class WechatController {
|
|
|
/**
|
|
/**
|
|
|
* 每天执行一次催缴 下午15点
|
|
* 每天执行一次催缴 下午15点
|
|
|
*/
|
|
*/
|
|
|
-// @Scheduled(fixedDelay = 20000)
|
|
|
|
|
- @Scheduled(cron = "0 0 15 * * ?")
|
|
|
|
|
|
|
+ @Scheduled(fixedDelay = 20000)
|
|
|
|
|
+ // @Scheduled(cron = "0 0 15 * * ?")
|
|
|
public void autoTiming() {
|
|
public void autoTiming() {
|
|
|
|
|
|
|
|
List<PayItem> payItemList = payItemService.list();
|
|
List<PayItem> payItemList = payItemService.list();
|