浏览代码

Merge branch 'dev' of trick9191/patient-co-management into dev

trick9191 7 年之前
父节点
当前提交
0bf45009b6

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/account/PatientController.java

@ -726,7 +726,7 @@ public class PatientController extends WeixinBaseController {
            return write(200, "获取签约状态成功!", "data", -1);
        } catch (Exception e) {
            error(e);
            return error(-1, "签约状态查询失败!");
            return error(-1, " !");
        }
    }

+ 92 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/process/WeiXinEventProcess.java

@ -400,6 +400,39 @@ public class WeiXinEventProcess {
            setUrlItems(articles, systemConf);
            setWifi(message.get("FromUserName"),articles,systemConf);
            // 构建回复消息XML
            result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        }else if (StringUtils.isNotEmpty(eventKey) && (("wechat_draw").equals(eventKey)) ||
                eventKey.startsWith("qrscene_wechat_draw")){
            // 配置信息
            Properties systemConf = SystemConf.getInstance().getSystemProperties();
            // 图文信息
            List<Map<String, String>> articles = new ArrayList<>();
            Map<String, String> article = new HashMap<>();
            // 图文URL
            String url = systemConf.getProperty("doctor_subscribe_url");
            // 图文消息图片URL
            String picUrl = systemConf.getProperty("doctor_qrcode_pic_url");
            // URL设置服务器URL、AppId
            url = url.replace("{server}", wechat_base_url)
                    .replace("{appId}", appId);
            //图片地址
            picUrl = picUrl.replace("{server}", serverUrl);
            article.put("Url", url);
            article.put("Title", "欢迎关注厦门i健康,快来签约家庭医生吧~");
            article.put("Description", "请点击查看家庭签约");
            article.put("PicUrl", picUrl);
            articles.add(article);
            //设置共有的图文消息
            setUrlItems(articles, systemConf);
            //设置抽奖
            setDraw(articles,systemConf);
            // 构建回复消息XML
            result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        }else {
@ -480,10 +513,37 @@ public class WeiXinEventProcess {
        }
    }
    public void setDraw(List<Map<String, String>> articles, Properties systemConf){
        Map<String, String> articleConsult = new HashMap<>();
        // 图文URL
        String urlConsult = getSystemCodeByName("PATIENT_DRAW_URL");
        // URL设置服务器URL、AppId
        urlConsult = urlConsult.replace("{server}", wechat_base_url)
                .replace("{appId}", appId);
        logger.info("pstient_Draw_url:"+urlConsult);
        // 图文消息图片URL
        String picUrlConsult = systemConf.getProperty("patient_draw_pic_url");
        picUrlConsult = picUrlConsult.replace("{server}", serverUrl);
        articleConsult.put("Url", urlConsult);
        articleConsult.put("Title", "健康宣传回访,电影票等你来拿~");
        articleConsult.put("Description", "外来流动人口健康宣传回访,快来参加抽取电影票~");
        articleConsult.put("PicUrl", picUrlConsult);
        articles.add(articleConsult);
    }
    public String getSystemWifiUrl(){
        List<SystemDict> systemDicts =  systemDictDao.findByDictName("HSLQ_WIFI");
        return systemDicts.get(0).getCode();
    }
    public String getSystemCodeByName(String name){
        List<SystemDict> systemDicts =  systemDictDao.findByDictName(name);
        return systemDicts.get(0).getCode();
    }
    /**
     * 设置微信公共的图文消息
@ -725,6 +785,38 @@ public class WeiXinEventProcess {
            setWifi(message.get("FromUserName"),articles,systemConf);
            // 构建回复消息XML
            result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        }else if (StringUtils.isNotEmpty(eventKey) && (("wechat_draw").equals(eventKey)) ||
                eventKey.startsWith("qrscene_wechat_draw")) {
            // 配置信息
            Properties systemConf = SystemConf.getInstance().getSystemProperties();
            // 图文信息
            List<Map<String, String>> articles = new ArrayList<>();
            Map<String, String> article = new HashMap<>();
            // 图文URL
            String url = systemConf.getProperty("doctor_subscribe_url");
            // 图文消息图片URL
            String picUrl = systemConf.getProperty("doctor_qrcode_pic_url");
            // URL设置服务器URL、AppId
            url = url.replace("{server}", wechat_base_url)
                    .replace("{appId}", appId);
            //图片地址
            picUrl = picUrl.replace("{server}", serverUrl);
            article.put("Url", url);
            article.put("Title", "欢迎关注厦门i健康,快来签约家庭医生吧~");
            article.put("Description", "请点击查看家庭签约");
            article.put("PicUrl", picUrl);
            articles.add(article);
            //设置共有的图文消息
            setUrlItems(articles, systemConf);
            //设置抽奖
            setDraw(articles,systemConf);
            // 构建回复消息XML
            result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        }
        return result;

+ 3 - 1
patient-co/patient-co-wlyy/src/main/resources/system.properties

@ -31,9 +31,11 @@ patient_QRCode_url=https://open.weixin.qq.com/connect/oauth2/authorize?appid={ap
#居民产检计划
patient_prenata_url=https://open.weixin.qq.com/connect/oauth2/authorize?appid={appId}&amp;redirect_uri={server}%2fwx%2fhtml%2ffybj%2fhtml%2fyunjianjihua.html&amp;response_type=code&amp;scope=snsapi_base&amp;state=STATE#wechat_redirect
#居民免疫计划
patient_immune_url=https://open.weixin.qq.com/connect/oauth2/authorize?appid={appId}&amp;redirect_uri={server}%2fwx%2fhtml%2ffybj%2fhtml%2fmianyijihua.html&amp;response_type=code&amp;scope=snsapi_base&amp;state=STATE#wechat_redirect
patient_immune_url=#居民抽奖图片地址
#居民wifi图片地址
patient_wifi_pic_url = {server}/images/wifi.png
#居民抽奖图片地址
patient_draw_pic_url = {server}/images/banner01.png
#居民wifi链接
patient_wifi_url =http://freewifi.mobcb.com/Portal/Wx/login
#就诊记录

二进制
patient-co/patient-co-wlyy/src/main/webapp/images/banner01.png