Selaa lähdekoodia

微信消息参数修改

lyr 8 vuotta sitten
vanhempi
commit
e66acc3404

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java

@ -32,7 +32,7 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("update Message a set a.read = 0,a.over='0' where a.id = ?1")
    int read(long msgid);
    @Query("SELECT a FROM Message a WHERE a.sender=?1 AND a.receiver = ?2 and a.signStatus = ?3 and read=1")
    @Query("SELECT a FROM Message a WHERE a.sender=?1 AND a.receiver = ?2 and a.signStatus = ?3 and a.read=1")
    Message findByParams(String sender, String receiver, String signStatus);
    @Query("SELECT a FROM Message a WHERE a.sender=?1 AND a.receiver = ?2 and a.signStatus = ?3 ")
@ -41,6 +41,6 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query(" from Message a where a.read = 1 and over ='1' and a.sender = ?1 and a.receiver=?2 and a.signStatus='1'")
    Message findByPatient(String patient,String doctor);
    @Query("select count(a) from Message a where a.read = 0 and over ='0'  and a.receiver=?1 and a.type=?2 ")
    @Query("select count(a) from Message a where a.read = 0 and a.over ='0'  and a.receiver=?1 and a.type=?2 ")
    int findMessageNum(String doctor, Integer type);
}

+ 2 - 65
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java

