|
@@ -549,6 +549,7 @@ public class WeiXinCorpController {
|
|
}
|
|
}
|
|
userMapper.updateById(userUpdate);
|
|
userMapper.updateById(userUpdate);
|
|
System.out.println("======关注时更新人员======");
|
|
System.out.println("======关注时更新人员======");
|
|
|
|
+ sendCardMsg(corpWxUserId);
|
|
}).start();
|
|
}).start();
|
|
}
|
|
}
|
|
} else if ("enter_agent".equals(event)) {
|
|
} else if ("enter_agent".equals(event)) {
|
|
@@ -673,6 +674,7 @@ public class WeiXinCorpController {
|
|
}
|
|
}
|
|
userMapper.updateById(userUpdate);
|
|
userMapper.updateById(userUpdate);
|
|
System.out.println("======更新人员======");
|
|
System.out.println("======更新人员======");
|
|
|
|
+ sendCardMsg(authUserId);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1508,6 +1510,7 @@ public class WeiXinCorpController {
|
|
}else {
|
|
}else {
|
|
System.out.println("未查询到该新建公司有支付订单");
|
|
System.out.println("未查询到该新建公司有支付订单");
|
|
}
|
|
}
|
|
|
|
+ sendCardMsg(openUserId);
|
|
} else {
|
|
} else {
|
|
//企业已经存在
|
|
//企业已经存在
|
|
Integer companyId = data.getCompanyId();
|
|
Integer companyId = data.getCompanyId();
|
|
@@ -1570,6 +1573,7 @@ public class WeiXinCorpController {
|
|
.setJobNumber(openUserId.equals(userId)?null:userId);//工号就是企业微信的用户ID
|
|
.setJobNumber(openUserId.equals(userId)?null:userId);//工号就是企业微信的用户ID
|
|
userMapper.insert(user);
|
|
userMapper.insert(user);
|
|
}
|
|
}
|
|
|
|
+ sendCardMsg(openUserId);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -3603,4 +3607,42 @@ public class WeiXinCorpController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @RequestMapping("/sendCardMsg")
|
|
|
|
+ public HttpRespMsg sendCardMsg(String corpwxOpenId) {
|
|
|
|
+ User user = userMapper.selectOne(new QueryWrapper<User>().eq("corpwx_userid", corpwxOpenId));
|
|
|
|
+ WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
|
|
|
|
+ JSONObject data = new JSONObject();
|
|
|
|
+ data.put("card_type", "news_notice");
|
|
|
|
+ JSONObject mainTitle = new JSONObject();
|
|
|
|
+ mainTitle.put("title", "工时管家使用指南");
|
|
|
|
+ mainTitle.put("desc", "欢迎使用工时管家,点击查看工时管家使用指南");
|
|
|
|
+ data.put("main_title", mainTitle);
|
|
|
|
+ JSONObject cardImg = new JSONObject();
|
|
|
|
+ cardImg.put("url", "http://www.ttkuaiban.com/card_img.png");
|
|
|
|
+ cardImg.put("aspect_ratio", 2.23);
|
|
|
|
+ data.put("card_image", cardImg);
|
|
|
|
+ JSONArray array = new JSONArray();
|
|
|
|
+ JSONObject docItem = new JSONObject();
|
|
|
|
+ docItem.put("type", 1);
|
|
|
|
+ docItem.put("title", "使用指南");
|
|
|
|
+ docItem.put("url", "https://doc.weixin.qq.com/doc/w3_AQAACQauAEA1Ucywi0bQGy7XLaYYE?scode=AMsA1AfkAAgde2tFhrAFIAdQbyAPU");
|
|
|
|
+ array.add(docItem);
|
|
|
|
+ JSONObject enterItem = new JSONObject();
|
|
|
|
+ enterItem.put("type", 1);
|
|
|
|
+ enterItem.put("title", "进入应用");
|
|
|
|
+ enterItem.put("url", "https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");
|
|
|
|
+ array.add(enterItem);
|
|
|
|
+ data.put("jump_list", array);
|
|
|
|
+ JSONObject cardAction = new JSONObject();
|
|
|
|
+ cardAction.put("type", 1);
|
|
|
|
+ cardAction.put("url", "https://doc.weixin.qq.com/doc/w3_AQAACQauAEA1Ucywi0bQGy7XLaYYE?scode=AMsA1AfkAAgde2tFhrAFIAdQbyAPU");
|
|
|
|
+ data.put("card_action", cardAction);
|
|
|
|
+ if (!isDev) {
|
|
|
|
+ //正式环境下开启重复检查
|
|
|
|
+ data.put("enable_duplicate_check", 1);
|
|
|
|
+ }
|
|
|
|
+ wxCorpInfoService.sendWXCorpTemplateCardMsg(wxCorpInfo, corpwxOpenId, data);
|
|
|
|
+ return new HttpRespMsg();
|
|
|
|
+ }
|
|
}
|
|
}
|