|
@@ -23,106 +23,105 @@ import com.zskk.service.ServiceFactory;
|
|
|
import com.zskk.service.UserService;
|
|
|
|
|
|
/**
|
|
|
- * 将此 DemoController 在YourJFinalConfig 中注册路由,
|
|
|
- * 并设置好weixin开发者中心的 URL 与 token ,使 URL 指向该
|
|
|
- * DemoController 继承自父类 WeixinController 的 index
|
|
|
+ * 将此 DemoController 在YourJFinalConfig 中注册路由, 并设置好weixin开发者中心的 URL 与 token ,使
|
|
|
+ * URL 指向该 DemoController 继承自父类 WeixinController 的 index
|
|
|
* 方法即可直接运行看效果,在此基础之上修改相关的方法即可进行实际项目开发
|
|
|
*/
|
|
|
public class WeixinMsgController extends MsgControllerAdapter {
|
|
|
|
|
|
- @Override
|
|
|
- protected void processInTextMsg(InTextMsg inTextMsg) {
|
|
|
+ @Override
|
|
|
+ protected void processInTextMsg(InTextMsg inTextMsg) {
|
|
|
String msgContent = inTextMsg.getContent().trim();
|
|
|
|
|
|
- if ("演示".equalsIgnoreCase(msgContent)) {
|
|
|
-
|
|
|
- CustomServiceApi.sendText(inTextMsg.getFromUserName(), "【声明】为保证客户数据隐私安全,电子胶片示例涉及检查信息、用户信息、医疗机构信息等均已经过数据脱敏处理。\n通过以下途径了解更多或联系我们:\n官方网站:<a href=\"http://www.pacsonline.cn\">点击进入</a>\n咨询热线:010-53932350\n电子邮箱:company@pacsonline.cn\n您即将收到电子胶片示例,请点击下方消息查看,谢谢您的使用!");
|
|
|
+ if ("演示".equalsIgnoreCase(msgContent)) {
|
|
|
|
|
|
- String toUrlString = String.format("http://wechat.client.pacsonline.cn/#/reportInfo/report?openid=%s&exam_id=%s&study_id=%s","test","116edead589fa976","116edead577aac99");
|
|
|
+ CustomServiceApi.sendText(inTextMsg.getFromUserName(),
|
|
|
+ "【声明】为保证客户数据隐私安全,电子胶片示例涉及检查信息、用户信息、医疗机构信息等均已经过数据脱敏处理。\n通过以下途径了解更多或联系我们:\n官方网站:<a href=\"http://www.pacsonline.cn\">点击进入</a>\n咨询热线:010-53932350\n电子邮箱:company@pacsonline.cn\n您即将收到数字影像示例,请点击下方消息查看,谢谢您的使用!");
|
|
|
+
|
|
|
+ String toUrlString = String.format(
|
|
|
+ "http://wechat.client.pacsonline.cn/#/reportInfo/report?openid=%s&exam_id=%s&study_id=%s", "test",
|
|
|
+ "116edead589fa976", "116edead577aac99");
|
|
|
|
|
|
List<Articles> list = new ArrayList<Articles>();
|
|
|
Articles articles1 = new Articles();
|
|
|
- articles1.setTitle("【示例】点击查看本次影像和报告");
|
|
|
+ articles1.setTitle("【数字影像示例】点击查看本次影像和报告");
|
|
|
articles1.setDescription("欢迎使用中世康恺PacsOnline!\n点击进入查看详情,您可以分享给家属或医生,日后还可以在\"我的报告\"中查看本次影像和报告");
|
|
|
articles1.setPicurl("http://work.pacsonline.cn/static/img/banner.e8ee043.png");
|
|
|
articles1.setUrl(toUrlString);
|
|
|
list.add(articles1);
|
|
|
CustomServiceApi.sendNews(inTextMsg.getFromUserName(), list);
|
|
|
renderNull();
|
|
|
- }else if ("开通".equalsIgnoreCase(msgContent)) {
|
|
|
-
|
|
|
- CustomServiceApi.sendText(inTextMsg.getFromUserName(), "您已申请开通中世康恺新冠肺炎远程诊断服务,请点击下方链接进行报名,\n<a href=\"https://wj.qq.com/s2/5297050/807b/\">点击报名</a>\n后续我们将会以短信形式下发系统账号");
|
|
|
+ } else if ("开通".equalsIgnoreCase(msgContent)) {
|
|
|
|
|
|
- renderNull();
|
|
|
- }else {
|
|
|
- OutTextMsg outMsgs = new OutTextMsg(inTextMsg);
|
|
|
- outMsgs.setContent("欢迎关注中世康恺电子胶片平台!\n使用微信或者本公众号内的\"扫一扫\",扫描报告上的二维码,即可查看电子影像和报告\n如有疑问请拨打010-53932350");
|
|
|
- render(outMsgs);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected void processInVoiceMsg(InVoiceMsg inVoiceMsg) {
|
|
|
- OutTextMsg outMsg = new OutTextMsg(inVoiceMsg);
|
|
|
- outMsg.setContent("语音消息~");
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected void processInVideoMsg(InVideoMsg inVideoMsg) {
|
|
|
- OutTextMsg outMsg = new OutTextMsg(inVideoMsg);
|
|
|
- outMsg.setContent("接收视频消息~");
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected void processInShortVideoMsg(InShortVideoMsg inShortVideoMsg) {
|
|
|
- OutTextMsg outMsg = new OutTextMsg(inShortVideoMsg);
|
|
|
- outMsg.setContent("小视频消息~");
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected void processInLocationMsg(InLocationMsg inLocationMsg) {
|
|
|
- //转发给多客服PC客户端
|
|
|
- OutCustomMsg outCustomMsg = new OutCustomMsg(inLocationMsg);
|
|
|
- render(outCustomMsg);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected void processInLinkMsg(InLinkMsg inLinkMsg)
|
|
|
- {
|
|
|
- //转发给多客服PC客户端
|
|
|
- OutCustomMsg outCustomMsg = new OutCustomMsg(inLinkMsg);
|
|
|
- render(outCustomMsg);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected void processInCustomEvent(InCustomEvent inCustomEvent)
|
|
|
- {
|
|
|
- log.debug("测试方法:processInCustomEvent()");
|
|
|
- renderNull();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected void processInImageMsg(InImageMsg inImageMsg)
|
|
|
- {
|
|
|
- //转发给多客服PC客户端
|
|
|
- OutCustomMsg outCustomMsg = new OutCustomMsg(inImageMsg);
|
|
|
- render(outCustomMsg);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 实现父类抽方法,处理关注/取消关注消息
|
|
|
- */
|
|
|
- @Override
|
|
|
- protected void processInFollowEvent(InFollowEvent inFollowEvent)
|
|
|
- {
|
|
|
- if (InFollowEvent.EVENT_INFOLLOW_SUBSCRIBE.equals(inFollowEvent.getEvent()))
|
|
|
- {
|
|
|
- log.debug("关注:" + inFollowEvent.getFromUserName());
|
|
|
- User findUser = User.dao.findFirst("select * from user where wx_openid = ?",inFollowEvent.getFromUserName());
|
|
|
+ CustomServiceApi.sendText(inTextMsg.getFromUserName(),
|
|
|
+ "您已申请开通中世康恺新冠肺炎远程诊断服务,请点击下方链接进行报名,\n<a href=\"https://wj.qq.com/s2/5297050/807b/\">点击报名</a>\n后续我们将会以短信形式下发系统账号");
|
|
|
+
|
|
|
+ renderNull();
|
|
|
+ } else {
|
|
|
+ OutTextMsg outMsgs = new OutTextMsg(inTextMsg);
|
|
|
+ outMsgs.setContent("欢迎关注中世康恺电子胶片平台!\n使用微信或者本公众号内的\"扫一扫\",扫描报告上的二维码,即可查看电子影像和报告\n如有疑问请拨打010-53932350");
|
|
|
+ render(outMsgs);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void processInVoiceMsg(InVoiceMsg inVoiceMsg) {
|
|
|
+ OutTextMsg outMsg = new OutTextMsg(inVoiceMsg);
|
|
|
+ outMsg.setContent("语音消息~");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void processInVideoMsg(InVideoMsg inVideoMsg) {
|
|
|
+ OutTextMsg outMsg = new OutTextMsg(inVideoMsg);
|
|
|
+ outMsg.setContent("接收视频消息~");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void processInShortVideoMsg(InShortVideoMsg inShortVideoMsg) {
|
|
|
+ OutTextMsg outMsg = new OutTextMsg(inShortVideoMsg);
|
|
|
+ outMsg.setContent("小视频消息~");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void processInLocationMsg(InLocationMsg inLocationMsg) {
|
|
|
+ // 转发给多客服PC客户端
|
|
|
+ OutCustomMsg outCustomMsg = new OutCustomMsg(inLocationMsg);
|
|
|
+ render(outCustomMsg);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void processInLinkMsg(InLinkMsg inLinkMsg) {
|
|
|
+ // 转发给多客服PC客户端
|
|
|
+ OutCustomMsg outCustomMsg = new OutCustomMsg(inLinkMsg);
|
|
|
+ render(outCustomMsg);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void processInCustomEvent(InCustomEvent inCustomEvent) {
|
|
|
+ log.debug("测试方法:processInCustomEvent()");
|
|
|
+ renderNull();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void processInImageMsg(InImageMsg inImageMsg) {
|
|
|
+ // 转发给多客服PC客户端
|
|
|
+ OutCustomMsg outCustomMsg = new OutCustomMsg(inImageMsg);
|
|
|
+ render(outCustomMsg);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 实现父类抽方法,处理关注/取消关注消息
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ protected void processInFollowEvent(InFollowEvent inFollowEvent) {
|
|
|
+ if (InFollowEvent.EVENT_INFOLLOW_SUBSCRIBE.equals(inFollowEvent.getEvent())) {
|
|
|
+ log.debug("关注:" + inFollowEvent.getFromUserName());
|
|
|
+ User findUser = User.dao.findFirst("select * from user where wx_openid = ?",
|
|
|
+ inFollowEvent.getFromUserName());
|
|
|
if (findUser == null) {
|
|
|
UserService aService = ServiceFactory.getService(UserService.class);
|
|
|
User users = aService.createWxUserByGH(inFollowEvent.getFromUserName(), inFollowEvent.getToUserName());
|
|
|
-
|
|
|
+
|
|
|
List<Articles> list = new ArrayList<Articles>();
|
|
|
Articles articles1 = new Articles();
|
|
|
articles1.setTitle("欢迎关注中世康恺电子胶片平台,点此进入");
|
|
@@ -131,41 +130,43 @@ public class WeixinMsgController extends MsgControllerAdapter {
|
|
|
articles1.setPicurl("http://work.pacsonline.cn/static/img/banner.e8ee043.png");
|
|
|
list.add(articles1);
|
|
|
CustomServiceApi.sendNews(inFollowEvent.getFromUserName(), list);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
findUser.setSubscribeStatus(2);
|
|
|
findUser.update();
|
|
|
OutTextMsg outMsgs = new OutTextMsg(inFollowEvent);
|
|
|
outMsgs.setContent("欢迎关注中世康恺电子胶片平台!\n使用微信或者本公众号内的\"扫一扫\",扫描报告上的二维码,即可查看电子影像和报告");
|
|
|
render(outMsgs);
|
|
|
}
|
|
|
- }
|
|
|
- // 如果为取消关注事件,将无法接收到传回的信息
|
|
|
- if (InFollowEvent.EVENT_INFOLLOW_UNSUBSCRIBE.equals(inFollowEvent.getEvent()))
|
|
|
- {
|
|
|
- log.debug("取消关注:" + inFollowEvent.getFromUserName());
|
|
|
- User findUser = User.dao.findFirst("select * from user where wx_openid = ?",inFollowEvent.getFromUserName());
|
|
|
- findUser.setSubscribeStatus(1);
|
|
|
- findUser.update();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected void processInQrCodeEvent(InQrCodeEvent inQrCodeEvent)
|
|
|
- {
|
|
|
- if (InQrCodeEvent.EVENT_INQRCODE_SUBSCRIBE.equals(inQrCodeEvent.getEvent()))
|
|
|
- {
|
|
|
- log.debug("扫码未关注:" + inQrCodeEvent.getFromUserName());
|
|
|
- User findUser = User.dao.findFirst("select * from user where wx_openid = ?",inQrCodeEvent.getFromUserName());
|
|
|
+ }
|
|
|
+ // 如果为取消关注事件,将无法接收到传回的信息
|
|
|
+ if (InFollowEvent.EVENT_INFOLLOW_UNSUBSCRIBE.equals(inFollowEvent.getEvent())) {
|
|
|
+ log.debug("取消关注:" + inFollowEvent.getFromUserName());
|
|
|
+ User findUser = User.dao.findFirst("select * from user where wx_openid = ?",
|
|
|
+ inFollowEvent.getFromUserName());
|
|
|
+ findUser.setSubscribeStatus(1);
|
|
|
+ findUser.update();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void processInQrCodeEvent(InQrCodeEvent inQrCodeEvent) {
|
|
|
+ if (InQrCodeEvent.EVENT_INQRCODE_SUBSCRIBE.equals(inQrCodeEvent.getEvent())) {
|
|
|
+ log.debug("扫码未关注:" + inQrCodeEvent.getFromUserName());
|
|
|
+ User findUser = User.dao.findFirst("select * from user where wx_openid = ?",
|
|
|
+ inQrCodeEvent.getFromUserName());
|
|
|
String rid = inQrCodeEvent.getEventKey();
|
|
|
String[] arr = rid.split("_");
|
|
|
if (arr[2].equals("DEMOCT")) {
|
|
|
- CustomServiceApi.sendText(inQrCodeEvent.getFromUserName(), "【声明】为保证客户数据隐私安全,电子胶片示例涉及检查信息、用户信息、医疗机构信息等均已经过数据脱敏处理。\n通过以下途径了解更多或联系我们:\n官方网站:<a href=\"http://www.pacsonline.cn\">点击进入</a>\n咨询热线:010-53932350\n电子邮箱:company@pacsonline.cn\n您即将收到电子胶片示例,请点击下方消息查看,谢谢您的使用!");
|
|
|
+ CustomServiceApi.sendText(inQrCodeEvent.getFromUserName(),
|
|
|
+ "【声明】为保证客户数据隐私安全,电子胶片示例涉及检查信息、用户信息、医疗机构信息等均已经过数据脱敏处理。\n通过以下途径了解更多或联系我们:\n官方网站:<a href=\"http://www.pacsonline.cn\">点击进入</a>\n咨询热线:010-53932350\n电子邮箱:company@pacsonline.cn\n您即将收到数字影像示例,请点击下方消息查看,谢谢您的使用!");
|
|
|
|
|
|
- String toUrlString = String.format("http://wechat.client.pacsonline.cn/#/reportInfo/report?openid=%s&exam_id=%s&study_id=%s","test","116edead589fa976","116edead577aac99");
|
|
|
+ String toUrlString = String.format(
|
|
|
+ "http://wechat.client.pacsonline.cn/#/reportInfo/report?openid=%s&exam_id=%s&study_id=%s",
|
|
|
+ "test", "116edead589fa976", "116edead577aac99");
|
|
|
|
|
|
List<Articles> list = new ArrayList<Articles>();
|
|
|
Articles articles1 = new Articles();
|
|
|
- articles1.setTitle("【示例】点击查看本次影像和报告");
|
|
|
+ articles1.setTitle("【数字影像示例】点击查看本次影像和报告");
|
|
|
articles1.setDescription("欢迎使用中世康恺PacsOnline!\n点击进入查看详情,您可以分享给家属或医生,日后还可以在\"我的报告\"中查看本次影像和报告");
|
|
|
articles1.setPicurl("http://work.pacsonline.cn/static/img/banner.e8ee043.png");
|
|
|
articles1.setUrl(toUrlString);
|
|
@@ -177,11 +178,14 @@ public class WeixinMsgController extends MsgControllerAdapter {
|
|
|
if (exams == null) {
|
|
|
renderNull();
|
|
|
}
|
|
|
- String toUrlString = String.format("http://wechat.client.pacsonline.cn/#/reportInfo/report?openid=%s&exam_id=%s&study_id=%s",inQrCodeEvent.getFromUserName(),exams.getId(),exams.getStudyId());
|
|
|
+ String toUrlString = String.format(
|
|
|
+ "http://wechat.client.pacsonline.cn/#/reportInfo/report?openid=%s&exam_id=%s&study_id=%s",
|
|
|
+ inQrCodeEvent.getFromUserName(), exams.getId(), exams.getStudyId());
|
|
|
if (findUser == null) {
|
|
|
UserService uService = ServiceFactory.getService(UserService.class);
|
|
|
- User users = uService.createWxUserByGH(inQrCodeEvent.getFromUserName(), inQrCodeEvent.getToUserName());
|
|
|
- UserBind userBind = UserBind.dao.findFirst("select * from user_bind where user_id=? and exam_id=?",users.getId(),exams.getId());
|
|
|
+ User users = uService.createWxUserByGH(inQrCodeEvent.getFromUserName(), inQrCodeEvent.getToUserName());
|
|
|
+ UserBind userBind = UserBind.dao.findFirst("select * from user_bind where user_id=? and exam_id=?",
|
|
|
+ users.getId(), exams.getId());
|
|
|
if (userBind == null) {
|
|
|
uService.bindUserReport(users.getId(), exams);
|
|
|
}
|
|
@@ -194,7 +198,7 @@ public class WeixinMsgController extends MsgControllerAdapter {
|
|
|
articles.setPicurl("http://work.pacsonline.cn/static/img/banner.e8ee043.png");
|
|
|
listgz.add(articles);
|
|
|
CustomServiceApi.sendNews(inQrCodeEvent.getFromUserName(), listgz);
|
|
|
-
|
|
|
+
|
|
|
List<Articles> list = new ArrayList<Articles>();
|
|
|
Articles articles1 = new Articles();
|
|
|
articles1.setTitle("点击查看本次影像和报告");
|
|
@@ -204,17 +208,19 @@ public class WeixinMsgController extends MsgControllerAdapter {
|
|
|
list.add(articles1);
|
|
|
CustomServiceApi.sendNews(inQrCodeEvent.getFromUserName(), list);
|
|
|
renderNull();
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
UserService uService = ServiceFactory.getService(UserService.class);
|
|
|
|
|
|
findUser.setSubscribeStatus(2);
|
|
|
findUser.update();
|
|
|
-
|
|
|
- UserBind userBind = UserBind.dao.findFirst("select * from user_bind where user_id=? and exam_id=?",findUser.getId(),exams.getId());
|
|
|
+
|
|
|
+ UserBind userBind = UserBind.dao.findFirst("select * from user_bind where user_id=? and exam_id=?",
|
|
|
+ findUser.getId(), exams.getId());
|
|
|
if (userBind == null) {
|
|
|
uService.bindUserReport(findUser.getId(), exams);
|
|
|
}
|
|
|
- CustomServiceApi.sendText(inQrCodeEvent.getFromUserName(), "欢迎关注中世康恺电子胶片平台!\n使用微信-\"扫一扫\",扫描报告上的二维码,即可查看电子影像和报告");
|
|
|
+ CustomServiceApi.sendText(inQrCodeEvent.getFromUserName(),
|
|
|
+ "欢迎关注中世康恺电子胶片平台!\n使用微信-\"扫一扫\",扫描报告上的二维码,即可查看电子影像和报告");
|
|
|
|
|
|
List<Articles> list = new ArrayList<Articles>();
|
|
|
Articles articles1 = new Articles();
|
|
@@ -225,46 +231,53 @@ public class WeixinMsgController extends MsgControllerAdapter {
|
|
|
list.add(articles1);
|
|
|
CustomServiceApi.sendNews(inQrCodeEvent.getFromUserName(), list);
|
|
|
renderNull();
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- if (InQrCodeEvent.EVENT_INQRCODE_SCAN.equals(inQrCodeEvent.getEvent()))
|
|
|
- {
|
|
|
- log.debug("扫码已关注:" + inQrCodeEvent.getFromUserName());
|
|
|
- String rid = inQrCodeEvent.getEventKey();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (InQrCodeEvent.EVENT_INQRCODE_SCAN.equals(inQrCodeEvent.getEvent())) {
|
|
|
+ log.debug("扫码已关注:" + inQrCodeEvent.getFromUserName());
|
|
|
+ String rid = inQrCodeEvent.getEventKey();
|
|
|
String[] arr = rid.split("_");
|
|
|
+ CustomServiceApi.sendText(inQrCodeEvent.getFromUserName(),arr.toString());
|
|
|
if (arr[1].equals("DEMOCT")) {
|
|
|
- CustomServiceApi.sendText(inQrCodeEvent.getFromUserName(), "【声明】为保证客户数据隐私安全,电子胶片示例涉及检查信息、用户信息、医疗机构信息等均已经过数据脱敏处理。\n通过以下途径了解更多或联系我们:\n官方网站:<a href=\"http://www.pacsonline.cn\">点击进入</a>\n咨询热线:010-53932350\n电子邮箱:company@pacsonline.cn\n您即将收到电子胶片示例,请点击下方消息查看,谢谢您的使用!");
|
|
|
+ CustomServiceApi.sendText(inQrCodeEvent.getFromUserName(),
|
|
|
+ "【声明】为保证客户数据隐私安全,电子胶片示例涉及检查信息、用户信息、医疗机构信息等均已经过数据脱敏处理。\n通过以下途径了解更多或联系我们:\n官方网站:<a href=\"http://www.pacsonline.cn\">点击进入</a>\n咨询热线:010-53932350\n电子邮箱:company@pacsonline.cn\n您即将收到数字影像示例,请点击下方消息查看,谢谢您的使用!");
|
|
|
|
|
|
- String toUrlString = String.format("http://wechat.client.pacsonline.cn/#/reportInfo/report?openid=%s&exam_id=%s&study_id=%s","test","116edead589fa976","116edead577aac99");
|
|
|
+ String toUrlString = String.format(
|
|
|
+ "http://wechat.client.pacsonline.cn/#/reportInfo/report?openid=%s&exam_id=%s&study_id=%s",
|
|
|
+ "test", "116edead589fa976", "116edead577aac99");
|
|
|
|
|
|
List<Articles> list = new ArrayList<Articles>();
|
|
|
Articles articles1 = new Articles();
|
|
|
- articles1.setTitle("【示例】点击查看本次影像和报告");
|
|
|
+ articles1.setTitle("【数字影像示例】点击查看本次影像和报告");
|
|
|
articles1.setDescription("欢迎使用中世康恺PacsOnline!\n点击进入查看详情,您可以分享给家属或医生,日后还可以在\"我的报告\"中查看本次影像和报告");
|
|
|
articles1.setPicurl("http://work.pacsonline.cn/static/img/banner.e8ee043.png");
|
|
|
articles1.setUrl(toUrlString);
|
|
|
list.add(articles1);
|
|
|
CustomServiceApi.sendNews(inQrCodeEvent.getFromUserName(), list);
|
|
|
- renderNull();
|
|
|
+ renderNull();
|
|
|
}
|
|
|
- User user = User.dao.findFirst("select * from user where wx_openid = ?",inQrCodeEvent.getFromUserName());
|
|
|
-
|
|
|
+ CustomServiceApi.sendText(inQrCodeEvent.getFromUserName(),"t");
|
|
|
+
|
|
|
+ User user = User.dao.findFirst("select * from user where wx_openid = ?", inQrCodeEvent.getFromUserName());
|
|
|
+
|
|
|
UserService uService = ServiceFactory.getService(UserService.class);
|
|
|
|
|
|
if (user == null) {
|
|
|
user = uService.createWxUserByGH(inQrCodeEvent.getFromUserName(), inQrCodeEvent.getToUserName());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
Exams exams = Exams.dao.findById(arr[1]);
|
|
|
|
|
|
- UserBind userBind = UserBind.dao.findFirst("select * from user_bind where user_id=? and exam_id=?",user.getId(),exams.getId());
|
|
|
-
|
|
|
+ UserBind userBind = UserBind.dao.findFirst("select * from user_bind where user_id=? and exam_id=?",
|
|
|
+ user.getId(), exams.getId());
|
|
|
+
|
|
|
if (userBind == null) {
|
|
|
uService.bindUserReport(user.getId(), exams);
|
|
|
}
|
|
|
-
|
|
|
- String toUrlString = String.format("http://wechat.client.pacsonline.cn/#/reportInfo/report?openid=%s&exam_id=%s&study_id=%s",inQrCodeEvent.getFromUserName(),exams.getId(),exams.getStudyId());
|
|
|
+
|
|
|
+ String toUrlString = String.format(
|
|
|
+ "http://wechat.client.pacsonline.cn/#/reportInfo/report?openid=%s&exam_id=%s&study_id=%s",
|
|
|
+ inQrCodeEvent.getFromUserName(), exams.getId(), exams.getStudyId());
|
|
|
List<Articles> list = new ArrayList<Articles>();
|
|
|
Articles articles1 = new Articles();
|
|
|
articles1.setTitle("点击查看本次影像和报告");
|
|
@@ -274,52 +287,47 @@ public class WeixinMsgController extends MsgControllerAdapter {
|
|
|
list.add(articles1);
|
|
|
CustomServiceApi.sendNews(inQrCodeEvent.getFromUserName(), list);
|
|
|
renderNull();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected void processInLocationEvent(InLocationEvent inLocationEvent)
|
|
|
- {
|
|
|
- log.debug("发送地理位置事件:" + inLocationEvent.getFromUserName());
|
|
|
- OutTextMsg outMsg = new OutTextMsg(inLocationEvent);
|
|
|
- outMsg.setContent("地理位置是:" + inLocationEvent.getLatitude());
|
|
|
- render(outMsg);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected void processInMassEvent(InMassEvent inMassEvent)
|
|
|
- {
|
|
|
- log.debug("测试方法:processInMassEvent()");
|
|
|
- renderNull();
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 实现父类抽方法,处理自定义菜单事件
|
|
|
- */
|
|
|
- @Override
|
|
|
- protected void processInMenuEvent(InMenuEvent inMenuEvent)
|
|
|
- {
|
|
|
- log.debug("菜单事件:" + inMenuEvent.getFromUserName());
|
|
|
- OutTextMsg outMsg = new OutTextMsg(inMenuEvent);
|
|
|
- outMsg.setContent("菜单事件内容是:" + inMenuEvent.getEventKey());
|
|
|
- render(outMsg);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected void processInSpeechRecognitionResults(InSpeechRecognitionResults inSpeechRecognitionResults)
|
|
|
- {
|
|
|
- log.debug("语音识别事件:" + inSpeechRecognitionResults.getFromUserName());
|
|
|
- OutTextMsg outMsg = new OutTextMsg(inSpeechRecognitionResults);
|
|
|
- outMsg.setContent("语音识别内容是:" + inSpeechRecognitionResults.getRecognition());
|
|
|
- render(outMsg);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected void processInTemplateMsgEvent(InTemplateMsgEvent inTemplateMsgEvent)
|
|
|
- {
|
|
|
- log.debug("测试方法:processInTemplateMsgEvent()");
|
|
|
- renderNull();
|
|
|
- }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void processInLocationEvent(InLocationEvent inLocationEvent) {
|
|
|
+ log.debug("发送地理位置事件:" + inLocationEvent.getFromUserName());
|
|
|
+ OutTextMsg outMsg = new OutTextMsg(inLocationEvent);
|
|
|
+ outMsg.setContent("地理位置是:" + inLocationEvent.getLatitude());
|
|
|
+ render(outMsg);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void processInMassEvent(InMassEvent inMassEvent) {
|
|
|
+ log.debug("测试方法:processInMassEvent()");
|
|
|
+ renderNull();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 实现父类抽方法,处理自定义菜单事件
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ protected void processInMenuEvent(InMenuEvent inMenuEvent) {
|
|
|
+ log.debug("菜单事件:" + inMenuEvent.getFromUserName());
|
|
|
+ OutTextMsg outMsg = new OutTextMsg(inMenuEvent);
|
|
|
+ outMsg.setContent("菜单事件内容是:" + inMenuEvent.getEventKey());
|
|
|
+ render(outMsg);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void processInSpeechRecognitionResults(InSpeechRecognitionResults inSpeechRecognitionResults) {
|
|
|
+ log.debug("语音识别事件:" + inSpeechRecognitionResults.getFromUserName());
|
|
|
+ OutTextMsg outMsg = new OutTextMsg(inSpeechRecognitionResults);
|
|
|
+ outMsg.setContent("语音识别内容是:" + inSpeechRecognitionResults.getRecognition());
|
|
|
+ render(outMsg);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void processInTemplateMsgEvent(InTemplateMsgEvent inTemplateMsgEvent) {
|
|
|
+ log.debug("测试方法:processInTemplateMsgEvent()");
|
|
|
+ renderNull();
|
|
|
+ }
|
|
|
|
|
|
// /**
|
|
|
// * 实现父类抽方法,处理文本消息
|
|
@@ -598,9 +606,3 @@ public class WeixinMsgController extends MsgControllerAdapter {
|
|
|
// renderOutTextMsg(transText);
|
|
|
// }
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|