@ -78,71 +78,6 @@ public class MessageService extends BaseService {
     * @return
     */
    public JSONObject findDoctorAllMessage(String doctor) {
        // 三师咨询未读消息总数
//        int consult = 0;
//        JSONObject consultJson = new JSONObject();
//        try {
//            consult = consultTeamDao.amountAllDoctorUnread(doctor);
//        } catch (Exception e) {
//        }
//
//        consultJson.put("amount", consult);
//
//        if (consult > 0) {
//            PageRequest pageRequest = new PageRequest(0, 1);
//            Page<Object> msgs = consultTeamDao.AllDoctorUnreadLast(doctor, pageRequest);
//
//            if (msgs != null && msgs.getSize() > 0) {
//                for (Object msg : msgs) {
//                    Object[] msgArray = (Object[]) msg;
//                    JSONObject msgJson = new JSONObject();
//                    msgJson.put("msg", msgArray[0].toString() + "向您发来一个咨询");
//                    if (msgArray[1] != null) {
//                        if (DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD).equals(DateUtil.dateToStr((Date) msgArray[1], DateUtil.YYYY_MM_DD))) {
//                            msgJson.put("msgTime", DateUtil.dateToStr((Date) msgArray[1], DateUtil.HH_MM));
//                        } else {
//                            msgJson.put("msgTime", DateUtil.dateToStr((Date) msgArray[1], DateUtil.YYYY_MM_DD_HH_MM));
//                        }
//                    } else {
//                        msgJson.put("msgTime", "");
//                    }
//                    consultJson.put("lastMessage", msgJson);
//                }
//            }
//        }
//
//        int famousConsult = 0;
//        JSONObject famousJson = new JSONObject();
//
//        try {
//            famousConsult = consultTeamDao.amountAlFamouslDoctorUnread(doctor);
//        } catch (Exception e) {
//        }
//
//        famousJson.put("amount", famousConsult);
//
//        if (famousConsult > 0) {
//            PageRequest pageRequest = new PageRequest(0, 1);
//            Page<Object> msgs = consultTeamDao.AllDoctorFamousUnreadLast(doctor, pageRequest);
//
//            if (msgs != null && msgs.getSize() > 0) {
//                for (Object msg : msgs) {
//                    Object[] msgArray = (Object[]) msg;
//                    JSONObject msgJson = new JSONObject();
//                    msgJson.put("msg", msgArray[0].toString() + "向您发来一个咨询");
//                    if (msgArray[1] != null) {
//                        if (DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD).equals(DateUtil.dateToStr((Date) msgArray[1], DateUtil.YYYY_MM_DD))) {
//                            msgJson.put("msgTime", DateUtil.dateToStr((Date) msgArray[1], DateUtil.HH_MM));
//                        } else {
//                            msgJson.put("msgTime", DateUtil.dateToStr((Date) msgArray[1], DateUtil.YYYY_MM_DD_HH_MM));
//                        }
//                    } else {
//                        msgJson.put("msgTime", "");
//                    }
//                    famousJson.put("lastMessage", msgJson);
//                }
//            }
//        }
        // 签约未读消息总数
        int sign = messageDao.amountUnreadByReceiver(doctor);
@ -189,7 +124,9 @@ public class MessageService extends BaseService {
        JSONObject systemJson = new JSONObject();
        systemJson.put("amount", count);
        JSONObject json = new JSONObject();
        getImMsgAmount(json,doctor);//IM消息数量
        json.put("sign", signJson);//签约数
        json.put("healthIndex", indexJson);//健康指标
        json.put("system", systemJson);//系统消息

+ 9 - 9
patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java

@ -245,9 +245,9 @@ public class PushMsgTask {
            String temp_id = "";
            if (type == 3) {
                if (json.has("isPublic") && json.getInt("isPublic") == 1) {
                    temp.setUrl(url + "jbsq/html/public-consult-detail.html?openid=" + openid + "&code=" + json.getString("consult") + "&toUser=" + json.getString("toUser"));
                    temp.setUrl(url + "jbsq/html/public-consult-detail.html?openid=" + openid + "&code=" + json.getString("consult") + "&toUser=" + json.getString("toUser") + "&toName=" + name);
                } else {
                    temp.setUrl(url + "yszx/html/consulting-doctor.html?openid=" + openid + "&consult=" + json.getString("consult") + "&toUser=" + json.getString("toUser"));
                    temp.setUrl(url + "yszx/html/consulting-doctor.html?openid=" + openid + "&consult=" + json.getString("consult") + "&toUser=" + json.getString("toUser") + "&toName=" + name);
                }
                temp_id = SystemConf.getInstance().getSystemProperties().getProperty("template_consult_notice");
                temp.setTemplate_id(temp_id);
@ -268,7 +268,7 @@ public class PushMsgTask {
                    temp_id = SystemConf.getInstance().getSystemProperties().getProperty("template_sign_success");
                else
                    temp_id = SystemConf.getInstance().getSystemProperties().getProperty("template_sign_failed");
                temp.setUrl(url + "ssgg/html/doctor-homepage-new.html?openid=" + openid + "&state=" + json.getString("doctor") + "&toUser=" + json.getString("toUser"));
                temp.setUrl(url + "ssgg/html/doctor-homepage-new.html?openid=" + openid + "&state=" + json.getString("doctor") + "&toUser=" + json.getString("toUser") + "&toName=" + name);
                temp.setTouser(openid);
                temp.setTopcolor("#000000");
                temp.setTemplate_id(temp_id);
@ -289,7 +289,7 @@ public class PushMsgTask {
                keyword4.setValue(json.getString("content"));
                m.put("keyword4", keyword4);
            } else if (type == 4) {
                temp.setUrl(url + "yszd/html/guidance-detail.html?openid=" + openid + "&toUser=" + json.getString("toUser") + "&id=" + String.valueOf(json.get("id")));
                temp.setUrl(url + "yszd/html/guidance-detail.html?openid=" + openid + "&toUser=" + json.getString("toUser") + "&id=" + String.valueOf(json.get("id")) + "&toName=" + name);
                temp_id = SystemConf.getInstance().getSystemProperties().getProperty("template_health_notice");
                temp.setTemplate_id(temp_id);
                WechatTemplateData keyword1 = new WechatTemplateData();
@ -313,7 +313,7 @@ public class PushMsgTask {
                keyword5.setValue(json.getString("content"));
                m.put("keyword5", keyword5);
            } else if (type == 5) {
                temp.setUrl(url + "ssgg/html/doctor-homepage-new.html?openid=" + openid + "&state=" + json.getString("doctor") + "&toUser=" + json.getString("toUser"));
                temp.setUrl(url + "ssgg/html/doctor-homepage-new.html?openid=" + openid + "&state=" + json.getString("doctor") + "&toUser=" + json.getString("toUser") + "&toName=" + name);
                temp_id = SystemConf.getInstance().getSystemProperties().getProperty("template_termination");
                temp.setTemplate_id(temp_id);
                WechatTemplateData keyword1 = new WechatTemplateData();
@ -333,7 +333,7 @@ public class PushMsgTask {
                keyword4.setValue(json.getString("date"));
                m.put("keyword4", keyword4);
            } else if (type == 6) {
                temp.setUrl(url + "wdyy/html/detail-appointment.html?openid=" + openid + "&id=" + json.getLong("id") + "&toUser=" + json.getString("toUser"));
                temp.setUrl(url + "wdyy/html/detail-appointment.html?openid=" + openid + "&id=" + json.getLong("id") + "&toUser=" + json.getString("toUser") + "&toName=" + name);
                temp_id = SystemConf.getInstance().getSystemProperties().getProperty("template_appoint_success");
                temp.setTemplate_id(temp_id);
                WechatTemplateData keyword1 = new WechatTemplateData();
@ -353,7 +353,7 @@ public class PushMsgTask {
                keyword4.setValue(json.getString("date"));
                m.put("planstarttime", keyword4);
            } else if (type == 7) {
                temp.setUrl(url + "wdyy/html/my-appointment.html?openid=" + openid + "&toUser=" + json.getString("toUser"));
                temp.setUrl(url + "wdyy/html/my-appointment.html?openid=" + openid + "&toUser=" + json.getString("toUser") + "&toName=" + name);
                temp_id = SystemConf.getInstance().getSystemProperties().getProperty("template_appoint_failed");
                temp.setTemplate_id(temp_id);
                WechatTemplateData keyword1 = new WechatTemplateData();
@ -393,7 +393,7 @@ public class PushMsgTask {
                keyword4.setValue(json.getString("content"));
                m.put("remark", keyword4);
            } else if (type == 9) {
                temp.setUrl(url + "jkjy/html/article.html?openid=" + openid + "&dataId=" + json.getString("article") + "&toUser=" + json.getString("toUser"));
                temp.setUrl(url + "jkjy/html/article.html?openid=" + openid + "&dataId=" + json.getString("article") + "&toUser=" + json.getString("toUser") + "&toName=" + name);
                temp_id = SystemConf.getInstance().getSystemProperties().getProperty("template_healthy_article");
                temp.setTemplate_id(temp_id);
                WechatTemplateData keyword1 = new WechatTemplateData();
@ -417,7 +417,7 @@ public class PushMsgTask {
                keyword5.setValue(json.getString("remark"));
                m.put("remark", keyword5);
            } else if (type == 10) {
                temp.setUrl(url + "qygl/html/signing-doctors.html?openid=" + openid + "&state=" + openid + "&toUser=" + json.getString("toUser"));
                temp.setUrl(url + "qygl/html/signing-doctors.html?openid=" + openid + "&state=" + openid + "&toUser=" + json.getString("toUser") + "&toName=" + name);
                temp.setTemplate_id(SystemConf.getInstance().getSystemProperties()
                        .getProperty("template_doctor_change"));
                WechatTemplateData keyword1 = new WechatTemplateData();