Browse Source

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

yeshijie 7 years ago
parent
commit
68ff30e0d2

+ 2 - 2
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/redis/RedisThread.java

@ -25,9 +25,9 @@ public class RedisThread implements Runnable {
    public void run() {
        String key = SystemConf.getInstance().getSystemProperties().getProperty("redis_prescription_title");
        while (true){
            redisTemplate.watch(key);
//            redisTemplate.watch(key);
            String message = redisTemplate.opsForList().rightPop(key);
            redisTemplate.unwatch();
//            redisTemplate.unwatch();
            if(StringUtils.isEmpty(message)){
                try{
                    Thread.sleep(1000L);//如果没有读取到记录,等待1秒

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

@ -152,19 +152,19 @@ public class MessageService extends BaseService {
        }
        //获取续方消息
        List<Message> prescriptionMessage = messageDao.getSysTemMessageByTypeAndRead(doctor,1,6);
        JSONObject prescriptionJson = new JSONObject();
        if (prescriptionMessage != null && prescriptionMessage.size() > 0) {
            prescriptionJson.put("amount", prescriptionMessage.size());
            JSONObject msgJson = new JSONObject();
            msgJson.put("title", systemMessage.get(0).getTitle());
            msgJson.put("type", systemMessage.get(0).getType());
            msgJson.put("msg", systemMessage.get(0).getContent());
            msgJson.put("msgTime", DateUtil.dateToStrLong(systemMessage.get(0).getCreateTime()));
            prescriptionJson.put("lastMessage", msgJson);
        } else {
            prescriptionJson.put("amount", 0);
        }
//        List<Message> prescriptionMessage = messageDao.getSysTemMessageByTypeAndRead(doctor,1,6);
//        JSONObject prescriptionJson = new JSONObject();
//        if (prescriptionMessage != null && prescriptionMessage.size() > 0) {
//            prescriptionJson.put("amount", prescriptionMessage.size());
//            JSONObject msgJson = new JSONObject();
//            msgJson.put("title", systemMessage.get(0).getTitle());
//            msgJson.put("type", systemMessage.get(0).getType());
//            msgJson.put("msg", systemMessage.get(0).getContent());
//            msgJson.put("msgTime", DateUtil.dateToStrLong(systemMessage.get(0).getCreateTime()));
//            prescriptionJson.put("lastMessage", msgJson);
//        } else {
//            prescriptionJson.put("amount", 0);
//        }
        JSONObject json = new JSONObject();
@ -172,7 +172,7 @@ public class MessageService extends BaseService {
        json.put("sign", signJson);//签约数
        json.put("healthIndex", indexJson);//健康指标
        json.put("system", systemJson);//系统消息
        json.put("prescription", prescriptionJson);//续方消息
//        json.put("prescription", prescriptionJson);//续方消息
        return json;
    }