Forráskód Böngészése

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

yeshijie 7 éve
szülő
commit
96dc731878

+ 2 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorTeamGuidanceService.java

@ -66,7 +66,7 @@ public class DoctorTeamGuidanceService extends BaseService {
     * @param content
     * @param images
     */
    public void saveTeamGuidance(String doctor, String title, JSONArray teams, String content, String images) throws Exception {
    public String saveTeamGuidance(String doctor, String title, JSONArray teams, String content, String images) throws Exception {
        String templateCode = getCode();
        Date nowDate = new Date();
        String image = "";
@ -113,6 +113,7 @@ public class DoctorTeamGuidanceService extends BaseService {
        doctorTeamGuidanceDetailDao.save(doctorTeamGuidanceDetail);
        return templateCode;
    }
    /**

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorGuidanceTempController.java

@ -75,7 +75,7 @@ public class DoctorGuidanceTempController extends BaseController {
            DoctorGuidanceTemp temp = guidanceTempService.add(getUID(), content, modelName, imagesUrl);
            if (temp != null) {
                return write(200, "添加成功");
                return write(200, "添加成功","modelCode",temp.getCode());
            } else {
                return write(-1, "添加失败");
            }

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorTeamGuidanceController.java

@ -128,8 +128,8 @@ public class DoctorTeamGuidanceController extends WeixinBaseController {
//            前端参数校验
            String doctor = getUID();
            JSONArray teams = new JSONArray(teamInfo);
            doctorTeamGuidanceService.saveTeamGuidance(doctor, title, teams, content, images);
            return write(200, "保存团队模板成功!");
            String guidanceCode = doctorTeamGuidanceService.saveTeamGuidance(doctor, title, teams, content, images);
            return write(200, "保存团队模板成功!","guidanceCode",guidanceCode);
        } catch (Exception e) {
            return invalidUserException(e, -1, e.getMessage());
        }

+ 128 - 82
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/process/WeiXinEventProcess.java

@ -91,7 +91,9 @@ public class WeiXinEventProcess {
            result = tempStr.replace("<ArticleCount>5</ArticleCount>", "<ArticleCount>4</ArticleCount>");
        }
        if (message.get("EventKey").equals("jiankangdangan")) {
            result = clickEventProcessMenu(message);
            result = clickEventProcessMenu(message,"jiankangdangan");
        }else if (message.get("EventKey").equals("fuyoubaojian")){
            result = clickEventProcessMenu(message,"fuyoubaojian");
        }
        return result;
    }
@ -194,105 +196,149 @@ public class WeiXinEventProcess {
     * 菜单点击消息发送
     *
     * @param message
     * @param key 微信菜单点击事件key值
     * @return
     * @throws Exception
     */
    private String clickEventProcessMenu(Map<String, String> message) throws Exception {
    private String clickEventProcessMenu(Map<String, String> message,String key) throws Exception {
        String result = "";
        // 配置信息
        Properties systemConf = SystemConf.getInstance().getSystemProperties();
        // 图文信息
        List<Map<String, String>> articles = new ArrayList<>();
        //就诊记录
        Map<String, String> articleVisit = new HashMap<>();
        String visit = systemConf.getProperty("patient_visit_url");
        // 图文消息图片URL
        String visit_pic = systemConf.getProperty("patient_visit_pic");
        // URL设置服务器URL、AppId
        visit = visit.replace("{server}", wechat_base_url)
                .replace("{appId}", appId);
        //图片地址
        visit_pic = visit_pic.replace("{server}", serverUrl);
        articleVisit.put("Url", visit);
        articleVisit.put("Title", "就诊记录");
        articleVisit.put("Description", "就诊记录");
        articleVisit.put("PicUrl", visit_pic);
        articles.add(articleVisit);
        if("jiankangdangan".equals(key)){
            //就诊记录
            Map<String, String> articleVisit = new HashMap<>();
            String visit = systemConf.getProperty("patient_visit_url");
            // 图文消息图片URL
            String visit_pic = systemConf.getProperty("patient_visit_pic");
            // URL设置服务器URL、AppId
            visit = visit.replace("{server}", wechat_base_url)
                    .replace("{appId}", appId);
            //图片地址
            visit_pic = visit_pic.replace("{server}", serverUrl);
        //#检查检验
        Map<String, String> articleInspect = new HashMap<>();
        // 图文URL
        String inspect = systemConf.getProperty("patient_inspect_url");
        // 图文消息图片URL
        String inspect_pic = systemConf.getProperty("patient_inspect_pic");
        // URL设置服务器URL、AppId
        inspect = inspect.replace("{server}", wechat_base_url)
                .replace("{appId}", appId);
        //图片地址
        inspect_pic = inspect_pic.replace("{server}", serverUrl);
            articleVisit.put("Url", visit);
            articleVisit.put("Title", "就诊记录");
            articleVisit.put("Description", "就诊记录");
            articleVisit.put("PicUrl", visit_pic);
            articles.add(articleVisit);
        articleInspect.put("Url", inspect);
        articleInspect.put("Title", "检查检验");
        articleInspect.put("Description", "检查检验");
        articleInspect.put("PicUrl", inspect_pic);
        articles.add(articleInspect);
            //#检查检验
            Map<String, String> articleInspect = new HashMap<>();
            // 图文URL
            String inspect = systemConf.getProperty("patient_inspect_url");
            // 图文消息图片URL
            String inspect_pic = systemConf.getProperty("patient_inspect_pic");
            // URL设置服务器URL、AppId
            inspect = inspect.replace("{server}", wechat_base_url)
                    .replace("{appId}", appId);
            //图片地址
            inspect_pic = inspect_pic.replace("{server}", serverUrl);
        Map<String, String> articleExamination = new HashMap<>();
        // 图文URL
        String examination = systemConf.getProperty("patient_examination_url");
        // 图文消息图片URL
        String examination_pic = systemConf.getProperty("patient_examination_pic");
        // URL设置服务器URL、AppId
        examination = examination.replace("{server}", wechat_base_url)
                .replace("{appId}", appId);
        //图片地址
        examination_pic = examination_pic.replace("{server}", serverUrl);
            articleInspect.put("Url", inspect);
            articleInspect.put("Title", "检查检验");
            articleInspect.put("Description", "检查检验");
            articleInspect.put("PicUrl", inspect_pic);
            articles.add(articleInspect);
        articleExamination.put("Url", examination);
        articleExamination.put("Title", "社区体检");
        articleExamination.put("Description", "社区体检");
        articleExamination.put("PicUrl", examination_pic);
        articles.add(articleExamination);
            Map<String, String> articleExamination = new HashMap<>();
            // 图文URL
            String examination = systemConf.getProperty("patient_examination_url");
            // 图文消息图片URL
            String examination_pic = systemConf.getProperty("patient_examination_pic");
            // URL设置服务器URL、AppId
            examination = examination.replace("{server}", wechat_base_url)
                    .replace("{appId}", appId);
            //图片地址
            examination_pic = examination_pic.replace("{server}", serverUrl);
//        新增处方记录图文消息
        Map<String, String> articlePrescription = new HashMap<>();
        // 图文URL
        String prescription = systemConf.getProperty("patient_prescription_url");
        // 图文消息图片URL
        String prescription_pic = systemConf.getProperty("patient_prescription_pic");
        // URL设置服务器URL、AppId
        prescription = prescription.replace("{server}", wechat_base_url)
                .replace("{appId}", appId);
        //图片地址
        prescription_pic = prescription_pic.replace("{server}", serverUrl);
            articleExamination.put("Url", examination);
            articleExamination.put("Title", "社区体检");
            articleExamination.put("Description", "社区体检");
            articleExamination.put("PicUrl", examination_pic);
            articles.add(articleExamination);
        articlePrescription.put("Url", prescription);
        articlePrescription.put("Title", "处方记录");
        articlePrescription.put("Description", "处方记录");
        articlePrescription.put("PicUrl", prescription_pic);
        articles.add(articlePrescription);
            //        新增处方记录图文消息
            Map<String, String> articlePrescription = new HashMap<>();
            // 图文URL
            String prescription = systemConf.getProperty("patient_prescription_url");
            // 图文消息图片URL
            String prescription_pic = systemConf.getProperty("patient_prescription_pic");
            // URL设置服务器URL、AppId
            prescription = prescription.replace("{server}", wechat_base_url)
                    .replace("{appId}", appId);
            //图片地址
            prescription_pic = prescription_pic.replace("{server}", serverUrl);
//        新增居民取药码图文消息 by wjj 2017.08.25
        Map<String, String> articlePatientQRCode = new HashMap<>();
        // 图文URL
        String patientQRCode = systemConf.getProperty("patient_QRCode_url");
        // 图文消息图片URL
        String patientQRCode_pic = systemConf.getProperty("patient_QRCode_pic");
        // URL设置服务器URL、AppId
        patientQRCode = patientQRCode.replace("{server}", wechat_base_url)
                .replace("{appId}", appId);
        //图片地址
        patientQRCode_pic = patientQRCode_pic.replace("{server}", serverUrl);
            articlePrescription.put("Url", prescription);
            articlePrescription.put("Title", "处方记录");
            articlePrescription.put("Description", "处方记录");
            articlePrescription.put("PicUrl", prescription_pic);
            articles.add(articlePrescription);
            //        新增居民取药码图文消息 by wjj 2017.08.25
            Map<String, String> articlePatientQRCode = new HashMap<>();
            // 图文URL
            String patientQRCode = systemConf.getProperty("patient_QRCode_url");
            // 图文消息图片URL
            String patientQRCode_pic = systemConf.getProperty("patient_QRCode_pic");
            // URL设置服务器URL、AppId
            patientQRCode = patientQRCode.replace("{server}", wechat_base_url)
                    .replace("{appId}", appId);
            //图片地址
            patientQRCode_pic = patientQRCode_pic.replace("{server}", serverUrl);
        articlePatientQRCode.put("Url", patientQRCode);
        articlePatientQRCode.put("Title", "我的取药码");
        articlePatientQRCode.put("Description", "我的取药码");
        articlePatientQRCode.put("PicUrl", patientQRCode_pic);
        articles.add(articlePatientQRCode);
            articlePatientQRCode.put("Url", patientQRCode);
            articlePatientQRCode.put("Title", "我的取药码");
            articlePatientQRCode.put("Description", "我的取药码");
            articlePatientQRCode.put("PicUrl", patientQRCode_pic);
            articles.add(articlePatientQRCode);
            // 构建回复消息XML
            result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        }else if ("fuyoubaojian".equals(key)){
            //        新增产检计划图文消息
            Map<String, String> articlePrenata = new HashMap<>();
            // 图文URL
            String prenata = systemConf.getProperty("patient_prenata_url");
            // 图文消息图片URL
            String prenata_pic = systemConf.getProperty("patient_prenata_pic");
            // URL设置服务器URL、AppId
            prenata = prenata.replace("{server}", wechat_base_url)
                    .replace("{appId}", appId);
            //图片地址
            prenata_pic = prenata_pic.replace("{server}", serverUrl);
            articlePrenata.put("Url", prenata);
            articlePrenata.put("Title", "产检计划");
            articlePrenata.put("Description", "产检计划");
            articlePrenata.put("PicUrl", prenata_pic);
            articles.add(articlePrenata);
            //        新增免疫计划图文消息
            Map<String, String> articleImmune = new HashMap<>();
            // 图文URL
            String immune = systemConf.getProperty("patient_immune_url");
            // 图文消息图片URL
            String immune_pic = systemConf.getProperty("patient_immune_pic");
            // URL设置服务器URL、AppId
            immune = immune.replace("{server}", wechat_base_url)
                    .replace("{appId}", appId);
            //图片地址
            immune_pic = immune_pic.replace("{server}", serverUrl);
            articleImmune.put("Url", immune);
            articleImmune.put("Title", "免疫计划");
            articleImmune.put("Description", "免疫计划");
            articleImmune.put("PicUrl", immune_pic);
            articles.add(articleImmune);
            // 构建回复消息XML
            result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        }
        // 构建回复消息XML
        result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        return result;
    }

+ 8 - 0
patient-co/patient-co-wlyy/src/main/resources/system.properties

@ -28,6 +28,10 @@ patient_examination_url=https://open.weixin.qq.com/connect/oauth2/authorize?appi
patient_prescription_url=https://open.weixin.qq.com/connect/oauth2/authorize?appid={appId}&amp;redirect_uri={server}%2fwx%2fhtml%2fprescription%2fhtml%2fprescription_records.html&amp;response_type=code&amp;scope=snsapi_base&amp;state=STATE#wechat_redirect
#居民取药码
patient_QRCode_url=https://open.weixin.qq.com/connect/oauth2/authorize?appid={appId}&amp;redirect_uri={server}%2fwx%2fhtml%2fprescription%2fhtml%2fmy-medicine-code.html&amp;response_type=code&amp;scope=snsapi_base&amp;state=STATE#wechat_redirect
#居民产检计划
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
#居民wifi图片地址
patient_wifi_pic_url = {server}/images/wifi.png
#居民wifi链接
@ -42,6 +46,10 @@ patient_examination_pic={server}/images/examination.png
patient_prescription_pic={server}/images/prescriptionRecords.png
#居民取药码
patient_QRCode_pic={server}/images/patientQRCode.png
#居民产检计划
patient_prenata_pic={server}/images/patientPrenata.png
#居民免疫计划
patient_immune_pic={server}/images/patientImmune.png
patient_operatinginstrutions_pic_url={server}/images/operatinginstructions.png
patient_booking_pic_url={server}/images/booking.png

+ 3 - 3
patient-co/patient-co-wlyy/src/main/resources/wechat/weixin_menu.txt

@ -50,9 +50,9 @@
            "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjbsq%2fhtml%2fslow-disease-manage.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                  },
        {
            "type":"view",
            "name":"孕检计划",
            "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2ffybj%2fhtml%2fyunjianjihua.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
            "type":"click",
            "name":"妇幼保健",
            "key":"fuyoubaojian"
        }
	  ]
   },